@privy-io/react-auth 1.96.0-beta-20241205061328 → 1.96.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.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{modal-context-CGnY5dhN.js → modal-context-CwkJu5Ic.js} +1 -1
- package/dist/cjs/{smart-wallets-CPx2tIDB.js → smart-wallets-DzZ1cvop.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/ui.js +34 -34
- package/dist/cjs/{useActiveWallet-CGur8FoD.js → useActiveWallet-CGfP6L7t.js} +127 -127
- package/dist/dts/index.d.mts +4 -4
- package/dist/dts/index.d.ts +4 -4
- package/dist/dts/{solana-BcdKsKNI.d.ts → solana-D7kL9lA8.d.mts} +1 -1
- package/dist/dts/{solana-BcdKsKNI.d.mts → solana-D7kL9lA8.d.ts} +1 -1
- package/dist/dts/solana.d.mts +2 -2
- package/dist/dts/solana.d.ts +2 -2
- package/dist/dts/{types-DsAgK5Fq.d.mts → types-2a5Pf2GX.d.mts} +22 -0
- package/dist/dts/{types-DsAgK5Fq.d.ts → types-2a5Pf2GX.d.ts} +22 -0
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/modal-context-B41efUBc.mjs +1 -0
- package/dist/esm/{smart-wallets-B6_M4YqT.mjs → smart-wallets-CrvHyIhF.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/ui.mjs +39 -39
- package/dist/esm/useActiveWallet-Bug7ZDKG.mjs +3154 -0
- package/package.json +3 -3
- package/dist/esm/modal-context-a9wsSrS2.mjs +0 -1
- package/dist/esm/useActiveWallet-P5GH7Ofs.mjs +0 -3154
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@abstract-foundation/agw-client"),r=require("viem"),n=require("viem/accounts"),t=require("viem/chains"),a=require("./useWallets-BygaNfXg.js"),s=require("./modal-context-
|
|
1
|
+
"use strict";var e=require("@abstract-foundation/agw-client"),r=require("viem"),n=require("viem/accounts"),t=require("viem/chains"),a=require("./useWallets-BygaNfXg.js"),s=require("./modal-context-CwkJu5Ic.js"),i=require("./getEmbeddedConnectedWallet-DTU4T9TJ.js"),o=require("./smart-wallets-DzZ1cvop.js");require("ofetch"),require("@ethersproject/address"),require("react"),require("@ethersproject/providers"),require("react/jsx-runtime"),require("tinycolor2"),require("permissionless"),require("permissionless/accounts"),require("permissionless/clients/pimlico"),require("viem/account-abstraction"),require("zod"),require("bs58"),require("ethers"),require("libphonenumber-js/max"),exports.useAbstractSmartWallets=function(){let{user:c}=a.usePrivyContext(),{noPromptOnSignature:l,openPrivyModal:d,chains:u,appId:E,rpcConfig:p}=a.usePrivyInternal(),{wallets:g}=a.useWallets(),{setModalData:m}=s.usePrivyModal(),y=async()=>{let a=i.getEmbeddedConnectedWallet(g);if(!a)throw Error("No connected wallet found");let o=u.find((e=>e.id===t.abstractTestnet.id));if(!o)throw Error("Chain not configured");await a.switchChain(o.id);let c=await a.getEthereumProvider(),l=r.createWalletClient({account:a.address,transport:r.custom(c)}),d=n.toAccount({address:a.address,signMessage:l.signMessage,signTransaction:l.signTransaction,signTypedData:l.signTypedData});return await e.createAbstractClient({chain:{...o,rpcUrls:{default:{http:[s.getJsonRpcEndpointFromChain(o,p,E)]}}},signer:d})};return{signMessage:async({message:e})=>{let r=await y();return new Promise((async(n,t)=>{let{entropyId:i,entropyIdVerifier:o}=a.getEntropyDetailsFromUser(c);l.current=!0,m({connectWallet:{entropyId:i,entropyIdVerifier:o,onCompleteNavigateTo:s.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>n(e),onFailure:t,uiOptions:{}}}),d(s.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{l.current=!1}))},signTypedData:async e=>{let r=await y();return new Promise((async(n,t)=>{l.current=!0;let{entropyId:i,entropyIdVerifier:o}=a.getEntropyDetailsFromUser(c);m({connectWallet:{entropyId:i,entropyIdVerifier:o,onCompleteNavigateTo:s.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>n(e),onFailure:t,uiOptions:{}}}),d(s.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{l.current=!1}))},sendTransaction:async e=>{let r=await y(),n=[];return n="calls"in e&&void 0!==e.calls?[...e.calls]:[e],new Promise((async(t,i)=>{l.current=!0;let{entropyId:u,entropyIdVerifier:E}=a.getEntropyDetailsFromUser(c);m({connectWallet:{entropyId:u,entropyIdVerifier:E,onCompleteNavigateTo:s.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:o.callsToTransactionRequests({calls:n,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:u,entropyIdVerifier:E,transactingWallet:{address:r.account.address,walletIndex:null},getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>n.length>1?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>t(e.hash),onFailure:i,uiOptions:{}}}),d(s.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{l.current=!1}))}}};
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./useActiveWallet-CGur8FoD.js"),r=require("./useSolanaWallets-DkS992n_.js"),t=require("./useWallets-BygaNfXg.js"),o=require("react"),i=require("./modal-context-CGnY5dhN.js"),n=require("./getEmbeddedConnectedWallet-DTU4T9TJ.js");require("react/jsx-runtime"),require("@ethersproject/address"),require("@ethersproject/providers"),require("mipd"),require("react-device-detect"),require("jose"),require("uuid"),require("@ethersproject/bytes"),require("eventemitter3"),require("@coinbase/wallet-sdk"),require("@marsidev/react-turnstile"),require("styled-components"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/WalletIcon"),require("@heroicons/react/24/outline/CheckIcon"),require("@heroicons/react/24/outline/Square2StackIcon"),require("@heroicons/react/24/outline/ExclamationCircleIcon"),require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon"),require("@heroicons/react/24/solid/DocumentCheckIcon"),require("@heroicons/react/20/solid/CheckIcon"),require("@heroicons/react/24/outline/EnvelopeIcon"),require("@heroicons/react/24/outline/PhoneIcon"),require("@heroicons/react/24/solid/CheckCircleIcon"),require("@heroicons/react/24/solid/XCircleIcon"),require("@walletconnect/ethereum-provider"),require("@heroicons/react/24/outline/CheckCircleIcon"),require("fast-password-entropy"),require("secure-password-utilities"),require("secure-password-utilities/wordlists"),require("@heroicons/react/24/outline/ArrowPathIcon"),require("@heroicons/react/24/outline/EyeIcon"),require("@heroicons/react/24/outline/EyeSlashIcon"),require("@heroicons/react/24/outline/KeyIcon"),require("@heroicons/react/24/outline/ArrowDownTrayIcon"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/DocumentDuplicateIcon"),require("@heroicons/react/24/outline/UserCircleIcon"),require("@heroicons/react/24/solid/LockClosedIcon"),require("qrcode"),require("viem"),require("@heroicons/react/24/outline/GlobeAltIcon"),require("@headlessui/react"),require("@heroicons/react/24/outline/ChevronDownIcon"),require("@ethersproject/bignumber"),require("@ethersproject/units"),require("@heroicons/react/24/outline/ClockIcon"),require("@heroicons/react/24/outline/TrashIcon"),require("@heroicons/react/24/solid/CheckBadgeIcon"),require("@heroicons/react/24/solid/ArrowsRightLeftIcon"),require("@heroicons/react/24/outline/PencilIcon"),require("@heroicons/react/24/outline/CreditCardIcon"),require("@heroicons/react/24/outline/QrCodeIcon"),require("@heroicons/react/24/outline/InformationCircleIcon"),require("ofetch"),require("@heroicons/react/24/outline/ChevronRightIcon"),require("@heroicons/react/24/outline/ShieldCheckIcon"),require("@heroicons/react/24/solid/IdentificationIcon"),require("@heroicons/react/24/outline/DevicePhoneMobileIcon"),require("@heroicons/react/24/outline/FingerPrintIcon"),require("@heroicons/react/24/outline/MinusCircleIcon"),require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon"),require("@heroicons/react/24/solid/ShieldCheckIcon"),require("@ethersproject/abstract-signer"),require("@ethersproject/contracts"),require("@ethersproject/transactions"),require("fetch-retry"),require("@heroicons/react/24/outline/CalendarIcon"),require("@heroicons/react/24/outline/LockClosedIcon"),require("@heroicons/react/24/outline/PencilSquareIcon"),require("@heroicons/react/24/outline"),require("@heroicons/react/24/outline/ClipboardDocumentIcon"),require("@ethersproject/logger"),require("@ethersproject/strings"),require("js-cookie"),require("zustand"),require("zustand/shallow"),require("zustand/traditional"),require("tinycolor2");const s=()=>{let{getAccessToken:e,user:i}=t.usePrivyContext(),{refreshUser:n,initializeWalletProxy:s}=t.usePrivyInternal(),a=r.useEmitPrivyEvent();return{importWallet:o.useCallback((({privateKey:r})=>(async({emitPrivyEvent:e,getAccessToken:r,initializeWalletProxy:o,refreshUser:i,user:n},{privateKey:s})=>{if(!n)throw e("linkAccount","onError",t.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new t.PrivyClientError("User must be authenticated before linking an account.");let[a,c]=await Promise.all([r(),o(15e3)]);if(!c||!a)throw e("linkAccount","onError",t.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new t.PrivyClientError("User must be authenticated before linking an account.");await c.import({privateKey:s,accessToken:a});let u=t.getImportedPrivyEthereumWallet(await i());if(!u)throw e("createWallet","onError",t.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return e("createWallet","onSuccess",u),u})({getAccessToken:e,user:i,initializeWalletProxy:s,refreshUser:n,emitPrivyEvent:a},{privateKey:r})),[i,e,n,s,a])}};let a=async(e,r,o,i,n)=>{if(!e)throw i("linkAccount","onError",t.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:n}),new t.PrivyClientError("User must be authenticated before linking an account.");if(!r?.linkedAccounts.some((e=>e.type.includes(n))))throw new t.PrivyClientError(`OAuth account of type ${n} not linked to the account.`);await o(n)};const c=u;function u(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}=t.usePrivyContext();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}}exports.AsExternalProvider=e.AsExternalProvider,exports.Captcha=e.Captcha,exports.ConnectorManager=e.ConnectorManager,exports.EthereumWalletConnector=e.EthereumWalletConnector,exports.LoginModal=e.LoginModal,exports.PrivyClient=e.PrivyClient,exports.PrivyProvider=e.PrivyProvider,exports.PrivyProxyProvider=e.PrivyProxyProvider,exports.errorIndicatesMaxMfaRetries=e.errorIndicatesMaxMfaRetries,exports.errorIndicatesMfaTimeout=e.errorIndicatesMfaTimeout,exports.errorIndicatesMfaVerificationFailed=e.errorIndicatesMfaVerificationFailed,exports.getAccessToken=e.getCustomerAccessToken,exports.useActiveWallet=e.useActiveWallet,exports.useConnectWallet=e.useConnectWallet,exports.useFundWallet=e.useFundWallet,exports.useLogin=e.useLogin,exports.useLogout=e.useLogout,exports.useMfa=e.useMfa,exports.useMfaEnrollment=e.useMfaEnrollment,exports.useRegisterMfaListener=e.useRegisterMfaListener,exports.WalletConnector=r.WalletConnector,exports.useSolanaWallets=r.useSolanaWallets,exports.useWallets=t.useWallets,exports.SUPPORTED_CHAINS=i.DEFAULT_SUPPORTED_CHAINS,exports.VERSION=i.VERSION,exports.addPrivyRpcToChain=i.addPrivyRpcToChain,exports.addRpcUrlOverrideToChain=i.addRpcUrlOverrideToChain,exports.getEmbeddedConnectedWallet=n.getEmbeddedConnectedWallet,exports.useConnectCoinbaseSmartWallet=()=>{let{connectCoinbaseSmartWallet:e}=t.usePrivyInternal();return{connectCoinbaseSmartWallet:e}},exports.useCreateWallet=function(e){let{createWallet:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("createWallet",e),{createWallet:i}},exports.useCrossAppAccounts=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:r,signMessageWithCrossAppWallet:o,signTypedDataWithCrossAppWallet:i,sendTransactionWithCrossAppWallet:n}=t.usePrivyContext();return{loginWithCrossAppAccount:({appId:r})=>e({appId:r,action:"login"}),linkCrossAppAccount:({appId:r})=>e({appId:r,action:"link"}),unlinkCrossAppAccount:r,signMessage:o,signTypedData:i,sendTransaction:n}},exports.useCustomAuth=e=>{let{customAuthStatus:o}=t.usePrivyInternal();return r.usePrivyEventSubscription("customAuth",e),{status:o}},exports.useDelegatedActions=()=>{let{revokeDelegatedWallets:e,delegateWallet:r}=t.usePrivyInternal();return{delegateWallet:r,revokeWallets:e}},exports.useExperimentalFarcasterSigner=c,exports.useFarcasterSigner=u,exports.useGuestAccounts=function(){let{createGuestAccount:e}=o.useContext(t.PrivyContext);return{createGuestAccount:e}},exports.useImportWallet=s,exports.useLinkAccount=function(e){let{linkEmail:i,linkPhone:n,linkWallet:s,linkGoogle:a,linkApple:c,linkTwitter:u,linkDiscord:l,linkGithub:h,linkLinkedIn:d,linkTiktok:p,linkSpotify:C,linkInstagram:y,linkTelegram:v,linkFarcaster:P}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("linkAccount",e),{linkEmail:i,linkPhone:n,linkWallet:s,linkGoogle:a,linkApple:c,linkTwitter:u,linkDiscord:l,linkGithub:h,linkLinkedIn:d,linkTiktok:p,linkSpotify:C,linkInstagram:y,linkFarcaster:P,linkTelegram:v}},exports.useLinkWithPasskey=e=>{let{initLinkWithPasskey:r,linkWithPasskey:i,passkeyAuthState:n,setPasskeyAuthState:s}=t.usePrivyInternal();return{linkWithPasskey:o.useCallback((async()=>{try{await r();let t=await i();if(!t)throw Error("Error, user not found");let o=t.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,r)=>r.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.(t,"passkey",o)}catch(r){throw s({status:"error",error:r}),e?.onError?.(r,{linkMethod:"passkey"}),r}}),[i]),state:n}},exports.useLinkWithSiwe=r=>{let i=e.useCaptcha(),{siweState:n,setSiweState:s,linkWithSiwe:a,generateSiweMessage:c}=t.usePrivyInternal();return{generateSiweMessage:o.useCallback((async({address:e,chainId:o})=>{try{if(!e||!o)throw Error("wallet address and chainId required to generate nonce");return await c({address:e,chainId:o}).then((e=>e))}catch(e){throw s({status:"error",error:e}),r?.onError?.(e.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),e}}),[c]),linkWithSiwe:o.useCallback((async({signature:o,message:n,chainId:c,walletClientType:u,connectorType:l})=>{try{if(i.enabled&&"success"!==i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);let{user:s,linkedAccount:h}=await a({message:n,signature:o,chainId:c,walletClientType:u,connectorType:l});h&&r?.onSuccess?.(s,"siwe",h)}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),o}}),[a,i.status]),state:n}},exports.useLoginWithEmail=r=>{let i=e.useCaptcha(),{emailOtpState:n,setEmailOtpState:s,initLoginWithEmail:a,loginWithCode:c}=t.usePrivyInternal();return{sendCode:o.useCallback((async({email:o,disableSignup:n})=>{try{let r;if(!o)throw Error("Email required to send OTP code");if(i.enabled&&"error"===i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);return i.enabled&&"success"!==i.status&&(i.execute(),r=await i.waitForResult()),await a({email:o,captchaToken:r,disableSignup:n,withPrivyUi:!1})}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR),o}}),[a]),loginWithCode:o.useCallback((async({code:o})=>{try{if(i.enabled&&"error"===i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);let{user:n,isNewUser:s,wasAlreadyAuthenticated:a,linkedAccount:u}=await c(o);r?.onComplete?.(n,s,a,"email",u)}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR),o}}),[c,i.status]),state:n}},exports.useLoginWithOAuth=n=>{r.usePrivyEventSubscription("login",n);let s=e.useCaptcha(),a=i.useIsServerConfigLoaded(),{ready:c,user:u}=t.usePrivyContext(),{initLoginWithHeadlessOAuth:l,loginWithHeadlessOAuth:h,oAuthState:d,setOAuthState:p,isHeadlessOAuthLoading:C}=t.usePrivyInternal(),y=o.useCallback((async r=>{try{if(s.enabled&&"success"!==s.status)throw new e.CaptchaError(s.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);return await l(r.provider,s.token,r.disableSignup)}catch(r){throw p({status:"error",error:r}),r}}),[l,s]),v=o.useCallback((async()=>{let r=e.detectCompletingOAuthFlow();try{if(u)return console.warn("Cannot login with OAuth when already logged in"),u;if(!r.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(r.popupFlow)return}catch(r){throw p({status:"error",error:r}),r}try{return await h(r)}catch(r){throw p({status:"error",error:r}),r}finally{e.stripUrlOAuthParamsAndRemoveStateCode()}}),[h]);return o.useEffect((()=>{let r=e.detectCompletingOAuthFlow();c&&a&&r.inProgress&&!r.withPrivyUi&&!r.popupFlow&&v()}),[c,a]),{initOAuth:y,loading:C,state:d}},exports.useLoginWithPasskey=r=>{let i=e.useCaptcha(),{initLoginWithPasskey:n,loginWithPasskey:s,passkeyAuthState:a,setPasskeyAuthState:c}=t.usePrivyInternal();return{loginWithPasskey:o.useCallback((async()=>{try{let o;if(i.enabled&&"error"===i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);i.enabled&&"success"!==i.status&&(i.execute(),o=await i.waitForResult()),await n({captchaToken:o,withPrivyUi:!1});let{user:a,isNewUser:c,wasAlreadyAuthenticated:u,loginAccount:l}=await s();r?.onComplete?.(a,c,u,"passkey",l)}catch(e){throw c({status:"error",error:e}),r?.onError?.(e),e}}),[s,i.status]),state:a}},exports.useLoginWithSms=r=>{let i=e.useCaptcha(),{smsOtpState:n,setSmsOtpState:s,initLoginWithSms:a,loginWithCode:c}=t.usePrivyInternal();return{sendCode:o.useCallback((async({phoneNumber:o,disableSignup:n})=>{try{let r;if(!o)throw Error("SMS required to send OTP code");if(i.enabled&&"error"===i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);return i.enabled&&"success"!==i.status&&(i.execute(),r=await i.waitForResult()),await a({phoneNumber:o,captchaToken:r,disableSignup:n,withPrivyUi:!1})}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR),o}}),[a]),loginWithCode:o.useCallback((async({code:o})=>{try{if(i.enabled&&"success"!==i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);let{user:n,isNewUser:s,wasAlreadyAuthenticated:a,linkedAccount:u}=await c(o);r?.onComplete?.(n,s,a,"sms",u)}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR),o}}),[c,i.status]),state:n}},exports.useModalStatus=()=>{let{isModalOpen:e}=o.useContext(t.PrivyContext);return{isOpen:e}},exports.useOAuthTokens=function(e){let{authenticated:o,user:i}=t.usePrivyContext(),{initLoginWithOAuth:n}=t.usePrivyInternal(),s=r.useEmitPrivyEvent();return r.usePrivyEventSubscription("oAuthAuthorization",e),{reauthorize:e=>a(o,i,n,s,e.provider)}},exports.usePrivy=()=>{let{importWallet:e}=s();return{...o.useContext(t.PrivyContext),importWallet:e}},exports.useSendSolanaTransaction=function(e){let{sendSolanaTransaction:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("sendSolanaTransaction",e),{sendSolanaTransaction:i}},exports.useSendTransaction=function(e){let{sendTransaction:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("sendTransaction",e),{sendTransaction:i}},exports.useSetWalletPassword=function(e){let{setWalletPassword:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("setWalletPassword",e),{setWalletPassword:i}},exports.useSetWalletRecovery=function(e){let{setWalletRecovery:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("setWalletRecovery",e),{setWalletRecovery:i}},exports.useSignMessage=function(e){let{signMessage:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("signMessage",e),{signMessage:i}},exports.useSignTypedData=function(e){let{signTypedData:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("signTypedData",e),{signTypedData:i}},exports.useToken=function(e){let{getAccessToken:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("accessToken",e),{getAccessToken:i}},exports.useUpdateAccount=function(e){let{updateEmail:i,updatePhone:n}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("update",e),{updateEmail:i,updatePhone:n}};
|
|
1
|
+
"use strict";var e=require("./useActiveWallet-CGfP6L7t.js"),r=require("./useSolanaWallets-DkS992n_.js"),t=require("./useWallets-BygaNfXg.js"),o=require("react"),i=require("./modal-context-CwkJu5Ic.js"),n=require("./getEmbeddedConnectedWallet-DTU4T9TJ.js");require("react/jsx-runtime"),require("@ethersproject/address"),require("@ethersproject/providers"),require("mipd"),require("react-device-detect"),require("jose"),require("uuid"),require("@ethersproject/bytes"),require("eventemitter3"),require("@coinbase/wallet-sdk"),require("@marsidev/react-turnstile"),require("styled-components"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/WalletIcon"),require("@heroicons/react/24/outline/CheckIcon"),require("@heroicons/react/24/outline/Square2StackIcon"),require("@heroicons/react/24/outline/ExclamationCircleIcon"),require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon"),require("@heroicons/react/24/solid/DocumentCheckIcon"),require("@heroicons/react/20/solid/CheckIcon"),require("@heroicons/react/24/outline/EnvelopeIcon"),require("@heroicons/react/24/outline/PhoneIcon"),require("@heroicons/react/24/solid/CheckCircleIcon"),require("@heroicons/react/24/solid/XCircleIcon"),require("@walletconnect/ethereum-provider"),require("@heroicons/react/24/outline/CheckCircleIcon"),require("fast-password-entropy"),require("secure-password-utilities"),require("secure-password-utilities/wordlists"),require("@heroicons/react/24/outline/ArrowPathIcon"),require("@heroicons/react/24/outline/EyeIcon"),require("@heroicons/react/24/outline/EyeSlashIcon"),require("@heroicons/react/24/outline/KeyIcon"),require("@heroicons/react/24/outline/ArrowDownTrayIcon"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/DocumentDuplicateIcon"),require("@heroicons/react/24/outline/UserCircleIcon"),require("@heroicons/react/24/solid/LockClosedIcon"),require("qrcode"),require("viem"),require("@heroicons/react/24/outline/GlobeAltIcon"),require("@headlessui/react"),require("@heroicons/react/24/outline/ChevronDownIcon"),require("@ethersproject/bignumber"),require("@ethersproject/units"),require("@heroicons/react/24/outline/ClockIcon"),require("@heroicons/react/24/outline/TrashIcon"),require("@heroicons/react/24/solid/CheckBadgeIcon"),require("@heroicons/react/24/solid/ArrowsRightLeftIcon"),require("@heroicons/react/24/outline/PencilIcon"),require("@heroicons/react/24/outline/CreditCardIcon"),require("@heroicons/react/24/outline/QrCodeIcon"),require("@heroicons/react/24/outline/InformationCircleIcon"),require("ofetch"),require("@heroicons/react/24/outline/ChevronRightIcon"),require("@heroicons/react/24/outline/ShieldCheckIcon"),require("@heroicons/react/24/solid/IdentificationIcon"),require("@heroicons/react/24/outline/DevicePhoneMobileIcon"),require("@heroicons/react/24/outline/FingerPrintIcon"),require("@heroicons/react/24/outline/MinusCircleIcon"),require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon"),require("@heroicons/react/24/solid/ShieldCheckIcon"),require("@ethersproject/abstract-signer"),require("@ethersproject/contracts"),require("@ethersproject/transactions"),require("fetch-retry"),require("@heroicons/react/24/outline/CalendarIcon"),require("@heroicons/react/24/outline/LockClosedIcon"),require("@heroicons/react/24/outline/PencilSquareIcon"),require("@heroicons/react/24/outline"),require("@heroicons/react/24/outline/ClipboardDocumentIcon"),require("@ethersproject/logger"),require("@ethersproject/strings"),require("js-cookie"),require("zustand"),require("zustand/shallow"),require("zustand/traditional"),require("tinycolor2");const s=()=>{let{getAccessToken:e,user:i}=t.usePrivyContext(),{refreshUser:n,initializeWalletProxy:s}=t.usePrivyInternal(),a=r.useEmitPrivyEvent();return{importWallet:o.useCallback((({privateKey:r})=>(async({emitPrivyEvent:e,getAccessToken:r,initializeWalletProxy:o,refreshUser:i,user:n},{privateKey:s})=>{if(!n)throw e("linkAccount","onError",t.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new t.PrivyClientError("User must be authenticated before linking an account.");let[a,c]=await Promise.all([r(),o(15e3)]);if(!c||!a)throw e("linkAccount","onError",t.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new t.PrivyClientError("User must be authenticated before linking an account.");await c.import({privateKey:s,accessToken:a});let u=t.getImportedPrivyEthereumWallet(await i());if(!u)throw e("createWallet","onError",t.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return e("createWallet","onSuccess",u),u})({getAccessToken:e,user:i,initializeWalletProxy:s,refreshUser:n,emitPrivyEvent:a},{privateKey:r})),[i,e,n,s,a])}};let a=async(e,r,o,i,n)=>{if(!e)throw i("linkAccount","onError",t.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:n}),new t.PrivyClientError("User must be authenticated before linking an account.");if(!r?.linkedAccounts.some((e=>e.type.includes(n))))throw new t.PrivyClientError(`OAuth account of type ${n} not linked to the account.`);await o(n)};const c=u;function u(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}=t.usePrivyContext();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}}exports.AsExternalProvider=e.AsExternalProvider,exports.Captcha=e.Captcha,exports.ConnectorManager=e.ConnectorManager,exports.EthereumWalletConnector=e.EthereumWalletConnector,exports.LoginModal=e.LoginModal,exports.PrivyClient=e.PrivyClient,exports.PrivyProvider=e.PrivyProvider,exports.PrivyProxyProvider=e.PrivyProxyProvider,exports.errorIndicatesMaxMfaRetries=e.errorIndicatesMaxMfaRetries,exports.errorIndicatesMfaTimeout=e.errorIndicatesMfaTimeout,exports.errorIndicatesMfaVerificationFailed=e.errorIndicatesMfaVerificationFailed,exports.getAccessToken=e.getCustomerAccessToken,exports.useActiveWallet=e.useActiveWallet,exports.useConnectWallet=e.useConnectWallet,exports.useFundWallet=e.useFundWallet,exports.useLogin=e.useLogin,exports.useLogout=e.useLogout,exports.useMfa=e.useMfa,exports.useMfaEnrollment=e.useMfaEnrollment,exports.useRegisterMfaListener=e.useRegisterMfaListener,exports.WalletConnector=r.WalletConnector,exports.useSolanaWallets=r.useSolanaWallets,exports.useWallets=t.useWallets,exports.SUPPORTED_CHAINS=i.DEFAULT_SUPPORTED_CHAINS,exports.VERSION=i.VERSION,exports.addPrivyRpcToChain=i.addPrivyRpcToChain,exports.addRpcUrlOverrideToChain=i.addRpcUrlOverrideToChain,exports.getEmbeddedConnectedWallet=n.getEmbeddedConnectedWallet,exports.useConnectCoinbaseSmartWallet=()=>{let{connectCoinbaseSmartWallet:e}=t.usePrivyInternal();return{connectCoinbaseSmartWallet:e}},exports.useCreateWallet=function(e){let{createWallet:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("createWallet",e),{createWallet:i}},exports.useCrossAppAccounts=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:r,signMessageWithCrossAppWallet:o,signTypedDataWithCrossAppWallet:i,sendTransactionWithCrossAppWallet:n}=t.usePrivyContext();return{loginWithCrossAppAccount:({appId:r})=>e({appId:r,action:"login"}),linkCrossAppAccount:({appId:r})=>e({appId:r,action:"link"}),unlinkCrossAppAccount:r,signMessage:o,signTypedData:i,sendTransaction:n}},exports.useCustomAuth=e=>{let{customAuthStatus:o}=t.usePrivyInternal();return r.usePrivyEventSubscription("customAuth",e),{status:o}},exports.useDelegatedActions=()=>{let{revokeDelegatedWallets:e,delegateWallet:r}=t.usePrivyInternal();return{delegateWallet:r,revokeWallets:e}},exports.useExperimentalFarcasterSigner=c,exports.useFarcasterSigner=u,exports.useGuestAccounts=function(){let{createGuestAccount:e}=o.useContext(t.PrivyContext);return{createGuestAccount:e}},exports.useImportWallet=s,exports.useLinkAccount=function(e){let{linkEmail:i,linkPhone:n,linkWallet:s,linkGoogle:a,linkApple:c,linkTwitter:u,linkDiscord:l,linkGithub:h,linkLinkedIn:d,linkTiktok:p,linkSpotify:C,linkInstagram:y,linkTelegram:v,linkFarcaster:P}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("linkAccount",e),{linkEmail:i,linkPhone:n,linkWallet:s,linkGoogle:a,linkApple:c,linkTwitter:u,linkDiscord:l,linkGithub:h,linkLinkedIn:d,linkTiktok:p,linkSpotify:C,linkInstagram:y,linkFarcaster:P,linkTelegram:v}},exports.useLinkWithPasskey=e=>{let{initLinkWithPasskey:r,linkWithPasskey:i,passkeyAuthState:n,setPasskeyAuthState:s}=t.usePrivyInternal();return{linkWithPasskey:o.useCallback((async()=>{try{await r();let t=await i();if(!t)throw Error("Error, user not found");let o=t.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,r)=>r.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.(t,"passkey",o)}catch(r){throw s({status:"error",error:r}),e?.onError?.(r,{linkMethod:"passkey"}),r}}),[i]),state:n}},exports.useLinkWithSiwe=r=>{let i=e.useCaptcha(),{siweState:n,setSiweState:s,linkWithSiwe:a,generateSiweMessage:c}=t.usePrivyInternal();return{generateSiweMessage:o.useCallback((async({address:e,chainId:o})=>{try{if(!e||!o)throw Error("wallet address and chainId required to generate nonce");return await c({address:e,chainId:o}).then((e=>e))}catch(e){throw s({status:"error",error:e}),r?.onError?.(e.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),e}}),[c]),linkWithSiwe:o.useCallback((async({signature:o,message:n,chainId:c,walletClientType:u,connectorType:l})=>{try{if(i.enabled&&"success"!==i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);let{user:s,linkedAccount:h}=await a({message:n,signature:o,chainId:c,walletClientType:u,connectorType:l});h&&r?.onSuccess?.(s,"siwe",h)}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),o}}),[a,i.status]),state:n}},exports.useLoginWithEmail=r=>{let i=e.useCaptcha(),{emailOtpState:n,setEmailOtpState:s,initLoginWithEmail:a,loginWithCode:c}=t.usePrivyInternal();return{sendCode:o.useCallback((async({email:o,disableSignup:n})=>{try{let r;if(!o)throw Error("Email required to send OTP code");if(i.enabled&&"error"===i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);return i.enabled&&"success"!==i.status&&(i.execute(),r=await i.waitForResult()),await a({email:o,captchaToken:r,disableSignup:n,withPrivyUi:!1})}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR),o}}),[a]),loginWithCode:o.useCallback((async({code:o})=>{try{if(i.enabled&&"error"===i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);let{user:n,isNewUser:s,wasAlreadyAuthenticated:a,linkedAccount:u}=await c(o);r?.onComplete?.(n,s,a,"email",u)}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR),o}}),[c,i.status]),state:n}},exports.useLoginWithOAuth=n=>{r.usePrivyEventSubscription("login",n);let s=e.useCaptcha(),a=i.useIsServerConfigLoaded(),{ready:c,user:u}=t.usePrivyContext(),{initLoginWithHeadlessOAuth:l,loginWithHeadlessOAuth:h,oAuthState:d,setOAuthState:p,isHeadlessOAuthLoading:C}=t.usePrivyInternal(),y=o.useCallback((async r=>{try{if(s.enabled&&"success"!==s.status)throw new e.CaptchaError(s.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);return await l(r.provider,s.token,r.disableSignup)}catch(r){throw p({status:"error",error:r}),r}}),[l,s]),v=o.useCallback((async()=>{let r=e.detectCompletingOAuthFlow();try{if(u)return console.warn("Cannot login with OAuth when already logged in"),u;if(!r.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(r.popupFlow)return}catch(r){throw p({status:"error",error:r}),r}try{return await h(r)}catch(r){throw p({status:"error",error:r}),r}finally{e.stripUrlOAuthParamsAndRemoveStateCode()}}),[h]);return o.useEffect((()=>{let r=e.detectCompletingOAuthFlow();c&&a&&r.inProgress&&!r.withPrivyUi&&!r.popupFlow&&v()}),[c,a]),{initOAuth:y,loading:C,state:d}},exports.useLoginWithPasskey=r=>{let i=e.useCaptcha(),{initLoginWithPasskey:n,loginWithPasskey:s,passkeyAuthState:a,setPasskeyAuthState:c}=t.usePrivyInternal();return{loginWithPasskey:o.useCallback((async()=>{try{let o;if(i.enabled&&"error"===i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);i.enabled&&"success"!==i.status&&(i.execute(),o=await i.waitForResult()),await n({captchaToken:o,withPrivyUi:!1});let{user:a,isNewUser:c,wasAlreadyAuthenticated:u,loginAccount:l}=await s();r?.onComplete?.(a,c,u,"passkey",l)}catch(e){throw c({status:"error",error:e}),r?.onError?.(e),e}}),[s,i.status]),state:a}},exports.useLoginWithSms=r=>{let i=e.useCaptcha(),{smsOtpState:n,setSmsOtpState:s,initLoginWithSms:a,loginWithCode:c}=t.usePrivyInternal();return{sendCode:o.useCallback((async({phoneNumber:o,disableSignup:n})=>{try{let r;if(!o)throw Error("SMS required to send OTP code");if(i.enabled&&"error"===i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);return i.enabled&&"success"!==i.status&&(i.execute(),r=await i.waitForResult()),await a({phoneNumber:o,captchaToken:r,disableSignup:n,withPrivyUi:!1})}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR),o}}),[a]),loginWithCode:o.useCallback((async({code:o})=>{try{if(i.enabled&&"success"!==i.status)throw new e.CaptchaError(i.error,null,t.PrivyErrorCode.CAPTCHA_FAILURE);let{user:n,isNewUser:s,wasAlreadyAuthenticated:a,linkedAccount:u}=await c(o);r?.onComplete?.(n,s,a,"sms",u)}catch(o){throw s({status:"error",error:o}),r?.onError?.(o.privyErrorCode||t.PrivyErrorCode.UNKNOWN_AUTH_ERROR),o}}),[c,i.status]),state:n}},exports.useModalStatus=()=>{let{isModalOpen:e}=o.useContext(t.PrivyContext);return{isOpen:e}},exports.useOAuthTokens=function(e){let{authenticated:o,user:i}=t.usePrivyContext(),{initLoginWithOAuth:n}=t.usePrivyInternal(),s=r.useEmitPrivyEvent();return r.usePrivyEventSubscription("oAuthAuthorization",e),{reauthorize:e=>a(o,i,n,s,e.provider)}},exports.usePrivy=()=>{let{importWallet:e}=s();return{...o.useContext(t.PrivyContext),importWallet:e}},exports.useSendSolanaTransaction=function(e){let{sendSolanaTransaction:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("sendSolanaTransaction",e),{sendSolanaTransaction:i}},exports.useSendTransaction=function(e){let{sendTransaction:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("sendTransaction",e),{sendTransaction:i}},exports.useSetWalletPassword=function(e){let{setWalletPassword:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("setWalletPassword",e),{setWalletPassword:i}},exports.useSetWalletRecovery=function(e){let{setWalletRecovery:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("setWalletRecovery",e),{setWalletRecovery:i}},exports.useSignMessage=function(e){let{signMessage:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("signMessage",e),{signMessage:i}},exports.useSignTypedData=function(e){let{signTypedData:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("signTypedData",e),{signTypedData:i}},exports.useToken=function(e){let{getAccessToken:i}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("accessToken",e),{getAccessToken:i}},exports.useUpdateAccount=function(e){let{updateEmail:i,updatePhone:n}=o.useContext(t.PrivyContext);return r.usePrivyEventSubscription("update",e),{updateEmail:i,updatePhone:n}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@ethersproject/providers"),t=require("./useWallets-BygaNfXg.js"),r=require("react/jsx-runtime"),a=require("react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(require("tinycolor2"));const l=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,i=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==l(e))return!1;if(e.providers)for(let t of e.providers)if(!i(t))return!1;return!0},s=(e,t=3,r=4,a="ethereum")=>{if(!e)return"";let n="ethereum"===a?2:0;return t+r+n+3>=e.length?e:`${e.slice(0,n+t)}...${e.slice(e.length-r,e.length)}`},p=e=>new Promise((t=>setTimeout(t,e)));const c=(e,r,a)=>{let n,o=e.id,l=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])n=e.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[l])n=r.rpcUrls[l];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",a),n=t.toString()}else n=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!n)throw new t.PrivyConnectorError(`No RPC url found for ${o}`);return n};const E={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},u={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},d={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},h={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},m={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},_={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},C={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},S={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},f={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},A={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},N={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},g={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},T={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},y={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},O={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},b=[E,u,y,f,A,N,g,T,C,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},m,_,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},S,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},d,h,O,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],R=new Set(b.map((e=>e.id)));function v({src:e,...t}){return r.jsx("img",{src:e,...t,style:{display:"none"}})}const L={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let w=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),I=e=>w.has(e),D=(e,t,r)=>r.indexOf(e)===t;const x=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(I).filter(D):e?e.filter(I).filter(D):L.appearance.walletList;function W(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let U="#FFFFFF";function k(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function M({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=U;break;case"dark":r="#1E1E1D";break;default:r=e}let a=o.default(r),n=o.default(t),l=o.default("#51BA81"),i=o.default("#FFB74D"),s=o.default("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(a.getLuminance()),c=k(a,"light"===p?-.04:.11),E=k(a,"light"===p?-.08:.16),u=k(a,"light"===p?-.88:.87),d=k(a,"light"===p?-.7:.75),h=k(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=k(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),_=k(n,.15),C=k(n,.25),S=k(n,-.06),f=k(n,-.6),A=k(s,.3),N=k(i,.3),g=o.default(n.getLuminance()>.5?"#040217":U),T=k(l,-.16),y=k(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),background3:E.toHslString(),foreground:u.toHslString(),foreground2:d.toHslString(),foreground3:h.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:_.toHslString(),accentLightest:C.toHslString(),accentDark:S.toHslString(),accentDarkest:f.toHslString(),foregroundAccent:g.toHslString(),success:l.toHslString(),successDark:T.toHslString(),successLight:y.toHslString(),error:s.toHslString(),errorLight:A.toHslString(),warn:i.toHslString(),warnLight:N.toHslString()}}function P(e,t,r){let a,n,o,l,i,s,p,c,E,u,d,h,m,_,C,S,A=r?console.warn:()=>{};t?.loginMethods?(a=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),E=t.loginMethods.includes("spotify"),u=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),h=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),m=t.loginMethods.includes("apple"),_=t.loginMethods.includes("farcaster"),C=t.loginMethods.includes("telegram")):(a=e.emailAuth,n=e.smsAuth,l=e.walletAuth||e.solanaWalletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,h=e.githubOAuth,E=e.spotifyOAuth,u=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,m=e.appleOAuth,_=e.farcasterAuth,C=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let N=[a,n].filter(Boolean),g=[i,s,p,h,E,u,c,d,m,_,C].filter(Boolean),T=[l].filter(Boolean);if(N.length+g.length+T.length===0)throw Error("You must enable at least one login method");let y=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;y&&0===T.length?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),y=!1):y||g.length+N.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),y=!0);let O=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let R=x({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),v=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r 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(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let a of e.overflow??[])t.includes(a)||r.includes(a)?console.warn(`Duplicated login method: ${a}`):r.push(a);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),w=t?.intl?.defaultCountry??"US",{chains:I,defaultChain:D}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:a}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&a&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=b.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?W(e,r):e}))}else n=b.concat(e??[]);let o=t?n[0]:f,l=r??o;if(!n.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),U=!!t?.defaultChain,k=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,P=!(e.enforceWalletUis??1);if(S=e.legacyWalletUiConfig??1?k?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??P:P,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==S)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:F,...H}=t?.embeddedWallets??{},G=t?.solanaClusters??[];return e.solanaWalletAuth&&!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`"),{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??L.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:M({backgroundTheme:t?.appearance?.theme??L.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??L.appearance.accentColor}),loginGroupPriority:y?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:R,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:l,email:a,sms:n,passkey:o,google:i,twitter:s,discord:p,github:h,spotify:E,instagram:u,tiktok:c,linkedin:d,apple:m,farcaster:_,telegram:C},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:v,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??L.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??L.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??L.rpcConfig.rpcTimeouts},chains:I,solanaClusters:{"mainnet-beta":G.find((e=>"mainnet-beta"===e.name))?.rpcUrl||"https://api.mainnet-beta.solana.com",testnet:G.find((e=>"testnet"===e.name))?.rpcUrl||"https://api.testnet.solana.com",devnet:G.find((e=>"devnet"===e.name))?.rpcUrl||"https://api.devnet.solana.com"},defaultChain:D,intl:{defaultCountry:w},shouldEnforceDefaultChainOnConnect:U,captchaEnabled:e.captchaEnabled??L.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??L.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:O},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof F?{requireUserOwnedRecoveryOnCreate:F}:{},...k?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...H,noPromptOnSignature:S,showWalletUIs:t?.embeddedWallets?.showWalletUIs,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:k?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??L._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??L.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??L.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??L.fundingMethodConfig.moonpay.useSandbox}}}}let F={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const H=P(F,void 0,!1);let G=a.createContext({appConfig:H,isServerConfigLoaded:!1});const B=()=>{let{appConfig:e}=a.useContext(G);return e};var K;exports.ModalScreen=void 0,(K=exports.ModalScreen||(exports.ModalScreen={})).LANDING="LANDING",K.CONNECT_OR_CREATE="CONNECT_OR_CREATE",K.AWAITING_CONNECTION="AWAITING_CONNECTION",K.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",K.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",K.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",K.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",K.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",K.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",K.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",K.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",K.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",K.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",K.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",K.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",K.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",K.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",K.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",K.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",K.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",K.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",K.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",K.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",K.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",K.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",K.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",K.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",K.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",K.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",K.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",K.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",K.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",K.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",K.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",K.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",K.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",K.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",K.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",K.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",K.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",K.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",K.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",K.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",K.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",K.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",K.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",K.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",K.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",K.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",K.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",K.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",K.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",K.CAPTCHA_SCREEN="CAPTCHA_SCREEN",K.ERROR_SCREEN="ERROR_SCREEN",K.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",K.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",K.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const Y=a.createContext({ready:!1,app:H,currentScreen:null,lastScreen:null,navigate:t.notImplemented,navigateBack:t.notImplemented,resetNavigation:t.notImplemented,setModalData:t.notImplemented,onUserCloseViaDialogOrKeybindRef:void 0});let j=[exports.ModalScreen.LANDING,exports.ModalScreen.CONNECT_ONLY_LANDING_SCREEN,null];exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=b,exports.DEFAULT_SUPPORTED_CHAIN_IDS=R,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.ModalProvider=e=>{let t=B(),n=e.authenticated,[o,l]=a.useState(e.initialScreen);a.useEffect((()=>{n||j.includes(e.initialScreen)||e.setInitialScreen(null)}),[n]);let i=a.useRef(null);a.useEffect((()=>{e.open||(i.current=null)}),[e.open]),a.useEffect((()=>{i.current=null}),[e.initialScreen]);let s={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(t,r=!0)=>{e.setInitialScreen(t),r&&l(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),l(null)},onUserCloseViaDialogOrKeybindRef:i};return r.jsxs(Y.Provider,{value:s,children:[("string"==typeof t.appearance.logo||"img"===t.appearance.logo?.type)&&r.jsx(v,{src:"string"==typeof t.appearance.logo?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PrivyAppConfigProvider=({children:e,legacyCreateEmbeddedWalletFlag:t,client:n,clientConfig:o})=>{let[l,i]=a.useState(null),s=a.useMemo((()=>P(l??F,o,!!l)),[l,o]);return a.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:a,supportedChains:n,defaultChain:o,externalWallets:l,...i}=e;return{...i,...a?{additionalChains:a.map((e=>e.id))}:void 0,...n?{supportedChains:n.map((e=>e.id))}:void 0,...o?{defaultChain:o.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(o,t),r=function(e,t=0){let r=3735928559^t,a=1103547991^t;for(let t,n=0;n<e.length;n++)r=Math.imul(r^(t=e.charCodeAt(n)),2654435761),a=Math.imul(a^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(a^a>>>13,3266489909),4294967296*(2097151&(a=Math.imul(a^a>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${l.id}:${r}`;localStorage.getItem(a)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[o,t,l]),a.useEffect((()=>{l||(async()=>{try{let e=await n.getServerConfig();e.customApiUrl&&n.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),r.jsx(G.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:e})},exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.RELAY_SOLANA_MAINNET_CLUSTER_CHAIN_ID=792703809,exports.RELAY_SOLANA_NATIVE_CURRENCY_ID="11111111111111111111111111111111",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.VERSION="1.96.0-beta-20241205061328",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=W,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!R.has(e.id)));return b.concat(t)},exports.arbitrum=E,exports.arbitrumSepolia=u,exports.avalanche=d,exports.avalancheFuji=h,exports.base=m,exports.baseSepolia=_,exports.celo=C,exports.clamp=function(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)},exports.constructURL=(e,t,r={},a={})=>{let n=new URL(t,e);for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);let o=Object.entries(a);if(o.length>0){let e=new URLSearchParams;for(let[t,r]of o)e.append(t,r);n.hash=e.toString()}return n.href},exports.convert1dTo2dArray=(e,t)=>{let r=e.slice(0),a=[];for(;r.length;)a.push(r.splice(0,t));return a},exports.detectInjectedConnectors=async function({store:e,walletList:t,externalWalletConfig:r,walletChainType:a,timeout:n=3e3}){let o=!1,s=window;return new Promise((p=>{function c(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",c);let n=e.getProviders();console.debug("Detected injected providers:",n.map((e=>e.info)));let s=[];for(let e of n)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===a&&"app.phantom"===e.info.rdns||s.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==a)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let e of t.providers)e&&r.push(e);return r.push(e.ethereum),r}()){let t=l(e);if(!n.some((e=>e.info.name===t))){if(i(e,!0)&&!s.find((e=>"metamask"===e.type))){s.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!s.find((e=>"phantom"===e.type))){s.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!s.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==r.coinbaseWallet?.connectionOptions))){s.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}s.find((e=>"unknown_browser_extension"===e.type))||s.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}p(s)}s.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout((()=>{c()}),n))}))},exports.formatChainIdToCAIP2=function(e){return`eip155:${String(Number(e))}`},exports.formatSolanaWalletAddress=(e,t=3,r=4)=>s(e,t,r,"solana"),exports.formatWalletAddress=s,exports.generateTypedDataWithDomainType=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map((([e,r])=>{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:r}}},exports.getBlockExplorer=(e,r)=>{let a=Number(e),n=r.find((e=>e.id===a));if(!n)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return n.blockExplorers?.default.url},exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getJsonRpcEndpoint=(e,r,a,n)=>{let o=Number(e),l=r.find((e=>e.id===o));if(!l)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return c(l,a,n)},exports.getJsonRpcEndpointFromChain=c,exports.getJsonRpcProvider=(r,a,n,o)=>{let l=Number(r),i=a.find((e=>e.id===l));if(!i)throw new t.PrivyConnectorError(`Unsupported chainId ${r}`,4901);return new e.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?i.rpcUrls.privyWalletOverride.http[0]:n.rpcUrls&&n.rpcUrls[l]?n.rpcUrls[l]:i.rpcUrls.privy?.http[0]?{url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}:i.rpcUrls.public?.http[0]?i.rpcUrls.public.http[0]:i.rpcUrls.default?.http[0])},exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.getSolanaNetworkFromRpcEndpoint=function(e){return e.includes("testnet")?"testnet":e.includes("devnet")?"devnet":"mainnet-beta"},exports.getSolanaRpcEndpointForCluster=function({name:e,rpcUrl:t}){if(t)return t;switch(e){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}},exports.getSolanaTransactionExplorerUrl=function(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`},exports.getSolanaWalletExplorerUrl=function(e,t){return`https://explorer.solana.com/account/${e}?cluster=${t}`},exports.invokeUntilSettled=(e,t={})=>{let r=t.delayMs||150,a=t.maxAttempts||270;return new Promise((async(n,o)=>{let l=!1,i=0;for(;!l&&i<a;){if(t.abortSignal?.aborted)return;e().then((e=>{l=!0,n(e)}),((...e)=>{l=!0,o(...e)})),i+=1,await p(r)}l||o(Error("Exceeded max attempts before resolving function"))}))},exports.isCoinbaseWalletInstalled=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},exports.isPhantomInstalled=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId)return!0}return!1},exports.linea=S,exports.mainnet=f,exports.optimism=A,exports.optimismSepolia=N,exports.pollForResult=function(e,{interval:t=100,timeout:r=5e3}={}){return new Promise(((a,n)=>{let o,l=0,i=()=>{l>=r?n("Max attempts reached without result"):(o=e(),l+=t,null==o?setTimeout(i,t):a(o))};i()}))},exports.polygon=g,exports.polygonAmoy=T,exports.sepolia=y,exports.sleep=p,exports.splitAtIndex=(e,t)=>{let r=[],a=[];for(let[n,o]of e.entries())n<t?r.push(o):a.push(o);return[r,a]},exports.stripEmoji=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),exports.toHex=e=>"string"==typeof e?e:"0x"+e.toString(16),exports.useAppConfig=B,exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=a.useContext(G);return e},exports.usePrivyModal=()=>a.useContext(Y),exports.validateEmail=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),exports.zora=O;
|
|
1
|
+
"use strict";var e=require("@ethersproject/providers"),t=require("./useWallets-BygaNfXg.js"),r=require("react/jsx-runtime"),a=require("react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(require("tinycolor2"));const l=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,i=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==l(e))return!1;if(e.providers)for(let t of e.providers)if(!i(t))return!1;return!0},s=(e,t=3,r=4,a="ethereum")=>{if(!e)return"";let n="ethereum"===a?2:0;return t+r+n+3>=e.length?e:`${e.slice(0,n+t)}...${e.slice(e.length-r,e.length)}`},p=e=>new Promise((t=>setTimeout(t,e)));const c=(e,r,a)=>{let n,o=e.id,l=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])n=e.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[l])n=r.rpcUrls[l];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",a),n=t.toString()}else n=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!n)throw new t.PrivyConnectorError(`No RPC url found for ${o}`);return n};const E={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},u={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},d={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},h={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},m={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},_={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},C={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},S={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},f={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},A={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},N={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},g={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},T={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},y={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},O={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},b=[E,u,y,f,A,N,g,T,C,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},m,_,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},S,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},d,h,O,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],R=new Set(b.map((e=>e.id)));function v({src:e,...t}){return r.jsx("img",{src:e,...t,style:{display:"none"}})}const L={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let w=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),D=e=>w.has(e),I=(e,t,r)=>r.indexOf(e)===t;const x=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(D).filter(I):e?e.filter(D).filter(I):L.appearance.walletList;function W(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let U="#FFFFFF";function k(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function M({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=U;break;case"dark":r="#1E1E1D";break;default:r=e}let a=o.default(r),n=o.default(t),l=o.default("#51BA81"),i=o.default("#FFB74D"),s=o.default("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(a.getLuminance()),c=k(a,"light"===p?-.04:.11),E=k(a,"light"===p?-.08:.16),u=k(a,"light"===p?-.88:.87),d=k(a,"light"===p?-.7:.75),h=k(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=k(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),_=k(n,.15),C=k(n,.25),S=k(n,-.06),f=k(n,-.6),A=k(s,.3),N=k(i,.3),g=o.default(n.getLuminance()>.5?"#040217":U),T=k(l,-.16),y=k(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),background3:E.toHslString(),foreground:u.toHslString(),foreground2:d.toHslString(),foreground3:h.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:_.toHslString(),accentLightest:C.toHslString(),accentDark:S.toHslString(),accentDarkest:f.toHslString(),foregroundAccent:g.toHslString(),success:l.toHslString(),successDark:T.toHslString(),successLight:y.toHslString(),error:s.toHslString(),errorLight:A.toHslString(),warn:i.toHslString(),warnLight:N.toHslString()}}function P(e,t,r){let a,n,o,l,i,s,p,c,E,u,d,h,m,_,C,S,A=r?console.warn:()=>{};t?.loginMethods?(a=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),E=t.loginMethods.includes("spotify"),u=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),h=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),m=t.loginMethods.includes("apple"),_=t.loginMethods.includes("farcaster"),C=t.loginMethods.includes("telegram")):(a=e.emailAuth,n=e.smsAuth,l=e.walletAuth||e.solanaWalletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,h=e.githubOAuth,E=e.spotifyOAuth,u=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,m=e.appleOAuth,_=e.farcasterAuth,C=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let N=[a,n].filter(Boolean),g=[i,s,p,h,E,u,c,d,m,_,C].filter(Boolean),T=[l].filter(Boolean);if(N.length+g.length+T.length===0)throw Error("You must enable at least one login method");let y=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;y&&0===T.length?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),y=!1):y||g.length+N.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),y=!0);let O=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let R=x({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),v=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r 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(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let a of e.overflow??[])t.includes(a)||r.includes(a)?console.warn(`Duplicated login method: ${a}`):r.push(a);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),w=t?.intl?.defaultCountry??"US",{chains:D,defaultChain:I}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:a}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&a&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=b.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?W(e,r):e}))}else n=b.concat(e??[]);let o=t?n[0]:f,l=r??o;if(!n.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),U=!!t?.defaultChain,k=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,P=!(e.enforceWalletUis??1);if(S=e.legacyWalletUiConfig??1?k?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??P:P,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==S)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:F,...H}=t?.embeddedWallets??{},G=t?.solanaClusters??[];return e.solanaWalletAuth&&!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`"),{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??L.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:M({backgroundTheme:t?.appearance?.theme??L.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??L.appearance.accentColor}),loginGroupPriority:y?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:R,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:l,email:a,sms:n,passkey:o,google:i,twitter:s,discord:p,github:h,spotify:E,instagram:u,tiktok:c,linkedin:d,apple:m,farcaster:_,telegram:C},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:v,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??L.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??L.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??L.rpcConfig.rpcTimeouts},chains:D,solanaClusters:{"mainnet-beta":G.find((e=>"mainnet-beta"===e.name))?.rpcUrl||"https://api.mainnet-beta.solana.com",testnet:G.find((e=>"testnet"===e.name))?.rpcUrl||"https://api.testnet.solana.com",devnet:G.find((e=>"devnet"===e.name))?.rpcUrl||"https://api.devnet.solana.com"},defaultChain:I,intl:{defaultCountry:w},shouldEnforceDefaultChainOnConnect:U,captchaEnabled:e.captchaEnabled??L.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??L.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:O},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof F?{requireUserOwnedRecoveryOnCreate:F}:{},...k?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...H,noPromptOnSignature:S,showWalletUIs:t?.embeddedWallets?.showWalletUIs,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:k?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??L._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??L.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??L.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??L.fundingMethodConfig.moonpay.useSandbox}}}}let F={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const H=P(F,void 0,!1);let G=a.createContext({appConfig:H,isServerConfigLoaded:!1});const B=()=>{let{appConfig:e}=a.useContext(G);return e};var K;exports.ModalScreen=void 0,(K=exports.ModalScreen||(exports.ModalScreen={})).LANDING="LANDING",K.CONNECT_OR_CREATE="CONNECT_OR_CREATE",K.AWAITING_CONNECTION="AWAITING_CONNECTION",K.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",K.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",K.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",K.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",K.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",K.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",K.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",K.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",K.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",K.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",K.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",K.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",K.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",K.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",K.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",K.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",K.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",K.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",K.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",K.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",K.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",K.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",K.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",K.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",K.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",K.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",K.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",K.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",K.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",K.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",K.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",K.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",K.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",K.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",K.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",K.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",K.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",K.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",K.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",K.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",K.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",K.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",K.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",K.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",K.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",K.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",K.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",K.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",K.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",K.CAPTCHA_SCREEN="CAPTCHA_SCREEN",K.ERROR_SCREEN="ERROR_SCREEN",K.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",K.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",K.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const Y=a.createContext({ready:!1,app:H,currentScreen:null,lastScreen:null,navigate:t.notImplemented,navigateBack:t.notImplemented,resetNavigation:t.notImplemented,setModalData:t.notImplemented,onUserCloseViaDialogOrKeybindRef:void 0});let j=[exports.ModalScreen.LANDING,exports.ModalScreen.CONNECT_ONLY_LANDING_SCREEN,null];exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=b,exports.DEFAULT_SUPPORTED_CHAIN_IDS=R,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.ModalProvider=e=>{let t=B(),n=e.authenticated,[o,l]=a.useState(e.initialScreen);a.useEffect((()=>{n||j.includes(e.initialScreen)||e.setInitialScreen(null)}),[n]);let i=a.useRef(null);a.useEffect((()=>{e.open||(i.current=null)}),[e.open]),a.useEffect((()=>{i.current=null}),[e.initialScreen]);let s={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(t,r=!0)=>{e.setInitialScreen(t),r&&l(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),l(null)},onUserCloseViaDialogOrKeybindRef:i};return r.jsxs(Y.Provider,{value:s,children:[("string"==typeof t.appearance.logo||"img"===t.appearance.logo?.type)&&r.jsx(v,{src:"string"==typeof t.appearance.logo?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PrivyAppConfigProvider=({children:e,legacyCreateEmbeddedWalletFlag:t,client:n,clientConfig:o})=>{let[l,i]=a.useState(null),s=a.useMemo((()=>P(l??F,o,!!l)),[l,o]);return a.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:a,supportedChains:n,defaultChain:o,externalWallets:l,...i}=e;return{...i,...a?{additionalChains:a.map((e=>e.id))}:void 0,...n?{supportedChains:n.map((e=>e.id))}:void 0,...o?{defaultChain:o.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(o,t),r=function(e,t=0){let r=3735928559^t,a=1103547991^t;for(let t,n=0;n<e.length;n++)r=Math.imul(r^(t=e.charCodeAt(n)),2654435761),a=Math.imul(a^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(a^a>>>13,3266489909),4294967296*(2097151&(a=Math.imul(a^a>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${l.id}:${r}`;localStorage.getItem(a)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[o,t,l]),a.useEffect((()=>{l||(async()=>{try{let e=await n.getServerConfig();e.customApiUrl&&n.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),r.jsx(G.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:e})},exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.RELAY_SOLANA_MAINNET_CLUSTER_CHAIN_ID=792703809,exports.RELAY_SOLANA_NATIVE_CURRENCY_ID="11111111111111111111111111111111",exports.RELAY_SOLANA_USDC_TOKEN_ID="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.VERSION="1.96.0",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=W,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!R.has(e.id)));return b.concat(t)},exports.arbitrum=E,exports.arbitrumSepolia=u,exports.avalanche=d,exports.avalancheFuji=h,exports.base=m,exports.baseSepolia=_,exports.celo=C,exports.clamp=function(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)},exports.constructURL=(e,t,r={},a={})=>{let n=new URL(t,e);for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);let o=Object.entries(a);if(o.length>0){let e=new URLSearchParams;for(let[t,r]of o)e.append(t,r);n.hash=e.toString()}return n.href},exports.convert1dTo2dArray=(e,t)=>{let r=e.slice(0),a=[];for(;r.length;)a.push(r.splice(0,t));return a},exports.detectInjectedConnectors=async function({store:e,walletList:t,externalWalletConfig:r,walletChainType:a,timeout:n=3e3}){let o=!1,s=window;return new Promise((p=>{function c(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",c);let n=e.getProviders();console.debug("Detected injected providers:",n.map((e=>e.info)));let s=[];for(let e of n)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===a&&"app.phantom"===e.info.rdns||s.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==a)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let e of t.providers)e&&r.push(e);return r.push(e.ethereum),r}()){let t=l(e);if(!n.some((e=>e.info.name===t))){if(i(e,!0)&&!s.find((e=>"metamask"===e.type))){s.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!s.find((e=>"phantom"===e.type))){s.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!s.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==r.coinbaseWallet?.connectionOptions))){s.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}s.find((e=>"unknown_browser_extension"===e.type))||s.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}p(s)}s.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout((()=>{c()}),n))}))},exports.formatChainIdToCAIP2=function(e){return`eip155:${String(Number(e))}`},exports.formatSolanaWalletAddress=(e,t=3,r=4)=>s(e,t,r,"solana"),exports.formatWalletAddress=s,exports.generateTypedDataWithDomainType=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map((([e,r])=>{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:r}}},exports.getBlockExplorer=(e,r)=>{let a=Number(e),n=r.find((e=>e.id===a));if(!n)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return n.blockExplorers?.default.url},exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getJsonRpcEndpoint=(e,r,a,n)=>{let o=Number(e),l=r.find((e=>e.id===o));if(!l)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return c(l,a,n)},exports.getJsonRpcEndpointFromChain=c,exports.getJsonRpcProvider=(r,a,n,o)=>{let l=Number(r),i=a.find((e=>e.id===l));if(!i)throw new t.PrivyConnectorError(`Unsupported chainId ${r}`,4901);return new e.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?i.rpcUrls.privyWalletOverride.http[0]:n.rpcUrls&&n.rpcUrls[l]?n.rpcUrls[l]:i.rpcUrls.privy?.http[0]?{url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}:i.rpcUrls.public?.http[0]?i.rpcUrls.public.http[0]:i.rpcUrls.default?.http[0])},exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.getSolanaNetworkFromRpcEndpoint=function(e){return e.includes("testnet")?"testnet":e.includes("devnet")?"devnet":"mainnet-beta"},exports.getSolanaRpcEndpointForCluster=function({name:e,rpcUrl:t}){if(t)return t;switch(e){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}},exports.getSolanaTransactionExplorerUrl=function(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`},exports.getSolanaWalletExplorerUrl=function(e,t){return`https://explorer.solana.com/account/${e}?cluster=${t}`},exports.invokeUntilSettled=(e,t={})=>{let r=t.delayMs||150,a=t.maxAttempts||270;return new Promise((async(n,o)=>{let l=!1,i=0;for(;!l&&i<a;){if(t.abortSignal?.aborted)return;e().then((e=>{l=!0,n(e)}),((...e)=>{l=!0,o(...e)})),i+=1,await p(r)}l||o(Error("Exceeded max attempts before resolving function"))}))},exports.isCoinbaseWalletInstalled=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},exports.isPhantomInstalled=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId)return!0}return!1},exports.linea=S,exports.mainnet=f,exports.optimism=A,exports.optimismSepolia=N,exports.pollForResult=function(e,{interval:t=100,timeout:r=5e3}={}){return new Promise(((a,n)=>{let o,l=0,i=()=>{l>=r?n("Max attempts reached without result"):(o=e(),l+=t,null==o?setTimeout(i,t):a(o))};i()}))},exports.polygon=g,exports.polygonAmoy=T,exports.sepolia=y,exports.sleep=p,exports.splitAtIndex=(e,t)=>{let r=[],a=[];for(let[n,o]of e.entries())n<t?r.push(o):a.push(o);return[r,a]},exports.stripEmoji=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),exports.toHex=e=>"string"==typeof e?e:"0x"+e.toString(16),exports.useAppConfig=B,exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=a.useContext(G);return e},exports.usePrivyModal=()=>a.useContext(Y),exports.validateEmail=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),exports.zora=O;
|