@privy-io/react-auth 1.76.2 → 1.76.3

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var hw=Object.create;var dl=Object.defineProperty;var yw=Object.getOwnPropertyDescriptor;var gw=Object.getOwnPropertyNames;var vw=Object.getPrototypeOf,Cw=Object.prototype.hasOwnProperty;var ww=(e,t)=>{for(var r in t)dl(e,r,{get:t[r],enumerable:!0})},um=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of gw(t))!Cw.call(e,n)&&n!==r&&dl(e,n,{get:()=>t[n],enumerable:!(o=yw(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?hw(vw(e)):{},um(t||!e||!e.__esModule?dl(r,"default",{value:e,enumerable:!0}):r,e)),bw=e=>um(dl({},"__esModule",{value:!0}),e);var rp=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var mm=(e,t,r)=>(rp(e,t,"read from private field"),r?r.call(e):t.get(e)),pl=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},op=(e,t,r,o)=>(rp(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var fm=(e,t,r)=>(rp(e,t,"access private method"),r);var c7={};ww(c7,{AsExternalProvider:()=>wo,Captcha:()=>ac,ConnectorManager:()=>sa,LoginModal:()=>Qd,PrivyClient:()=>la,PrivyProvider:()=>E0,PrivyProxyProvider:()=>ct,SUPPORTED_CHAINS:()=>ia,VERSION:()=>Ml,WalletConnector:()=>mr,addRpcUrlOverrideToChain:()=>rw,errorIndicatesMaxMfaRetries:()=>Mc,errorIndicatesMfaTimeout:()=>Bn,errorIndicatesMfaVerificationFailed:()=>Hn,getAccessToken:()=>Ie,getEmbeddedConnectedWallet:()=>ow,useConnectWallet:()=>O0,useCreateWallet:()=>N0,useCrossAppAccounts:()=>F0,useExperimentalFarcasterSigner:()=>tw,useFarcasterSigner:()=>om,useFundWallet:()=>D0,useLinkAccount:()=>M0,useLinkWithSiwe:()=>R0,useLogin:()=>S0,useLoginWithEmail:()=>x0,useLoginWithOAuth:()=>A0,useLoginWithSms:()=>k0,useLogout:()=>P0,useMfa:()=>$a,useMfaEnrollment:()=>ho,useModalStatus:()=>Q0,useOAuthTokens:()=>ew,usePrivy:()=>$,useRegisterMfaListener:()=>dc,useSendTransaction:()=>H0,useSetWalletPassword:()=>V0,useSetWalletRecovery:()=>z0,useSignMessage:()=>K0,useSignTypedData:()=>Y0,useSolanaWallets:()=>U0,useToken:()=>X0,useWallets:()=>mo});module.exports=bw(c7);var rn=require("@ethersproject/address"),ep=require("@ethersproject/providers"),f0=require("mipd"),ve=require("react"),h0=require("react-device-detect"),ts=require("@privy-io/js-sdk-core");var hm=require("ofetch"),wt=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},pr=class extends wt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},b=class extends wt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},ul=class extends b{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var we=class extends wt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},Ce=e=>{if(e instanceof wt)return e;if(!(e instanceof hm.FetchError))return bt(e);if(!e.response)return new pr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new pr(t||"ApiError",e.response.status,r||o,e,n)},bt=e=>e instanceof wt?e:e instanceof Error?new b(e.message,e):new b(`Internal error: ${e}`);var nn=class extends b{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ur=class extends b{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},ml=class extends b{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var ro=class extends b{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var fl="/api/v1/sessions",hl="/api/v1/sessions/logout",ym="/api/v1/sessions/fork",yl="/api/v1/sessions/fork/recover",gm="/api/v1/siwe/init",vm="/api/v1/siwe/authenticate",Cm="/api/v1/siwe/link",wm="/api/v1/siwe/unlink",bm="/api/v1/farcaster/init",Em="/api/v1/farcaster/authenticate",Tm="/api/v1/farcaster/link",Sm="/api/v1/farcaster/status",_m="/api/v1/farcaster/unlink",Pm="/api/v1/passwordless/init",Am="/api/v1/passwordless/authenticate",xm="/api/v1/passwordless/link",km="/api/v1/passwordless/unlink",Rm="/api/v1/passwordless/update",Im="/api/v1/passwordless_sms/init",Mm="/api/v1/passwordless_sms/link",Wm="/api/v1/passwordless_sms/unlink",Om="/api/v1/passwordless_sms/authenticate",gl="/api/v1/oauth/init",Lm="/api/v1/oauth/authenticate",vl="/api/v1/oauth/link",Nm="/api/v1/oauth/unlink",Dm="/api/v1/recovery/oauth/init",Um="/api/v1/recovery/oauth/init_icloud",Fm="/api/v1/recovery/oauth/authenticate",Bm="/api/v1/passkeys/link/init",Hm="/api/v1/passkeys/authenticate/init",Gm="/api/v1/passkeys/link",Vm="/api/v1/passkeys/authenticate",qm="/api/v1/passkeys/unlink",zm="/api/v1/telegram/authenticate",$m="/api/v1/telegram/link",Km="/api/v1/telegram/unlink";var jm="/api/v1/mfa/passwordless_sms/init",Ym="/api/v1/mfa/passkeys/init",Zm="/api/v1/users/me/accept_terms",Cl="/api/v1/analytics_events",Qm="/api/v1/custom_jwt_account/authenticate",Jm="/api/v1/plugins/moonpay_on_ramp/sign",Xm="/api/v1/funding/coinbase_on_ramp/init",ef="/api/v1/funding/coinbase_on_ramp/status";var Vi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(Qm,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){throw new Error("Unimplemented")}};var Pn=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Am,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(xm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw Ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{return await this.api.post(Pm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},wl=class extends Pn{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new b("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Rm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw Ce(r)}}};var kl=require("react-device-detect");var np=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},bl=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function ip(){try{let e="privy:__session_storage__test",t="blobby",r=new bl;return r.put(e,t),r.del(e),!0}catch{return!1}}function Ew(){return typeof window<"u"&&window.localStorage?new bl:new np}var X=Ew();var qi=require("@ethersproject/providers");function tf(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var El=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var ap=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||El(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!ap(r))return!1}return!0},An=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Tl=()=>{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};var rf=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},Sl=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,}))$/),of=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Wt=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},sp=e=>new Promise(t=>setTimeout(t,e));function nf(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var os=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await sp(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},_l=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var af=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),ii=e=>typeof e=="string"?e:"0x"+e.toString(16);async function sf(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of tf()){let f=El(m);if(!s.some(u=>u.info.name===f)){if(ap(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function zi(e){return`eip155:${String(Number(e))}`}var lf=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);return lp(i,r,o)},lp=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new we(`No RPC url found for ${o}`);return i},cf=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new we(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Er=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new qi.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new qi.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new qi.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new qi.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new qi.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new we(`No RPC url found for ${e}`);return a},ns=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var Pl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Al))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Al={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function df(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function pf(e,t){let r=df(t);if(r.deepLink)return gf(r.deepLink,e);if(r.universalLink)return cp(r.universalLink,e);throw new b(`Unsupported wallet ${t.id}`)}function uf(e,t){let r=df(t);if(r.universalLink)return cp(r.universalLink,e)}var mf="WALLETCONNECT_DEEPLINK_CHOICE";function ff(){try{localStorage.removeItem(mf)}catch{}}function hf({href:e,name:t}){try{localStorage.setItem(mf,JSON.stringify({href:e,name:t}))}catch{}}function yf(e){return e.startsWith("http://")||e.startsWith("https://")}function gf(e,t){if(yf(e))return cp(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function cp(e,t){if(!yf(e))return gf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function xl(e,t){window.open(e,t,"noreferrer noopener")}var rt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var is=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");try{let t=await this.api.post(Em,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new b("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(Tm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw Ce(t)}}async _startChannelOnce(){if(!this.api)throw new b("Auth flow has no API instance");let t=await this.api.post(bm,{token:this.captchaToken});kl.isMobile&&!kl.isIOS&&t.connect_uri&&xl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new b("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");let t=await this.api.get(Sm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var vf="1.76.2";var Cf="34357d3c125c2bcf2ce2bc3309d98715",Rl="https://auth.privy.io",wf=2e4,ot=1400,Il=2500,Ml=vf;var ai="privy:token",dp="privy-token",Wl="privy:refresh_token",bf="privy-refresh-token",pp="privy:id_token",up="privy-id-token",Ol="privy-session",as="privy:session_transfer_token",Sw="privy:wallet",ss="privy:caid",ls=e=>`privy:cross-app:${e}`,si="privy:state_code",li="privy:code_verifier",ci="privy:headless_oauth",Ll=e=>`${Sw}:${e}`,mp="privy:connectors",fp="privy:connections";var di=12e4,an=1,hp="0x1",$i=3e4,Ef="https://api.moonpay.com/v1",Tf="https://api.moonpay.com/v1",Sf="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",_f="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var Pf="deprecated";var yp=require("jose");async function Af(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function xf(e){return crypto.getRandomValues(new Uint8Array(e))}var _w="S256",Pw="S256";function pi(){return yp.base64url.encode(xf(36))}function Ki(){return pi()}async function ji(e,t=_w){if(t==Pw){let r=await Af(e);return yp.base64url.encode(r)}else return e}function kf(){let e=X.get(li);if(!e)throw new b("Authentication error.");return e}function Nl(){return!!X.get(ci)}var Do=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Nl();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=kf();try{let r=await this.api.post(Lm,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(li),this.meta.headless&&X.del(ci),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=Ce(r);throw o.privyErrorCode?new b(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=X.get(li);if(!t)throw new b("Authentication error.");try{let r=await this.api.post(vl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(li),r}catch(r){throw Ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initializing OAuth authentication.");let t=pi();X.put(li,t);let r=Ki();X.put(si,r);let o=await ji(t);this.meta.headless&&X.put(ci,!0);try{return await this.api.post(gl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw Ce(n)}}};function gp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var cs=require("react/jsx-runtime"),Dl=({style:e,...t})=>(0,cs.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,cs.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,cs.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var xn=require("react/jsx-runtime"),Ul=({style:e,...t})=>(0,xn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,xn.jsx)("g",{clipPath:"url(#clip0)",children:(0,xn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,xn.jsx)("defs",{children:(0,xn.jsx)("clipPath",{id:"clip0",children:(0,xn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var vp=require("react/jsx-runtime"),Fl=({style:e,...t})=>(0,vp.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,vp.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var Rf=require("@heroicons/react/24/outline"),Mf=require("react/jsx-runtime"),If=({style:e})=>(0,Mf.jsx)(Rf.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var ui=require("react/jsx-runtime"),Bl=({style:e,...t})=>(0,ui.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,ui.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,ui.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,ui.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,ui.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Ut=require("react/jsx-runtime");function Hl(e){return(0,Ut.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Ut.jsxs)("defs",{children:[(0,Ut.jsxs)("linearGradient",{id:"b",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Ut.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Ut.jsxs)("linearGradient",{id:"a",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Ut.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Ut.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Ut.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var ds=require("react/jsx-runtime");function Gl({style:e,...t}){return(0,ds.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,ds.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ds.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ds.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var ps=require("react/jsx-runtime");function Vl(e){return(0,ps.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,ps.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,ps.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Yi=require("react/jsx-runtime");function ql(e){return(0,Yi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Yi.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Yi.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Yi.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Cp=require("react/jsx-runtime"),zl=({style:e,...t})=>(0,Cp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Cp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Wf={google:{name:"Google",component:Bl},discord:{name:"Discord",component:Ul},github:{name:"Github",component:Fl},linkedin:{name:"LinkedIn",component:Gl},twitter:{name:"Twitter",component:zl},spotify:{name:"Spotify",component:Vl},instagram:{name:"Instagram",component:Hl},tiktok:{name:"Tiktok",component:ql},apple:{name:"Apple",component:Dl}},us=e=>e in Wf?Wf[e]:{name:"Unknown",component:If};function Of(e,t){let r={detail:"",retryable:!1},o=gp(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=us(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=us(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function ms(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Nl(),popupFlow:window.opener!==null&&n}}function mi(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),X.del(si),window.history.replaceState({},"",e)}var fi=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(Vm,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(Gm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Hm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Bm,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var $l=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
1
+ "use strict";var bw=Object.create;var pl=Object.defineProperty;var Ew=Object.getOwnPropertyDescriptor;var Tw=Object.getOwnPropertyNames;var Sw=Object.getPrototypeOf,_w=Object.prototype.hasOwnProperty;var Pw=(e,t)=>{for(var r in t)pl(e,r,{get:t[r],enumerable:!0})},fm=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Tw(t))!_w.call(e,n)&&n!==r&&pl(e,n,{get:()=>t[n],enumerable:!(o=Ew(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?bw(Sw(e)):{},fm(t||!e||!e.__esModule?pl(r,"default",{value:e,enumerable:!0}):r,e)),Aw=e=>fm(pl({},"__esModule",{value:!0}),e);var np=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var hm=(e,t,r)=>(np(e,t,"read from private field"),r?r.call(e):t.get(e)),ul=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},ip=(e,t,r,o)=>(np(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var ym=(e,t,r)=>(np(e,t,"access private method"),r);var h7={};Pw(h7,{AsExternalProvider:()=>bo,Captcha:()=>lc,ConnectorManager:()=>ca,LoginModal:()=>Xd,PrivyClient:()=>da,PrivyProvider:()=>x0,PrivyProxyProvider:()=>ct,SUPPORTED_CHAINS:()=>sa,VERSION:()=>Wl,WalletConnector:()=>mr,addRpcUrlOverrideToChain:()=>lw,errorIndicatesMaxMfaRetries:()=>Oc,errorIndicatesMfaTimeout:()=>Gn,errorIndicatesMfaVerificationFailed:()=>Vn,getAccessToken:()=>Ie,getEmbeddedConnectedWallet:()=>cw,useConnectWallet:()=>B0,useCreateWallet:()=>G0,useCrossAppAccounts:()=>z0,useExperimentalFarcasterSigner:()=>sw,useFarcasterSigner:()=>im,useFundWallet:()=>V0,useLinkAccount:()=>U0,useLinkWithSiwe:()=>N0,useLogin:()=>R0,useLoginWithEmail:()=>O0,useLoginWithOAuth:()=>W0,useLoginWithSms:()=>L0,useLogout:()=>M0,useMfa:()=>Ka,useMfaEnrollment:()=>yo,useModalStatus:()=>ow,useOAuthTokens:()=>aw,usePrivy:()=>z,useRegisterMfaListener:()=>uc,useSendTransaction:()=>K0,useSetWalletPassword:()=>Y0,useSetWalletRecovery:()=>Q0,useSignMessage:()=>X0,useSignTypedData:()=>tw,useSolanaWallets:()=>q0,useToken:()=>iw,useWallets:()=>fo});module.exports=Aw(h7);var on=require("@ethersproject/address"),rp=require("@ethersproject/providers"),w0=require("mipd"),ve=require("react"),b0=require("react-device-detect"),rs=require("@privy-io/js-sdk-core");var gm=require("ofetch"),wt=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},pr=class extends wt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},b=class extends wt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},ml=class extends b{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var we=class extends wt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},Ce=e=>{if(e instanceof wt)return e;if(!(e instanceof gm.FetchError))return bt(e);if(!e.response)return new pr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new pr(t||"ApiError",e.response.status,r||o,e,n)},bt=e=>e instanceof wt?e:e instanceof Error?new b(e.message,e):new b(`Internal error: ${e}`);var an=class extends b{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ur=class extends b{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},fl=class extends b{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var no=class extends b{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var hl="/api/v1/sessions",yl="/api/v1/sessions/logout",vm="/api/v1/sessions/fork",gl="/api/v1/sessions/fork/recover",Cm="/api/v1/siwe/init",wm="/api/v1/siwe/authenticate",bm="/api/v1/siwe/link",Em="/api/v1/siwe/unlink",Tm="/api/v1/farcaster/init",Sm="/api/v1/farcaster/authenticate",_m="/api/v1/farcaster/link",Pm="/api/v1/farcaster/status",Am="/api/v1/farcaster/unlink",xm="/api/v1/passwordless/init",km="/api/v1/passwordless/authenticate",Rm="/api/v1/passwordless/link",Im="/api/v1/passwordless/unlink",Mm="/api/v1/passwordless/update",Wm="/api/v1/passwordless_sms/init",Om="/api/v1/passwordless_sms/link",Lm="/api/v1/passwordless_sms/unlink",Nm="/api/v1/passwordless_sms/authenticate",Dm="/api/v1/passwordless_sms/update",vl="/api/v1/oauth/init",Um="/api/v1/oauth/authenticate",Cl="/api/v1/oauth/link",Fm="/api/v1/oauth/unlink",Bm="/api/v1/recovery/oauth/init",Hm="/api/v1/recovery/oauth/init_icloud",Gm="/api/v1/recovery/oauth/authenticate",Vm="/api/v1/passkeys/link/init",qm="/api/v1/passkeys/authenticate/init",zm="/api/v1/passkeys/link",$m="/api/v1/passkeys/authenticate",Km="/api/v1/passkeys/unlink",jm="/api/v1/telegram/authenticate",Ym="/api/v1/telegram/link",Zm="/api/v1/telegram/unlink";var Qm="/api/v1/mfa/passwordless_sms/init",Jm="/api/v1/mfa/passkeys/init",Xm="/api/v1/users/me/accept_terms",wl="/api/v1/analytics_events",ef="/api/v1/custom_jwt_account/authenticate",tf="/api/v1/plugins/moonpay_on_ramp/sign",rf="/api/v1/funding/coinbase_on_ramp/init",of="/api/v1/funding/coinbase_on_ramp/status";var zi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(ef,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){throw new Error("Unimplemented")}};var An=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(km,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Rm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw Ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{return await this.api.post(xm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},bl=class extends An{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new b("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Mm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw Ce(r)}}};var Rl=require("react-device-detect");var ap=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},El=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function sp(){try{let e="privy:__session_storage__test",t="blobby",r=new El;return r.put(e,t),r.del(e),!0}catch{return!1}}function xw(){return typeof window<"u"&&window.localStorage?new El:new ap}var X=xw();var $i=require("@ethersproject/providers");function nf(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var Tl=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var lp=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Tl(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!lp(r))return!1}return!0},xn=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Sl=()=>{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};var af=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},_l=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,}))$/),sf=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Wt=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},cp=e=>new Promise(t=>setTimeout(t,e));function lf(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var ns=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await cp(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},Pl=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var cf=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),li=e=>typeof e=="string"?e:"0x"+e.toString(16);async function df(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of nf()){let f=Tl(m);if(!s.some(u=>u.info.name===f)){if(lp(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function Ki(e){return`eip155:${String(Number(e))}`}var pf=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);return dp(i,r,o)},dp=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new we(`No RPC url found for ${o}`);return i},uf=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new we(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Er=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new $i.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new $i.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new $i.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new $i.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new $i.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new we(`No RPC url found for ${e}`);return a},is=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var Al=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(xl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var xl={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function mf(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function ff(e,t){let r=mf(t);if(r.deepLink)return wf(r.deepLink,e);if(r.universalLink)return pp(r.universalLink,e);throw new b(`Unsupported wallet ${t.id}`)}function hf(e,t){let r=mf(t);if(r.universalLink)return pp(r.universalLink,e)}var yf="WALLETCONNECT_DEEPLINK_CHOICE";function gf(){try{localStorage.removeItem(yf)}catch{}}function vf({href:e,name:t}){try{localStorage.setItem(yf,JSON.stringify({href:e,name:t}))}catch{}}function Cf(e){return e.startsWith("http://")||e.startsWith("https://")}function wf(e,t){if(Cf(e))return pp(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function pp(e,t){if(!Cf(e))return wf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function kl(e,t){window.open(e,t,"noreferrer noopener")}var rt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var as=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");try{let t=await this.api.post(Sm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new b("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(_m,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw Ce(t)}}async _startChannelOnce(){if(!this.api)throw new b("Auth flow has no API instance");let t=await this.api.post(Tm,{token:this.captchaToken});Rl.isMobile&&!Rl.isIOS&&t.connect_uri&&kl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new b("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");let t=await this.api.get(Pm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var bf="1.76.3";var Ef="34357d3c125c2bcf2ce2bc3309d98715",Il="https://auth.privy.io",Tf=2e4,ot=1400,Ml=2500,Wl=bf;var ci="privy:token",up="privy-token",Ol="privy:refresh_token",Sf="privy-refresh-token",mp="privy:id_token",fp="privy-id-token",Ll="privy-session",ss="privy:session_transfer_token",Rw="privy:wallet",ls="privy:caid",cs=e=>`privy:cross-app:${e}`,di="privy:state_code",pi="privy:code_verifier",ui="privy:headless_oauth",Nl=e=>`${Rw}:${e}`,hp="privy:connectors",yp="privy:connections";var mi=12e4,sn=1,gp="0x1",ji=3e4,_f="https://api.moonpay.com/v1",Pf="https://api.moonpay.com/v1",Af="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",xf="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var kf="deprecated";var vp=require("jose");async function Rf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function If(e){return crypto.getRandomValues(new Uint8Array(e))}var Iw="S256",Mw="S256";function fi(){return vp.base64url.encode(If(36))}function Yi(){return fi()}async function Zi(e,t=Iw){if(t==Mw){let r=await Rf(e);return vp.base64url.encode(r)}else return e}function Mf(){let e=X.get(pi);if(!e)throw new b("Authentication error.");return e}function Dl(){return!!X.get(ui)}var Uo=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Dl();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=Mf();try{let r=await this.api.post(Um,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(pi),this.meta.headless&&X.del(ui),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=Ce(r);throw o.privyErrorCode?new b(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=X.get(pi);if(!t)throw new b("Authentication error.");try{let r=await this.api.post(Cl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(pi),r}catch(r){throw Ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initializing OAuth authentication.");let t=fi();X.put(pi,t);let r=Yi();X.put(di,r);let o=await Zi(t);this.meta.headless&&X.put(ui,!0);try{return await this.api.post(vl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw Ce(n)}}};function Cp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ds=require("react/jsx-runtime"),Ul=({style:e,...t})=>(0,ds.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,ds.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,ds.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var kn=require("react/jsx-runtime"),Fl=({style:e,...t})=>(0,kn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,kn.jsx)("g",{clipPath:"url(#clip0)",children:(0,kn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,kn.jsx)("defs",{children:(0,kn.jsx)("clipPath",{id:"clip0",children:(0,kn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var wp=require("react/jsx-runtime"),Bl=({style:e,...t})=>(0,wp.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,wp.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var Wf=require("@heroicons/react/24/outline"),Lf=require("react/jsx-runtime"),Of=({style:e})=>(0,Lf.jsx)(Wf.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var hi=require("react/jsx-runtime"),Hl=({style:e,...t})=>(0,hi.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,hi.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,hi.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,hi.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,hi.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Ut=require("react/jsx-runtime");function Gl(e){return(0,Ut.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Ut.jsxs)("defs",{children:[(0,Ut.jsxs)("linearGradient",{id:"b",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Ut.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Ut.jsxs)("linearGradient",{id:"a",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Ut.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Ut.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Ut.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var ps=require("react/jsx-runtime");function Vl({style:e,...t}){return(0,ps.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,ps.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ps.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ps.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var us=require("react/jsx-runtime");function ql(e){return(0,us.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,us.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,us.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Qi=require("react/jsx-runtime");function zl(e){return(0,Qi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Qi.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Qi.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Qi.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var bp=require("react/jsx-runtime"),$l=({style:e,...t})=>(0,bp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,bp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Nf={google:{name:"Google",component:Hl},discord:{name:"Discord",component:Fl},github:{name:"Github",component:Bl},linkedin:{name:"LinkedIn",component:Vl},twitter:{name:"Twitter",component:$l},spotify:{name:"Spotify",component:ql},instagram:{name:"Instagram",component:Gl},tiktok:{name:"Tiktok",component:zl},apple:{name:"Apple",component:Ul}},ms=e=>e in Nf?Nf[e]:{name:"Unknown",component:Of};function Df(e,t){let r={detail:"",retryable:!1},o=Cp(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=ms(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ms(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function fs(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Dl(),popupFlow:window.opener!==null&&n}}function yi(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),X.del(di),window.history.replaceState({},"",e)}var gi=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post($m,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(zm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(qm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Vm,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var Kl=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
2
2
  ${e}
3
3
 
4
4
  ${i}
@@ -9,7 +9,7 @@ Chain ID: ${t}
9
9
  Nonce: ${r}
10
10
  Issued At: ${a}
11
11
  Resources:
12
- - https://privy.io`};var sn=class{constructor(t,r,o){this.getNonceOnce=new rt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw Ce(t)}}async sign(){if(!this.client)throw new b("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new b("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new b("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new b("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=$l({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var hi=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Om,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Mm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw Ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new b("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Im,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}};var Zi=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(zm,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post($m,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw Ce(t)}}};function wp(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Nf(){let e;if(e=Aw(),e)return Lf(),{...e,flowType:"login-url"};if(e=xw(),e)return Lf(),{...e,flowType:"web-app"}}function Aw(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:l,auth_date:o,hash:r}}function xw(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash");if(!(!r||!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i}}function Lf(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var zh=require("uuid");function oe(e){return e?new Date(e*1e3):null}function kw(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let m={subject:r.subject,username:r.username,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(m);break;case"twitter_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(f);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(u);break;case"github_oauth":let w={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(w);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let E={subject:r.subject,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(E);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)});break;case"farcaster":let T={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(T);break;case"passkey":let R={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(R);break;case"telegram":let S={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:oe(r.first_verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function Tr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var xe=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,yi=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Kl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,Rw=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Sr=(e,t)=>xe(e)||yi(e)?!1:t==="all-users"||t==="users-without-wallets"&&!Rw(e)?.length;function _r(e){if(!e)return null;let t=kw(e.linked_accounts),r=Tr(t,"wallet"),o=Tr(t,"email"),n=Tr(t,"phone"),i=Tr(t,"google_oauth"),a=Tr(t,"twitter_oauth"),l=Tr(t,"discord_oauth"),s=Tr(t,"github_oauth"),c=Tr(t,"spotify_oauth"),m=Tr(t,"instagram_oauth"),f=Tr(t,"tiktok_oauth"),u=Tr(t,"linkedin_oauth"),w=Tr(t,"apple_oauth"),v=Tr(t,"farcaster"),g=Tr(t,"telegram"),E=e.mfa_methods.map(({type:R,verified_at:S})=>({type:R,verifiedAt:oe(S)}));return{id:e.id,createdAt:oe(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:w&&{subject:w.subject,email:w.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:E.map(R=>R.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var kp=require("@ethersproject/address"),Fh=require("@ethersproject/bytes"),Bh=y(require("eventemitter3"));var zf=y(require("@coinbase/wallet-sdk"));var fs=require("react/jsx-runtime"),ln=({style:e,...t})=>(0,fs.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,fs.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,fs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var bo=require("@ethersproject/address"),bp=require("@ethersproject/providers"),qf=y(require("eventemitter3"));var Ff=y(require("eventemitter3"));var Iw=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Df=e=>Iw.includes(e);var Uf=require("@ethersproject/logger"),kn=require("@privy-io/js-sdk-core");var Qi=class extends we{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ji=class extends we{constructor(){super("User rejected connection");this.type="wallet_error"}},Co=e=>{if(e instanceof we)return e;if(e?.code&&e?.reason){let t=new Kt(e);return e.code===Uf.ErrorCode.ACTION_REJECTED&&(t.details=kn.ProviderErrors.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Kt(e):new we("Unknown connector error",e)},oo=class extends wt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Kt=class extends oo{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(kn.ProviderErrors).find(i=>i.eipCode===o.code);this.details=n||kn.ProviderErrors.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=kn.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=kn.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=kn.ProviderErrors.E32002_WALLET_LOCKED))}},Mw={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},cn={...Mw,...kn.ProviderErrors};var ct=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Qi,r=this.rpcTimeoutDuration)=>new Promise((o,n)=>setTimeout(()=>{n(t)},r));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(r=>{this.removeListener(r.eventName,r.listener)}),this.walletProvider=t,this._subscriptions.forEach(r=>{this.walletProvider?.on(r.eventName,r.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=r||di,this._subscriptions=[]}on(t,r){if(this.walletProvider)return this.walletProvider.on(t,r);this._subscriptions.push({eventName:t,listener:r})}async request(t){if(!this.walletProvider)throw new we(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(r=>{throw Co(r)})}},Rn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},hs=class extends Ff.default{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=Er(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Xi(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new Rn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Ie()||!this.address)throw new Rn("Disconnected",4900);return(await Gf(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new Rn(`Invalid params for ${r.method}`,4200);let o;if(typeof r.params[0]=="string")o=r.params[0];else if("chainId"in r.params[0]&&typeof r.params[0].chainId=="string")o=r.params[0].chainId;else throw new Rn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Er(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Bf(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await Hf(ns(o))}async handleEstimateGas(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_estimateGas");delete r.params[0].gasPrice,delete r.params[0].maxFeePerGas,delete r.params[0].maxPriorityFeePerGas;let o={...r.params[0],chainId:ii(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return ii(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(r);case"eth_sendTransaction":return this.handleSendTransaction(r);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(r);case"personal_sign":return this.handlePersonalSign(r);case"eth_signTypedData_v4":return this.handleSignedTypedData(r);default:break}if(Df(r.method)){let o=await Ie();if(await Vf(),!o||!this.address)throw new Rn("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:o,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new Rn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Ie();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},wo=class extends ct{constructor(r){super(r,r.rpcTimeoutDuration)}},In=class extends ct{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Ww=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},mr=class extends qf.default{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=zi(r),this.walletClientType==="privy"&&X.put(Ll(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=Xi(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>(0,bo.getAddress)(l.address)===(0,bo.getAddress)(r));return{address:(0,bo.getAddress)(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new we("Wallet is not currently connected.");let s=this.wallets.find(w=>(0,bo.getAddress)(w.address)===(0,bo.getAddress)(r))?.chainId;if(!s)throw new we("Unable to determine current chainId.");let c,m;if(typeof l=="number"?(c=`0x${l.toString(16)}`,m=l):(c=l,m=Number(l)),s===zi(c))return;let f=this.chains.find(w=>w.id===m);if(!f)throw new we(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await u()}catch(w){if(Ww(w,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&w.message?.includes("wallet_switchEthereumChain")?new we(`Rainbow does not support the chainId ${o}`):w}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new bp.Web3Provider(new wo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new In(this.proxyProvider)},sign:async l=>{if(!await a())throw new we("Wallet is not currently connected.");return await this.sign(l)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await os(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch(c){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=(0,bo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=X.get(Ll(i));this.chains.find(m=>m.id===Number(c))||(X.del(Ll(i)),c=null),l=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let c=await os(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${hp}`,c),l=hp}let s=zi(l);if(!a.find(c=>(0,bo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,bo.getAddress)(n),s,c,this.connectorType==="embedded_imported"))}jl(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,bo.getAddress)(n)===(0,bo.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new bp.Web3Provider(new wo(this.proxyProvider)).getSigner().signMessage(r)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}};var Ow=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Lw=(e,t)=>e.makeWeb3Provider({options:t}),Ep,Yl=class extends mr{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Ep){let s=[o.id].concat(r.map(m=>m.id)),c=this.connectionOptions!=="eoaOnly"?s.filter(m=>!Ow.includes(m)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),Ep=new zf.default({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Lw(Ep,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:ln,id:"com.coinbase.wallet"}}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Co(r)}}};var Tp=require("react/jsx-runtime"),Mn=({...e})=>(0,Tp.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Tp.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var ys=class extends mr{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[ii(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Mn,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Sp=require("react/jsx-runtime"),ea=({style:e,...t})=>(0,Sp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Sp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var or=require("react/jsx-runtime"),ta=({style:e,...t})=>(0,or.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,or.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,or.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,or.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,or.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,or.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,or.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,or.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,or.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,or.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,or.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,or.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,or.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,or.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var gs=require("react/jsx-runtime"),Uo=({style:e,...t})=>(0,gs.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,gs.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,gs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var oa=class extends mr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Co(r)}}},ra,na=class extends mr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";pl(this,ra,void 0);this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?op(this,ra,{name:"MetaMask",icon:ta,id:"io.metamask"}):a==="phantom"&&op(this,ra,{name:"Phantom",icon:Uo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return mm(this,ra)??{name:"Browser Extension",icon:ea,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Co(r)}}};ra=new WeakMap;var Nw=require("@ethersproject/address"),Dw=require("@ethersproject/providers"),$f=require("react-device-detect");var Zl=class extends oa{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{$f.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Co(t)}}};var Ql=class extends mr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new ct(void 0,di);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var Jl=class extends Ql{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Uo,id:"phantom"}}};var aa=require("@walletconnect/ethereum-provider"),Uh=require("react-device-detect");var no=require("react");var jf=require("react/jsx-runtime");function Kf({src:e,...t}){return(0,jf.jsx)("img",{src:e,...t,style:{display:"none"}})}var Fo=require("react"),Mh=require("react");var fr={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:Cf,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var Yf=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let o of e.primary.slice(1))t.includes(o)?console.warn(`Duplicated login method: ${o}`):t.push(o);for(let o of e.overflow??[])!t.includes(o)&&!r.includes(o)?r.push(o):console.warn(`Duplicated login method: ${o}`);return{primary:t,overflow:r}};var Uw=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),Zf=e=>Uw.has(e),Qf=(e,t,r)=>r.indexOf(e)===t,Jf=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Zf).filter(Qf):e?e.filter(Zf).filter(Qf):fr.appearance.walletList;var Xf={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"}}};var eh={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var th={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};var rh={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"}}};var oh={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};var nh={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"}},testnet:!0};var ih={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var ah={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};var sh={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};var lh={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};var ch={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};var dh={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"}}};var ph={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"}}};var uh={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"}}};var mh={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var fh={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"}}};var hh={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};var yh={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};var Xl={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"}}};var gh={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"}}};var vh={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var Ch={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};var wh={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",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"}}};var bh={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var Eh={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/"}}};var Th={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var Sh={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};var _h={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"}}};var Ph={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};var Ah={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};var ia=[Xf,eh,th,mh,Sh,Xl,gh,vh,Ch,wh,bh,lh,ch,dh,ph,nh,ih,ah,sh,hh,yh,rh,oh,_h,Ah,Ph,fh,Eh,uh,Th],iS=new Set(ia.map(e=>e.id));var Wn=y(require("tinycolor2")),xh="#FFFFFF",Fw="#040217",Bw=xh,Hw="#1E1E1D";function Gw(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"}function Eo(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Wn.default)({...e.toHsl(),l:r})}var Vw="#51BA81",qw="#FFB74D",zw="#EC6351",$w=xh,Kw=Fw;function kh({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=Bw;break;case"dark":r=Hw;break;default:r=e;break}let o=(0,Wn.default)(r),n=(0,Wn.default)(t),i=(0,Wn.default)(Vw),a=(0,Wn.default)(qw),l=(0,Wn.default)(zw),s=Gw(o.getLuminance()),c=Eo(o,s==="light"?-.04:.11),m=Eo(o,s==="light"?-.88:.87),f=Eo(o,s==="light"?-.7:.75),u=Eo(o,s==="light"?-.43:.45).desaturate(s==="light"?60:20),w=Eo(o,s==="light"?-.08:.25).desaturate(s==="light"?60:20),v=Eo(n,.15),g=Eo(n,-.06),E=Eo(l,.3),T=Eo(a,.3),R=(0,Wn.default)(n.getLuminance()>.5?Kw:$w),S=Eo(i,-.16),x=Eo(i,.4);return{colorScheme:s,background:o.toHslString(),background2:c.toHslString(),foreground:m.toHslString(),foreground2:f.toHslString(),foreground3:u.toHslString(),foreground4:w.toHslString(),accent:n.toHslString(),accentLight:v.toHslString(),accentDark:g.toHslString(),foregroundAccent:R.toHslString(),success:i.toHslString(),successDark:S.toHslString(),successLight:x.toHslString(),error:l.toHslString(),errorLight:E.toHslString(),warn:a.toHslString(),warnLight:T.toHslString()}}function _p(e,t,r){let o=r?console.warn:()=>{},n,i,a,l,s,c,m,f,u,w,v,g,E,T,R;t?.loginMethods?(n=t.loginMethods.includes("email"),i=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),s=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),m=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),w=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),v=t.loginMethods.includes("linkedin"),E=t.loginMethods.includes("apple"),T=t.loginMethods.includes("farcaster"),R=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,l=e.walletAuth,s=e.googleOAuth,c=e.twitterOAuth,m=e.discordOAuth,g=e.githubOAuth,u=e.spotifyOAuth,w=e.instagramOAuth,f=e.tiktokOAuth,v=e.linkedinOAuth,E=e.appleOAuth,T=e.farcasterAuth,R=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let S=[n,i].filter(Boolean),x=[s,c,m,g,u,w,f,v,E,T,R].filter(Boolean),I=[l].filter(Boolean);if(S.length+x.length+I.length===0)throw new Error("You must enable at least one login method");let M=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;M&&I.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),M=!1):!M&&x.length+S.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),M=!0);let U=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=Jf({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=Yf({input:t?.loginMethodsAndOrder}),Z=t?.intl?.defaultCountry??"US",{chains:L,defaultChain:F}=jw({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),O=!!t?.defaultChain,Me=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,je,Q=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?Me?je=t?.embeddedWallets?.noPromptOnSignature??!0:je=t?.embeddedWallets?.noPromptOnSignature??Q:je=Q,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&je!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:re,...ie}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??fr.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:kh({backgroundTheme:t?.appearance?.theme??fr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??fr.appearance.accentColor}),loginGroupPriority:M?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:G},loginMethods:{wallet:l,email:n,sms:i,passkey:a,google:s,twitter:c,discord:m,github:g,spotify:u,instagram:w,tiktok:f,linkedin:v,apple:E,farcaster:T,telegram:R},loginMethodsAndOrder:Y,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??fr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??fr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??fr.rpcConfig.rpcTimeouts},chains:L,defaultChain:F,intl:{defaultCountry:Z},shouldEnforceDefaultChainOnConnect:O,captchaEnabled:e.captchaEnabled??fr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??fr.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U}},embeddedWallets:{...e.embeddedWalletConfig,...typeof re=="boolean"?{requireUserOwnedRecoveryOnCreate:re}:{},...Me?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...ie,noPromptOnSignature:je},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:Me?{enabled:!0,...t.customAuth}:void 0,loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??fr._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??fr.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??fr.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??fr.fundingMethodConfig.moonpay.useSandbox}}}}function Rh(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:i,...a}=e;return{...a,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function jw({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&o&&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(s=>s.rpcUrls.privyWalletOverride?s:ia.find(m=>m.id===s.id)??s)}else n=ia.concat(e??[]);let i=t?n[0]:Xl,a=r??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var Ih=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,i;n<e.length;n++)i=e.charCodeAt(n),r=Math.imul(r^i,2654435761),o=Math.imul(o^i,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var Lh=require("react/jsx-runtime"),Wh={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,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},Pp=_p(Wh,void 0,!1),Ap=(0,Mh.createContext)({appConfig:Pp,isServerConfigLoaded:!1}),Oh=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=(0,Fo.useState)(null),a=(0,Fo.useMemo)(()=>_p(n??Wh,o,!!n),[n,o]);return(0,Fo.useEffect)(()=>{if(!n)return;let l=Rh(o,t),s=Ih(JSON.stringify(l)).toString(),c=`privy:sent:${n.id}:${s}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:l}),localStorage.setItem(c,"t"))},[o,t,n]),(0,Fo.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,Lh.jsx)(Ap.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},dt=()=>{let{appConfig:e}=(0,Fo.useContext)(Ap);return e},ec=()=>{let{isServerConfigLoaded:e}=(0,Fo.useContext)(Ap);return e};var _=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var tc=require("react/jsx-runtime"),Nh=(0,no.createContext)({ready:!1,app:Pp,currentScreen:null,lastScreen:null,navigate:_,navigateBack:_,resetNavigation:_,setModalData:_,onUserCloseViaDialogOrKeybindRef:void 0}),Yw=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Dh=e=>{let t=dt(),r=e.authenticated,[o,n]=(0,no.useState)(e.initialScreen);(0,no.useEffect)(()=>{!r&&!Yw.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=(0,no.useRef)(null);(0,no.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,no.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,tc.jsxs)(Nh.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,tc.jsx)(Kf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},A=()=>(0,no.useContext)(Nh);var dn=require("react/jsx-runtime"),vs=({style:e,...t})=>{let{app:r}=A();return(0,dn.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,dn.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,dn.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,dn.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,dn.jsx)("defs",{children:(0,dn.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,dn.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var To=class extends mr{constructor(r,o,n,i,a,l,s,c){super(c||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=Al[c],this.walletClientType=c)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=Pl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:ta,id:"io.metamask"}:{name:af(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||vs,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=Al[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,ff(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Ji)};this.onQrModalClosed=n,(async()=>{let a="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(a=l[0]),!a||a==="")throw new we("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=Pl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Xi(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(Co(a));return}o(new we("Unknown error during connection"))}).finally(()=>this.modal?.closeModal())})}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let a of this.chains){let l=lf(a.id,this.chains,this.rpcConfig,this.privyAppId);l&&(r[a.id]=l)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await aa.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:aa.OPTIONAL_EVENTS,optionalMethods:aa.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),Uh.isMobile&&this.walletEntry){let{redirect:l,href:s}=pf(a,this.walletEntry);hf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let c=uf(a,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),xl(l,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=Pl(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var Rp=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,Fh.isHexString)(o)).map(o=>(0,kp.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Xi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||di:di,sa=class extends Bh.default{constructor(r,o,n,i,a,l,s,c,m,f,u){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new ct:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=m,this.privyAppName=f,this.privyAppLogo=u,this.storedConnections=xp()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return r.has(a)?!1:(r.add(a),!0)}),n=o.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;X.get(mp)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(mp));let r=sf(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!An()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new hs(r,o,this.rpcConfig,this.chains,i,n.id),s=new ys(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new hs(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,c=new ys(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(c)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=xp(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=xp(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof To&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Zl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new na(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new na(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new na(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new oa(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Yl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Jl(this.defaultChain):new To(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));X.put(fp,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,kp.getAddress)(r),this.emit("walletsUpdated")}};function jl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var Zw=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",xp=()=>{let e=X.get(fp);return e&&Array.isArray(e)&&e.map(o=>Zw(o)).every(Boolean)?e:[]};var Hh=require("ofetch");var Qw=[fl,yl,hl,Cl],rc=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Ml,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=Hh.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let l=new Headers(a.headers);l.set("privy-app-id",this.appId),this.appClientId&&l.set("privy-client-id",this.appClientId),l.set("privy-ca-id",this.clientAnalyticsId||""),l.set("privy-client",`react-auth:${this.sdkVersion}`);let s=Qw.includes(i.toString());if(!l.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:s});c!==null&&l.set("authorization",`Bearer ${c}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new ul}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw Ce(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw Ce(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw Ce(o)}}};var Gh=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var pn=y(require("js-cookie"));function Vh(e){return e instanceof Pn?"email":e instanceof hi?"sms":e instanceof sn?"siwe":e instanceof Vi?"custom_auth":e instanceof Do?e.meta.provider:null}var qh=y(require("jose")),io=class{static parse(t){try{return new io(t)}catch{return null}}constructor(t){this.value=t,this._decoded=qh.decodeJwt(t)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(t=0){let r=Date.now(),o=(this.expiration-t)*1e3;return r>=o}};var Jw=30,oc=class{constructor(){this.authenticateOnce=new rt(async t=>this._authenticate(t)),this.linkOnce=new rt(async t=>this._link(t)),this.refreshOnce=new rt(this._refresh.bind(this)),this.destroyOnce=new rt(this._destroy.bind(this)),this.forkSessionOnce=new rt(this._forkSession.bind(this))}get token(){try{let t=X.get(ai);return typeof t=="string"?new io(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(Wl);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(as);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(ls(t));if(typeof r=="string"){let o=new io(r);return o.isExpired()?(X.del(ls(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=pn.default.get(Ol);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==Pf}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=io.parse(this.token);return t!==null&&!t.isExpired(Jw)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(t,r){typeof r=="string"?X.put(ls(t),r):X.del(ls(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:i}=r;this.handleTokenResponse(r);let a=i,l=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0,s=Vh(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:_r(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),bt(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:_r(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),bt(r)}}async _refresh(){if(!this.api)throw new b("Session has no API instance");if(!this.client)throw new b("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(t&&r||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(fl,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(yl,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),_r(n.user)}catch(n){if(n instanceof pr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw bt(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&(this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token))}async _destroy(){try{await this.api?.post(hl,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new b("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(ym,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw bt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(ai);if(X.put(ai,t),!this.client?.useServerCookies){let o=io.parse(t)?.expiration;pn.default.set(dp,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(ai),pn.default.remove(dp),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put(Wl,t),this.client?.useServerCookies||pn.default.set(Ol,"t",{sameSite:"Strict",secure:!0,expires:30})):(X.del(Wl),pn.default.remove(bf),pn.default.remove(Ol))}storeIdentityToken(t){if(this.client?.useServerCookies)return;X.put(pp,t);let r=io.parse(t)?.expiration;pn.default.set(up,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){X.del(pp),pn.default.remove(up)}clearForkedToken(){X.del(as)}};var Ip,nc,$h,la=class{constructor(t){pl(this,nc);this.apiUrl=t.apiUrl||Rl,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||wf,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=fm(this,nc,$h).call(this),Ip||(Ip=new oc),this.session=Ip,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:c}){this.connectors||(this.connectors=new sa(this.appId,t,r,o,n,i,a,l,s,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new rc({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new b("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new b("No auth flow in progress.");let{oAuthTokens:t}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:t}}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(jm,{action:"verify"})}catch(t){throw Ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Ym,{});return Gh(t.options)}catch(t){throw Ce(t)}}async acceptTerms(){try{let t=await this.api.post(Zm,{});return _r(t)}catch(t){throw bt(t)}}async unlinkEmail(t){try{let r=await this.api.post(km,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPhone(t){try{let r=await this.api.post(Wm,{phoneNumber:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkWallet(t){try{let r=await this.api.post(wm,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Nm,{provider:t,subject:r});return await this.getAuthenticatedUser()??_r(o)}catch(o){throw bt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(_m,{fid:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Km,{telegram_user_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(qm,{credential_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async createAnalyticsEvent({eventName:t,payload:r,timestamp:o,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(Cl,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(Jm,t)}catch(r){throw bt(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(Xm,t)}catch(r){throw bt(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${ef}?partnerUserId=${t}`)}catch(r){throw bt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?io.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0,i=o.funding_config?{methods:o.funding_config.methods,defaultRecommendedAmount:o.funding_config.default_recommended_amount,defaultRecommendedCurrency:o.funding_config.default_recommended_currency,promptFundingOnWalletCreation:o.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,twitterOAuthOnMobileEnabled:o.twitter_oauth_on_mobile_enabled,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(t){throw bt(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(gm,{address:t,token:r})).nonce}catch(o){throw bt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(vm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(Cm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i});return _r(a)}catch(a){throw bt(a)}}};nc=new WeakSet,$h=function(){if(typeof window>"u")return null;try{let r=X.get(ss);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,zh.v4)();try{return X.put(ss,t),t}catch{return t}};var Zh=require("@marsidev/react-turnstile"),ic=require("react");var ao=require("react");var Yh=require("react/jsx-runtime"),Kh=(0,ao.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:_,setError:_,setExecuting:_,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:_,reset:_,execute:_}),Nr=class extends wt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},jh=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,ao.useRef)(null),[i,a]=(0,ao.useState)(),[l,s]=(0,ao.useState)(),[c,m]=(0,ao.useState)(!1),f=(0,ao.useMemo)(()=>o?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,c]);return(0,Yh.jsx)(Kh.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:m,remove(){o&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){o&&(m(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await nf(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Nr("Captcha failed",null,"captcha_timeout")}}},children:e})},We=()=>(0,ao.useContext)(Kh);var Mp=require("react/jsx-runtime"),ac=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=We(),[,s]=(0,ic.useMemo)(()=>r?.split("t:")||[],[r]);if((0,ic.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Mp.jsx)("div",{className:"hidden h-0 w-0",children:(0,Mp.jsx)(Zh.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var _n=require("react"),Qu=y(require("styled-components"));var sc=require("react");var Wp=(0,sc.createContext)({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:_,initializeWalletProxy:_,getAuthMeta:_,getAuthFlow:_,closePrivyModal:_,openPrivyModal:_,connectWallet:_,initLoginWithWallet:_,loginWithWallet:_,initLoginWithFarcaster:_,loginWithFarcaster:_,loginWithCode:_,initLoginWithEmail:_,initLoginWithSms:_,initUpdateEmail:_,resendEmailCode:_,resendSmsCode:_,initLoginWithHeadlessOAuth:_,loginWithHeadlessOAuth:_,crossAppAuthFlow:_,initLoginWithOAuth:_,recoveryOAuthFlow:_,loginWithOAuth:_,initLoginWithPasskey:_,loginWithPasskey:_,initLinkWithPasskey:_,linkWithPasskey:_,refreshUser:_,walletProxy:null,createAnalyticsEvent:_,acceptTerms:_,getUsdTokenPrice:_,recoverEmbeddedEthereumWallet:_,getMoonpaySignedUrl:_,initCoinbaseOnRamp:_,getCoinbaseOnRampStatus:_,updateWallets:_,fundWallet:_,setReadyToTrue:_,requestFarcasterSignerStatus:_,initLoginWithTelegram:_,loginWithTelegram:_,generateSiweMessage:_,linkWithSiwe:_,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:_,recoverEmbeddedSolanaWallet:_,solanaSignMessage:_}),W=()=>(0,sc.useContext)(Wp);var lc=require("react");var Ue=(0,lc.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:_,login:_,connectOrCreateWallet:_,linkEmail:_,linkPhone:_,linkFarcaster:_,linkWallet:_,linkCrossAppAccount:_,linkGoogle:_,linkTwitter:_,linkDiscord:_,linkGithub:_,linkSpotify:_,linkInstagram:_,linkTelegram:_,linkTiktok:_,linkLinkedIn:_,linkApple:_,linkPasskey:_,updateEmail:_,logout:_,getAccessToken:_,getEthereumProvider:_,getEthersProvider:_,getWeb3jsProvider:_,unlinkEmail:_,unlinkPhone:_,unlinkWallet:_,unlinkGoogle:_,unlinkTwitter:_,unlinkDiscord:_,unlinkGithub:_,unlinkSpotify:_,unlinkInstagram:_,unlinkTiktok:_,unlinkLinkedIn:_,unlinkApple:_,unlinkCrossAppAccount:_,unlinkFarcaster:_,unlinkTelegram:_,unlinkPasskey:_,setActiveWallet:_,forkSession:_,createWallet:_,importWallet:_,signMessage:_,signTypedData:_,enrollInMfa:_,initEnrollmentWithSms:_,initEnrollmentWithTotp:_,initEnrollmentWithPasskey:_,promptMfa:_,init:_,submitEnrollmentWithSms:_,submitEnrollmentWithTotp:_,submitEnrollmentWithPasskey:_,unenroll:_,submit:_,cancel:_,sendTransaction:_,exportWallet:_,setWalletPassword:_,setWalletRecovery:_,requestFarcasterSignerFromWarpcast:_,getFarcasterSignerPublicKey:_,signFarcasterMessage:_,initLoginWithEmail:_,initLoginWithSms:_,otpState:{status:"initial"},loginWithCode:_,fundWallet:_,initLoginWithHeadlessOAuth:_,loginWithHeadlessOAuth:_,generateSiweMessage:_,linkWithSiwe:_,signMessageWithCrossAppWallet:_,signTypedDataWithCrossAppWallet:_,sendTransactionWithCrossAppWallet:_,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),$=()=>(0,lc.useContext)(Ue);var cc=require("react"),Qh=e=>{let[t,r]=(0,cc.useState)("auto");return(0,cc.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var ca=require("react"),Jh={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]}},Op=(0,ca.createContext)(void 0),Xh=()=>(0,ca.useContext)(Op);function He(e,t){if(!t)return;let o=Xh().current[e];return(0,ca.useEffect)(()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(a=>a!==i)}},[t])}function B(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function da(){let e=Xh();return(t,r,...o)=>B(e,t,r,...o)}function dc(e){He("configureMfa",e)}var cy=require("@heroicons/react/24/outline"),Dp=y(require("styled-components"));var So=y(require("styled-components"));var pc=y(require("styled-components")),On=require("react/jsx-runtime"),Pt=({success:e,fail:t})=>(0,On.jsxs)(On.Fragment,{children:[(0,On.jsx)(At,{className:e?"success":t?"fail":""}),(0,On.jsx)(Cs,{className:e?"success":t?"fail":""})]}),At=pc.default.span`
12
+ - https://privy.io`};var ln=class{constructor(t,r,o){this.getNonceOnce=new rt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw Ce(t)}}async sign(){if(!this.client)throw new b("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new b("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new b("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new b("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Kl({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var Rn=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Nm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Om,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw Ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new b("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Wm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},jl=class extends Rn{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new b("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Dm,{oldPhoneNumber:this.meta.oldPhoneNumber,newPhoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw Ce(r)}}};var Ji=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(jm,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(Ym,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw Ce(t)}}};function Ep(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Ff(){let e;if(e=Ww(),e)return Uf(),{...e,flowType:"login-url"};if(e=Ow(),e)return Uf(),{...e,flowType:"web-app"}}function Ww(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:l,auth_date:o,hash:r}}function Ow(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash");if(!(!r||!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i}}function Uf(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var Yh=require("uuid");function oe(e){return e?new Date(e*1e3):null}function Lw(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let m={subject:r.subject,username:r.username,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(m);break;case"twitter_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(f);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(u);break;case"github_oauth":let w={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(w);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let E={subject:r.subject,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(E);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)});break;case"farcaster":let S={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(S);break;case"passkey":let R={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(R);break;case"telegram":let _={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:oe(r.first_verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(_);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function Tr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var ke=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,vi=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Yl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,Nw=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Sr=(e,t)=>ke(e)||vi(e)?!1:t==="all-users"||t==="users-without-wallets"&&!Nw(e)?.length;function _r(e){if(!e)return null;let t=Lw(e.linked_accounts),r=Tr(t,"wallet"),o=Tr(t,"email"),n=Tr(t,"phone"),i=Tr(t,"google_oauth"),a=Tr(t,"twitter_oauth"),l=Tr(t,"discord_oauth"),s=Tr(t,"github_oauth"),c=Tr(t,"spotify_oauth"),m=Tr(t,"instagram_oauth"),f=Tr(t,"tiktok_oauth"),u=Tr(t,"linkedin_oauth"),w=Tr(t,"apple_oauth"),v=Tr(t,"farcaster"),g=Tr(t,"telegram"),E=e.mfa_methods.map(({type:R,verified_at:_})=>({type:R,verifiedAt:oe(_)}));return{id:e.id,createdAt:oe(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:w&&{subject:w.subject,email:w.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:E.map(R=>R.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Ip=require("@ethersproject/address"),Vh=require("@ethersproject/bytes"),qh=y(require("eventemitter3"));var jf=y(require("@coinbase/wallet-sdk"));var hs=require("react/jsx-runtime"),cn=({style:e,...t})=>(0,hs.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,hs.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,hs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var Eo=require("@ethersproject/address"),Tp=require("@ethersproject/providers"),Kf=y(require("eventemitter3"));var Gf=y(require("eventemitter3"));var Dw=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Bf=e=>Dw.includes(e);var Hf=require("@ethersproject/logger"),In=require("@privy-io/js-sdk-core");var Xi=class extends we{constructor(){super("Wallet timeout");this.type="wallet_error"}},ea=class extends we{constructor(){super("User rejected connection");this.type="wallet_error"}},wo=e=>{if(e instanceof we)return e;if(e?.code&&e?.reason){let t=new Kt(e);return e.code===Hf.ErrorCode.ACTION_REJECTED&&(t.details=In.ProviderErrors.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Kt(e):new we("Unknown connector error",e)},io=class extends wt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Kt=class extends io{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(In.ProviderErrors).find(i=>i.eipCode===o.code);this.details=n||In.ProviderErrors.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=In.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=In.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=In.ProviderErrors.E32002_WALLET_LOCKED))}},Uw={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},dn={...Uw,...In.ProviderErrors};var ct=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Xi,r=this.rpcTimeoutDuration)=>new Promise((o,n)=>setTimeout(()=>{n(t)},r));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(r=>{this.removeListener(r.eventName,r.listener)}),this.walletProvider=t,this._subscriptions.forEach(r=>{this.walletProvider?.on(r.eventName,r.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=r||mi,this._subscriptions=[]}on(t,r){if(this.walletProvider)return this.walletProvider.on(t,r);this._subscriptions.push({eventName:t,listener:r})}async request(t){if(!this.walletProvider)throw new we(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(r=>{throw wo(r)})}},Mn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},ys=class extends Gf.default{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=Er(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=ta(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new Mn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Ie()||!this.address)throw new Mn("Disconnected",4900);return(await zf(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new Mn(`Invalid params for ${r.method}`,4200);let o;if(typeof r.params[0]=="string")o=r.params[0];else if("chainId"in r.params[0]&&typeof r.params[0].chainId=="string")o=r.params[0].chainId;else throw new Mn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Er(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Vf(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await qf(is(o))}async handleEstimateGas(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_estimateGas");delete r.params[0].gasPrice,delete r.params[0].maxFeePerGas,delete r.params[0].maxPriorityFeePerGas;let o={...r.params[0],chainId:li(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return li(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(r);case"eth_sendTransaction":return this.handleSendTransaction(r);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(r);case"personal_sign":return this.handlePersonalSign(r);case"eth_signTypedData_v4":return this.handleSignedTypedData(r);default:break}if(Bf(r.method)){let o=await Ie();if(await $f(),!o||!this.address)throw new Mn("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:o,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new Mn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Ie();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},bo=class extends ct{constructor(r){super(r,r.rpcTimeoutDuration)}},Wn=class extends ct{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Fw=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},mr=class extends Kf.default{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=Ki(r),this.walletClientType==="privy"&&X.put(Nl(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=ta(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>(0,Eo.getAddress)(l.address)===(0,Eo.getAddress)(r));return{address:(0,Eo.getAddress)(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new we("Wallet is not currently connected.");let s=this.wallets.find(w=>(0,Eo.getAddress)(w.address)===(0,Eo.getAddress)(r))?.chainId;if(!s)throw new we("Unable to determine current chainId.");let c,m;if(typeof l=="number"?(c=`0x${l.toString(16)}`,m=l):(c=l,m=Number(l)),s===Ki(c))return;let f=this.chains.find(w=>w.id===m);if(!f)throw new we(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await u()}catch(w){if(Fw(w,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&w.message?.includes("wallet_switchEthereumChain")?new we(`Rainbow does not support the chainId ${o}`):w}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new Tp.Web3Provider(new bo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new Wn(this.proxyProvider)},sign:async l=>{if(!await a())throw new we("Wallet is not currently connected.");return await this.sign(l)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await ns(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch(c){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=(0,Eo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=X.get(Nl(i));this.chains.find(m=>m.id===Number(c))||(X.del(Nl(i)),c=null),l=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let c=await ns(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${gp}`,c),l=gp}let s=Ki(l);if(!a.find(c=>(0,Eo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,Eo.getAddress)(n),s,c,this.connectorType==="embedded_imported"))}Zl(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,Eo.getAddress)(n)===(0,Eo.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new Tp.Web3Provider(new bo(this.proxyProvider)).getSigner().signMessage(r)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}};var Bw=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Hw=(e,t)=>e.makeWeb3Provider({options:t}),Sp,Ql=class extends mr{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Sp){let s=[o.id].concat(r.map(m=>m.id)),c=this.connectionOptions!=="eoaOnly"?s.filter(m=>!Bw.includes(m)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),Sp=new jf.default({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Hw(Sp,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:cn,id:"com.coinbase.wallet"}}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw wo(r)}}};var _p=require("react/jsx-runtime"),On=({...e})=>(0,_p.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,_p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var gs=class extends mr{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[li(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:On,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Pp=require("react/jsx-runtime"),ra=({style:e,...t})=>(0,Pp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Pp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var or=require("react/jsx-runtime"),oa=({style:e,...t})=>(0,or.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,or.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,or.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,or.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,or.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,or.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,or.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,or.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,or.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,or.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,or.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,or.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,or.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,or.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var vs=require("react/jsx-runtime"),Fo=({style:e,...t})=>(0,vs.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,vs.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,vs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var ia=class extends mr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw wo(r)}}},na,aa=class extends mr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";ul(this,na,void 0);this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?ip(this,na,{name:"MetaMask",icon:oa,id:"io.metamask"}):a==="phantom"&&ip(this,na,{name:"Phantom",icon:Fo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return hm(this,na)??{name:"Browser Extension",icon:ra,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw wo(r)}}};na=new WeakMap;var Gw=require("@ethersproject/address"),Vw=require("@ethersproject/providers"),Yf=require("react-device-detect");var Jl=class extends ia{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Yf.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw wo(t)}}};var Xl=class extends mr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new ct(void 0,mi);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var ec=class extends Xl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Fo,id:"phantom"}}};var la=require("@walletconnect/ethereum-provider"),Gh=require("react-device-detect");var ao=require("react");var Qf=require("react/jsx-runtime");function Zf({src:e,...t}){return(0,Qf.jsx)("img",{src:e,...t,style:{display:"none"}})}var Bo=require("react"),Nh=require("react");var fr={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:Ef,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var Jf=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let o of e.primary.slice(1))t.includes(o)?console.warn(`Duplicated login method: ${o}`):t.push(o);for(let o of e.overflow??[])!t.includes(o)&&!r.includes(o)?r.push(o):console.warn(`Duplicated login method: ${o}`);return{primary:t,overflow:r}};var qw=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),Xf=e=>qw.has(e),eh=(e,t,r)=>r.indexOf(e)===t,th=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Xf).filter(eh):e?e.filter(Xf).filter(eh):fr.appearance.walletList;var rh={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"}}};var oh={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var nh={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};var ih={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"}}};var ah={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};var sh={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"}},testnet:!0};var lh={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var ch={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};var dh={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};var ph={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};var uh={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};var mh={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"}}};var fh={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"}}};var hh={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"}}};var yh={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var gh={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"}}};var vh={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};var Ch={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};var wh={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"}}};var tc={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"}}};var bh={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"}}};var Eh={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var Th={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};var Sh={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",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"}}};var _h={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var Ph={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/"}}};var Ah={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var xh={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};var kh={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"}}};var Rh={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};var Ih={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};var sa=[rh,oh,nh,yh,xh,tc,bh,Eh,Th,Sh,_h,ph,uh,mh,fh,sh,lh,ch,dh,wh,vh,Ch,ih,ah,kh,Ih,Rh,gh,Ph,hh,Ah],mS=new Set(sa.map(e=>e.id));var Ln=y(require("tinycolor2")),Mh="#FFFFFF",zw="#040217",$w=Mh,Kw="#1E1E1D";function jw(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"}function To(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Ln.default)({...e.toHsl(),l:r})}var Yw="#51BA81",Zw="#FFB74D",Qw="#EC6351",Jw=Mh,Xw=zw;function Wh({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=$w;break;case"dark":r=Kw;break;default:r=e;break}let o=(0,Ln.default)(r),n=(0,Ln.default)(t),i=(0,Ln.default)(Yw),a=(0,Ln.default)(Zw),l=(0,Ln.default)(Qw),s=jw(o.getLuminance()),c=To(o,s==="light"?-.04:.11),m=To(o,s==="light"?-.88:.87),f=To(o,s==="light"?-.7:.75),u=To(o,s==="light"?-.43:.45).desaturate(s==="light"?60:20),w=To(o,s==="light"?-.08:.25).desaturate(s==="light"?60:20),v=To(n,.15),g=To(n,-.06),E=To(l,.3),S=To(a,.3),R=(0,Ln.default)(n.getLuminance()>.5?Xw:Jw),_=To(i,-.16),k=To(i,.4);return{colorScheme:s,background:o.toHslString(),background2:c.toHslString(),foreground:m.toHslString(),foreground2:f.toHslString(),foreground3:u.toHslString(),foreground4:w.toHslString(),accent:n.toHslString(),accentLight:v.toHslString(),accentDark:g.toHslString(),foregroundAccent:R.toHslString(),success:i.toHslString(),successDark:_.toHslString(),successLight:k.toHslString(),error:l.toHslString(),errorLight:E.toHslString(),warn:a.toHslString(),warnLight:S.toHslString()}}function Ap(e,t,r){let o=r?console.warn:()=>{},n,i,a,l,s,c,m,f,u,w,v,g,E,S,R;t?.loginMethods?(n=t.loginMethods.includes("email"),i=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),s=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),m=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),w=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),v=t.loginMethods.includes("linkedin"),E=t.loginMethods.includes("apple"),S=t.loginMethods.includes("farcaster"),R=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,l=e.walletAuth,s=e.googleOAuth,c=e.twitterOAuth,m=e.discordOAuth,g=e.githubOAuth,u=e.spotifyOAuth,w=e.instagramOAuth,f=e.tiktokOAuth,v=e.linkedinOAuth,E=e.appleOAuth,S=e.farcasterAuth,R=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let _=[n,i].filter(Boolean),k=[s,c,m,g,u,w,f,v,E,S,R].filter(Boolean),I=[l].filter(Boolean);if(_.length+k.length+I.length===0)throw new Error("You must enable at least one login method");let M=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;M&&I.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),M=!1):!M&&k.length+_.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),M=!0);let U=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=th({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=Jf({input:t?.loginMethodsAndOrder}),Z=t?.intl?.defaultCountry??"US",{chains:L,defaultChain:F}=e4({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),O=!!t?.defaultChain,Me=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,je,Q=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?Me?je=t?.embeddedWallets?.noPromptOnSignature??!0:je=t?.embeddedWallets?.noPromptOnSignature??Q:je=Q,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&je!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:re,...ie}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??fr.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:Wh({backgroundTheme:t?.appearance?.theme??fr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??fr.appearance.accentColor}),loginGroupPriority:M?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:G},loginMethods:{wallet:l,email:n,sms:i,passkey:a,google:s,twitter:c,discord:m,github:g,spotify:u,instagram:w,tiktok:f,linkedin:v,apple:E,farcaster:S,telegram:R},loginMethodsAndOrder:Y,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??fr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??fr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??fr.rpcConfig.rpcTimeouts},chains:L,defaultChain:F,intl:{defaultCountry:Z},shouldEnforceDefaultChainOnConnect:O,captchaEnabled:e.captchaEnabled??fr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??fr.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U}},embeddedWallets:{...e.embeddedWalletConfig,...typeof re=="boolean"?{requireUserOwnedRecoveryOnCreate:re}:{},...Me?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...ie,noPromptOnSignature:je},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:Me?{enabled:!0,...t.customAuth}:void 0,loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??fr._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??fr.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??fr.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??fr.fundingMethodConfig.moonpay.useSandbox}}}}function Oh(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:i,...a}=e;return{...a,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function e4({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&o&&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(s=>s.rpcUrls.privyWalletOverride?s:sa.find(m=>m.id===s.id)??s)}else n=sa.concat(e??[]);let i=t?n[0]:tc,a=r??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var Lh=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,i;n<e.length;n++)i=e.charCodeAt(n),r=Math.imul(r^i,2654435761),o=Math.imul(o^i,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var Fh=require("react/jsx-runtime"),Dh={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,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},xp=Ap(Dh,void 0,!1),kp=(0,Nh.createContext)({appConfig:xp,isServerConfigLoaded:!1}),Uh=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=(0,Bo.useState)(null),a=(0,Bo.useMemo)(()=>Ap(n??Dh,o,!!n),[n,o]);return(0,Bo.useEffect)(()=>{if(!n)return;let l=Oh(o,t),s=Lh(JSON.stringify(l)).toString(),c=`privy:sent:${n.id}:${s}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:l}),localStorage.setItem(c,"t"))},[o,t,n]),(0,Bo.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,Fh.jsx)(kp.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},dt=()=>{let{appConfig:e}=(0,Bo.useContext)(kp);return e},rc=()=>{let{isServerConfigLoaded:e}=(0,Bo.useContext)(kp);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var oc=require("react/jsx-runtime"),Bh=(0,ao.createContext)({ready:!1,app:xp,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),t4=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Hh=e=>{let t=dt(),r=e.authenticated,[o,n]=(0,ao.useState)(e.initialScreen);(0,ao.useEffect)(()=>{!r&&!t4.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=(0,ao.useRef)(null);(0,ao.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,ao.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,oc.jsxs)(Bh.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,oc.jsx)(Zf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},P=()=>(0,ao.useContext)(Bh);var pn=require("react/jsx-runtime"),Cs=({style:e,...t})=>{let{app:r}=P();return(0,pn.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,pn.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,pn.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,pn.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,pn.jsx)("defs",{children:(0,pn.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,pn.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var So=class extends mr{constructor(r,o,n,i,a,l,s,c){super(c||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=xl[c],this.walletClientType=c)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=Al(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:oa,id:"io.metamask"}:{name:cf(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Cs,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=xl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,gf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new ea)};this.onQrModalClosed=n,(async()=>{let a="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(a=l[0]),!a||a==="")throw new we("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=Al(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=ta(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(wo(a));return}o(new we("Unknown error during connection"))}).finally(()=>this.modal?.closeModal())})}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let a of this.chains){let l=pf(a.id,this.chains,this.rpcConfig,this.privyAppId);l&&(r[a.id]=l)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await la.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:la.OPTIONAL_EVENTS,optionalMethods:la.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),Gh.isMobile&&this.walletEntry){let{redirect:l,href:s}=ff(a,this.walletEntry);vf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let c=hf(a,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),kl(l,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=Al(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var Mp=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,Vh.isHexString)(o)).map(o=>(0,Ip.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},ta=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||mi:mi,ca=class extends qh.default{constructor(r,o,n,i,a,l,s,c,m,f,u){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new ct:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=m,this.privyAppName=f,this.privyAppLogo=u,this.storedConnections=Rp()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return r.has(a)?!1:(r.add(a),!0)}),n=o.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;X.get(hp)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(hp));let r=df(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!xn()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new ys(r,o,this.rpcConfig,this.chains,i,n.id),s=new gs(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new ys(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,c=new gs(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(c)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Rp(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Rp(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof So&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Jl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new aa(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new aa(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new aa(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new ia(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Ql(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new ec(this.defaultChain):new So(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));X.put(yp,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Ip.getAddress)(r),this.emit("walletsUpdated")}};function Zl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var r4=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Rp=()=>{let e=X.get(yp);return e&&Array.isArray(e)&&e.map(o=>r4(o)).every(Boolean)?e:[]};var zh=require("ofetch");var o4=[hl,gl,yl,wl],nc=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Wl,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=zh.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let l=new Headers(a.headers);l.set("privy-app-id",this.appId),this.appClientId&&l.set("privy-client-id",this.appClientId),l.set("privy-ca-id",this.clientAnalyticsId||""),l.set("privy-client",`react-auth:${this.sdkVersion}`);let s=o4.includes(i.toString());if(!l.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:s});c!==null&&l.set("authorization",`Bearer ${c}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new ml}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw Ce(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw Ce(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw Ce(o)}}};var $h=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var un=y(require("js-cookie"));function Kh(e){return e instanceof An?"email":e instanceof Rn?"sms":e instanceof ln?"siwe":e instanceof zi?"custom_auth":e instanceof Uo?e.meta.provider:null}var jh=y(require("jose")),so=class{static parse(t){try{return new so(t)}catch{return null}}constructor(t){this.value=t,this._decoded=jh.decodeJwt(t)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(t=0){let r=Date.now(),o=(this.expiration-t)*1e3;return r>=o}};var n4=30,ic=class{constructor(){this.authenticateOnce=new rt(async t=>this._authenticate(t)),this.linkOnce=new rt(async t=>this._link(t)),this.refreshOnce=new rt(this._refresh.bind(this)),this.destroyOnce=new rt(this._destroy.bind(this)),this.forkSessionOnce=new rt(this._forkSession.bind(this))}get token(){try{let t=X.get(ci);return typeof t=="string"?new so(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(Ol);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(ss);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(cs(t));if(typeof r=="string"){let o=new so(r);return o.isExpired()?(X.del(cs(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=un.default.get(Ll);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==kf}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=so.parse(this.token);return t!==null&&!t.isExpired(n4)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(t,r){typeof r=="string"?X.put(cs(t),r):X.del(cs(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:i}=r;this.handleTokenResponse(r);let a=i,l=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0,s=Kh(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:_r(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),bt(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:_r(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),bt(r)}}async _refresh(){if(!this.api)throw new b("Session has no API instance");if(!this.client)throw new b("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(t&&r||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(hl,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(gl,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),_r(n.user)}catch(n){if(n instanceof pr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw bt(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&(this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token))}async _destroy(){try{await this.api?.post(yl,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new b("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(vm,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw bt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(ci);if(X.put(ci,t),!this.client?.useServerCookies){let o=so.parse(t)?.expiration;un.default.set(up,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(ci),un.default.remove(up),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put(Ol,t),this.client?.useServerCookies||un.default.set(Ll,"t",{sameSite:"Strict",secure:!0,expires:30})):(X.del(Ol),un.default.remove(Sf),un.default.remove(Ll))}storeIdentityToken(t){if(this.client?.useServerCookies)return;X.put(mp,t);let r=so.parse(t)?.expiration;un.default.set(fp,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){X.del(mp),un.default.remove(fp)}clearForkedToken(){X.del(ss)}};var Wp,ac,Zh,da=class{constructor(t){ul(this,ac);this.apiUrl=t.apiUrl||Il,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||Tf,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=ym(this,ac,Zh).call(this),Wp||(Wp=new ic),this.session=Wp,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:c}){this.connectors||(this.connectors=new ca(this.appId,t,r,o,n,i,a,l,s,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new nc({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new b("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new b("No auth flow in progress.");let{oAuthTokens:t}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:t}}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(Qm,{action:"verify"})}catch(t){throw Ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Jm,{});return $h(t.options)}catch(t){throw Ce(t)}}async acceptTerms(){try{let t=await this.api.post(Xm,{});return _r(t)}catch(t){throw bt(t)}}async unlinkEmail(t){try{let r=await this.api.post(Im,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPhone(t){try{let r=await this.api.post(Lm,{phoneNumber:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkWallet(t){try{let r=await this.api.post(Em,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Fm,{provider:t,subject:r});return await this.getAuthenticatedUser()??_r(o)}catch(o){throw bt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Am,{fid:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Zm,{telegram_user_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Km,{credential_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async createAnalyticsEvent({eventName:t,payload:r,timestamp:o,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(wl,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(tf,t)}catch(r){throw bt(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(rf,t)}catch(r){throw bt(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${of}?partnerUserId=${t}`)}catch(r){throw bt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?so.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0,i=o.funding_config?{methods:o.funding_config.methods,defaultRecommendedAmount:o.funding_config.default_recommended_amount,defaultRecommendedCurrency:o.funding_config.default_recommended_currency,promptFundingOnWalletCreation:o.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,twitterOAuthOnMobileEnabled:o.twitter_oauth_on_mobile_enabled,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(t){throw bt(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(Cm,{address:t,token:r})).nonce}catch(o){throw bt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(wm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(bm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i});return _r(a)}catch(a){throw bt(a)}}};ac=new WeakSet,Zh=function(){if(typeof window>"u")return null;try{let r=X.get(ls);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,Yh.v4)();try{return X.put(ls,t),t}catch{return t}};var ey=require("@marsidev/react-turnstile"),sc=require("react");var lo=require("react");var Xh=require("react/jsx-runtime"),Qh=(0,lo.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:T,setError:T,setExecuting:T,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:T,reset:T,execute:T}),Dr=class extends wt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Jh=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,lo.useRef)(null),[i,a]=(0,lo.useState)(),[l,s]=(0,lo.useState)(),[c,m]=(0,lo.useState)(!1),f=(0,lo.useMemo)(()=>o?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,c]);return(0,Xh.jsx)(Qh.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:m,remove(){o&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){o&&(m(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await lf(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Dr("Captcha failed",null,"captcha_timeout")}}},children:e})},We=()=>(0,lo.useContext)(Qh);var Op=require("react/jsx-runtime"),lc=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=We(),[,s]=(0,sc.useMemo)(()=>r?.split("t:")||[],[r]);if((0,sc.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Op.jsx)("div",{className:"hidden h-0 w-0",children:(0,Op.jsx)(ey.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var Pn=require("react"),Xu=y(require("styled-components"));var cc=require("react");var Lp=(0,cc.createContext)({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,initUpdatePhone:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,crossAppAuthFlow:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,recoverEmbeddedEthereumWallet:T,getMoonpaySignedUrl:T,initCoinbaseOnRamp:T,getCoinbaseOnRampStatus:T,updateWallets:T,fundWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T,generateSiweMessage:T,linkWithSiwe:T,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:T,recoverEmbeddedSolanaWallet:T,solanaSignMessage:T}),W=()=>(0,cc.useContext)(Lp);var dc=require("react");var Ue=(0,dc.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,linkCrossAppAccount:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,updatePhone:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkCrossAppAccount:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,importWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,initLoginWithEmail:T,initLoginWithSms:T,otpState:{status:"initial"},loginWithCode:T,fundWallet:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,generateSiweMessage:T,linkWithSiwe:T,signMessageWithCrossAppWallet:T,signTypedDataWithCrossAppWallet:T,sendTransactionWithCrossAppWallet:T,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),z=()=>(0,dc.useContext)(Ue);var pc=require("react"),ty=e=>{let[t,r]=(0,pc.useState)("auto");return(0,pc.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var pa=require("react"),ry={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]}},Np=(0,pa.createContext)(void 0),oy=()=>(0,pa.useContext)(Np);function He(e,t){if(!t)return;let o=oy().current[e];return(0,pa.useEffect)(()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(a=>a!==i)}},[t])}function B(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function ua(){let e=oy();return(t,r,...o)=>B(e,t,r,...o)}function uc(e){He("configureMfa",e)}var my=require("@heroicons/react/24/outline"),Fp=y(require("styled-components"));var _o=y(require("styled-components"));var mc=y(require("styled-components")),Nn=require("react/jsx-runtime"),At=({success:e,fail:t})=>(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(xt,{className:e?"success":t?"fail":""}),(0,Nn.jsx)(ws,{className:e?"success":t?"fail":""})]}),xt=mc.default.span`
13
13
  && {
14
14
  width: 82px;
15
15
  height: 82px;
@@ -42,13 +42,13 @@ Resources:
42
42
  border-color: var(--privy-color-error);
43
43
  border-bottom-color: var(--privy-color-error);
44
44
  }
45
- `,Cs=(0,pc.default)(At)`
45
+ `,ws=(0,mc.default)(xt)`
46
46
  && {
47
47
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
48
48
  animation: none;
49
49
  opacity: 0.5;
50
50
  }
51
- `,Bo=e=>(0,On.jsx)(Xw,{color:e.color||"var(--privy-color-foreground-3)"}),Xw=(0,pc.default)(At)`
51
+ `,Ho=e=>(0,Nn.jsx)(i4,{color:e.color||"var(--privy-color-foreground-3)"}),i4=(0,mc.default)(xt)`
52
52
  && {
53
53
  height: 1rem;
54
54
  width: 1rem;
@@ -58,7 +58,7 @@ Resources:
58
58
  /* Override default Loader to match button transitions */
59
59
  transition: border-color 200ms ease;
60
60
  }
61
- `;var xt=require("react/jsx-runtime"),ws=So.default.button`
61
+ `;var kt=require("react/jsx-runtime"),bs=_o.default.button`
62
62
  display: flex;
63
63
  flex-direction: row;
64
64
  align-items: center;
@@ -80,7 +80,7 @@ Resources:
80
80
  && {
81
81
  padding: 12px 16px;
82
82
  }
83
- `,H=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,xt.jsx)(ey,{disabled:t||r,...n,children:t?(0,xt.jsxs)("span",{children:[(0,xt.jsx)(Bo,{}),o?(0,xt.jsx)("span",{children:o}):null]}):e}),uc=({children:e,loading:t,disabled:r,...o})=>(0,xt.jsx)(e4,{disabled:r,...o,children:t?(0,xt.jsx)(Bo,{color:"var(--privy-color-foreground-accent)"}):e}),e4=(0,So.default)(ws)`
83
+ `,H=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,kt.jsx)(ny,{disabled:t||r,...n,children:t?(0,kt.jsxs)("span",{children:[(0,kt.jsx)(Ho,{}),o?(0,kt.jsx)("span",{children:o}):null]}):e}),fc=({children:e,loading:t,disabled:r,...o})=>(0,kt.jsx)(a4,{disabled:r,...o,children:t?(0,kt.jsx)(Ho,{color:"var(--privy-color-foreground-accent)"}):e}),a4=(0,_o.default)(bs)`
84
84
  position: relative;
85
85
 
86
86
  && {
@@ -106,7 +106,7 @@ Resources:
106
106
  color: var(--privy-color-foreground-accent);
107
107
  background-color: var(--privy-color-accent-dark);
108
108
  }
109
- `,mc=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,xt.jsx)(ey,{as:"a",disabled:t||r,...n,children:t?(0,xt.jsxs)("span",{children:[(0,xt.jsx)(Bo,{}),o?(0,xt.jsx)("span",{children:o}):null]}):e}),ey=(0,So.default)(ws)`
109
+ `,hc=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,kt.jsx)(ny,{as:"a",disabled:t||r,...n,children:t?(0,kt.jsxs)("span",{children:[(0,kt.jsx)(Ho,{}),o?(0,kt.jsx)("span",{children:o}):null]}):e}),ny=(0,_o.default)(bs)`
110
110
  position: relative;
111
111
 
112
112
  && {
@@ -132,7 +132,7 @@ Resources:
132
132
  }
133
133
 
134
134
  /* If an anchor tag, :disabled isn't a thing, so manually set state */
135
- ${e=>e.disabled?So.css`
135
+ ${e=>e.disabled?_o.css`
136
136
  &&&,
137
137
  &&&:hover,
138
138
  &&&:active {
@@ -151,7 +151,7 @@ Resources:
151
151
  opacity: 1;
152
152
  animation: fadein 200ms ease;
153
153
  }
154
- `,_o=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,xt.jsx)(t4,{disabled:t||r,...n,children:t?(0,xt.jsxs)("span",{children:[(0,xt.jsx)(Bo,{}),o?(0,xt.jsx)("span",{children:o}):null]}):e}),t4=(0,So.default)(ws)`
154
+ `,Po=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,kt.jsx)(s4,{disabled:t||r,...n,children:t?(0,kt.jsxs)("span",{children:[(0,kt.jsx)(Ho,{}),o?(0,kt.jsx)("span",{children:o}):null]}):e}),s4=(0,_o.default)(bs)`
155
155
  && {
156
156
  border-width: 1px;
157
157
  border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
@@ -180,7 +180,7 @@ Resources:
180
180
  opacity: 1;
181
181
  animation: fadein 200ms ease;
182
182
  }
183
- `,Ln=So.default.button`
183
+ `,Dn=_o.default.button`
184
184
  && {
185
185
  padding: 12px 16px;
186
186
  font-weight: 500;
@@ -193,7 +193,7 @@ Resources:
193
193
  transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
194
194
  user-select: none;
195
195
 
196
- ${e=>e.invisible&&So.css`
196
+ ${e=>e.invisible&&_o.css`
197
197
  pointer-events: none;
198
198
  `}
199
199
 
@@ -211,10 +211,10 @@ Resources:
211
211
  cursor: not-allowed;
212
212
  }
213
213
  }
214
- `,$_=So.default.div`
214
+ `,eP=_o.default.div`
215
215
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
216
216
  height: 44px;
217
- `,pa=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>(0,xt.jsxs)(r4,{isSubmitting:o,onClick:t,disabled:r,...n,children:[(0,xt.jsx)("span",{children:e}),(0,xt.jsx)("span",{children:(0,xt.jsx)(Bo,{})})]}),r4=So.default.button`
217
+ `,ma=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>(0,kt.jsxs)(l4,{isSubmitting:o,onClick:t,disabled:r,...n,children:[(0,kt.jsx)("span",{children:e}),(0,kt.jsx)("span",{children:(0,kt.jsx)(Ho,{})})]}),l4=_o.default.button`
218
218
  && {
219
219
  color: var(--privy-color-accent);
220
220
  font-size: 16px;
@@ -256,7 +256,7 @@ Resources:
256
256
  cursor: not-allowed;
257
257
  }
258
258
  }
259
- `;var ty=y(require("styled-components")),ry=ty.default.span`
259
+ `;var iy=y(require("styled-components")),ay=iy.default.span`
260
260
  && {
261
261
  width: 82px;
262
262
  height: 82px;
@@ -268,7 +268,7 @@ Resources:
268
268
  display: inline-block;
269
269
  box-sizing: border-box;
270
270
  }
271
- `;var oy=y(require("@heroicons/react/24/outline/ArrowLeftIcon")),ny=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),iy=y(require("@heroicons/react/24/outline/XMarkIcon")),gi=y(require("styled-components"));var Ft=require("react/jsx-runtime"),o4=({backFn:e})=>(0,Ft.jsx)("div",{children:(0,Ft.jsx)(Lp,{onClick:e,children:(0,Ft.jsx)(oy.default,{height:"16px",width:"16px",strokeWidth:2})})}),n4=({infoFn:e})=>(0,Ft.jsx)("div",{children:(0,Ft.jsx)(a4,{"aria-label":"info",onClick:e,children:(0,Ft.jsx)(ny.default,{height:"22px",width:"22px",strokeWidth:2})})}),i4=e=>(0,Ft.jsx)("div",{children:(0,Ft.jsx)(Lp,{"aria-label":"close modal",onClick:e.onClose,children:(0,Ft.jsx)(iy.default,{height:"16px",width:"16px",strokeWidth:2})})});var k=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=W(),a=dt();return(0,Ft.jsxs)(s4,{children:[(0,Ft.jsxs)(l4,{children:[e&&(0,Ft.jsx)(o4,{backFn:e}),t&&(0,Ft.jsx)(n4,{infoFn:t})]}),o&&(0,Ft.jsx)(d4,{id:"privy-dialog-title",children:o}),(0,Ft.jsx)(c4,{children:!a.render.standalone&&n&&(0,Ft.jsx)(i4,{onClose:r||(()=>i())})})]})},Lp=gi.default.button`
271
+ `;var sy=y(require("@heroicons/react/24/outline/ArrowLeftIcon")),ly=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),cy=y(require("@heroicons/react/24/outline/XMarkIcon")),Ci=y(require("styled-components"));var Ft=require("react/jsx-runtime"),c4=({backFn:e})=>(0,Ft.jsx)("div",{children:(0,Ft.jsx)(Dp,{onClick:e,children:(0,Ft.jsx)(sy.default,{height:"16px",width:"16px",strokeWidth:2})})}),d4=({infoFn:e})=>(0,Ft.jsx)("div",{children:(0,Ft.jsx)(u4,{"aria-label":"info",onClick:e,children:(0,Ft.jsx)(ly.default,{height:"22px",width:"22px",strokeWidth:2})})}),p4=e=>(0,Ft.jsx)("div",{children:(0,Ft.jsx)(Dp,{"aria-label":"close modal",onClick:e.onClose,children:(0,Ft.jsx)(cy.default,{height:"16px",width:"16px",strokeWidth:2})})});var x=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=W(),a=dt();return(0,Ft.jsxs)(m4,{children:[(0,Ft.jsxs)(f4,{children:[e&&(0,Ft.jsx)(c4,{backFn:e}),t&&(0,Ft.jsx)(d4,{infoFn:t})]}),o&&(0,Ft.jsx)(y4,{id:"privy-dialog-title",children:o}),(0,Ft.jsx)(h4,{children:!a.render.standalone&&n&&(0,Ft.jsx)(p4,{onClose:r||(()=>i())})})]})},Dp=Ci.default.button`
272
272
  && {
273
273
  cursor: pointer;
274
274
  display: flex;
@@ -287,11 +287,11 @@ Resources:
287
287
  opacity: 1;
288
288
  }
289
289
  }
290
- `,a4=(0,gi.default)(Lp)`
290
+ `,u4=(0,Ci.default)(Dp)`
291
291
  && {
292
292
  background-color: transparent;
293
293
  }
294
- `,s4=gi.default.div`
294
+ `,m4=Ci.default.div`
295
295
  padding: 16px 0;
296
296
  display: flex;
297
297
  align-items: center;
@@ -303,23 +303,23 @@ Resources:
303
303
  font-weight: 600;
304
304
  color: var(--privy-color-foreground);
305
305
  }
306
- `,l4=gi.default.div`
306
+ `,f4=Ci.default.div`
307
307
  flex: 1;
308
308
  align-items: center;
309
309
  display: flex;
310
310
  gap: 8px;
311
- `,c4=gi.default.div`
311
+ `,h4=Ci.default.div`
312
312
  flex: 1;
313
313
  display: flex;
314
314
  justify-content: flex-end;
315
- `,d4=gi.default.div`
315
+ `,y4=Ci.default.div`
316
316
  overflow: hidden;
317
317
  white-space: nowrap;
318
318
  max-width: 100%;
319
319
  text-overflow: ellipsis;
320
320
  text-align: center;
321
321
  color: var(--privy-color-foreground-2);
322
- `;var ay=y(require("styled-components")),p4=ay.default.div`
322
+ `;var dy=y(require("styled-components")),g4=dy.default.div`
323
323
  display: flex;
324
324
  flex-direction: column;
325
325
  justify-content: center;
@@ -342,15 +342,15 @@ Resources:
342
342
  left: -19px;
343
343
  top: -19px;
344
344
  }
345
- `,vt=p4;var Po=y(require("styled-components")),Ho=Po.default.div`
345
+ `,vt=g4;var Ao=y(require("styled-components")),Go=Ao.default.div`
346
346
  text-align: left;
347
347
  flex-grow: 1;
348
- `,fc=Po.default.div`
348
+ `,yc=Ao.default.div`
349
349
  display: flex;
350
350
  flex-direction: column;
351
351
  justify-content: flex-end;
352
352
  flex-grow: 1;
353
- `,Pr=Po.default.div`
353
+ `,Pr=Ao.default.div`
354
354
  display: flex;
355
355
  flex-direction: column;
356
356
  gap: 12px;
@@ -365,13 +365,13 @@ Resources:
365
365
  &::-webkit-scrollbar {
366
366
  display: none;
367
367
  }
368
- `,sy=(0,Po.default)(Pr)`
368
+ `,py=(0,Ao.default)(Pr)`
369
369
  ${e=>{if(e.colorScheme==="light")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;";if(e.colorScheme==="dark")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;"}}
370
370
 
371
371
  background-repeat: no-repeat;
372
372
  background-size: 100% 32px, 100% 16px;
373
373
  background-attachment: local, scroll;
374
- `,ly=Po.css`
374
+ `,uy=Ao.css`
375
375
  && {
376
376
  width: 100%;
377
377
  font-size: 16px;
@@ -408,22 +408,22 @@ Resources:
408
408
  max-width: 24px;
409
409
  }
410
410
  }
411
- `,hc=Po.default.div`
411
+ `,gc=Ao.default.div`
412
412
  text-align: center;
413
413
  font-size: 14px;
414
414
  margin-bottom: 24px;
415
- `,Oe=Po.default.button`
416
- ${ly}
417
- `,Np=Po.default.a`
418
- ${ly}
419
- `,Ao=Po.default.div`
415
+ `,Oe=Ao.default.button`
416
+ ${uy}
417
+ `,Up=Ao.default.a`
418
+ ${uy}
419
+ `,xo=Ao.default.div`
420
420
  width: 100%;
421
421
  height: 100%;
422
422
  min-height: inherit;
423
423
  display: flex;
424
424
  flex-direction: column;
425
425
  ${e=>e.if?"display: none;":""}
426
- `;var nr=require("react/jsx-runtime"),dy=()=>{let{navigate:e,app:t}=A();return(0,nr.jsxs)(nr.Fragment,{children:[(0,nr.jsx)(k,{}),(0,nr.jsxs)(u4,{children:[(0,nr.jsx)(vt,{children:(0,nr.jsxs)("div",{children:[(0,nr.jsx)(ry,{color:"var(--privy-color-warn-light)"}),(0,nr.jsx)(cy.QuestionMarkCircleIcon,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),(0,nr.jsxs)(m4,{children:[(0,nr.jsx)("h3",{children:"Account not found"}),(0,nr.jsxs)("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),(0,nr.jsx)(Ho,{}),(0,nr.jsx)(H,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},u4=Dp.default.div`
426
+ `;var nr=require("react/jsx-runtime"),fy=()=>{let{navigate:e,app:t}=P();return(0,nr.jsxs)(nr.Fragment,{children:[(0,nr.jsx)(x,{}),(0,nr.jsxs)(v4,{children:[(0,nr.jsx)(vt,{children:(0,nr.jsxs)("div",{children:[(0,nr.jsx)(ay,{color:"var(--privy-color-warn-light)"}),(0,nr.jsx)(my.QuestionMarkCircleIcon,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),(0,nr.jsxs)(C4,{children:[(0,nr.jsx)("h3",{children:"Account not found"}),(0,nr.jsxs)("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),(0,nr.jsx)(Go,{}),(0,nr.jsx)(H,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},v4=Fp.default.div`
427
427
  display: flex;
428
428
  flex-direction: column;
429
429
  align-items: center;
@@ -432,11 +432,11 @@ Resources:
432
432
  width: 100%;
433
433
  padding-bottom: 16px;
434
434
  margin-top: 24px;
435
- `,m4=Dp.default.div`
435
+ `,C4=Fp.default.div`
436
436
  display: flex;
437
437
  flex-direction: column;
438
438
  gap: 8px;
439
- `;var Bp=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),uy=y(require("@heroicons/react/24/solid/DocumentCheckIcon")),my=y(require("styled-components"));var Fp=y(require("styled-components"));var Go=require("react/jsx-runtime"),Up=Fp.default.div`
439
+ `;var Gp=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),yy=y(require("@heroicons/react/24/solid/DocumentCheckIcon")),gy=y(require("styled-components"));var Hp=y(require("styled-components"));var Vo=require("react/jsx-runtime"),Bp=Hp.default.div`
440
440
  margin-top: 16px;
441
441
  font-size: 13px;
442
442
  text-align: center;
@@ -445,7 +445,7 @@ Resources:
445
445
  && > a {
446
446
  color: var(--privy-color-accent);
447
447
  }
448
- `;function ua(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return(0,Go.jsx)(Up,{});if(!r&&!t)return(0,Go.jsx)(Up,{});let n=!!(t&&r);return(0,Go.jsxs)(Up,{children:["By logging in I agree to the"," ",r&&(0,Go.jsx)("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,Go.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var j=()=>(0,Go.jsxs)(J,{children:[(0,Go.jsx)(Mn,{}),(0,Go.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),J=Fp.default.div`
448
+ `;function fa(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return(0,Vo.jsx)(Bp,{});if(!r&&!t)return(0,Vo.jsx)(Bp,{});let n=!!(t&&r);return(0,Vo.jsxs)(Bp,{children:["By logging in I agree to the"," ",r&&(0,Vo.jsx)("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,Vo.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var K=()=>(0,Vo.jsxs)(J,{children:[(0,Vo.jsx)(On,{}),(0,Vo.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),J=Hp.default.div`
449
449
  display: flex;
450
450
  align-items: center;
451
451
  justify-content: center;
@@ -490,7 +490,7 @@ Resources:
490
490
  font-size: 0.875rem;
491
491
 
492
492
  text-align: center;
493
- `,so=Ot.default.div`
493
+ `,co=Ot.default.div`
494
494
  display: flex;
495
495
  flex-direction: column;
496
496
  align-items: center;
@@ -500,7 +500,7 @@ Resources:
500
500
  @media (max-width: 440px) {
501
501
  padding: 10px 10px 20px;
502
502
  }
503
- `,vi=Ot.default.div`
503
+ `,wi=Ot.default.div`
504
504
  display: flex;
505
505
  flex-direction: column;
506
506
  align-items: stretch;
@@ -532,7 +532,7 @@ Resources:
532
532
  flex-direction: column;
533
533
  gap: 10px;
534
534
  padding-top: 20px;
535
- `,yc=Ot.default.div`
535
+ `,vc=Ot.default.div`
536
536
  display: flex;
537
537
  flex-direction: column;
538
538
  align-items: stretch;
@@ -540,11 +540,11 @@ Resources:
540
540
  padding: 1rem 0rem 0rem;
541
541
  flex-grow: 1;
542
542
  width: 100%;
543
- `,gc=Ot.default.div`
543
+ `,Cc=Ot.default.div`
544
544
  display: flex;
545
545
  gap: 5px;
546
546
  width: 100%;
547
- `,vc=Ot.default.button`
547
+ `,wc=Ot.default.button`
548
548
  && {
549
549
  background-color: transparent;
550
550
  color: var(--privy-color-foreground-3);
@@ -562,7 +562,7 @@ Resources:
562
562
  &&:hover {
563
563
  color: var(--privy-color-error);
564
564
  }
565
- `,Cc=Ot.default.div`
565
+ `,bc=Ot.default.div`
566
566
  display: flex;
567
567
  align-items: center;
568
568
  gap: 0.5rem;
@@ -572,7 +572,7 @@ Resources:
572
572
  height: 20px !important;
573
573
  width: 20px !important;
574
574
  }
575
- `,Ci=Ot.default.div`
575
+ `,bi=Ot.default.div`
576
576
  display: flex;
577
577
  align-items: center;
578
578
  gap: 6px;
@@ -586,15 +586,15 @@ Resources:
586
586
  display: flex !important;
587
587
  align-items: flex-end;
588
588
  }
589
- `,wc=Ot.default.div`
589
+ `,Ec=Ot.default.div`
590
590
  width: 100%;
591
591
  display: flex;
592
592
  justify-content: space-between;
593
- `,py=Ot.default.p`
593
+ `,hy=Ot.default.p`
594
594
  text-align: left;
595
595
  width: 100%;
596
596
  color: var(--privy-color-foreground-3) !important;
597
- `,bs=Ot.default.button`
597
+ `,Es=Ot.default.button`
598
598
  display: flex;
599
599
  flex-direction: row;
600
600
  align-items: center;
@@ -639,12 +639,12 @@ Resources:
639
639
  width: auto !important;
640
640
  color: white;
641
641
  }
642
- `,bc=Ot.default.div`
642
+ `,Tc=Ot.default.div`
643
643
  color: var(--privy-color-error);
644
- `;var Lt=require("react/jsx-runtime"),fy=()=>{let{user:e,logout:t}=$(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=A(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=W(),c=f=>{f?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let m=async f=>{f.preventDefault(),await a(),e&&Sr(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:u=>{console.error(u),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:u,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,Lt.jsx)(f4,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:m,onDecline:c})},f4=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(k,{closeable:!1}),(0,Lt.jsx)(uy.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,Lt.jsx)(Te,{style:{marginTop:24},children:"One last step"}),(0,Lt.jsx)(Pe,{children:"By signing up, you agree to our terms and privacy policy."}),(0,Lt.jsxs)(Pr,{style:{marginTop:24},children:[e&&(0,Lt.jsxs)(Np,{target:"_blank",href:e,children:["View Terms ",(0,Lt.jsx)(Bp.default,{style:{marginLeft:"auto"}})]}),t&&(0,Lt.jsxs)(Np,{target:"_blank",href:t,children:["View Privacy Policy ",(0,Lt.jsx)(Bp.default,{style:{marginLeft:"auto"}})]})]}),(0,Lt.jsxs)(h4,{style:{marginTop:24},children:[(0,Lt.jsx)(_o,{onClick:o,children:"No thanks"}),(0,Lt.jsx)(H,{onClick:r,children:"Accept"})]}),(0,Lt.jsx)(j,{})]}),h4=my.default.div`
644
+ `;var Lt=require("react/jsx-runtime"),vy=()=>{let{user:e,logout:t}=z(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=P(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=W(),c=f=>{f?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let m=async f=>{f.preventDefault(),await a(),e&&Sr(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:u=>{console.error(u),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:u,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,Lt.jsx)(w4,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:m,onDecline:c})},w4=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(x,{closeable:!1}),(0,Lt.jsx)(yy.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,Lt.jsx)(Te,{style:{marginTop:24},children:"One last step"}),(0,Lt.jsx)(Pe,{children:"By signing up, you agree to our terms and privacy policy."}),(0,Lt.jsxs)(Pr,{style:{marginTop:24},children:[e&&(0,Lt.jsxs)(Up,{target:"_blank",href:e,children:["View Terms ",(0,Lt.jsx)(Gp.default,{style:{marginLeft:"auto"}})]}),t&&(0,Lt.jsxs)(Up,{target:"_blank",href:t,children:["View Privacy Policy ",(0,Lt.jsx)(Gp.default,{style:{marginLeft:"auto"}})]})]}),(0,Lt.jsxs)(b4,{style:{marginTop:24},children:[(0,Lt.jsx)(Po,{onClick:o,children:"No thanks"}),(0,Lt.jsx)(H,{onClick:r,children:"Accept"})]}),(0,Lt.jsx)(K,{})]}),b4=gy.default.div`
645
645
  display: flex;
646
646
  gap: 10px;
647
- `;var Gp=y(require("styled-components"));var hy=y(require("styled-components")),Ec=hy.default.span`
647
+ `;var qp=y(require("styled-components"));var Cy=y(require("styled-components")),Sc=Cy.default.span`
648
648
  && {
649
649
  width: 82px;
650
650
  height: 82px;
@@ -659,7 +659,7 @@ Resources:
659
659
  transition: border-color 800ms;
660
660
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
661
661
  }
662
- `;var Hp=require("react/jsx-runtime"),Tc=({style:e,...t})=>(0,Hp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,Hp.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var kt=require("react/jsx-runtime"),yy=()=>{let{navigate:e,app:t}=A(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(k,{}),(0,kt.jsxs)(y4,{children:[(0,kt.jsx)(vt,{children:(0,kt.jsxs)("div",{children:[(0,kt.jsx)(Ec,{}),(0,kt.jsx)(Tc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,kt.jsxs)(g4,{children:[typeof r=="string"?(0,kt.jsx)("h3",{children:r}):(0,kt.jsx)(kt.Fragment,{children:r}),typeof o=="string"?(0,kt.jsx)("p",{children:o}):(0,kt.jsx)(kt.Fragment,{children:o})]}),t?.allowlistConfig.errorCtaLink?(0,kt.jsx)(H,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,kt.jsx)(H,{onClick:()=>{e("LANDING")},children:n})]})]})},y4=Gp.default.div`
662
+ `;var Vp=require("react/jsx-runtime"),_c=({style:e,...t})=>(0,Vp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,Vp.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var Rt=require("react/jsx-runtime"),wy=()=>{let{navigate:e,app:t}=P(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(x,{}),(0,Rt.jsxs)(E4,{children:[(0,Rt.jsx)(vt,{children:(0,Rt.jsxs)("div",{children:[(0,Rt.jsx)(Sc,{}),(0,Rt.jsx)(_c,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,Rt.jsxs)(T4,{children:[typeof r=="string"?(0,Rt.jsx)("h3",{children:r}):(0,Rt.jsx)(Rt.Fragment,{children:r}),typeof o=="string"?(0,Rt.jsx)("p",{children:o}):(0,Rt.jsx)(Rt.Fragment,{children:o})]}),t?.allowlistConfig.errorCtaLink?(0,Rt.jsx)(H,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,Rt.jsx)(H,{onClick:()=>{e("LANDING")},children:n})]})]})},E4=qp.default.div`
663
663
  display: flex;
664
664
  flex-direction: column;
665
665
  align-items: center;
@@ -667,11 +667,11 @@ Resources:
667
667
  gap: 24px;
668
668
  width: 100%;
669
669
  padding-bottom: 16px;
670
- `,g4=Gp.default.div`
670
+ `,T4=qp.default.div`
671
671
  display: flex;
672
672
  flex-direction: column;
673
673
  gap: 8px;
674
- `;var Sy=y(require("@heroicons/react/20/solid/CheckIcon")),_y=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Py=y(require("@heroicons/react/24/outline/PhoneIcon")),qo=require("react"),Ay=require("react-device-detect"),Dn=y(require("styled-components"));var hr=y(require("styled-components")),lo=hr.default.div`
674
+ `;var xy=y(require("@heroicons/react/20/solid/CheckIcon")),ky=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Ry=y(require("@heroicons/react/24/outline/PhoneIcon")),zo=require("react"),Iy=require("react-device-detect"),Fn=y(require("styled-components"));var hr=y(require("styled-components")),kr=hr.default.div`
675
675
  display: flex;
676
676
  flex-direction: column;
677
677
  align-items: flex-start;
@@ -686,16 +686,16 @@ Resources:
686
686
  justify-content: center;
687
687
  flex-grow: 1;
688
688
  width: 100%;
689
- `,gy=hr.default.div`
689
+ `,by=hr.default.div`
690
690
  display: flex;
691
691
  flex-direction: column;
692
692
  align-items: center;
693
693
  width: 100%;
694
- `,ma=(0,hr.default)(jt)`
694
+ `,ha=(0,hr.default)(jt)`
695
695
  padding: 20px 0;
696
- `,Dr=(0,hr.default)(jt)`
696
+ `,Ur=(0,hr.default)(jt)`
697
697
  gap: 16px;
698
- `,Nn=hr.default.div`
698
+ `,Un=hr.default.div`
699
699
  display: flex;
700
700
  flex-direction: column;
701
701
  width: 100%;
@@ -703,12 +703,12 @@ Resources:
703
703
  display: flex;
704
704
  flex-direction: column;
705
705
  gap: 8px;
706
- `,kP=hr.default.div`
706
+ `,DP=hr.default.div`
707
707
  display: flex;
708
708
  flex-direction: column;
709
709
  justify-content: space-between;
710
710
  height: 100%;
711
- `,vy=hr.default.div`
711
+ `,Ey=hr.default.div`
712
712
  display: flex;
713
713
  flex-direction: column;
714
714
  justify-content: flex-start;
@@ -731,15 +731,15 @@ Resources:
731
731
  color: var(--privy-color-foreground-3);
732
732
  font-size: 14px;
733
733
  }
734
- `,pe=hr.default.div`
734
+ `,se=hr.default.div`
735
735
  height: 16px;
736
- `,fe=hr.default.div`
736
+ `,ue=hr.default.div`
737
737
  height: 12px;
738
- `,Cy=hr.default.div`
738
+ `,Ty=hr.default.div`
739
739
  position: relative;
740
- `,fa=hr.default.div`
740
+ `,ya=hr.default.div`
741
741
  height: ${e=>e.height??"12"}px;
742
- `,wy=hr.default.div`
742
+ `,Sy=hr.default.div`
743
743
  background-color: var(--privy-color-accent);
744
744
  display: flex;
745
745
  justify-content: center;
@@ -747,9 +747,9 @@ Resources:
747
747
  border-radius: 50%;
748
748
  border-color: white;
749
749
  border-width: 2px !important;
750
- `;var Sc=y(require("styled-components")),xo=require("react/jsx-runtime"),wi=({title:e,description:t,children:r,...o})=>(0,xo.jsx)(by,{...o,children:(0,xo.jsxs)(xo.Fragment,{children:[(0,xo.jsx)("h3",{children:e}),typeof t=="string"?(0,xo.jsx)("p",{children:t}):t,r]})}),Vo=(0,Sc.default)(wi)`
750
+ `;var Pc=y(require("styled-components")),ko=require("react/jsx-runtime"),Ei=({title:e,description:t,children:r,...o})=>(0,ko.jsx)(_y,{...o,children:(0,ko.jsxs)(ko.Fragment,{children:[(0,ko.jsx)("h3",{children:e}),typeof t=="string"?(0,ko.jsx)("p",{children:t}):t,r]})}),qo=(0,Pc.default)(Ei)`
751
751
  margin-bottom: 24px;
752
- `,ke=({title:e,description:t,icon:r,children:o,...n})=>(0,xo.jsxs)(v4,{...n,children:[r||null,(0,xo.jsx)("h3",{children:e}),t&&typeof t=="string"?(0,xo.jsx)("p",{children:t}):t,o]}),by=Sc.default.div`
752
+ `,xe=({title:e,description:t,icon:r,children:o,...n})=>(0,ko.jsxs)(S4,{...n,children:[r||null,(0,ko.jsx)("h3",{children:e}),t&&typeof t=="string"?(0,ko.jsx)("p",{children:t}):t,o]}),_y=Pc.default.div`
753
753
  display: flex;
754
754
  flex-direction: column;
755
755
  justify-content: flex-start;
@@ -769,7 +769,7 @@ Resources:
769
769
  color: var(--privy-color-foreground-2);
770
770
  font-size: 14px;
771
771
  }
772
- `,v4=(0,Sc.default)(by)`
772
+ `,S4=(0,Pc.default)(_y)`
773
773
  align-items: center;
774
774
  text-align: center;
775
775
  gap: 16px;
@@ -777,7 +777,7 @@ Resources:
777
777
  h3 {
778
778
  margin-bottom: 24px;
779
779
  }
780
- `;var $e=require("react/jsx-runtime"),Vp=6,Ey=new Array(Vp).fill(""),C4=1400,w4=30;var xy=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=A(),{closePrivyModal:a,resendEmailCode:l,resendSmsCode:s,getAuthMeta:c,loginWithCode:m,updateWallets:f,createAnalyticsEvent:u}=W(),{authenticated:w,logout:v,user:g}=$(),[E,T]=(0,qo.useState)(Ey),[R,S]=(0,qo.useState)(!1),[x,I]=(0,qo.useState)(null),[M,U]=(0,qo.useState)(null),[G,Y]=(0,qo.useState)(0);i.current=()=>null;let Z=c()?.email?0:1,L=ot,F=L-500;(0,qo.useEffect)(()=>{if(G){let re=setTimeout(()=>{Y(G-1)},1e3);return()=>clearTimeout(re)}},[G]),(0,qo.useEffect)(()=>{if(w&&R&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let ie=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},F);return()=>clearTimeout(ie)}if(Sr(g,e?.embeddedWallets?.createOnLogin)){let ie=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:Fe=>{console.error(Fe),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Fe,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},F);return()=>clearTimeout(ie)}else{f();let ie=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),L);return()=>clearTimeout(ie)}}},[w,R,g]),(0,qo.useEffect)(()=>{if(x&&M===0){let re=setTimeout(()=>{T(Ey),I(null),document.querySelector("input[name=code-0]")?.focus()},C4);return()=>clearTimeout(re)}},[x]);let O=re=>{re.preventDefault();let ie=re.currentTarget.value.replace(" ","");if(ie==="")return;if(isNaN(Number(ie))){I("Code should be numeric"),U(1);return}I(null),U(null);let Fe=Number(re.currentTarget.name?.charAt(5)),De=[...ie||[""]].slice(0,Vp-Fe),ut=[...E.slice(0,Fe),...De,...E.slice(Fe+De.length)];T(ut);let lt=De.length,Dt=Math.min(Math.max(Fe+lt,0),Vp-1);isNaN(Number(re.currentTarget.value))||document.querySelector(`input[name=code-${Dt}]`)?.focus(),ut.every(at=>at&&!isNaN(+at))&&(document.querySelector(`input[name=code-${Dt}]`)?.blur(),m(ut.join("")).then(()=>S(!0)).catch(ge=>{if(ge?.status===422)I("Invalid or expired verification code");else if(ge instanceof pr&&ge.privyErrorCode==="cannot_link_more_of_type")I(ge.message);else if(ge instanceof pr&&ge.privyErrorCode==="max_accounts_reached"){console.error(new ro(ge).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(ge instanceof pr&&ge.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(ge instanceof pr&&ge.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:ge,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else I("Issue verifying code");U(0)}))},Me=re=>{M===1&&(I(null),U(null));let ie=[...E.slice(0,re),"",...E.slice(re+1)];T(ie),re>0&&document.querySelector(`input[name=code-${re-1}]`)?.focus()},je=Z==0?(0,$e.jsx)(_y.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,$e.jsx)(Py.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),Q=Z==0?(0,$e.jsxs)("p",{children:["Please check ",(0,$e.jsx)(Ty,{children:c()?.email})," for an email from privy.io and enter your code below."]}):(0,$e.jsxs)("p",{children:["Please check ",(0,$e.jsx)(Ty,{children:c()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)(k,{backFn:()=>o()},"header"),(0,$e.jsxs)(b4,{children:[(0,$e.jsx)(ke,{title:"Enter confirmation code",description:Q,icon:je}),(0,$e.jsxs)(gy,{children:[(0,$e.jsxs)(E4,{children:[(0,$e.jsx)(T4,{fail:!!x,success:R,children:(0,$e.jsx)("span",{children:x||(R?"Success!":"")})}),(0,$e.jsx)("div",{children:E.map((re,ie)=>(0,$e.jsx)("input",{name:`code-${ie}`,type:"text",value:E[ie],onChange:O,onKeyUp:Fe=>{Fe.key==="Backspace"&&Me(ie)},inputMode:"numeric",autoFocus:ie===0,pattern:"[0-9]",className:`${R?"success":""} ${x?"fail":""}`,autoComplete:Ay.isMobile?"one-time-code":"off"},ie))})]}),(0,$e.jsxs)(S4,{children:[(0,$e.jsxs)("span",{children:["Didn't get ",Z==0?"an email":"a message","?"]}),G?(0,$e.jsxs)(P4,{children:[(0,$e.jsx)(Sy.default,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),(0,$e.jsx)("span",{children:"Code sent"})]}):(0,$e.jsx)(_4,{children:(0,$e.jsx)("button",{onClick:async()=>{Y(w4),Z==0?await l():await s()},children:"Resend code"})})]})]})]}),(0,$e.jsx)(j,{})]})},b4=Dn.default.div`
780
+ `;var $e=require("react/jsx-runtime"),zp=6,Py=new Array(zp).fill(""),_4=1400,P4=30;var My=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=P(),{closePrivyModal:a,resendEmailCode:l,resendSmsCode:s,getAuthMeta:c,loginWithCode:m,updateWallets:f,createAnalyticsEvent:u}=W(),{authenticated:w,logout:v,user:g}=z(),[E,S]=(0,zo.useState)(Py),[R,_]=(0,zo.useState)(!1),[k,I]=(0,zo.useState)(null),[M,U]=(0,zo.useState)(null),[G,Y]=(0,zo.useState)(0);i.current=()=>null;let Z=c()?.email?0:1,L=ot,F=L-500;(0,zo.useEffect)(()=>{if(G){let re=setTimeout(()=>{Y(G-1)},1e3);return()=>clearTimeout(re)}},[G]),(0,zo.useEffect)(()=>{if(w&&R&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let ie=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},F);return()=>clearTimeout(ie)}if(Sr(g,e?.embeddedWallets?.createOnLogin)){let ie=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:Fe=>{console.error(Fe),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Fe,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},F);return()=>clearTimeout(ie)}else{f();let ie=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),L);return()=>clearTimeout(ie)}}},[w,R,g]),(0,zo.useEffect)(()=>{if(k&&M===0){let re=setTimeout(()=>{S(Py),I(null),document.querySelector("input[name=code-0]")?.focus()},_4);return()=>clearTimeout(re)}},[k]);let O=re=>{re.preventDefault();let ie=re.currentTarget.value.replace(" ","");if(ie==="")return;if(isNaN(Number(ie))){I("Code should be numeric"),U(1);return}I(null),U(null);let Fe=Number(re.currentTarget.name?.charAt(5)),De=[...ie||[""]].slice(0,zp-Fe),ut=[...E.slice(0,Fe),...De,...E.slice(Fe+De.length)];S(ut);let lt=De.length,Dt=Math.min(Math.max(Fe+lt,0),zp-1);isNaN(Number(re.currentTarget.value))||document.querySelector(`input[name=code-${Dt}]`)?.focus(),ut.every(at=>at&&!isNaN(+at))&&(document.querySelector(`input[name=code-${Dt}]`)?.blur(),m(ut.join("")).then(()=>_(!0)).catch(ge=>{if(ge?.status===422)I("Invalid or expired verification code");else if(ge instanceof pr&&ge.privyErrorCode==="cannot_link_more_of_type")I(ge.message);else if(ge instanceof pr&&ge.privyErrorCode==="max_accounts_reached"){console.error(new no(ge).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(ge instanceof pr&&ge.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(ge instanceof pr&&ge.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:ge,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else I("Issue verifying code");U(0)}))},Me=re=>{M===1&&(I(null),U(null));let ie=[...E.slice(0,re),"",...E.slice(re+1)];S(ie),re>0&&document.querySelector(`input[name=code-${re-1}]`)?.focus()},je=Z==0?(0,$e.jsx)(ky.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,$e.jsx)(Ry.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),Q=Z==0?(0,$e.jsxs)("p",{children:["Please check ",(0,$e.jsx)(Ay,{children:c()?.email})," for an email from privy.io and enter your code below."]}):(0,$e.jsxs)("p",{children:["Please check ",(0,$e.jsx)(Ay,{children:c()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)(x,{backFn:()=>o()},"header"),(0,$e.jsxs)(A4,{children:[(0,$e.jsx)(xe,{title:"Enter confirmation code",description:Q,icon:je}),(0,$e.jsxs)(by,{children:[(0,$e.jsxs)(x4,{children:[(0,$e.jsx)(k4,{fail:!!k,success:R,children:(0,$e.jsx)("span",{children:k||(R?"Success!":"")})}),(0,$e.jsx)("div",{children:E.map((re,ie)=>(0,$e.jsx)("input",{name:`code-${ie}`,type:"text",value:E[ie],onChange:O,onKeyUp:Fe=>{Fe.key==="Backspace"&&Me(ie)},inputMode:"numeric",autoFocus:ie===0,pattern:"[0-9]",className:`${R?"success":""} ${k?"fail":""}`,autoComplete:Iy.isMobile?"one-time-code":"off"},ie))})]}),(0,$e.jsxs)(R4,{children:[(0,$e.jsxs)("span",{children:["Didn't get ",Z==0?"an email":"a message","?"]}),G?(0,$e.jsxs)(M4,{children:[(0,$e.jsx)(xy.default,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),(0,$e.jsx)("span",{children:"Code sent"})]}):(0,$e.jsx)(I4,{children:(0,$e.jsx)("button",{onClick:async()=>{Y(P4),Z==0?await l():await s()},children:"Resend code"})})]})]})]}),(0,$e.jsx)(K,{})]})},A4=Fn.default.div`
781
781
  display: flex;
782
782
  flex-direction: column;
783
783
  align-items: flex-start;
@@ -785,7 +785,7 @@ Resources:
785
785
  margin: auto;
786
786
  gap: 16px;
787
787
  flex-grow: 1;
788
- `,E4=Dn.default.div`
788
+ `,x4=Fn.default.div`
789
789
  display: flex;
790
790
  flex-direction: column;
791
791
  width: 100%;
@@ -842,7 +842,7 @@ Resources:
842
842
  transform: translate(1px, 0px);
843
843
  }
844
844
  }
845
- `,T4=Dn.default.div`
845
+ `,k4=Fn.default.div`
846
846
  line-height: 20px;
847
847
  height: 20px;
848
848
  font-size: 13px;
@@ -850,7 +850,7 @@ Resources:
850
850
  display: flex;
851
851
  justify-content: flex-end;
852
852
  width: 100%;
853
- `,S4=Dn.default.div`
853
+ `,R4=Fn.default.div`
854
854
  font-size: 13px;
855
855
  color: var(--privy-color-foreground);
856
856
  display: flex;
@@ -861,13 +861,13 @@ Resources:
861
861
  // Equal opposing size buffer to account for auto margining when the
862
862
  // success/fail text does not show up
863
863
  padding-bottom: 32px;
864
- `,_4=Dn.default.div`
864
+ `,I4=Fn.default.div`
865
865
  color: var(--privy-color-accent);
866
866
  padding: 2px 0;
867
867
  > button {
868
868
  text-decoration: underline;
869
869
  }
870
- `,P4=Dn.default.div`
870
+ `,M4=Fn.default.div`
871
871
  display: flex;
872
872
  align-items: center;
873
873
  justify-content: center;
@@ -876,10 +876,10 @@ Resources:
876
876
  gap: 4px;
877
877
  background: var(--privy-color-background-2);
878
878
  color: var(--privy-color-foreground-2);
879
- `,Ty=Dn.default.span`
879
+ `,Ay=Fn.default.span`
880
880
  font-weight: 500;
881
881
  word-break: break-all;
882
- `;var My=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Wy=y(require("@heroicons/react/24/solid/XCircleIcon")),Ur=require("react"),Oy=y(require("styled-components"));var ky=y(require("styled-components"));var ko=require("react/jsx-runtime"),Ry=({icon:e})=>{let t=e;return(0,ko.jsx)(ko.Fragment,{children:(0,ko.jsx)(A4,{children:(0,ko.jsxs)("div",{children:[(0,ko.jsx)(Pt,{}),typeof t=="string"?(0,ko.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,ko.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,ko.jsx)("span",{})]})})})},A4=ky.default.div`
882
+ `;var Ny=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Dy=y(require("@heroicons/react/24/solid/XCircleIcon")),Fr=require("react"),Uy=y(require("styled-components"));var Wy=y(require("styled-components"));var Ro=require("react/jsx-runtime"),Oy=({icon:e})=>{let t=e;return(0,Ro.jsx)(Ro.Fragment,{children:(0,Ro.jsx)(W4,{children:(0,Ro.jsxs)("div",{children:[(0,Ro.jsx)(At,{}),typeof t=="string"?(0,Ro.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,Ro.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,Ro.jsx)("span",{})]})})})},W4=Wy.default.div`
883
883
  display: flex;
884
884
  flex-direction: column;
885
885
  justify-content: center;
@@ -902,14 +902,14 @@ Resources:
902
902
  left: -19px;
903
903
  top: -19px;
904
904
  }
905
- `;var Bt=require("react/jsx-runtime"),Ly=500,Iy=Ly*2,Ny=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=A(),{status:a,token:l,waitForResult:s,reset:c,execute:m}=We(),f=(0,Ur.useRef)([]),u=F=>{f.current=[F,...f.current]},[w,v]=(0,Ur.useState)(!0);(0,Ur.useEffect)(()=>{let F=setTimeout(v,Iy,!1);return u(F),()=>{f.current.forEach(O=>clearTimeout(O)),f.current=[]}},[]);let[g,E]=(0,Ur.useState)(""),[T,R]=(0,Ur.useState)("Checking that you are a human..."),[S,x]=(0,Ur.useState)((0,Bt.jsx)(H,{onClick:()=>{},disabled:!0,children:"Continue"})),[I,M]=(0,Ur.useState)(!1),[U,G]=(0,Ur.useState)(3),Y=r?.captchaModalData,Z=async F=>{try{await Y?.callback(F),Y?.onSuccessNavigateTo&&n(Y?.onSuccessNavigateTo,!1)}catch(O){if(O instanceof Nr)return;{let Me={error:O,previousScreen:e||"LANDING"};i({errorModalData:Me}),n(Y?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Ur.useEffect)(()=>{if(a==="success"){let F=setTimeout(async()=>{let O=await s();!O||Y?.userIntentRequired||Z(O)},Iy);u(F)}else if(a==="ready"){let F=setTimeout(()=>{a==="ready"&&m()},Ly);u(F)}},[a]),(0,Ur.useEffect)(()=>{if(!w)switch(a){case"success":E("Success!"),R("CAPTCHA passed successfully."),x((0,Bt.jsx)(H,{onClick:()=>{M(!0),Z(l)},disabled:!Y?.userIntentRequired,loading:I,children:Y?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":E(""),R("Checking that you are a human..."),x((0,Bt.jsx)(H,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":E("Something went wrong"),U<=0?(R("If you use an adblocker or VPN, try disabling and re-attempting."),x(null)):(R("You did not pass CAPTCHA. Please try again."),x((0,Bt.jsx)(H,{onClick:L,children:"Retry"})));break;case"ready":default:break}},[a,w,I]);let L=async()=>{if(U<=0)return;G(O=>O-1),c(),m();let F=await s();!F||Y?.userIntentRequired||Z(F)};return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(k,{backFn:!e||t===e?void 0:o}),(0,Bt.jsxs)(x4,{children:[a==="success"?(0,Bt.jsx)(My.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Bt.jsx)(Wy.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Bt.jsx)(Ry,{}),(0,Bt.jsxs)(pt,{children:[g?(0,Bt.jsx)("h3",{children:g}):null,(0,Bt.jsx)("p",{children:T})]}),S]}),(0,Bt.jsx)(J,{})]})},x4=Oy.default.div`
905
+ `;var Bt=require("react/jsx-runtime"),Fy=500,Ly=Fy*2,By=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=P(),{status:a,token:l,waitForResult:s,reset:c,execute:m}=We(),f=(0,Fr.useRef)([]),u=F=>{f.current=[F,...f.current]},[w,v]=(0,Fr.useState)(!0);(0,Fr.useEffect)(()=>{let F=setTimeout(v,Ly,!1);return u(F),()=>{f.current.forEach(O=>clearTimeout(O)),f.current=[]}},[]);let[g,E]=(0,Fr.useState)(""),[S,R]=(0,Fr.useState)("Checking that you are a human..."),[_,k]=(0,Fr.useState)((0,Bt.jsx)(H,{onClick:()=>{},disabled:!0,children:"Continue"})),[I,M]=(0,Fr.useState)(!1),[U,G]=(0,Fr.useState)(3),Y=r?.captchaModalData,Z=async F=>{try{await Y?.callback(F),Y?.onSuccessNavigateTo&&n(Y?.onSuccessNavigateTo,!1)}catch(O){if(O instanceof Dr)return;{let Me={error:O,previousScreen:e||"LANDING"};i({errorModalData:Me}),n(Y?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Fr.useEffect)(()=>{if(a==="success"){let F=setTimeout(async()=>{let O=await s();!O||Y?.userIntentRequired||Z(O)},Ly);u(F)}else if(a==="ready"){let F=setTimeout(()=>{a==="ready"&&m()},Fy);u(F)}},[a]),(0,Fr.useEffect)(()=>{if(!w)switch(a){case"success":E("Success!"),R("CAPTCHA passed successfully."),k((0,Bt.jsx)(H,{onClick:()=>{M(!0),Z(l)},disabled:!Y?.userIntentRequired,loading:I,children:Y?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":E(""),R("Checking that you are a human..."),k((0,Bt.jsx)(H,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":E("Something went wrong"),U<=0?(R("If you use an adblocker or VPN, try disabling and re-attempting."),k(null)):(R("You did not pass CAPTCHA. Please try again."),k((0,Bt.jsx)(H,{onClick:L,children:"Retry"})));break;case"ready":default:break}},[a,w,I]);let L=async()=>{if(U<=0)return;G(O=>O-1),c(),m();let F=await s();!F||Y?.userIntentRequired||Z(F)};return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(x,{backFn:!e||t===e?void 0:o}),(0,Bt.jsxs)(O4,{children:[a==="success"?(0,Bt.jsx)(Ny.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Bt.jsx)(Dy.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Bt.jsx)(Oy,{}),(0,Bt.jsxs)(pt,{children:[g?(0,Bt.jsx)("h3",{children:g}):null,(0,Bt.jsx)("p",{children:S})]}),_]}),(0,Bt.jsx)(J,{})]})},O4=Uy.default.div`
906
906
  display: flex;
907
907
  flex-direction: column;
908
908
  align-items: center;
909
909
  justify-content: center;
910
910
  gap: 24px;
911
911
  width: 100%;
912
- `;var $p=require("react-device-detect"),Kp=y(require("styled-components"));var Dy=y(require("@heroicons/react/24/outline/WalletIcon")),_c=require("react/jsx-runtime"),Pc=({icon:e,name:t})=>typeof e=="string"?(0,_c.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,_c.jsx)(Dy.default,{}):e?(0,_c.jsx)(e,{}):null;var bi=y(require("styled-components"));var Es=require("styled-components"),k4=Es.keyframes`
912
+ `;var jp=require("react-device-detect"),Yp=y(require("styled-components"));var Hy=y(require("@heroicons/react/24/outline/WalletIcon")),Ac=require("react/jsx-runtime"),xc=({icon:e,name:t})=>typeof e=="string"?(0,Ac.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,Ac.jsx)(Hy.default,{}):e?(0,Ac.jsx)(e,{}):null;var Ti=y(require("styled-components"));var Ts=require("styled-components"),L4=Ts.keyframes`
913
913
  from, to {
914
914
  background: var(--privy-color-foreground-4);
915
915
  color: var(--privy-color-foreground-4);
@@ -919,20 +919,20 @@ Resources:
919
919
  background: var(--privy-color-foreground-accent);
920
920
  color: var(--privy-color-foreground-accent);
921
921
  }
922
- `,Ac=Es.css`
923
- ${e=>e.$isLoading?Es.css`
922
+ `,kc=Ts.css`
923
+ ${e=>e.$isLoading?Ts.css`
924
924
  width: 35%;
925
- animation: ${k4} 2s linear infinite;
925
+ animation: ${L4} 2s linear infinite;
926
926
  border-radius: var(--privy-border-radius-sm);
927
927
  `:""}
928
- `;var Uy=require("react/jsx-runtime"),kr=({children:e,color:t,isLoading:r,isPulsing:o,className:n})=>(0,Uy.jsx)(R4,{$color:t,$isLoading:r,$isPulsing:o,className:n,children:e}),R4=bi.default.span`
928
+ `;var Gy=require("react/jsx-runtime"),Rr=({children:e,color:t,isLoading:r,isPulsing:o,className:n})=>(0,Gy.jsx)(N4,{$color:t,$isLoading:r,$isPulsing:o,className:n,children:e}),N4=Ti.default.span`
929
929
  padding: 0.125rem 0.5rem;
930
930
  font-size: 0.75rem;
931
931
  font-weight: 500;
932
932
  line-height: 1.125rem; /* 150% */
933
933
  border-radius: var(--privy-border-radius-sm);
934
934
 
935
- ${e=>{let t,r;e.$color==="green"&&(t="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),e.$color==="red"&&(t="var(--privy-color-error)",r="var(--privy-color-error-light)"),e.$color==="gray"&&(t="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let o=bi.keyframes`
935
+ ${e=>{let t,r;e.$color==="green"&&(t="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),e.$color==="red"&&(t="var(--privy-color-error)",r="var(--privy-color-error-light)"),e.$color==="gray"&&(t="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let o=Ti.keyframes`
936
936
  from, to {
937
937
  background-color: ${r};
938
938
  }
@@ -940,16 +940,16 @@ Resources:
940
940
  50% {
941
941
  background-color: rgba(${r}, 0.8);
942
942
  }
943
- `;return bi.css`
943
+ `;return Ti.css`
944
944
  color: ${t};
945
945
  background-color: ${r};
946
- ${e.$isPulsing&&bi.css`
946
+ ${e.$isPulsing&&Ti.css`
947
947
  animation: ${o} 3s linear infinite;
948
948
  `};
949
949
  `}}
950
950
 
951
- ${Ac}
952
- `;var $y=require("@heroicons/react/24/outline");var yr=require("react/jsx-runtime"),Fy=({...e})=>(0,yr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,yr.jsx)("defs",{children:(0,yr.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,yr.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,yr.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,yr.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,yr.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,yr.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,yr.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,yr.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,yr.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,yr.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,yr.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var Ts=require("react/jsx-runtime"),By=({...e})=>(0,Ts.jsxs)("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,Ts.jsx)("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),(0,Ts.jsx)("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]});var Ht=require("react/jsx-runtime"),Hy=({style:e,...t})=>(0,Ht.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,Ht.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,Ht.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,Ht.jsxs)("defs",{children:[(0,Ht.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ht.jsx)("stop",{stopColor:"#002D72"}),(0,Ht.jsx)("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),(0,Ht.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ht.jsx)("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),(0,Ht.jsx)("stop",{offset:"1",stopColor:"#002D72"})]})]})]});var Et=require("react/jsx-runtime"),Gy=e=>(0,Et.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,Et.jsx)("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),(0,Et.jsx)("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),(0,Et.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),(0,Et.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),(0,Et.jsx)("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),(0,Et.jsxs)("defs",{children:[(0,Et.jsxs)("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"white"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"white"})]}),(0,Et.jsxs)("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"#8697FF"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,Et.jsxs)("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"#8697FF"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,Et.jsxs)("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"white"}),(0,Et.jsx)("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});var ne=require("react/jsx-runtime"),Vy=({style:e,...t})=>(0,ne.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,ne.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,ne.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,ne.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,ne.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,ne.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,ne.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,ne.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,ne.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,ne.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,ne.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,ne.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,ne.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,ne.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,ne.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,ne.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,ne.jsxs)("defs",{children:[(0,ne.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#174299"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,ne.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,ne.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ne.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#FF4000"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ne.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#8754C9"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,ne.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,ne.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ne.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#FFF700"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ne.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#FFF700"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ne.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,ne.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ne.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,ne.jsx)("stop",{stopColor:"#00AAFF"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ne.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,ne.jsx)("stop",{stopColor:"#00AAFF"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ne.jsx)("clipPath",{id:"clip0_5_32",children:(0,ne.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,ne.jsx)("clipPath",{id:"clip1_5_32",children:(0,ne.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var Rr=require("react/jsx-runtime"),qy=({style:e,...t})=>(0,Rr.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Rr.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,Rr.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,Rr.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var un=require("react/jsx-runtime"),zy=({style:e,...t})=>(0,un.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,un.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,un.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,un.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,un.jsx)("defs",{children:(0,un.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,un.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var qp=require("react/jsx-runtime"),co={coinbase_wallet:{logo:ln,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:ln,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:ta,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Uo,displayName:"Phantom"},rainbow:{logo:Vy,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:vs,displayName:"WalletConnect"},zerion:{logo:zy,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Fy,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Hy,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:qy,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:Gy,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"}},Un=(e,t,r)=>{if(co[e]?.displayName)return e==="coinbase_wallet"?co[r].displayName:co[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},xc=(e,t,r)=>{if(co[e]?.logo)return e==="coinbase_wallet"?co[r].logo:co[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return vs},kc=(e,t)=>{let r=t?.height||16,o=t?.width||16;switch(e){case 8453:return(0,qp.jsx)(By,{height:r,width:o});default:return(0,qp.jsx)($y.GlobeAltIcon,{height:r,width:o})}};function ha(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}var ya=require("react"),jy=require("react");var Qy=require("react/jsx-runtime"),Yy=(0,jy.createContext)({}),Zy=({children:e})=>{let t=dt(),[r,o]=(0,ya.useState)({});return He("login",{onComplete:(n,i,a,l,s)=>{!s||s.type==="passkey"||s.type==="cross_app"||s.type==="wallet"&&s.walletClientType==="privy"||(X.put(Ky(t.id),s.type),s.type==="wallet"?(X.put(zp(t.id),s.walletClientType),o({accountType:s.type,walletClientType:s.walletClientType})):(X.del(zp(t.id)),o({accountType:s.type})))}}),(0,ya.useEffect)(()=>{if(!t.id)return;let n=X.get(Ky(t.id)),i=X.get(zp(t.id));n&&o(n==="wallet"?{accountType:n,walletClientType:i}:{accountType:n})},[t.id]),(0,Qy.jsx)(Yy.Provider,{value:r,children:e})},Ky=e=>`privy:${e}:recent-login-method`,zp=e=>`privy:${e}:recent-login-wallet-client`,ar=()=>(0,ya.useContext)(Yy);var Ei=require("react/jsx-runtime"),Ti=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=A(),{connectWallet:a}=W(),l=ar(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches,m;return n.connectorType==="phantom"?m=()=>{An()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i($p.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&$p.isMobile&&!c&&!Tl()?m=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:m=()=>{ha(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},(0,Ei.jsxs)(I4,{onClick:m,children:[(0,Ei.jsx)(Pc,{icon:xc(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),(0,Ei.jsx)("span",{children:Un(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?(0,Ei.jsx)(M4,{color:"gray",children:"Recent"}):(0,Ei.jsx)("span",{id:"connect-text",children:"Connect"})]})},I4=(0,Kp.default)(Oe)`
951
+ ${kc}
952
+ `;var Zy=require("@heroicons/react/24/outline");var yr=require("react/jsx-runtime"),Vy=({...e})=>(0,yr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,yr.jsx)("defs",{children:(0,yr.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,yr.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,yr.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,yr.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,yr.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,yr.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,yr.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,yr.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,yr.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,yr.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,yr.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var Ss=require("react/jsx-runtime"),qy=({...e})=>(0,Ss.jsxs)("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,Ss.jsx)("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),(0,Ss.jsx)("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]});var Ht=require("react/jsx-runtime"),zy=({style:e,...t})=>(0,Ht.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,Ht.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,Ht.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,Ht.jsxs)("defs",{children:[(0,Ht.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ht.jsx)("stop",{stopColor:"#002D72"}),(0,Ht.jsx)("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),(0,Ht.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ht.jsx)("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),(0,Ht.jsx)("stop",{offset:"1",stopColor:"#002D72"})]})]})]});var Et=require("react/jsx-runtime"),$y=e=>(0,Et.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,Et.jsx)("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),(0,Et.jsx)("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),(0,Et.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),(0,Et.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),(0,Et.jsx)("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),(0,Et.jsxs)("defs",{children:[(0,Et.jsxs)("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"white"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"white"})]}),(0,Et.jsxs)("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"#8697FF"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,Et.jsxs)("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"#8697FF"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,Et.jsxs)("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"white"}),(0,Et.jsx)("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});var ne=require("react/jsx-runtime"),Ky=({style:e,...t})=>(0,ne.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,ne.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,ne.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,ne.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,ne.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,ne.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,ne.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,ne.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,ne.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,ne.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,ne.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,ne.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,ne.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,ne.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,ne.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,ne.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,ne.jsxs)("defs",{children:[(0,ne.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#174299"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,ne.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,ne.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ne.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#FF4000"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ne.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#8754C9"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,ne.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,ne.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ne.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#FFF700"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ne.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#FFF700"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ne.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,ne.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ne.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,ne.jsx)("stop",{stopColor:"#00AAFF"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ne.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,ne.jsx)("stop",{stopColor:"#00AAFF"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ne.jsx)("clipPath",{id:"clip0_5_32",children:(0,ne.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,ne.jsx)("clipPath",{id:"clip1_5_32",children:(0,ne.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var Ir=require("react/jsx-runtime"),jy=({style:e,...t})=>(0,Ir.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Ir.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,Ir.jsxs)("g",{children:[(0,Ir.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,Ir.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,Ir.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,Ir.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,Ir.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,Ir.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,Ir.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,Ir.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,Ir.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var mn=require("react/jsx-runtime"),Yy=({style:e,...t})=>(0,mn.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,mn.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,mn.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,mn.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,mn.jsx)("defs",{children:(0,mn.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,mn.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var $p=require("react/jsx-runtime"),po={coinbase_wallet:{logo:cn,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:cn,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:oa,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Fo,displayName:"Phantom"},rainbow:{logo:Ky,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Cs,displayName:"WalletConnect"},zerion:{logo:Yy,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Vy,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:zy,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:jy,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:$y,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"}},Bn=(e,t,r)=>{if(po[e]?.displayName)return e==="coinbase_wallet"?po[r].displayName:po[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},Rc=(e,t,r)=>{if(po[e]?.logo)return e==="coinbase_wallet"?po[r].logo:po[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Cs},Ic=(e,t)=>{let r=t?.height||16,o=t?.width||16;switch(e){case 8453:return(0,$p.jsx)(qy,{height:r,width:o});default:return(0,$p.jsx)(Zy.GlobeAltIcon,{height:r,width:o})}};function ga(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}var va=require("react"),Jy=require("react");var tg=require("react/jsx-runtime"),Xy=(0,Jy.createContext)({}),eg=({children:e})=>{let t=dt(),[r,o]=(0,va.useState)({});return He("login",{onComplete:(n,i,a,l,s)=>{!s||s.type==="passkey"||s.type==="cross_app"||s.type==="wallet"&&s.walletClientType==="privy"||(X.put(Qy(t.id),s.type),s.type==="wallet"?(X.put(Kp(t.id),s.walletClientType),o({accountType:s.type,walletClientType:s.walletClientType})):(X.del(Kp(t.id)),o({accountType:s.type})))}}),(0,va.useEffect)(()=>{if(!t.id)return;let n=X.get(Qy(t.id)),i=X.get(Kp(t.id));n&&o(n==="wallet"?{accountType:n,walletClientType:i}:{accountType:n})},[t.id]),(0,tg.jsx)(Xy.Provider,{value:r,children:e})},Qy=e=>`privy:${e}:recent-login-method`,Kp=e=>`privy:${e}:recent-login-wallet-client`,ar=()=>(0,va.useContext)(Xy);var Si=require("react/jsx-runtime"),_i=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=P(),{connectWallet:a}=W(),l=ar(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches,m;return n.connectorType==="phantom"?m=()=>{xn()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(jp.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&jp.isMobile&&!c&&!Sl()?m=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:m=()=>{ga(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},(0,Si.jsxs)(D4,{onClick:m,children:[(0,Si.jsx)(xc,{icon:Rc(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),(0,Si.jsx)("span",{children:Bn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?(0,Si.jsx)(U4,{color:"gray",children:"Recent"}):(0,Si.jsx)("span",{id:"connect-text",children:"Connect"})]})},D4=(0,Yp.default)(Oe)`
953
953
  /* Show "Connect" on hover */
954
954
  > #connect-text {
955
955
  font-weight: 500;
@@ -971,16 +971,16 @@ Resources:
971
971
  display: none;
972
972
  }
973
973
  }
974
- `,M4=(0,Kp.default)(kr)`
974
+ `,U4=(0,Yp.default)(Rr)`
975
975
  margin-left: auto;
976
- `;var Ro=require("react/jsx-runtime"),W4=["coinbase_wallet"],O4=["metamask","okx_wallet","rainbow","uniswap","zerion","rabby_wallet","cryptocom"],L4=[],N4=["phantom"],ga=({connectOnly:e})=>{let{connectors:t}=W(),{app:r}=A(),o=Fn(r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return(0,Ro.jsxs)(Ro.Fragment,{children:[...o]})},Fn=(e,t,r,o,n)=>{let i=[],a=[],l=[],s=t.find(c=>c.connectorType==="wallet_connect_v2");for(let c of e)if(c==="detected_wallets"){let m=t.filter(({connectorType:f,walletClientType:u})=>u==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="crypto.com_wallet_extension"?!o.includes("cryptocom"):f==="injected"&&!o.includes(u));for(let f of m){let{walletClientType:u,walletBranding:w}=f;(u==="unknown"?a:i).push((0,Ro.jsx)(Ti,{connectOnly:r,provider:u,logo:w.icon,displayName:w.name,connector:f},`${c}-${u}`))}}else if(N4.includes(c)){let m=t.find(f=>f.connectorType==="injected"&&f.walletClientType===c||f.connectorType===c);m&&i.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:m},c))}else if(O4.includes(c)){let m=t.find(f=>c==="uniswap"?f.walletClientType==="uniswap_wallet_extension":c==="cryptocom"?f.walletClientType==="crypto.com_wallet_extension":f.connectorType==="injected"&&f.walletClientType===c);n&&!m&&(m=s),m&&i.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:m},c))}else if(W4.includes(c)){let m=t.find(({connectorType:f})=>f===c);m&&i.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:m},c))}else L4.includes(c)?s&&l.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:s},c)):c==="wallet_connect"&&s&&l.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:s},c));return[...a,...i,...l]};var zo=require("react/jsx-runtime"),Jy=()=>{let{app:e}=A(),{linkingOrConnectingHint:t}=W(),r=t?`Connect the wallet with address ${Wt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsx)(k,{},"header"),(0,zo.jsx)(Vo,{title:"Connect your wallet",description:r}),(0,zo.jsx)(Pr,{children:(0,zo.jsx)(ga,{connectOnly:!0})}),(0,zo.jsx)(j,{})]})};var Io=require("react/jsx-runtime"),Xy=()=>{let{app:e}=A(),{linkingOrConnectingHint:t}=W(),r=t?`Connect the wallet with address ${Wt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,Io.jsxs)(Io.Fragment,{children:[(0,Io.jsx)(k,{},"header"),(0,Io.jsx)(wi,{title:"Connect your wallet",description:r}),(0,Io.jsx)(Pr,{children:(0,Io.jsx)(ga,{connectOnly:!0})}),e&&(0,Io.jsx)(ua,{app:e,alwaysShowImplicitConsent:!0}),(0,Io.jsx)(j,{})]})};var Ca=require("react"),og=require("react-device-detect"),ng=y(require("styled-components"));var Fr=require("react"),_s=require("react-device-detect"),Yp=y(require("styled-components"));var Ss=require("react"),D4=(e,t)=>{let r=(0,Ss.useRef)(()=>{});(0,Ss.useEffect)(()=>{r.current=e}),(0,Ss.useEffect)(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},eg=D4;var va=require("react");function tg(){let[e,t]=(0,va.useState)(!1),r=(0,va.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,va.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var Ge=require("react/jsx-runtime"),jp=2,Zp=e=>e?.privyErrorCode==="linked_to_another_user"?cn.ERROR_USER_EXISTS:e instanceof Kt&&!e.details.default?e.details:e instanceof Qi?cn.ERROR_TIMED_OUT:e instanceof Ji?cn.ERROR_USER_REJECTED_CONNECTION:cn.ERROR_WALLET_CONNECTION,rg=()=>{let[e,t]=(0,Fr.useState)(!1),[r,o]=(0,Fr.useState)(!1),[n,i]=(0,Fr.useState)(void 0),{authenticated:a,logout:l}=$(),{app:s,navigate:c,navigateBack:m,lastScreen:f,currentScreen:u,setModalData:w}=A(),{getAuthFlow:v,walletConnectionStatus:g,closePrivyModal:E,initLoginWithWallet:T,loginWithWallet:R,updateWallets:S,createAnalyticsEvent:x}=W(),{walletConnectors:I}=$(),[M,U]=(0,Fr.useState)(0),{user:G}=$(),[Y]=(0,Fr.useState)(G?.linkedAccounts.length||0),[Z,L]=(0,Fr.useState)(""),[F,O]=(0,Fr.useState)(""),[Me,je]=(0,Fr.useState)(!1),{hasTabbedAway:Q}=tg(),{enabled:re,token:ie}=We(),Fe=_s.isMobile&&g?.connector?.connectorType==="wallet_connect_v2"||_s.isMobile&&g?.connector?.connectorType==="coinbase_wallet"||_s.isMobile&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",De=g?.status==="connected",ut=g?.status==="switching_to_supported_chain";(0,Fr.useEffect)(()=>{let q=v(),he=q instanceof sn?q:void 0;if(De&&!he&&(re&&!ie&&!a?(w({captchaModalData:{callback:It=>T(g.connectedWallet,It).then(()=>{je(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):T(g.connectedWallet,ie).then(()=>{je(!0)})),he&&Fe&&De&&!he.preparedMessage){he.buildSiweMessage();return}!he||Fe||!De||r||(async()=>{o(!0),i(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await sp(2500),await Dt()}catch(It){console.warn("Auto-prompted signature failed",It)}finally{o(!1)}})()},[M,De,Me]),(0,Fr.useEffect)(()=>{if(G&&e){let he=ot-500;if(s?.legal.requireUsersAcceptTerms&&!G.hasAcceptedTerms){let rs=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},he);return()=>clearTimeout(rs)}if(Sr(G,s?.embeddedWallets?.createOnLogin)){let rs=setTimeout(()=>{w({createWallet:{onSuccess:()=>{},onFailure:il=>{console.error(il),x({eventName:"embedded_wallet_creation_failure_logout",payload:{error:il,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},he);return()=>clearTimeout(rs)}S();let It=setTimeout(()=>E({shouldCallAuthOnSuccess:!0,isSuccess:!0}),ot);return()=>clearTimeout(It)}},[G,e]);let lt=q=>{if(q?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(q?.privyErrorCode==="max_accounts_reached"){console.error(new ro(q).toString()),c("USER_LIMIT_REACHED_SCREEN");return}else if(q?.privyErrorCode==="user_does_not_exist"){c("ACCOUNT_NOT_FOUND_SCREEN");return}i(Zp(q))};async function Dt(){try{await R(),t(!0)}catch(q){lt(q)}finally{o(!1)}}(0,Fr.useEffect)(()=>{g?.connectError&&lt(g?.connectError)},[g]),eg(()=>{let q=at==="wallet_connect_v2"&&g?.connector instanceof To?g.connector.redirectUri:void 0;q&&L(q);let he=at==="wallet_connect_v2"&&g?.connector instanceof To?g.connector.fallbackUniversalRedirectUri:void 0;he&&O(he)},g?.connector instanceof To&&!Z?500:null);let at=g?.connector?.connectorType||"injected",ge=g?.connector?.walletClientType||"unknown",Cr=co[ge]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",go=co[ge]?.logo||g?.connector?.walletBranding.icon||(q=>(0,Ge.jsx)(ea,{...q})),Lo=Cr==="Browser Extension"?Cr.toLowerCase():Cr,N;e?N=`Successfully connected with ${Lo}`:n?N=n.message:ut?N="Switching networks":De?N=r&&Fe?"Signing":"Sign to verify":N=`Waiting for ${Lo}`;let _t="Don\u2019t see your wallet? Check your other browser windows.";if(e){let q=G?.linkedAccounts.length||0;Y===q?_t="Wallet was already linked.":_t="You\u2019re good to go!"}else M>=jp&&n?_t="Unable to connect wallet":n?_t=n.detail:ut?_t="Switch your wallet to the requested network.":De&&Fe?_t="Sign the message in your wallet to verify it belongs to you.":ge==="metamask"&&_s.isMobile?_t="Click continue to open and connect MetaMask.":ge==="metamask"?_t="For the best experience, connect only one wallet at a time.":at==="wallet_connect"?_t="Open your mobile wallet app to continue":at==="coinbase_wallet"&&(Tl()||(Rp(G)?_t="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":_t="Open the Coinbase app on your phone to continue."));let vo=I?.walletConnectors?.find(q=>q.walletClientType==="coinbase_wallet"),V=ge==="coinbase_wallet"&&(Rp(G)||n===cn.ERROR_USER_EXISTS);return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(k,{backFn:!f||u===f?void 0:m}),(0,Ge.jsxs)(U4,{children:[(0,Ge.jsx)(Qp,{walletLogo:go,success:e,fail:!!n}),(0,Ge.jsxs)(pt,{children:[(0,Ge.jsx)("h3",{children:N}),(0,Ge.jsx)("p",{children:_t}),!De&&Z&&!Q?(0,Ge.jsxs)("p",{children:["Still here?"," ",(0,Ge.jsx)("a",{href:Z,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),F&&(0,Ge.jsxs)(Ge.Fragment,{children:[" ","or"," ",(0,Ge.jsx)("a",{href:F,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),V?(0,Ge.jsx)(H,{onClick:()=>vo&&vo?.disconnect(),disabled:e,children:"Use a different wallet"}):n==cn.ERROR_USER_EXISTS&&u!==f?(0,Ge.jsx)(H,{onClick:m,children:"Use a different wallet"}):De&&!e&&Fe?(0,Ge.jsx)(H,{onClick:()=>{o(!0),Dt()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<jp?(0,Ge.jsx)(H,{onClick:()=>{U(M+1),i(void 0),De?(o(!0),Dt()):g?.connectRetry()},disabled:!e&&(!n?.retryable||M>=jp),children:"Retry"}):!e&&!n?(0,Ge.jsx)(H,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,Ge.jsx)(J,{})]})},U4=Yp.default.div`
976
+ `;var Io=require("react/jsx-runtime"),F4=["coinbase_wallet"],B4=["metamask","okx_wallet","rainbow","uniswap","zerion","rabby_wallet","cryptocom"],H4=[],G4=["phantom"],Ca=({connectOnly:e})=>{let{connectors:t}=W(),{app:r}=P(),o=Hn(r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return(0,Io.jsxs)(Io.Fragment,{children:[...o]})},Hn=(e,t,r,o,n)=>{let i=[],a=[],l=[],s=t.find(c=>c.connectorType==="wallet_connect_v2");for(let c of e)if(c==="detected_wallets"){let m=t.filter(({connectorType:f,walletClientType:u})=>u==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="crypto.com_wallet_extension"?!o.includes("cryptocom"):f==="injected"&&!o.includes(u));for(let f of m){let{walletClientType:u,walletBranding:w}=f;(u==="unknown"?a:i).push((0,Io.jsx)(_i,{connectOnly:r,provider:u,logo:w.icon,displayName:w.name,connector:f},`${c}-${u}`))}}else if(G4.includes(c)){let m=t.find(f=>f.connectorType==="injected"&&f.walletClientType===c||f.connectorType===c);m&&i.push((0,Io.jsx)(_i,{connectOnly:r,provider:c,connector:m},c))}else if(B4.includes(c)){let m=t.find(f=>c==="uniswap"?f.walletClientType==="uniswap_wallet_extension":c==="cryptocom"?f.walletClientType==="crypto.com_wallet_extension":f.connectorType==="injected"&&f.walletClientType===c);n&&!m&&(m=s),m&&i.push((0,Io.jsx)(_i,{connectOnly:r,provider:c,connector:m},c))}else if(F4.includes(c)){let m=t.find(({connectorType:f})=>f===c);m&&i.push((0,Io.jsx)(_i,{connectOnly:r,provider:c,connector:m},c))}else H4.includes(c)?s&&l.push((0,Io.jsx)(_i,{connectOnly:r,provider:c,connector:s},c)):c==="wallet_connect"&&s&&l.push((0,Io.jsx)(_i,{connectOnly:r,provider:c,connector:s},c));return[...a,...i,...l]};var $o=require("react/jsx-runtime"),rg=()=>{let{app:e}=P(),{linkingOrConnectingHint:t}=W(),r=t?`Connect the wallet with address ${Wt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)(x,{},"header"),(0,$o.jsx)(qo,{title:"Connect your wallet",description:r}),(0,$o.jsx)(Pr,{children:(0,$o.jsx)(Ca,{connectOnly:!0})}),(0,$o.jsx)(K,{})]})};var Mo=require("react/jsx-runtime"),og=()=>{let{app:e}=P(),{linkingOrConnectingHint:t}=W(),r=t?`Connect the wallet with address ${Wt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,Mo.jsxs)(Mo.Fragment,{children:[(0,Mo.jsx)(x,{},"header"),(0,Mo.jsx)(Ei,{title:"Connect your wallet",description:r}),(0,Mo.jsx)(Pr,{children:(0,Mo.jsx)(Ca,{connectOnly:!0})}),e&&(0,Mo.jsx)(fa,{app:e,alwaysShowImplicitConsent:!0}),(0,Mo.jsx)(K,{})]})};var ba=require("react"),sg=require("react-device-detect"),lg=y(require("styled-components"));var Br=require("react"),Ps=require("react-device-detect"),Qp=y(require("styled-components"));var _s=require("react"),V4=(e,t)=>{let r=(0,_s.useRef)(()=>{});(0,_s.useEffect)(()=>{r.current=e}),(0,_s.useEffect)(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},ng=V4;var wa=require("react");function ig(){let[e,t]=(0,wa.useState)(!1),r=(0,wa.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,wa.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var Ge=require("react/jsx-runtime"),Zp=2,Jp=e=>e?.privyErrorCode==="linked_to_another_user"?dn.ERROR_USER_EXISTS:e instanceof Kt&&!e.details.default?e.details:e instanceof Xi?dn.ERROR_TIMED_OUT:e instanceof ea?dn.ERROR_USER_REJECTED_CONNECTION:dn.ERROR_WALLET_CONNECTION,ag=()=>{let[e,t]=(0,Br.useState)(!1),[r,o]=(0,Br.useState)(!1),[n,i]=(0,Br.useState)(void 0),{authenticated:a,logout:l}=z(),{app:s,navigate:c,navigateBack:m,lastScreen:f,currentScreen:u,setModalData:w}=P(),{getAuthFlow:v,walletConnectionStatus:g,closePrivyModal:E,initLoginWithWallet:S,loginWithWallet:R,updateWallets:_,createAnalyticsEvent:k}=W(),{walletConnectors:I}=z(),[M,U]=(0,Br.useState)(0),{user:G}=z(),[Y]=(0,Br.useState)(G?.linkedAccounts.length||0),[Z,L]=(0,Br.useState)(""),[F,O]=(0,Br.useState)(""),[Me,je]=(0,Br.useState)(!1),{hasTabbedAway:Q}=ig(),{enabled:re,token:ie}=We(),Fe=Ps.isMobile&&g?.connector?.connectorType==="wallet_connect_v2"||Ps.isMobile&&g?.connector?.connectorType==="coinbase_wallet"||Ps.isMobile&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",De=g?.status==="connected",ut=g?.status==="switching_to_supported_chain";(0,Br.useEffect)(()=>{let q=v(),he=q instanceof ln?q:void 0;if(De&&!he&&(re&&!ie&&!a?(w({captchaModalData:{callback:Mt=>S(g.connectedWallet,Mt).then(()=>{je(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):S(g.connectedWallet,ie).then(()=>{je(!0)})),he&&Fe&&De&&!he.preparedMessage){he.buildSiweMessage();return}!he||Fe||!De||r||(async()=>{o(!0),i(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await cp(2500),await Dt()}catch(Mt){console.warn("Auto-prompted signature failed",Mt)}finally{o(!1)}})()},[M,De,Me]),(0,Br.useEffect)(()=>{if(G&&e){let he=ot-500;if(s?.legal.requireUsersAcceptTerms&&!G.hasAcceptedTerms){let os=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},he);return()=>clearTimeout(os)}if(Sr(G,s?.embeddedWallets?.createOnLogin)){let os=setTimeout(()=>{w({createWallet:{onSuccess:()=>{},onFailure:al=>{console.error(al),k({eventName:"embedded_wallet_creation_failure_logout",payload:{error:al,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},he);return()=>clearTimeout(os)}_();let Mt=setTimeout(()=>E({shouldCallAuthOnSuccess:!0,isSuccess:!0}),ot);return()=>clearTimeout(Mt)}},[G,e]);let lt=q=>{if(q?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(q?.privyErrorCode==="max_accounts_reached"){console.error(new no(q).toString()),c("USER_LIMIT_REACHED_SCREEN");return}else if(q?.privyErrorCode==="user_does_not_exist"){c("ACCOUNT_NOT_FOUND_SCREEN");return}i(Jp(q))};async function Dt(){try{await R(),t(!0)}catch(q){lt(q)}finally{o(!1)}}(0,Br.useEffect)(()=>{g?.connectError&&lt(g?.connectError)},[g]),ng(()=>{let q=at==="wallet_connect_v2"&&g?.connector instanceof So?g.connector.redirectUri:void 0;q&&L(q);let he=at==="wallet_connect_v2"&&g?.connector instanceof So?g.connector.fallbackUniversalRedirectUri:void 0;he&&O(he)},g?.connector instanceof So&&!Z?500:null);let at=g?.connector?.connectorType||"injected",ge=g?.connector?.walletClientType||"unknown",Cr=po[ge]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",vo=po[ge]?.logo||g?.connector?.walletBranding.icon||(q=>(0,Ge.jsx)(ra,{...q})),No=Cr==="Browser Extension"?Cr.toLowerCase():Cr,N;e?N=`Successfully connected with ${No}`:n?N=n.message:ut?N="Switching networks":De?N=r&&Fe?"Signing":"Sign to verify":N=`Waiting for ${No}`;let _t="Don\u2019t see your wallet? Check your other browser windows.";if(e){let q=G?.linkedAccounts.length||0;Y===q?_t="Wallet was already linked.":_t="You\u2019re good to go!"}else M>=Zp&&n?_t="Unable to connect wallet":n?_t=n.detail:ut?_t="Switch your wallet to the requested network.":De&&Fe?_t="Sign the message in your wallet to verify it belongs to you.":ge==="metamask"&&Ps.isMobile?_t="Click continue to open and connect MetaMask.":ge==="metamask"?_t="For the best experience, connect only one wallet at a time.":at==="wallet_connect"?_t="Open your mobile wallet app to continue":at==="coinbase_wallet"&&(Sl()||(Mp(G)?_t="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":_t="Open the Coinbase app on your phone to continue."));let Co=I?.walletConnectors?.find(q=>q.walletClientType==="coinbase_wallet"),V=ge==="coinbase_wallet"&&(Mp(G)||n===dn.ERROR_USER_EXISTS);return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(x,{backFn:!f||u===f?void 0:m}),(0,Ge.jsxs)(q4,{children:[(0,Ge.jsx)(Xp,{walletLogo:vo,success:e,fail:!!n}),(0,Ge.jsxs)(pt,{children:[(0,Ge.jsx)("h3",{children:N}),(0,Ge.jsx)("p",{children:_t}),!De&&Z&&!Q?(0,Ge.jsxs)("p",{children:["Still here?"," ",(0,Ge.jsx)("a",{href:Z,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),F&&(0,Ge.jsxs)(Ge.Fragment,{children:[" ","or"," ",(0,Ge.jsx)("a",{href:F,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),V?(0,Ge.jsx)(H,{onClick:()=>Co&&Co?.disconnect(),disabled:e,children:"Use a different wallet"}):n==dn.ERROR_USER_EXISTS&&u!==f?(0,Ge.jsx)(H,{onClick:m,children:"Use a different wallet"}):De&&!e&&Fe?(0,Ge.jsx)(H,{onClick:()=>{o(!0),Dt()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<Zp?(0,Ge.jsx)(H,{onClick:()=>{U(M+1),i(void 0),De?(o(!0),Dt()):g?.connectRetry()},disabled:!e&&(!n?.retryable||M>=Zp),children:"Retry"}):!e&&!n?(0,Ge.jsx)(H,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,Ge.jsx)(J,{})]})},q4=Qp.default.div`
977
977
  display: flex;
978
978
  flex-direction: column;
979
979
  align-items: center;
980
980
  justify-content: center;
981
981
  gap: 24px;
982
982
  width: 100%;
983
- `,F4=Yp.default.div`
983
+ `,z4=Qp.default.div`
984
984
  display: flex;
985
985
  flex-direction: column;
986
986
  justify-content: center;
@@ -1003,14 +1003,14 @@ Resources:
1003
1003
  left: -19px;
1004
1004
  top: -19px;
1005
1005
  }
1006
- `,Qp=e=>{let t=e.walletLogo;return(0,Ge.jsx)(Ge.Fragment,{children:(0,Ge.jsx)(F4,{children:(0,Ge.jsxs)("div",{children:[(0,Ge.jsx)(Pt,{success:e.success,fail:e.fail}),typeof t=="string"?(0,Ge.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,Ge.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var sr=require("react/jsx-runtime"),Rc=2,ig=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=A(),{walletConnectionStatus:i,closePrivyModal:a}=W(),[l,s]=(0,Ca.useState)(void 0),[c,m]=(0,Ca.useState)(0),f=i?.status==="connected",u=i?.status==="switching_to_supported_chain";(0,Ca.useEffect)(()=>{if(f){let I;if(n?.externalConnectWallet?.onCompleteNavigateTo){let M=n.externalConnectWallet.onCompleteNavigateTo;I=setTimeout(()=>{t(M)},ot)}else I=setTimeout(a,ot);return()=>clearTimeout(I)}},[f]);let w=I=>{s(Zp(I))};(0,Ca.useEffect)(()=>{i?.connectError&&w(i?.connectError)},[i]);let v=i?.connector?.connectorType||"injected",g=i?.connector?.walletClientType||"unknown",E=co[g]?.displayName||i?.connector?.walletBranding.name||"Browser Extension",T=co[g]?.logo||i?.connector?.walletBranding.icon||(I=>(0,sr.jsx)(ea,{...I})),R=E==="Browser Extension"?E.toLowerCase():E,S;f?S=`Successfully connected with ${R}`:l?S=l.message:u?S="Switching networks":S=`Waiting for ${R}`;let x="Don\u2019t see your wallet? Check your other browser windows.";return f?x="You\u2019re good to go!":c>=Rc&&l?x="Unable to connect wallet":l?x=l.detail:u?x="Switch your wallet to the requested network.":g==="metamask"&&og.isMobile?x="Click to continue to open and connect MetaMask.":g==="metamask"?x="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?x="Open your mobile wallet app to continue":v==="coinbase_wallet"&&(x="Open the Coinbase app on your phone to continue."),(0,sr.jsxs)(sr.Fragment,{children:[(0,sr.jsx)(k,{backFn:o===r?void 0:e}),(0,sr.jsxs)(B4,{children:[(0,sr.jsx)(Qp,{walletLogo:T,success:f,fail:!!l}),(0,sr.jsxs)(pt,{children:[(0,sr.jsx)("h3",{children:S}),(0,sr.jsx)("p",{children:x})]}),l==cn.ERROR_USER_EXISTS?(0,sr.jsx)(H,{onClick:e,children:"Use a different wallet"}):!f&&l?.retryable&&c<Rc?(0,sr.jsx)(H,{onClick:()=>{m(c+1),s(void 0),i?.connectRetry()},disabled:!f&&(!l?.retryable||c>=Rc),children:"Retry"}):!f&&l&&c>=Rc?(0,sr.jsx)(H,{onClick:e,children:"Use a different wallet"}):null]}),(0,sr.jsx)(J,{})]})},B4=ng.default.div`
1006
+ `,Xp=e=>{let t=e.walletLogo;return(0,Ge.jsx)(Ge.Fragment,{children:(0,Ge.jsx)(z4,{children:(0,Ge.jsxs)("div",{children:[(0,Ge.jsx)(At,{success:e.success,fail:e.fail}),typeof t=="string"?(0,Ge.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,Ge.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var sr=require("react/jsx-runtime"),Mc=2,cg=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=P(),{walletConnectionStatus:i,closePrivyModal:a}=W(),[l,s]=(0,ba.useState)(void 0),[c,m]=(0,ba.useState)(0),f=i?.status==="connected",u=i?.status==="switching_to_supported_chain";(0,ba.useEffect)(()=>{if(f){let I;if(n?.externalConnectWallet?.onCompleteNavigateTo){let M=n.externalConnectWallet.onCompleteNavigateTo;I=setTimeout(()=>{t(M)},ot)}else I=setTimeout(a,ot);return()=>clearTimeout(I)}},[f]);let w=I=>{s(Jp(I))};(0,ba.useEffect)(()=>{i?.connectError&&w(i?.connectError)},[i]);let v=i?.connector?.connectorType||"injected",g=i?.connector?.walletClientType||"unknown",E=po[g]?.displayName||i?.connector?.walletBranding.name||"Browser Extension",S=po[g]?.logo||i?.connector?.walletBranding.icon||(I=>(0,sr.jsx)(ra,{...I})),R=E==="Browser Extension"?E.toLowerCase():E,_;f?_=`Successfully connected with ${R}`:l?_=l.message:u?_="Switching networks":_=`Waiting for ${R}`;let k="Don\u2019t see your wallet? Check your other browser windows.";return f?k="You\u2019re good to go!":c>=Mc&&l?k="Unable to connect wallet":l?k=l.detail:u?k="Switch your wallet to the requested network.":g==="metamask"&&sg.isMobile?k="Click to continue to open and connect MetaMask.":g==="metamask"?k="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?k="Open your mobile wallet app to continue":v==="coinbase_wallet"&&(k="Open the Coinbase app on your phone to continue."),(0,sr.jsxs)(sr.Fragment,{children:[(0,sr.jsx)(x,{backFn:o===r?void 0:e}),(0,sr.jsxs)($4,{children:[(0,sr.jsx)(Xp,{walletLogo:S,success:f,fail:!!l}),(0,sr.jsxs)(pt,{children:[(0,sr.jsx)("h3",{children:_}),(0,sr.jsx)("p",{children:k})]}),l==dn.ERROR_USER_EXISTS?(0,sr.jsx)(H,{onClick:e,children:"Use a different wallet"}):!f&&l?.retryable&&c<Mc?(0,sr.jsx)(H,{onClick:()=>{m(c+1),s(void 0),i?.connectRetry()},disabled:!f&&(!l?.retryable||c>=Mc),children:"Retry"}):!f&&l&&c>=Mc?(0,sr.jsx)(H,{onClick:e,children:"Use a different wallet"}):null]}),(0,sr.jsx)(J,{})]})},$4=lg.default.div`
1007
1007
  display: flex;
1008
1008
  flex-direction: column;
1009
1009
  align-items: center;
1010
1010
  justify-content: center;
1011
1011
  gap: 24px;
1012
1012
  width: 100%;
1013
- `;var Si=require("react"),sg=y(require("styled-components"));var Jp=require("react/jsx-runtime"),ag=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?(0,Jp.jsx)("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):(0,Jp.jsx)("span",{})};var Yt=require("react/jsx-runtime"),lg=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=A(),{crossAppAuthFlow:r,updateWallets:o,closePrivyModal:n}=W(),[i,a]=(0,Si.useState)({}),l={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},s=ot,c=new b(`There was an issue connecting your ${l.name} account. Please try again.`),m=new rt(async v=>{if(!e?.crossAppAuth?.popup){a({error:c});return}try{let g=await r({appId:v,popup:e.crossAppAuth.popup});a({data:g})}catch(g){g instanceof b?a({error:g}):g instanceof pr?(e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),a({error:c})):a({error:c})}}),f=()=>{i.data&&(o(),e?.crossAppAuth?.onSuccess(i.data),n({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(i.error??new b("User canceled flow")),n({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=f,(0,Si.useEffect)(()=>{l.id.length&&m.execute(l.id)},[l.id]),(0,Si.useEffect)(()=>{if(!i.data)return;let v=setTimeout(f,s);return()=>clearTimeout(v)},[i.data]);let{title:u,subtitle:w}=(0,Si.useMemo)(()=>i.data?{title:`Successfully connected with ${l.name}`,subtitle:"You're good to go!"}:i.error?{title:"Authentication failed",subtitle:i.error.message}:{title:`Connecting to ${l.name}`,subtitle:`Please check the pop-up from ${l.name} to continue`},[i,l.name]);return(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(k,{onClose:f}),(0,Yt.jsx)(pe,{}),(0,Yt.jsxs)(H4,{children:[(0,Yt.jsx)(vt,{children:(0,Yt.jsxs)("div",{children:[(0,Yt.jsx)(Pt,{success:!!i.data,fail:!!i.error}),(0,Yt.jsx)(ag,{name:l.name,logoUrl:l.logoUrl})]})}),(0,Yt.jsxs)(pt,{children:[(0,Yt.jsx)("h3",{children:u}),(0,Yt.jsx)("p",{children:w})]})]}),(0,Yt.jsx)(fe,{}),(0,Yt.jsx)(J,{})]})},H4=sg.default.div`
1013
+ `;var Pi=require("react"),pg=y(require("styled-components"));var eu=require("react/jsx-runtime"),dg=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?(0,eu.jsx)("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):(0,eu.jsx)("span",{})};var Yt=require("react/jsx-runtime"),ug=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=P(),{crossAppAuthFlow:r,updateWallets:o,closePrivyModal:n}=W(),[i,a]=(0,Pi.useState)({}),l={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},s=ot,c=new b(`There was an issue connecting your ${l.name} account. Please try again.`),m=new rt(async v=>{if(!e?.crossAppAuth?.popup){a({error:c});return}try{let g=await r({appId:v,popup:e.crossAppAuth.popup});a({data:g})}catch(g){g instanceof b?a({error:g}):g instanceof pr?(e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),a({error:c})):a({error:c})}}),f=()=>{i.data&&(o(),e?.crossAppAuth?.onSuccess(i.data),n({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(i.error??new b("User canceled flow")),n({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=f,(0,Pi.useEffect)(()=>{l.id.length&&m.execute(l.id)},[l.id]),(0,Pi.useEffect)(()=>{if(!i.data)return;let v=setTimeout(f,s);return()=>clearTimeout(v)},[i.data]);let{title:u,subtitle:w}=(0,Pi.useMemo)(()=>i.data?{title:`Successfully connected with ${l.name}`,subtitle:"You're good to go!"}:i.error?{title:"Authentication failed",subtitle:i.error.message}:{title:`Connecting to ${l.name}`,subtitle:`Please check the pop-up from ${l.name} to continue`},[i,l.name]);return(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(x,{onClose:f}),(0,Yt.jsx)(se,{}),(0,Yt.jsxs)(K4,{children:[(0,Yt.jsx)(vt,{children:(0,Yt.jsxs)("div",{children:[(0,Yt.jsx)(At,{success:!!i.data,fail:!!i.error}),(0,Yt.jsx)(dg,{name:l.name,logoUrl:l.logoUrl})]})}),(0,Yt.jsxs)(pt,{children:[(0,Yt.jsx)("h3",{children:u}),(0,Yt.jsx)("p",{children:w})]})]}),(0,Yt.jsx)(ue,{}),(0,Yt.jsx)(J,{})]})},K4=pg.default.div`
1014
1014
  display: flex;
1015
1015
  flex-direction: column;
1016
1016
  align-items: center;
@@ -1018,7 +1018,7 @@ Resources:
1018
1018
  margin-left: 27px;
1019
1019
  margin-right: 27px;
1020
1020
  gap: 24px;
1021
- `;var mg=y(require("@heroicons/react/24/solid/XCircleIcon")),Ea=require("react"),fg=y(require("styled-components"));var Ps=y(require("styled-components")),wa=require("react/jsx-runtime"),Ic=()=>(0,wa.jsx)(G4,{children:(0,wa.jsxs)(V4,{children:[(0,wa.jsx)(q4,{}),(0,wa.jsx)(z4,{})]})}),G4=Ps.default.div`
1021
+ `;var gg=y(require("@heroicons/react/24/solid/XCircleIcon")),Sa=require("react"),vg=y(require("styled-components"));var As=y(require("styled-components")),Ea=require("react/jsx-runtime"),Wc=()=>(0,Ea.jsx)(j4,{children:(0,Ea.jsxs)(Y4,{children:[(0,Ea.jsx)(Z4,{}),(0,Ea.jsx)(Q4,{})]})}),j4=As.default.div`
1022
1022
  display: flex;
1023
1023
  justify-content: center;
1024
1024
  align-items: center;
@@ -1030,14 +1030,14 @@ Resources:
1030
1030
  @media all and (display-mode: standalone) {
1031
1031
  margin-bottom: 30px;
1032
1032
  }
1033
- `,V4=Ps.default.div`
1033
+ `,Y4=As.default.div`
1034
1034
  position: relative;
1035
1035
  height: 140px;
1036
1036
  width: 140px;
1037
1037
 
1038
1038
  opacity: 1;
1039
1039
  animation: fadein 200ms ease;
1040
- `,q4=Ps.default.div`
1040
+ `,Z4=As.default.div`
1041
1041
  position: absolute;
1042
1042
  top: 0;
1043
1043
  right: 0;
@@ -1050,7 +1050,7 @@ Resources:
1050
1050
  border: 4px solid var(--privy-color-accent-light);
1051
1051
  border-radius: 50%;
1052
1052
  }
1053
- `,z4=Ps.default.div`
1053
+ `,Q4=As.default.div`
1054
1054
  position: absolute;
1055
1055
  top: 0;
1056
1056
  right: 0;
@@ -1074,20 +1074,20 @@ Resources:
1074
1074
  transform: rotate(360deg);
1075
1075
  }
1076
1076
  }
1077
- `;var cg=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];var Ze=class extends Error{constructor(r,o){super(o);this.type=r}};function ba(e){let t=e.type;return typeof t=="string"&&cg.includes(t)}function $4(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function _i(e){return ba(e)&&e.type==="wallet_not_on_device"}function dg(e){return ba(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Bn(e){return!!(ba(e)&&e.type==="mfa_timeout")}function Hn(e){return!!(ba(e)&&e.type==="missing_or_invalid_mfa")}function Mc(e){return!!(ba(e)&&e.type==="mfa_verification_max_attempts_reached")}function Wc(e){return!!(ba(e)&&e.message.includes("code 429"))}function Oc(e){return!!($4(e)&&e.message==="MFA canceled")}function Xp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function Lc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r=!1,isResettingPassword:o=!1}){return r||t.length===1?Xp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function Nc(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function eu({api:e,provider:t}){let r=pi(),o=Ki(),n=await ji(r);try{return t==="icloud"?{url:(await e.post(Um,{client_type:"web"})).url}:{url:(await e.post(Dm,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(i){throw Ce(i)}}async function pg({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new b("User denied confirmation during OAuth flow");try{return(await e.post(Fm,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=Ce(i);throw a.privyErrorCode?new b(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}var Ir=require("react/jsx-runtime"),ug=1,hg=()=>{let{authenticated:e,user:t,getAccessToken:r}=$(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=W(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=A(),m=(0,Ea.useMemo)(()=>Date.now(),[]),[f,u]=(0,Ea.useState)(!1),{onCompleteNavigateTo:w,onFailure:v,shouldForceMFA:g,address:E}=l?.connectWallet,T=S=>{f||(u(!0),v(typeof S=="string"?new Error(S):S))};(0,Ea.useEffect)(()=>{let S=E?t?.linkedAccounts.find(M=>M.type==="wallet"&&M.walletClientType==="privy"&&M.address===E):xe(t),x;return!e||!S?T("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let M=await r();if(!M)return T("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:M,address:S.address}),g&&await i.verifyMfa({accessToken:M});let U=(Date.now()-m)/1e3;w==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&U<ug?x=setTimeout(()=>{a(w)},(ug-U)*1e3):a(w)}catch(U){if(_i(U)&&S.recoveryMethod==="privy"){let G=await r();if(!G)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:S.address}}),(await i?.recover({address:S.address,accessToken:G,recoveryMethod:S.recoveryMethod}))?.address||T(new Error("Unable to recover wallet")),w?a(w):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:S.address}}),a(w)}catch{T("An error has occurred, please try again.")}}else if(_i(U)&&S.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:S,onCompleteNavigateTo:w,onFailure:v},recoveryOAuthStatus:{provider:S.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let G=Nc(S.recoveryMethod);a(G)}else T(U)}})(),()=>clearTimeout(x)):void 0},[e,t,i]);let R=()=>{T("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=R,(0,Ir.jsxs)(Ir.Fragment,{children:[(0,Ir.jsx)(k,{onClose:R}),f?(0,Ir.jsxs)(Ir.Fragment,{children:[(0,Ir.jsxs)(Dr,{children:[(0,Ir.jsx)(mg.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Ir.jsx)(ke,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,Ir.jsx)(H,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,Ir.jsx)(Ic,{}),(0,Ir.jsx)(K4,{})]})},K4=fg.default.div`
1077
+ `;var mg=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];var Ze=class extends Error{constructor(r,o){super(o);this.type=r}};function Ta(e){let t=e.type;return typeof t=="string"&&mg.includes(t)}function J4(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function Ai(e){return Ta(e)&&e.type==="wallet_not_on_device"}function fg(e){return Ta(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Gn(e){return!!(Ta(e)&&e.type==="mfa_timeout")}function Vn(e){return!!(Ta(e)&&e.type==="missing_or_invalid_mfa")}function Oc(e){return!!(Ta(e)&&e.type==="mfa_verification_max_attempts_reached")}function Lc(e){return!!(Ta(e)&&e.message.includes("code 429"))}function Nc(e){return!!(J4(e)&&e.message==="MFA canceled")}function tu({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function Dc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r=!1,isResettingPassword:o=!1}){return r||t.length===1?tu({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function Uc(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function ru({api:e,provider:t}){let r=fi(),o=Yi(),n=await Zi(r);try{return t==="icloud"?{url:(await e.post(Hm,{client_type:"web"})).url}:{url:(await e.post(Bm,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(i){throw Ce(i)}}async function hg({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new b("User denied confirmation during OAuth flow");try{return(await e.post(Gm,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=Ce(i);throw a.privyErrorCode?new b(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}var Mr=require("react/jsx-runtime"),yg=1,Cg=()=>{let{authenticated:e,user:t,getAccessToken:r}=z(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=W(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=P(),m=(0,Sa.useMemo)(()=>Date.now(),[]),[f,u]=(0,Sa.useState)(!1),{onCompleteNavigateTo:w,onFailure:v,shouldForceMFA:g,address:E}=l?.connectWallet,S=_=>{f||(u(!0),v(typeof _=="string"?new Error(_):_))};(0,Sa.useEffect)(()=>{let _=E?t?.linkedAccounts.find(M=>M.type==="wallet"&&M.walletClientType==="privy"&&M.address===E):ke(t),k;return!e||!_?S("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let M=await r();if(!M)return S("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:M,address:_.address}),g&&await i.verifyMfa({accessToken:M});let U=(Date.now()-m)/1e3;w==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&U<yg?k=setTimeout(()=>{a(w)},(yg-U)*1e3):a(w)}catch(U){if(Ai(U)&&_.recoveryMethod==="privy"){let G=await r();if(!G)return S("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:_.address}}),(await i?.recover({address:_.address,accessToken:G,recoveryMethod:_.recoveryMethod}))?.address||S(new Error("Unable to recover wallet")),w?a(w):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:_.address}}),a(w)}catch{S("An error has occurred, please try again.")}}else if(Ai(U)&&_.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:_,onCompleteNavigateTo:w,onFailure:v},recoveryOAuthStatus:{provider:_.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let G=Uc(_.recoveryMethod);a(G)}else S(U)}})(),()=>clearTimeout(k)):void 0},[e,t,i]);let R=()=>{S("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=R,(0,Mr.jsxs)(Mr.Fragment,{children:[(0,Mr.jsx)(x,{onClose:R}),f?(0,Mr.jsxs)(Mr.Fragment,{children:[(0,Mr.jsxs)(Ur,{children:[(0,Mr.jsx)(gg.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Mr.jsx)(xe,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,Mr.jsx)(H,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,Mr.jsx)(Wc,{}),(0,Mr.jsx)(X4,{})]})},X4=vg.default.div`
1078
1078
  height: 44px;
1079
- `;var yg=y(require("@heroicons/react/24/solid/CheckCircleIcon")),gg=require("react");var po=require("react/jsx-runtime"),vg=()=>{let{user:e}=$(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=W(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=A(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,m=()=>{let f=xe(e);f?(o(),l(f)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,gg.useEffect)(()=>{let f=setTimeout(m,Il);return()=>clearTimeout(f)},[]),a.current=m,(0,po.jsxs)(po.Fragment,{children:[(0,po.jsx)(k,{onClose:m}),(0,po.jsx)(pe,{}),(0,po.jsxs)(Dr,{children:[(0,po.jsx)(yg.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,po.jsx)(ke,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,po.jsx)(fe,{}),(0,po.jsx)(j,{})]})};var bg=y(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),Eg=y(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),mn=require("react"),fn=y(require("styled-components"));var Re=require("react/jsx-runtime"),Tg=()=>{let[e,t]=(0,mn.useState)(null),{authenticated:r,user:o,getAccessToken:n}=$(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=W(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),m=xe(o)?.address,{onFailure:f,onSuccess:u,origin:w,appId:v,appClientId:g}=s.keyExport,E=R=>{i({shouldCallAuthOnSuccess:!1}),f(typeof R=="string"?new Error(R):R)},T=()=>{i({shouldCallAuthOnSuccess:!1}),u(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:m}})};return(0,mn.useEffect)(()=>{let R=xe(o);if(!r||!R)return E("User must be authenticated before exporting their wallet");n().then(t,E)},[r,o]),c.current=T,(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(k,{onClose:T}),(0,Re.jsxs)(Z4,{children:[(0,Re.jsxs)(ke,{icon:(0,Re.jsx)(Eg.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,Re.jsxs)(e5,{children:[(0,Re.jsx)(Y4,{style:{marginRight:6}}),Wt(m)]}),(0,Re.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,Re.jsxs)(Q4,{children:[(0,Re.jsxs)(Cg,{children:[(0,Re.jsx)(wg,{children:"1"}),(0,Re.jsxs)("span",{children:[(0,Re.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,Re.jsxs)(Cg,{children:[(0,Re.jsx)(wg,{children:"2"}),(0,Re.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,Re.jsx)("div",{style:{width:"100%"},children:e&&(0,Re.jsx)(j4,{origin:w,appId:v,appClientId:g,accessToken:e,clientAnalyticsId:l,address:m,dimensions:{height:"44px"}})}),(0,Re.jsxs)(t5,{children:[(0,Re.jsxs)("div",{children:[(0,Re.jsx)(bg.default,{viewBox:"0 0 20 18"}),(0,Re.jsx)("h4",{children:"Warning"})]}),(0,Re.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,Re.jsx)(j,{})]})};function j4(e){let[t,r]=(0,mn.useState)(e.dimensions.width),[o,n]=(0,mn.useState)(void 0),i=(0,mn.useRef)(null);return(0,mn.useEffect)(()=>{if(i.current&&t===void 0){let{width:l}=i.current.getBoundingClientRect();r(l)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,Re.jsx)("div",{ref:i,children:t&&(0,Re.jsxs)(J4,{children:[(0,Re.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:_l(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o},{token:e.accessToken})}),(0,Re.jsx)(X4,{children:"Loading..."})]})})}function Y4(e){return(0,Re.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,Re.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Z4=fn.default.div`
1079
+ `;var wg=y(require("@heroicons/react/24/solid/CheckCircleIcon")),bg=require("react");var uo=require("react/jsx-runtime"),Eg=()=>{let{user:e}=z(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=W(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=P(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,m=()=>{let f=ke(e);f?(o(),l(f)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,bg.useEffect)(()=>{let f=setTimeout(m,Ml);return()=>clearTimeout(f)},[]),a.current=m,(0,uo.jsxs)(uo.Fragment,{children:[(0,uo.jsx)(x,{onClose:m}),(0,uo.jsx)(se,{}),(0,uo.jsxs)(Ur,{children:[(0,uo.jsx)(wg.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,uo.jsx)(xe,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,uo.jsx)(ue,{}),(0,uo.jsx)(K,{})]})};var _g=y(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),Pg=y(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),fn=require("react"),hn=y(require("styled-components"));var Re=require("react/jsx-runtime"),Ag=()=>{let[e,t]=(0,fn.useState)(null),{authenticated:r,user:o,getAccessToken:n}=z(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=W(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=P(),m=ke(o)?.address,{onFailure:f,onSuccess:u,origin:w,appId:v,appClientId:g}=s.keyExport,E=R=>{i({shouldCallAuthOnSuccess:!1}),f(typeof R=="string"?new Error(R):R)},S=()=>{i({shouldCallAuthOnSuccess:!1}),u(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:m}})};return(0,fn.useEffect)(()=>{let R=ke(o);if(!r||!R)return E("User must be authenticated before exporting their wallet");n().then(t,E)},[r,o]),c.current=S,(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(x,{onClose:S}),(0,Re.jsxs)(r5,{children:[(0,Re.jsxs)(xe,{icon:(0,Re.jsx)(Pg.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,Re.jsxs)(a5,{children:[(0,Re.jsx)(t5,{style:{marginRight:6}}),Wt(m)]}),(0,Re.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,Re.jsxs)(o5,{children:[(0,Re.jsxs)(Tg,{children:[(0,Re.jsx)(Sg,{children:"1"}),(0,Re.jsxs)("span",{children:[(0,Re.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,Re.jsxs)(Tg,{children:[(0,Re.jsx)(Sg,{children:"2"}),(0,Re.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,Re.jsx)("div",{style:{width:"100%"},children:e&&(0,Re.jsx)(e5,{origin:w,appId:v,appClientId:g,accessToken:e,clientAnalyticsId:l,address:m,dimensions:{height:"44px"}})}),(0,Re.jsxs)(s5,{children:[(0,Re.jsxs)("div",{children:[(0,Re.jsx)(_g.default,{viewBox:"0 0 20 18"}),(0,Re.jsx)("h4",{children:"Warning"})]}),(0,Re.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,Re.jsx)(K,{})]})};function e5(e){let[t,r]=(0,fn.useState)(e.dimensions.width),[o,n]=(0,fn.useState)(void 0),i=(0,fn.useRef)(null);return(0,fn.useEffect)(()=>{if(i.current&&t===void 0){let{width:l}=i.current.getBoundingClientRect();r(l)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,Re.jsx)("div",{ref:i,children:t&&(0,Re.jsxs)(n5,{children:[(0,Re.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Pl(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o},{token:e.accessToken})}),(0,Re.jsx)(i5,{children:"Loading..."})]})})}function t5(e){return(0,Re.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,Re.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var r5=hn.default.div`
1080
1080
  display: flex;
1081
1081
  flex-direction: column;
1082
1082
  text-align: left;
1083
- `,Q4=fn.default.div`
1083
+ `,o5=hn.default.div`
1084
1084
  display: flex;
1085
1085
  flex-direction: column;
1086
1086
  gap: 24px;
1087
1087
  padding-bottom: 16px;
1088
1088
  margin-left: 11px;
1089
1089
  border-left: 1px solid var(--privy-color-foreground-4) !important;
1090
- `,Cg=fn.default.div`
1090
+ `,Tg=hn.default.div`
1091
1091
  display: flex;
1092
1092
  align-items: top;
1093
1093
  gap: 8px;
@@ -1096,7 +1096,7 @@ Resources:
1096
1096
  color: var(--privy-color-accent);
1097
1097
  text-decoration: underline;
1098
1098
  }
1099
- `,wg=fn.default.div`
1099
+ `,Sg=hn.default.div`
1100
1100
  display: flex;
1101
1101
  align-items: center;
1102
1102
  justify-content: center;
@@ -1110,11 +1110,11 @@ Resources:
1110
1110
  border-radius: 100%;
1111
1111
  background: var(--privy-color-background);
1112
1112
  color: var(--privy-color-accent);
1113
- `,J4=fn.default.div`
1113
+ `,n5=hn.default.div`
1114
1114
  overflow: visible;
1115
1115
  position: relative;
1116
1116
  height: 44px;
1117
- `,X4=fn.default.div`
1117
+ `,i5=hn.default.div`
1118
1118
  position: absolute;
1119
1119
  display: flex;
1120
1120
  align-items: center;
@@ -1126,7 +1126,7 @@ Resources:
1126
1126
  border-radius: var(--privy-border-radius-md);
1127
1127
  background-color: var(--privy-color-background-2);
1128
1128
  color: var(--privy-color-foreground-3);
1129
- `,e5=fn.default.div`
1129
+ `,a5=hn.default.div`
1130
1130
  display: flex;
1131
1131
  align-items: center;
1132
1132
  padding-top: 1px;
@@ -1139,7 +1139,7 @@ Resources:
1139
1139
  font-size: 12px;
1140
1140
  font-weight: 500;
1141
1141
  margin: auto;
1142
- `,t5=fn.default.div`
1142
+ `,s5=hn.default.div`
1143
1143
  border: 1px solid var(--privy-color-background-2) !important;
1144
1144
  border-radius: var(--privy-border-radius-md);
1145
1145
  padding: 16px;
@@ -1161,9 +1161,9 @@ Resources:
1161
1161
  color: var(--privy-color-error);
1162
1162
  }
1163
1163
  }
1164
- `;var Sg=y(require("@heroicons/react/24/solid/XCircleIcon")),As=require("react"),_g=y(require("styled-components"));var Dc=require("react");function Uc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=W(),o=(0,Dc.useRef)(!1);return{createWallet:(0,Dc.useCallback)(async i=>{let a=await Ie();if(!a)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),new Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let l=await r($i);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,c=new Promise((w,v)=>{setTimeout(()=>{v(new Error("walletProxy.create timed out."))},s)});if(!await Promise.race([l.create({accessToken:a,recoveryPassword:i}),c]))throw new Error("walletProxy.create did not send a response.");let f=await e();if(!f)throw new Error("Failed to refresh user.");let u=xe(f);if(!u)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:u.address}}),o.current=!0,u}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}var uo=require("react/jsx-runtime"),Pg=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=A(),[i,a]=(0,As.useState)(""),{embeddedWallets:l}=dt(),{authenticated:s}=$(),{closePrivyModal:c}=W(),{onSuccess:m,onFailure:f,callAuthOnSuccessOnClose:u}=o.createWallet,w=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:v}=Uc(),[g,E]=(0,As.useState)(null),T=new rt(async()=>{try{let S=await v();if(!S)return;E(S),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(S){a(S.message)}});(0,As.useEffect)(()=>{if(!s){r("LANDING"),f(new Error("User must be authenticated before creating a Privy wallet"));return}if(w){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let S=Lc({walletAction:"create",availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(S)}T.execute()},[w,s]);let R=()=>{g?(m(g),c({shouldCallAuthOnSuccess:u})):(f(new ur("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?(0,uo.jsxs)(uo.Fragment,{children:[(0,uo.jsx)(k,{closeable:!1}),(0,uo.jsxs)(Dr,{children:[(0,uo.jsx)(Sg.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,uo.jsx)(ke,{title:"Something went wrong",description:i})]}),(0,uo.jsx)(H,{onClick:R,children:"Close"}),(0,uo.jsx)(r5,{})]}):(0,uo.jsx)(Ic,{})},r5=_g.default.div`
1164
+ `;var xg=y(require("@heroicons/react/24/solid/XCircleIcon")),xs=require("react"),kg=y(require("styled-components"));var Fc=require("react");function Bc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=W(),o=(0,Fc.useRef)(!1);return{createWallet:(0,Fc.useCallback)(async i=>{let a=await Ie();if(!a)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),new Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let l=await r(ji);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,c=new Promise((w,v)=>{setTimeout(()=>{v(new Error("walletProxy.create timed out."))},s)});if(!await Promise.race([l.create({accessToken:a,recoveryPassword:i}),c]))throw new Error("walletProxy.create did not send a response.");let f=await e();if(!f)throw new Error("Failed to refresh user.");let u=ke(f);if(!u)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:u.address}}),o.current=!0,u}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}var mo=require("react/jsx-runtime"),Rg=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=P(),[i,a]=(0,xs.useState)(""),{embeddedWallets:l}=dt(),{authenticated:s}=z(),{closePrivyModal:c}=W(),{onSuccess:m,onFailure:f,callAuthOnSuccessOnClose:u}=o.createWallet,w=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:v}=Bc(),[g,E]=(0,xs.useState)(null),S=new rt(async()=>{try{let _=await v();if(!_)return;E(_),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(_){a(_.message)}});(0,xs.useEffect)(()=>{if(!s){r("LANDING"),f(new Error("User must be authenticated before creating a Privy wallet"));return}if(w){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let _=Dc({walletAction:"create",availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(_)}S.execute()},[w,s]);let R=()=>{g?(m(g),c({shouldCallAuthOnSuccess:u})):(f(new ur("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?(0,mo.jsxs)(mo.Fragment,{children:[(0,mo.jsx)(x,{closeable:!1}),(0,mo.jsxs)(Ur,{children:[(0,mo.jsx)(xg.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,mo.jsx)(xe,{title:"Something went wrong",description:i})]}),(0,mo.jsx)(H,{onClick:R,children:"Close"}),(0,mo.jsx)(l5,{})]}):(0,mo.jsx)(Wc,{})},l5=kg.default.div`
1165
1165
  height: 44px;
1166
- `;var Pi=require("react");var Ra=require("react");var Og=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Aa=require("react");var Ag=y(require("@heroicons/react/24/outline/ArrowPathIcon")),xg=y(require("@heroicons/react/24/outline/EyeIcon")),kg=y(require("@heroicons/react/24/outline/EyeSlashIcon")),Tt=y(require("styled-components"));var o5=Tt.css`
1166
+ `;var xi=require("react");var Ma=require("react");var Ug=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ka=require("react");var Ig=y(require("@heroicons/react/24/outline/ArrowPathIcon")),Mg=y(require("@heroicons/react/24/outline/EyeIcon")),Wg=y(require("@heroicons/react/24/outline/EyeSlashIcon")),Tt=y(require("styled-components"));var c5=Tt.css`
1167
1167
  font-size: 14px;
1168
1168
  font-style: normal;
1169
1169
  font-weight: 400;
@@ -1171,8 +1171,8 @@ Resources:
1171
1171
  letter-spacing: -0.008px;
1172
1172
  text-align: left;
1173
1173
  transition: color 0.1s ease-in;
1174
- `,Fc=Tt.default.span`
1175
- ${o5}
1174
+ `,Hc=Tt.default.span`
1175
+ ${c5}
1176
1176
  transition: color 0.1s ease-in;
1177
1177
  color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1178
1178
  text-transform: ${({error:e})=>e?"":"capitalize"};
@@ -1180,18 +1180,18 @@ Resources:
1180
1180
  &[aria-hidden='true'] {
1181
1181
  visibility: hidden;
1182
1182
  }
1183
- `,Gn=Tt.default.div`
1183
+ `,qn=Tt.default.div`
1184
1184
  display: flex;
1185
1185
  flex-direction: column;
1186
1186
  justify-content: center;
1187
1187
  flex-grow: 1;
1188
- `,Vn=(0,Tt.default)(H)`
1188
+ `,zn=(0,Tt.default)(H)`
1189
1189
  ${e=>e.hideAnimations&&Tt.css`
1190
1190
  && {
1191
1191
  transition: none;
1192
1192
  }
1193
1193
  `}
1194
- `,Rg=Tt.css`
1194
+ `,Og=Tt.css`
1195
1195
  && {
1196
1196
  width: 100%;
1197
1197
  border-width: 1px;
@@ -1206,8 +1206,8 @@ Resources:
1206
1206
  font-weight: 300;
1207
1207
  line-height: 22px; /* 137.5% */
1208
1208
  }
1209
- `,Ta=Tt.default.input`
1210
- ${Rg}
1209
+ `,_a=Tt.default.input`
1210
+ ${Og}
1211
1211
 
1212
1212
  &::placeholder {
1213
1213
  color: var(--privy-color-foreground-3);
@@ -1218,15 +1218,15 @@ Resources:
1218
1218
  overflow: hidden;
1219
1219
  text-overflow: ellipsis;
1220
1220
  white-space: nowrap;
1221
- `,Ig=Tt.default.div`
1222
- ${Rg}
1223
- `,qn=Tt.default.div`
1221
+ `,Lg=Tt.default.div`
1222
+ ${Og}
1223
+ `,$n=Tt.default.div`
1224
1224
  position: relative;
1225
1225
  width: 100%;
1226
1226
  display: flex;
1227
1227
  align-items: center;
1228
1228
  justify-content: ${({centered:e})=>e?"center":"space-between"};
1229
- `,zn=Tt.default.div`
1229
+ `,Kn=Tt.default.div`
1230
1230
  display: flex;
1231
1231
  flex-direction: column;
1232
1232
  align-items: center;
@@ -1248,12 +1248,12 @@ Resources:
1248
1248
  font-weight: 400;
1249
1249
  line-height: 20px;
1250
1250
  }
1251
- `,xs=Tt.default.div`
1251
+ `,ks=Tt.default.div`
1252
1252
  display: flex;
1253
1253
  flex-direction: column;
1254
1254
  gap: 10px;
1255
1255
  padding-bottom: 1rem;
1256
- `,ks=Tt.default.div`
1256
+ `,Rs=Tt.default.div`
1257
1257
  display: flex;
1258
1258
  text-align: left;
1259
1259
  align-items: center;
@@ -1273,13 +1273,13 @@ Resources:
1273
1273
  > :first-child {
1274
1274
  min-width: 24px;
1275
1275
  }
1276
- `,lR=Tt.default.div`
1276
+ `,yR=Tt.default.div`
1277
1277
  height: var(--privy-height-modal-full);
1278
1278
 
1279
1279
  @media (max-width: 440px) {
1280
1280
  height: var(--privy-height-modal-compact);
1281
1281
  }
1282
- `,tu=(0,Tt.default)(ws)`
1282
+ `,ou=(0,Tt.default)(bs)`
1283
1283
  display: flex;
1284
1284
  flex: 1;
1285
1285
  gap: 4px;
@@ -1291,7 +1291,7 @@ Resources:
1291
1291
  border-color: var(--privy-color-foreground-3);
1292
1292
  border-width: 1px;
1293
1293
  }
1294
- `,Sa=Tt.default.div`
1294
+ `,Pa=Tt.default.div`
1295
1295
  position: absolute;
1296
1296
  right: 0.5rem;
1297
1297
 
@@ -1299,7 +1299,7 @@ Resources:
1299
1299
  flex-direction: row;
1300
1300
  justify-content: space-around;
1301
1301
  align-items: center;
1302
- `,Mg=(0,Tt.default)(Ag.default)`
1302
+ `,Ng=(0,Tt.default)(Ig.default)`
1303
1303
  height: 1.25rem;
1304
1304
  width: 1.25rem;
1305
1305
  stroke: var(--privy-color-accent);
@@ -1308,7 +1308,7 @@ Resources:
1308
1308
  :active {
1309
1309
  stroke: var(--privy-color-accent-light);
1310
1310
  }
1311
- `,_a=(0,Tt.default)(kg.default)`
1311
+ `,Aa=(0,Tt.default)(Wg.default)`
1312
1312
  height: 1.25rem;
1313
1313
  width: 1.25rem;
1314
1314
  stroke: var(--privy-color-accent);
@@ -1317,7 +1317,7 @@ Resources:
1317
1317
  :active {
1318
1318
  stroke: var(--privy-color-accent-light);
1319
1319
  }
1320
- `,Pa=(0,Tt.default)(xg.default)`
1320
+ `,xa=(0,Tt.default)(Mg.default)`
1321
1321
  height: 1.25rem;
1322
1322
  width: 1.25rem;
1323
1323
  stroke: var(--privy-color-accent);
@@ -1326,7 +1326,7 @@ Resources:
1326
1326
  :active {
1327
1327
  stroke: var(--privy-color-accent-light);
1328
1328
  }
1329
- `,Wg=Tt.default.progress`
1329
+ `,Dg=Tt.default.progress`
1330
1330
  height: 4px;
1331
1331
  width: 100%;
1332
1332
  margin: 8px 0;
@@ -1342,7 +1342,7 @@ Resources:
1342
1342
  transition: all 0.1s ease-out;
1343
1343
  background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1344
1344
  }
1345
- `;var St=require("react/jsx-runtime"),Lg=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=(0,Aa.useState)(!0),[l,s]=(0,Aa.useState)(!1),[c,m]=(0,Aa.useState)(""),f=r===c;return(0,Aa.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,St.jsxs)(St.Fragment,{children:[(0,St.jsx)(k,{closeable:!1,backFn:n}),(0,St.jsx)(pe,{}),(0,St.jsxs)(Gn,{children:[(0,St.jsxs)(zn,{children:[(0,St.jsx)(Og.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,St.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,St.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,St.jsxs)(qn,{children:[(0,St.jsx)(Ta,{value:c,onChange:u=>m(u.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),(0,St.jsx)(Sa,{style:{right:"0.75rem"},children:i?(0,St.jsx)(_a,{onClick:()=>a(!1)}):(0,St.jsx)(Pa,{onClick:()=>a(!0)})})]}),(0,St.jsx)(Fc,{"aria-hidden":!l||f,error:!0,children:"Passwords do not match"})]}),(0,St.jsx)(Vn,{onClick:o,loading:t,disabled:!f,hideAnimations:e,children:"Continue"}),(0,St.jsx)(fe,{}),(0,St.jsx)(j,{})]})};var Fg=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Bg=require("react"),Hg=y(require("styled-components"));var xa=y(require("styled-components")),$n=require("react/jsx-runtime"),Ng=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>(0,$n.jsx)("label",{children:(0,$n.jsxs)(n5,{className:e,children:[(0,$n.jsx)(Ug,{checked:t,...o}),(0,$n.jsx)(i5,{color:r,checked:t,children:(0,$n.jsx)(Dg,{viewBox:"0 0 24 24",children:(0,$n.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})});var yR=xa.default.label`
1345
+ `;var St=require("react/jsx-runtime"),Fg=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=(0,ka.useState)(!0),[l,s]=(0,ka.useState)(!1),[c,m]=(0,ka.useState)(""),f=r===c;return(0,ka.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,St.jsxs)(St.Fragment,{children:[(0,St.jsx)(x,{closeable:!1,backFn:n}),(0,St.jsx)(se,{}),(0,St.jsxs)(qn,{children:[(0,St.jsxs)(Kn,{children:[(0,St.jsx)(Ug.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,St.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,St.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,St.jsxs)($n,{children:[(0,St.jsx)(_a,{value:c,onChange:u=>m(u.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),(0,St.jsx)(Pa,{style:{right:"0.75rem"},children:i?(0,St.jsx)(Aa,{onClick:()=>a(!1)}):(0,St.jsx)(xa,{onClick:()=>a(!0)})})]}),(0,St.jsx)(Hc,{"aria-hidden":!l||f,error:!0,children:"Passwords do not match"})]}),(0,St.jsx)(zn,{onClick:o,loading:t,disabled:!f,hideAnimations:e,children:"Continue"}),(0,St.jsx)(ue,{}),(0,St.jsx)(K,{})]})};var Vg=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),qg=require("react"),zg=y(require("styled-components"));var Ra=y(require("styled-components")),jn=require("react/jsx-runtime"),Bg=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>(0,jn.jsx)("label",{children:(0,jn.jsxs)(d5,{className:e,children:[(0,jn.jsx)(Gg,{checked:t,...o}),(0,jn.jsx)(p5,{color:r,checked:t,children:(0,jn.jsx)(Hg,{viewBox:"0 0 24 24",children:(0,jn.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})});var SR=Ra.default.label`
1346
1346
  && {
1347
1347
  cursor: pointer;
1348
1348
  display: flex;
@@ -1354,14 +1354,14 @@ Resources:
1354
1354
  border: 1px solid var(--privy-color-foreground-4);
1355
1355
  width: 100%;
1356
1356
  }
1357
- `,n5=xa.default.div`
1357
+ `,d5=Ra.default.div`
1358
1358
  display: inline-block;
1359
1359
  vertical-align: middle;
1360
- `,Dg=xa.default.svg`
1360
+ `,Hg=Ra.default.svg`
1361
1361
  fill: none;
1362
1362
  stroke: white;
1363
1363
  stroke-width: 3px;
1364
- `,Ug=xa.default.input.attrs({type:"checkbox"})`
1364
+ `,Gg=Ra.default.input.attrs({type:"checkbox"})`
1365
1365
  border: 0;
1366
1366
  clip: rect(0 0 0 0);
1367
1367
  clippath: inset(50%);
@@ -1372,7 +1372,7 @@ Resources:
1372
1372
  position: absolute;
1373
1373
  white-space: nowrap;
1374
1374
  width: 1px;
1375
- `,i5=xa.default.div`
1375
+ `,p5=Ra.default.div`
1376
1376
  display: inline-block;
1377
1377
  width: 18px;
1378
1378
  height: 18px;
@@ -1387,28 +1387,28 @@ Resources:
1387
1387
  border-width: 1px;
1388
1388
  }
1389
1389
 
1390
- ${Ug}:focus + & {
1390
+ ${Gg}:focus + & {
1391
1391
  box-shadow: 0 0 0 1px ${e=>e.color};
1392
1392
  }
1393
1393
 
1394
- ${Dg} {
1394
+ ${Hg} {
1395
1395
  visibility: ${e=>e.checked?"visible":"hidden"};
1396
1396
  }
1397
- `;var Ct=require("react/jsx-runtime"),Gg=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=(0,Bg.useState)(!1);return(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsx)(k,{closeable:!1,backFn:o}),(0,Ct.jsx)(pe,{}),(0,Ct.jsxs)(Gn,{children:[(0,Ct.jsxs)(zn,{children:[(0,Ct.jsx)(Fg.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,Ct.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,Ct.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,Ct.jsx)(xs,{children:(0,Ct.jsxs)(ks,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[(0,Ct.jsx)(Ng,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),(0,Ct.jsx)(Ct.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),(0,Ct.jsxs)(a5,{children:[n.initiatedBy==="user"&&(0,Ct.jsx)(_o,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,Ct.jsx)(Vn,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,Ct.jsx)(fe,{}),(0,Ct.jsx)(j,{})]})},a5=Hg.default.div`
1397
+ `;var Ct=require("react/jsx-runtime"),$g=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=(0,qg.useState)(!1);return(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsx)(x,{closeable:!1,backFn:o}),(0,Ct.jsx)(se,{}),(0,Ct.jsxs)(qn,{children:[(0,Ct.jsxs)(Kn,{children:[(0,Ct.jsx)(Vg.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,Ct.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,Ct.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,Ct.jsx)(ks,{children:(0,Ct.jsxs)(Rs,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[(0,Ct.jsx)(Bg,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),(0,Ct.jsx)(Ct.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),(0,Ct.jsxs)(u5,{children:[n.initiatedBy==="user"&&(0,Ct.jsx)(Po,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,Ct.jsx)(zn,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,Ct.jsx)(ue,{}),(0,Ct.jsx)(K,{})]})},u5=zg.default.div`
1398
1398
  display: flex;
1399
1399
  gap: 10px;
1400
- `;var Qg=y(require("@heroicons/react/24/outline/KeyIcon")),ru=y(require("@heroicons/react/24/solid/CheckCircleIcon")),hn=require("react"),ou=y(require("styled-components"));var Vg=y(require("fast-password-entropy")),qg=y(require("secure-password-utilities")),zg=require("secure-password-utilities/wordlists"),s5=95,l5=8,c5=3,d5=.3,p5=/[a-z]/,u5=/[A-Z]/,m5=/[0-9]/,f5="a-zA-Z0-9",$g="!@#$%^&*()\\-_+.",Kg=`${f5}${$g}`,h5=new RegExp(`[${$g}]`),y5=new RegExp(`[${Kg}]`),jg=new RegExp(`^[${Kg}]{6,}$`),Yg=(e="")=>{let t=e.split("").filter(r=>!y5.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},Bc=()=>qg.generatePassphrase(4,zg.DEFAULT_WORDLIST);function g5(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function v5(e){if(e.length<l5)return 0;let t=0;p5.test(e)&&(t+=1),u5.test(e)&&(t+=1),m5.test(e)&&(t+=1),h5.test(e)&&(t+=1);let r=t/c5;return Math.max(0,Math.min(1,r))}function C5(e=""){let t=v5(e),r=(0,Vg.default)(e)/s5;return(t*d5+r)/2}function Zg(e=""){let t=C5(e);return{value:t,label:g5(t)}}var Ve=require("react/jsx-runtime"),Jg=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:c})=>{let[m,f]=(0,hn.useState)(!1),[u,w]=(0,hn.useState)(!1);(0,hn.useEffect)(()=>{r&&!u&&w(!0)},[r]);let v=(0,hn.useMemo)(()=>u?(r?.length||0)<6?"Password must be at least 6 characters":jg.test(r||"")?null:`Invalid characters used ( ${Yg(r).join(" ")} )`:null,[r,u]),g=(0,hn.useMemo)(()=>v?{value:0,label:"Weak"}:Zg(r),[r,v]),E=(0,hn.useMemo)(()=>!!(!r?.length||v),[v,r]);return(0,Ve.jsxs)(Ve.Fragment,{children:[(0,Ve.jsx)(k,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),(0,Ve.jsx)(pe,{}),(0,Ve.jsxs)(Gn,{children:[(0,Ve.jsxs)(zn,{children:[(0,Ve.jsx)(Qg.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ve.jsxs)("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),(0,Ve.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,Ve.jsxs)(qn,{children:[(0,Ve.jsx)(Ta,{value:r,onChange:T=>s(T.target.value),placeholder:"enter or generate a strong password",type:m?"password":"text",style:{paddingRight:"3.8rem"}}),(0,Ve.jsxs)(Sa,{style:{width:"3.5rem"},children:[m?(0,Ve.jsx)(_a,{onClick:()=>f(!1)}):(0,Ve.jsx)(Pa,{onClick:()=>f(!0)}),(0,Ve.jsx)(Mg,{onClick:c})]})]}),(0,Ve.jsx)(Wg,{value:g.value===0?.01:g.value,label:g.label}),(0,Ve.jsx)(Fc,{error:!!v,children:v||`Password Strength: ${u?g.label:"--"}`}),(0,Ve.jsxs)(b5,{children:[(0,Ve.jsx)(w5,{children:(0,Ve.jsxs)(xs,{children:[(0,Ve.jsxs)(ks,{children:[(0,Ve.jsx)(ru.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,Ve.jsxs)(ks,{children:[(0,Ve.jsx)(ru.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),(0,Ve.jsx)(Vn,{onClick:i,loading:t,disabled:E,hideAnimations:e,children:"Continue"})]})]}),(0,Ve.jsx)(fe,{}),(0,Ve.jsx)(j,{})]})},w5=(0,ou.default)(xs)`
1400
+ `;var t1=y(require("@heroicons/react/24/outline/KeyIcon")),nu=y(require("@heroicons/react/24/solid/CheckCircleIcon")),yn=require("react"),iu=y(require("styled-components"));var Kg=y(require("fast-password-entropy")),jg=y(require("secure-password-utilities")),Yg=require("secure-password-utilities/wordlists"),m5=95,f5=8,h5=3,y5=.3,g5=/[a-z]/,v5=/[A-Z]/,C5=/[0-9]/,w5="a-zA-Z0-9",Zg="!@#$%^&*()\\-_+.",Qg=`${w5}${Zg}`,b5=new RegExp(`[${Zg}]`),E5=new RegExp(`[${Qg}]`),Jg=new RegExp(`^[${Qg}]{6,}$`),Xg=(e="")=>{let t=e.split("").filter(r=>!E5.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},Gc=()=>jg.generatePassphrase(4,Yg.DEFAULT_WORDLIST);function T5(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function S5(e){if(e.length<f5)return 0;let t=0;g5.test(e)&&(t+=1),v5.test(e)&&(t+=1),C5.test(e)&&(t+=1),b5.test(e)&&(t+=1);let r=t/h5;return Math.max(0,Math.min(1,r))}function _5(e=""){let t=S5(e),r=(0,Kg.default)(e)/m5;return(t*y5+r)/2}function e1(e=""){let t=_5(e);return{value:t,label:T5(t)}}var Ve=require("react/jsx-runtime"),r1=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:c})=>{let[m,f]=(0,yn.useState)(!1),[u,w]=(0,yn.useState)(!1);(0,yn.useEffect)(()=>{r&&!u&&w(!0)},[r]);let v=(0,yn.useMemo)(()=>u?(r?.length||0)<6?"Password must be at least 6 characters":Jg.test(r||"")?null:`Invalid characters used ( ${Xg(r).join(" ")} )`:null,[r,u]),g=(0,yn.useMemo)(()=>v?{value:0,label:"Weak"}:e1(r),[r,v]),E=(0,yn.useMemo)(()=>!!(!r?.length||v),[v,r]);return(0,Ve.jsxs)(Ve.Fragment,{children:[(0,Ve.jsx)(x,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),(0,Ve.jsx)(se,{}),(0,Ve.jsxs)(qn,{children:[(0,Ve.jsxs)(Kn,{children:[(0,Ve.jsx)(t1.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ve.jsxs)("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),(0,Ve.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,Ve.jsxs)($n,{children:[(0,Ve.jsx)(_a,{value:r,onChange:S=>s(S.target.value),placeholder:"enter or generate a strong password",type:m?"password":"text",style:{paddingRight:"3.8rem"}}),(0,Ve.jsxs)(Pa,{style:{width:"3.5rem"},children:[m?(0,Ve.jsx)(Aa,{onClick:()=>f(!1)}):(0,Ve.jsx)(xa,{onClick:()=>f(!0)}),(0,Ve.jsx)(Ng,{onClick:c})]})]}),(0,Ve.jsx)(Dg,{value:g.value===0?.01:g.value,label:g.label}),(0,Ve.jsx)(Hc,{error:!!v,children:v||`Password Strength: ${u?g.label:"--"}`}),(0,Ve.jsxs)(A5,{children:[(0,Ve.jsx)(P5,{children:(0,Ve.jsxs)(ks,{children:[(0,Ve.jsxs)(Rs,{children:[(0,Ve.jsx)(nu.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,Ve.jsxs)(Rs,{children:[(0,Ve.jsx)(nu.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),(0,Ve.jsx)(zn,{onClick:i,loading:t,disabled:E,hideAnimations:e,children:"Continue"})]})]}),(0,Ve.jsx)(ue,{}),(0,Ve.jsx)(K,{})]})},P5=(0,iu.default)(ks)`
1401
1401
  flex: 1;
1402
1402
  padding-top: 1rem;
1403
- `,b5=ou.default.div`
1403
+ `,A5=iu.default.div`
1404
1404
  display: flex;
1405
1405
  flex-direction: column;
1406
1406
  height: 100%;
1407
- `;var Xg=y(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),e1=y(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),t1=y(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),r1=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Rs=require("react");var Qe=require("react/jsx-runtime"),o1=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=(0,Rs.useState)(!1),s=(0,Rs.useCallback)(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=(0,Rs.useCallback)(()=>{let m=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),u=new Blob([E5(r,o)],{type:"text/plain"}),w=URL.createObjectURL(u);m.href=w,m.target="_blank",m.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(m),m.click(),setTimeout(()=>{m.remove(),URL.revokeObjectURL(w)},5e3)},[o]);return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(k,{backFn:i,closeable:!1}),(0,Qe.jsx)(pe,{}),(0,Qe.jsxs)(Gn,{children:[(0,Qe.jsxs)(zn,{children:[(0,Qe.jsx)(r1.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Qe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,Qe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),(0,Qe.jsx)(qn,{centered:!0,children:(0,Qe.jsx)(Ig,{children:o})}),(0,Qe.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,Qe.jsx)(tu,{onClick:s,children:a?(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(e1.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(t1.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,Qe.jsxs)(tu,{onClick:c,children:[(0,Qe.jsx)(Xg.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,Qe.jsx)(Vn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,Qe.jsx)(fe,{}),(0,Qe.jsx)(j,{})]})},E5=(e,t)=>`Your wallet recovery password for ${e} is
1407
+ `;var o1=y(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),n1=y(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),i1=y(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),a1=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Is=require("react");var Qe=require("react/jsx-runtime"),s1=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=(0,Is.useState)(!1),s=(0,Is.useCallback)(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=(0,Is.useCallback)(()=>{let m=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),u=new Blob([x5(r,o)],{type:"text/plain"}),w=URL.createObjectURL(u);m.href=w,m.target="_blank",m.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(m),m.click(),setTimeout(()=>{m.remove(),URL.revokeObjectURL(w)},5e3)},[o]);return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(x,{backFn:i,closeable:!1}),(0,Qe.jsx)(se,{}),(0,Qe.jsxs)(qn,{children:[(0,Qe.jsxs)(Kn,{children:[(0,Qe.jsx)(a1.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Qe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,Qe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),(0,Qe.jsx)($n,{centered:!0,children:(0,Qe.jsx)(Lg,{children:o})}),(0,Qe.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,Qe.jsx)(ou,{onClick:s,children:a?(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(n1.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(i1.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,Qe.jsxs)(ou,{onClick:c,children:[(0,Qe.jsx)(o1.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,Qe.jsx)(zn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,Qe.jsx)(ue,{}),(0,Qe.jsx)(K,{})]})},x5=(e,t)=>`Your wallet recovery password for ${e} is
1408
1408
 
1409
1409
  ${t}
1410
1410
 
1411
- You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var n1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),i1=y(require("@heroicons/react/24/solid/XCircleIcon"));var lr=require("react/jsx-runtime"),a1=({error:e,onClose:t})=>(0,lr.jsxs)(lr.Fragment,{children:[(0,lr.jsx)(k,{closeable:!1}),(0,lr.jsx)(pe,{}),e?(0,lr.jsxs)(Dr,{children:[(0,lr.jsx)(i1.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,lr.jsx)(ke,{title:"Something went wrong",description:e})]}):(0,lr.jsxs)(Dr,{children:[(0,lr.jsx)(n1.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,lr.jsx)(ke,{title:"Success"})]}),(0,lr.jsx)(H,{onClick:t,children:"Close"}),(0,lr.jsx)(fe,{}),(0,lr.jsx)(j,{})]});var s1=require("react"),T5=(e,t)=>{switch(e){case"creating":return t==="back"?e:"saving";case"saving":return t==="back"?"creating":"confirming";case"confirming":return t==="back"?"saving":"finalizing";case"finalizing":return t==="back"?"confirming":"done";default:return e}},l1=()=>{let[e,t]=(0,s1.useReducer)(T5,"creating");return{send:t,state:e}};var ka=require("react/jsx-runtime"),Hc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=A(),{send:n,state:i}=l1(),a=(0,Ra.useCallback)(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);(0,Ra.useEffect)(()=>{let c;return i==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),ot)),()=>{c&&clearTimeout(c)}},[i,t.config.initiatedBy,t.onClose]);let l=(0,Ra.useCallback)(()=>{n("back")},[n]),s=(0,Ra.useCallback)(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?(0,ka.jsx)(Jg,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?(0,ka.jsx)(o1,{...t,onSubmit:a,onBack:l}):i==="confirming"?(0,ka.jsx)(Lg,{...t,onSubmit:a,onBack:l}):i==="finalizing"?(0,ka.jsx)(Gg,{...t,onSubmit:a,onBack:l}):i==="done"?(0,ka.jsx)(a1,{...t,onSubmit:a}):null};var d1=require("react/jsx-runtime"),c1=()=>{let[e,t]=(0,Pi.useState)(null),[r,o]=(0,Pi.useState)(!1),[n,i]=(0,Pi.useState)(null),[a,l]=(0,Pi.useState)(""),{authenticated:s,getAccessToken:c,user:m}=$(),{walletProxy:f,refreshUser:u,closePrivyModal:w,createAnalyticsEvent:v}=W(),{app:g,navigate:E,data:T,onUserCloseViaDialogOrKeybindRef:R}=A(),{onSuccess:S,onFailure:x}=T.createWallet,I=xe(m),M=e?.recoveryMethod==="user-passcode",U=I?.recoveryMethod==="user-passcode";(0,Pi.useEffect)(()=>{s||(E("LANDING"),x(new ml("User must be authenticated before setting a password on a Privy wallet")))},[s]);let G=()=>{if(n){x(n),w({shouldCallAuthOnSuccess:!1});return}if(!M){x(new ur("Exited before password was added to wallet")),w({shouldCallAuthOnSuccess:!1});return}S(e),w({shouldCallAuthOnSuccess:!1})};R.current=G;let Y=async()=>{let L=await c();if(L&&I?.address&&a&&f)try{if(v({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:I.address,recoveryMethod:"user-passcode",isResettingPassword:U}}),!(await f.setRecovery({accessToken:L,address:I.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new ur("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:I.address,recoveryMethod:"user-passcode",isResettingPassword:U,reason:"error setting password"}});return}let O=await u(),Me=xe(O);if(!Me){i(new ur("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:I.address,recoveryMethod:"user-passcode",isResettingPassword:U,reason:"wallet disconnected"}});return}t(Me),v({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:I.address,recoveryMethod:"user-passcode",isResettingPassword:U}})}catch(F){console.warn(F),i(F instanceof Error?F:new Error("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:I.address,reason:F}})}},Z=async()=>{M?(S(e),w({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await Y(),o(!1))};return(0,d1.jsx)(Hc,{appName:g?.name||"privy",config:{initiatedBy:"user",onCancel:G},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:U,onPasswordGenerate:()=>l(Bc()),onPasswordChange:l,onSubmit:Z,onClose:G})};var p1=y(require("@heroicons/react/24/outline/UserCircleIcon")),u1=y(require("@heroicons/react/24/solid/LockClosedIcon"));var Zt=require("react/jsx-runtime"),m1=()=>{let{closePrivyModal:e}=W(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=A(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new ur("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)(k,{onClose:l}),(0,Zt.jsx)(pe,{}),(0,Zt.jsxs)(Dr,{children:[(0,Zt.jsxs)(Cy,{children:[(0,Zt.jsx)(p1.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,Zt.jsx)(wy,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,Zt.jsx)(u1.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,Zt.jsxs)(ke,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,Zt.jsx)("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),(0,Zt.jsx)(H,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,Zt.jsx)(fe,{}),(0,Zt.jsx)(j,{})]})};var f1=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),h1=y(require("@heroicons/react/24/outline/PhoneIcon")),nu=y(require("styled-components"));var Rt=require("react/jsx-runtime"),S5=e=>{let t=(0,Rt.jsx)(f1.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof b)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof Ze&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,Rt.jsx)(h1.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof wt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,Rt.jsx)(Tc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,Rt.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,Rt.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:t};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof pr&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},y1=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=A(),i=r?.errorModalData?.previousScreen||(o===n?void 0:o);return(0,Rt.jsx)(Ai,{error:r?.errorModalData?.error||new Error,backFn:()=>i?e(i,!1):t(),onClick:()=>e(i||"LANDING",!1)})},Ai=({error:e,backFn:t,onClick:r})=>{let{reset:o}=We(),n=S5(e),i=()=>{e instanceof wt&&e.privyErrorCode==="invalid_captcha"&&o(),r?.()};return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(k,{backFn:t}),(0,Rt.jsxs)(_5,{children:[(0,Rt.jsx)(vt,{children:(0,Rt.jsxs)("div",{children:[(0,Rt.jsx)(Ec,{color:"var(--privy-color-error)"}),n.icon]})}),(0,Rt.jsxs)(P5,{children:[(0,Rt.jsx)("h3",{children:n.title}),(0,Rt.jsx)("p",{children:n.detail})]}),(0,Rt.jsx)(H,{color:"var(--privy-color-error)",onClick:i,children:n.ctaText})]})]})},_5=nu.default.div`
1411
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var l1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),c1=y(require("@heroicons/react/24/solid/XCircleIcon"));var lr=require("react/jsx-runtime"),d1=({error:e,onClose:t})=>(0,lr.jsxs)(lr.Fragment,{children:[(0,lr.jsx)(x,{closeable:!1}),(0,lr.jsx)(se,{}),e?(0,lr.jsxs)(Ur,{children:[(0,lr.jsx)(c1.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,lr.jsx)(xe,{title:"Something went wrong",description:e})]}):(0,lr.jsxs)(Ur,{children:[(0,lr.jsx)(l1.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,lr.jsx)(xe,{title:"Success"})]}),(0,lr.jsx)(H,{onClick:t,children:"Close"}),(0,lr.jsx)(ue,{}),(0,lr.jsx)(K,{})]});var p1=require("react"),k5=(e,t)=>{switch(e){case"creating":return t==="back"?e:"saving";case"saving":return t==="back"?"creating":"confirming";case"confirming":return t==="back"?"saving":"finalizing";case"finalizing":return t==="back"?"confirming":"done";default:return e}},u1=()=>{let[e,t]=(0,p1.useReducer)(k5,"creating");return{send:t,state:e}};var Ia=require("react/jsx-runtime"),Vc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=P(),{send:n,state:i}=u1(),a=(0,Ma.useCallback)(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);(0,Ma.useEffect)(()=>{let c;return i==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),ot)),()=>{c&&clearTimeout(c)}},[i,t.config.initiatedBy,t.onClose]);let l=(0,Ma.useCallback)(()=>{n("back")},[n]),s=(0,Ma.useCallback)(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?(0,Ia.jsx)(r1,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?(0,Ia.jsx)(s1,{...t,onSubmit:a,onBack:l}):i==="confirming"?(0,Ia.jsx)(Fg,{...t,onSubmit:a,onBack:l}):i==="finalizing"?(0,Ia.jsx)($g,{...t,onSubmit:a,onBack:l}):i==="done"?(0,Ia.jsx)(d1,{...t,onSubmit:a}):null};var f1=require("react/jsx-runtime"),m1=()=>{let[e,t]=(0,xi.useState)(null),[r,o]=(0,xi.useState)(!1),[n,i]=(0,xi.useState)(null),[a,l]=(0,xi.useState)(""),{authenticated:s,getAccessToken:c,user:m}=z(),{walletProxy:f,refreshUser:u,closePrivyModal:w,createAnalyticsEvent:v}=W(),{app:g,navigate:E,data:S,onUserCloseViaDialogOrKeybindRef:R}=P(),{onSuccess:_,onFailure:k}=S.createWallet,I=ke(m),M=e?.recoveryMethod==="user-passcode",U=I?.recoveryMethod==="user-passcode";(0,xi.useEffect)(()=>{s||(E("LANDING"),k(new fl("User must be authenticated before setting a password on a Privy wallet")))},[s]);let G=()=>{if(n){k(n),w({shouldCallAuthOnSuccess:!1});return}if(!M){k(new ur("Exited before password was added to wallet")),w({shouldCallAuthOnSuccess:!1});return}_(e),w({shouldCallAuthOnSuccess:!1})};R.current=G;let Y=async()=>{let L=await c();if(L&&I?.address&&a&&f)try{if(v({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:I.address,recoveryMethod:"user-passcode",isResettingPassword:U}}),!(await f.setRecovery({accessToken:L,address:I.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new ur("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:I.address,recoveryMethod:"user-passcode",isResettingPassword:U,reason:"error setting password"}});return}let O=await u(),Me=ke(O);if(!Me){i(new ur("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:I.address,recoveryMethod:"user-passcode",isResettingPassword:U,reason:"wallet disconnected"}});return}t(Me),v({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:I.address,recoveryMethod:"user-passcode",isResettingPassword:U}})}catch(F){console.warn(F),i(F instanceof Error?F:new Error("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:I.address,reason:F}})}},Z=async()=>{M?(_(e),w({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await Y(),o(!1))};return(0,f1.jsx)(Vc,{appName:g?.name||"privy",config:{initiatedBy:"user",onCancel:G},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:U,onPasswordGenerate:()=>l(Gc()),onPasswordChange:l,onSubmit:Z,onClose:G})};var h1=y(require("@heroicons/react/24/outline/UserCircleIcon")),y1=y(require("@heroicons/react/24/solid/LockClosedIcon"));var Zt=require("react/jsx-runtime"),g1=()=>{let{closePrivyModal:e}=W(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=P(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new ur("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)(x,{onClose:l}),(0,Zt.jsx)(se,{}),(0,Zt.jsxs)(Ur,{children:[(0,Zt.jsxs)(Ty,{children:[(0,Zt.jsx)(h1.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,Zt.jsx)(Sy,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,Zt.jsx)(y1.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,Zt.jsxs)(xe,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,Zt.jsx)("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),(0,Zt.jsx)(H,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,Zt.jsx)(ue,{}),(0,Zt.jsx)(K,{})]})};var v1=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),C1=y(require("@heroicons/react/24/outline/PhoneIcon")),au=y(require("styled-components"));var It=require("react/jsx-runtime"),R5=e=>{let t=(0,It.jsx)(v1.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof b)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof Ze&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,It.jsx)(C1.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof wt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,It.jsx)(_c,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,It.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,It.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:t};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof pr&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},w1=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=P(),i=r?.errorModalData?.previousScreen||(o===n?void 0:o);return(0,It.jsx)(ki,{error:r?.errorModalData?.error||new Error,backFn:()=>i?e(i,!1):t(),onClick:()=>e(i||"LANDING",!1)})},ki=({error:e,backFn:t,onClick:r})=>{let{reset:o}=We(),n=R5(e),i=()=>{e instanceof wt&&e.privyErrorCode==="invalid_captcha"&&o(),r?.()};return(0,It.jsxs)(It.Fragment,{children:[(0,It.jsx)(x,{backFn:t}),(0,It.jsxs)(I5,{children:[(0,It.jsx)(vt,{children:(0,It.jsxs)("div",{children:[(0,It.jsx)(Sc,{color:"var(--privy-color-error)"}),n.icon]})}),(0,It.jsxs)(M5,{children:[(0,It.jsx)("h3",{children:n.title}),(0,It.jsx)("p",{children:n.detail})]}),(0,It.jsx)(H,{color:"var(--privy-color-error)",onClick:i,children:n.ctaText})]})]})},I5=au.default.div`
1412
1412
  display: flex;
1413
1413
  flex-direction: column;
1414
1414
  align-items: center;
@@ -1416,11 +1416,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1416
1416
  gap: 24px;
1417
1417
  width: 100%;
1418
1418
  padding-bottom: 16px;
1419
- `,P5=nu.default.div`
1419
+ `,M5=au.default.div`
1420
1420
  display: flex;
1421
1421
  flex-direction: column;
1422
1422
  gap: 8px;
1423
- `;var yn=require("react"),Ms=require("react-device-detect"),lu=y(require("styled-components"));var v1=require("react"),C1=y(require("styled-components"));var iu=require("react/jsx-runtime"),Ia=({style:e,color:t,...r})=>(0,iu.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:(0,iu.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var Gc=require("react/jsx-runtime"),g1=({color:e,...t})=>(0,Gc.jsx)("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:(0,Gc.jsx)("g",{children:(0,Gc.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});var Is=require("react/jsx-runtime"),Kn=e=>{let[t,r]=(0,v1.useState)(!1);return(0,Is.jsxs)(A5,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,Is.jsx)(Ia,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,Is.jsx)(g1,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},A5=C1.default.button`
1423
+ `;var gn=require("react"),Ws=require("react-device-detect"),du=y(require("styled-components"));var E1=require("react"),T1=y(require("styled-components"));var su=require("react/jsx-runtime"),Wa=({style:e,color:t,...r})=>(0,su.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:(0,su.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var qc=require("react/jsx-runtime"),b1=({color:e,...t})=>(0,qc.jsx)("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:(0,qc.jsx)("g",{children:(0,qc.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});var Ms=require("react/jsx-runtime"),Yn=e=>{let[t,r]=(0,E1.useState)(!1);return(0,Ms.jsxs)(W5,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,Ms.jsx)(Wa,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,Ms.jsx)(b1,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},W5=T1.default.button`
1424
1424
  display: flex;
1425
1425
  align-items: center;
1426
1426
  gap: 6px;
@@ -1458,7 +1458,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1458
1458
  width: 14px;
1459
1459
  height: 14px;
1460
1460
  }
1461
- `;var w1=require("react"),b1=y(require("styled-components")),E1=require("react/jsx-runtime"),Vc=e=>{let[t,r]=(0,w1.useState)(!1);return(0,E1.jsx)(x5,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},x5=b1.default.a`
1461
+ `;var S1=require("react"),_1=y(require("styled-components")),P1=require("react/jsx-runtime"),zc=e=>{let[t,r]=(0,S1.useState)(!1);return(0,P1.jsx)(O5,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},O5=_1.default.a`
1462
1462
  display: flex;
1463
1463
  align-items: center;
1464
1464
  gap: 6px;
@@ -1496,7 +1496,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1496
1496
  width: 14px;
1497
1497
  height: 14px;
1498
1498
  }
1499
- `;var S1=y(require("qrcode")),_1=y(require("react")),P1=y(require("styled-components"));var au=require("react/jsx-runtime"),T1=()=>(0,au.jsx)("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:(0,au.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var st=require("react/jsx-runtime"),Br=7,su=(e,t,r,o,n)=>{for(let i=t;i<t+o;i++)for(let a=r;a<r+n;a++){let l=e?.[a];l&&l[i]&&(l[i]=0)}return e},k5=e=>{let t=S1.default.create(e,{errorCorrectionLevel:"high"}).modules,r=of(Array.from(t.data),t.size);return r=su(r,0,0,Br,Br),r=su(r,r.length-Br,0,Br,Br),r=su(r,0,r.length-Br,Br,Br),r},R5=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>(0,st.jsx)(st.Fragment,{children:[0,1,2].map(i=>(0,st.jsx)("circle",{r:r*(Br-i*2)/2,cx:e+r*Br/2,cy:t+r*Br/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),I5=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Br)*e,0],[0,(t-Br)*e]];return(0,st.jsx)(st.Fragment,{children:n.map(([i,a])=>(0,st.jsx)(R5,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},M5=({matrix:e,cellSize:t,color:r})=>(0,st.jsx)(st.Fragment,{children:e.map((i,a)=>i.map((l,s)=>l?(0,st.jsx)("rect",{height:t-.2*2,width:t-.2*2,x:a*t+t*(.2/2),y:s*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${a}-${s}`):(0,st.jsx)(_1.default.Fragment,{},`circle-${a}-${s}`)))}),W5=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return(0,st.jsx)(st.Fragment,{});let i=t*(o||.15),a=Math.floor(t/2-i/2),l=Math.floor(t/2+i/2);(l-a)%2!==t%2&&(l+=1);let s=(l-a)*e,c=.1,m=s-s*c*2,f=r,u=a*e;return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),(0,st.jsx)(f,{x:u+s*c,y:u+s*c,height:m,width:m})]})},O5=e=>{let t=e.outputSize,r=k5(e.url),o=t/r.length;return(0,st.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,st.jsx)(M5,{matrix:r,cellSize:o,color:e.fgColor}),(0,st.jsx)(I5,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,st.jsx)(W5,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},L5=P1.default.div`
1499
+ `;var x1=y(require("qrcode")),k1=y(require("react")),R1=y(require("styled-components"));var lu=require("react/jsx-runtime"),A1=()=>(0,lu.jsx)("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:(0,lu.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var st=require("react/jsx-runtime"),Hr=7,cu=(e,t,r,o,n)=>{for(let i=t;i<t+o;i++)for(let a=r;a<r+n;a++){let l=e?.[a];l&&l[i]&&(l[i]=0)}return e},L5=e=>{let t=x1.default.create(e,{errorCorrectionLevel:"high"}).modules,r=sf(Array.from(t.data),t.size);return r=cu(r,0,0,Hr,Hr),r=cu(r,r.length-Hr,0,Hr,Hr),r=cu(r,0,r.length-Hr,Hr,Hr),r},N5=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>(0,st.jsx)(st.Fragment,{children:[0,1,2].map(i=>(0,st.jsx)("circle",{r:r*(Hr-i*2)/2,cx:e+r*Hr/2,cy:t+r*Hr/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),D5=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Hr)*e,0],[0,(t-Hr)*e]];return(0,st.jsx)(st.Fragment,{children:n.map(([i,a])=>(0,st.jsx)(N5,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},U5=({matrix:e,cellSize:t,color:r})=>(0,st.jsx)(st.Fragment,{children:e.map((i,a)=>i.map((l,s)=>l?(0,st.jsx)("rect",{height:t-.2*2,width:t-.2*2,x:a*t+t*(.2/2),y:s*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${a}-${s}`):(0,st.jsx)(k1.default.Fragment,{},`circle-${a}-${s}`)))}),F5=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return(0,st.jsx)(st.Fragment,{});let i=t*(o||.15),a=Math.floor(t/2-i/2),l=Math.floor(t/2+i/2);(l-a)%2!==t%2&&(l+=1);let s=(l-a)*e,c=.1,m=s-s*c*2,f=r,u=a*e;return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),(0,st.jsx)(f,{x:u+s*c,y:u+s*c,height:m,width:m})]})},B5=e=>{let t=e.outputSize,r=L5(e.url),o=t/r.length;return(0,st.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,st.jsx)(U5,{matrix:r,cellSize:o,color:e.fgColor}),(0,st.jsx)(D5,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,st.jsx)(F5,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},H5=R1.default.div`
1500
1500
  display: flex;
1501
1501
  justify-content: center;
1502
1502
  align-items: center;
@@ -1511,7 +1511,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1511
1511
  border-color: ${e=>e.borderColor};
1512
1512
  border-radius: var(--privy-border-radius-md);
1513
1513
  }
1514
- `,jn=e=>{let{appearance:t}=dt(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return(0,st.jsx)(L5,{size:n,bgColor:r,fgColor:o,borderColor:i,children:(0,st.jsx)(O5,{url:e.url,logo:{element:e.squareLogoElement??T1},outputSize:n,bgColor:r,fgColor:o})})};var xi=require("react/jsx-runtime"),$o=({style:e,...t})=>(0,xi.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,xi.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,xi.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,xi.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,xi.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var ue=require("react/jsx-runtime"),A1="#8a63d2",k1=1e3,N5=k1*2,D5=k1*120,R1=()=>{let{authenticated:e,logout:t,ready:r,user:o}=$(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=A(),{getAuthFlow:c,loginWithFarcaster:m,closePrivyModal:f,createAnalyticsEvent:u}=W(),[w,v]=(0,yn.useState)(void 0),[g,E]=(0,yn.useState)(!1),[T,R]=(0,yn.useState)(!1),S=(0,yn.useRef)([]),x=ot,I=c(),M=I?.meta.connectUri;return(0,yn.useEffect)(()=>{let U=Date.now(),G=setInterval(async()=>{let Y=await I.pollForReady.execute(),Z=Date.now()-U;if(Y){clearInterval(G),E(!0);try{await m(),R(!0)}catch(L){let F={retryable:!1,message:"Authentication failed"};if(L?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(L?.privyErrorCode==="max_accounts_reached"){console.error(new ro(L).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else if(L?.privyErrorCode==="user_does_not_exist"){i("ACCOUNT_NOT_FOUND_SCREEN");return}else L?.privyErrorCode==="linked_to_another_user"?F.detail="This account has already been linked to another user.":L?.privyErrorCode==="invalid_credentials"?(F.retryable=!0,F.detail="Something went wrong. Try again."):L?.privyErrorCode==="too_many_requests"&&(F.detail="Too many requests. Please wait before trying again.");v(F)}}else Z>D5&&(clearInterval(G),v({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},N5);return()=>{clearInterval(G),S.current.forEach(Y=>clearTimeout(Y))}},[]),(0,yn.useEffect)(()=>{if(r&&e&&T&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},x);return()=>clearTimeout(G)}T&&(Sr(o,s?.embeddedWallets.createOnLogin)?S.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:G=>{console.error(G),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:G,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},x)):S.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),x)))}},[T,r,e,o]),Ms.isMobile||g?(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(k,{backFn:n?a:void 0,onClose:f},"header"),(0,ue.jsx)(pe,{}),Ms.isIOS?(0,ue.jsx)(ue.Fragment,{children:(0,ue.jsxs)(U5,{children:[(0,ue.jsx)(vt,{children:(0,ue.jsxs)("div",{children:[(0,ue.jsx)(Pt,{success:T,fail:!!w}),(0,ue.jsx)($o,{style:{width:"38px",height:"38px"}})]})}),(0,ue.jsxs)(pt,{children:[(0,ue.jsx)(Te,{children:w?w.message:"Sign in with Farcaster"}),(0,ue.jsx)(Pe,{children:w?w.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&(0,ue.jsx)(H,{onClick:U=>{U.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):(0,ue.jsx)(ue.Fragment,{children:(0,ue.jsxs)(x1,{children:[(0,ue.jsx)(vt,{children:(0,ue.jsxs)("div",{children:[(0,ue.jsx)(Pt,{success:T,fail:!!w}),(0,ue.jsx)($o,{style:{width:"38px",height:"38px"}})]})}),(0,ue.jsxs)(pt,{children:[(0,ue.jsx)(Te,{children:w?w.message:"Signing in with Farcaster"}),(0,ue.jsx)(Pe,{children:w?w.detail:"This should only take a moment"}),(0,ue.jsx)(jt,{children:M&&Ms.isMobile&&(0,ue.jsx)(Vc,{text:"Take me to Warpcast",url:M,color:A1})})]})]})}),(0,ue.jsx)(J,{})]}):(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(k,{backFn:n?a:void 0,onClose:f},"header"),(0,ue.jsx)(pe,{}),(0,ue.jsx)(x1,{children:(0,ue.jsxs)("div",{children:[(0,ue.jsx)(Te,{children:"Sign in with Farcaster"}),(0,ue.jsx)(Pe,{children:"Scan with your phone's camera to continue."}),(0,ue.jsx)(ma,{children:M?(0,ue.jsx)(jn,{url:M,size:275,squareLogoElement:$o}):(0,ue.jsx)(At,{})}),(0,ue.jsxs)(jt,{children:[(0,ue.jsx)(Pe,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&(0,ue.jsx)(Kn,{text:M,itemName:"link",color:A1})]})]})}),(0,ue.jsx)(J,{})]})},x1=lu.default.div`
1514
+ `,Zn=e=>{let{appearance:t}=dt(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return(0,st.jsx)(H5,{size:n,bgColor:r,fgColor:o,borderColor:i,children:(0,st.jsx)(B5,{url:e.url,logo:{element:e.squareLogoElement??A1},outputSize:n,bgColor:r,fgColor:o})})};var Ri=require("react/jsx-runtime"),Ko=({style:e,...t})=>(0,Ri.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,Ri.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,Ri.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,Ri.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,Ri.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var me=require("react/jsx-runtime"),I1="#8a63d2",W1=1e3,G5=W1*2,V5=W1*120,O1=()=>{let{authenticated:e,logout:t,ready:r,user:o}=z(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=P(),{getAuthFlow:c,loginWithFarcaster:m,closePrivyModal:f,createAnalyticsEvent:u}=W(),[w,v]=(0,gn.useState)(void 0),[g,E]=(0,gn.useState)(!1),[S,R]=(0,gn.useState)(!1),_=(0,gn.useRef)([]),k=ot,I=c(),M=I?.meta.connectUri;return(0,gn.useEffect)(()=>{let U=Date.now(),G=setInterval(async()=>{let Y=await I.pollForReady.execute(),Z=Date.now()-U;if(Y){clearInterval(G),E(!0);try{await m(),R(!0)}catch(L){let F={retryable:!1,message:"Authentication failed"};if(L?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(L?.privyErrorCode==="max_accounts_reached"){console.error(new no(L).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else if(L?.privyErrorCode==="user_does_not_exist"){i("ACCOUNT_NOT_FOUND_SCREEN");return}else L?.privyErrorCode==="linked_to_another_user"?F.detail="This account has already been linked to another user.":L?.privyErrorCode==="invalid_credentials"?(F.retryable=!0,F.detail="Something went wrong. Try again."):L?.privyErrorCode==="too_many_requests"&&(F.detail="Too many requests. Please wait before trying again.");v(F)}}else Z>V5&&(clearInterval(G),v({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},G5);return()=>{clearInterval(G),_.current.forEach(Y=>clearTimeout(Y))}},[]),(0,gn.useEffect)(()=>{if(r&&e&&S&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},k);return()=>clearTimeout(G)}S&&(Sr(o,s?.embeddedWallets.createOnLogin)?_.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:G=>{console.error(G),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:G,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},k)):_.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),k)))}},[S,r,e,o]),Ws.isMobile||g?(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(x,{backFn:n?a:void 0,onClose:f},"header"),(0,me.jsx)(se,{}),Ws.isIOS?(0,me.jsx)(me.Fragment,{children:(0,me.jsxs)(q5,{children:[(0,me.jsx)(vt,{children:(0,me.jsxs)("div",{children:[(0,me.jsx)(At,{success:S,fail:!!w}),(0,me.jsx)(Ko,{style:{width:"38px",height:"38px"}})]})}),(0,me.jsxs)(pt,{children:[(0,me.jsx)(Te,{children:w?w.message:"Sign in with Farcaster"}),(0,me.jsx)(Pe,{children:w?w.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&(0,me.jsx)(H,{onClick:U=>{U.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):(0,me.jsx)(me.Fragment,{children:(0,me.jsxs)(M1,{children:[(0,me.jsx)(vt,{children:(0,me.jsxs)("div",{children:[(0,me.jsx)(At,{success:S,fail:!!w}),(0,me.jsx)(Ko,{style:{width:"38px",height:"38px"}})]})}),(0,me.jsxs)(pt,{children:[(0,me.jsx)(Te,{children:w?w.message:"Signing in with Farcaster"}),(0,me.jsx)(Pe,{children:w?w.detail:"This should only take a moment"}),(0,me.jsx)(jt,{children:M&&Ws.isMobile&&(0,me.jsx)(zc,{text:"Take me to Warpcast",url:M,color:I1})})]})]})}),(0,me.jsx)(J,{})]}):(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(x,{backFn:n?a:void 0,onClose:f},"header"),(0,me.jsx)(se,{}),(0,me.jsx)(M1,{children:(0,me.jsxs)("div",{children:[(0,me.jsx)(Te,{children:"Sign in with Farcaster"}),(0,me.jsx)(Pe,{children:"Scan with your phone's camera to continue."}),(0,me.jsx)(ha,{children:M?(0,me.jsx)(Zn,{url:M,size:275,squareLogoElement:Ko}):(0,me.jsx)(xt,{})}),(0,me.jsxs)(jt,{children:[(0,me.jsx)(Pe,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&(0,me.jsx)(Yn,{text:M,itemName:"link",color:I1})]})]})}),(0,me.jsx)(J,{})]})},M1=du.default.div`
1515
1515
  display: flex;
1516
1516
  flex-direction: column;
1517
1517
  align-items: center;
@@ -1519,14 +1519,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1519
1519
  margin-left: 27px;
1520
1520
  margin-right: 27px;
1521
1521
  gap: 24px;
1522
- `,U5=lu.default.div`
1522
+ `,q5=du.default.div`
1523
1523
  display: flex;
1524
1524
  flex-direction: column;
1525
1525
  align-items: center;
1526
1526
  justify-content: center;
1527
1527
  gap: 24px;
1528
1528
  width: 100%;
1529
- `;var Yn=require("react"),Ws=require("react-device-detect"),cu=y(require("styled-components"));var me=require("react/jsx-runtime"),I1="#8a63d2",W1=1e3,F5=W1*2,B5=W1*300,O1=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=A(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=W(),[a,l]=(0,Yn.useState)(void 0),[s,c]=(0,Yn.useState)(!1),[m,f]=(0,Yn.useState)(!1),u=(0,Yn.useRef)([]),w=ot,v=r?.farcasterSigner;(0,Yn.useEffect)(()=>{let E=Date.now(),T=setInterval(async()=>{if(!v?.public_key){clearInterval(T),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}v.status==="approved"&&(clearInterval(T),c(!1),f(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),w)));let R=await n(v?.public_key),S=Date.now()-E;R.status==="approved"?(clearInterval(T),c(!1),f(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),w))):S>B5?(clearInterval(T),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):R.status==="revoked"&&(clearInterval(T),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},F5);return()=>{clearInterval(T),u.current.forEach(R=>clearTimeout(R))}},[]);let g=v?.status==="pending_approval"?v.signer_approval_url:void 0;return Ws.isMobile||s?(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(k,{backFn:e?t:void 0,onClose:i},"header"),(0,me.jsx)(pe,{}),Ws.isIOS?(0,me.jsx)(me.Fragment,{children:(0,me.jsxs)(H5,{children:[(0,me.jsx)(vt,{children:(0,me.jsxs)("div",{children:[(0,me.jsx)(Pt,{success:m,fail:!!a}),(0,me.jsx)($o,{style:{width:"38px",height:"38px"}})]})}),(0,me.jsxs)(pt,{children:[(0,me.jsx)(Te,{children:a?a.message:"Add a signer to Farcaster"}),(0,me.jsx)(Pe,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&(0,me.jsx)(H,{onClick:E=>{E.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):(0,me.jsx)(me.Fragment,{children:(0,me.jsxs)(M1,{children:[(0,me.jsx)(vt,{children:(0,me.jsxs)("div",{children:[(0,me.jsx)(Pt,{success:m,fail:!!a}),(0,me.jsx)($o,{style:{width:"38px",height:"38px"}})]})}),(0,me.jsxs)(pt,{children:[(0,me.jsx)(Te,{children:a?a.message:"Requesting signer from Farcaster"}),(0,me.jsx)(Pe,{children:a?a.detail:"This should only take a moment"}),(0,me.jsx)(jt,{children:g&&Ws.isMobile&&(0,me.jsx)(Vc,{text:"Take me to Warpcast",url:g,color:I1})})]})]})}),(0,me.jsx)(J,{})]}):(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(k,{backFn:e?t:void 0,onClose:i},"header"),(0,me.jsx)(pe,{}),(0,me.jsx)(M1,{children:(0,me.jsxs)("div",{children:[(0,me.jsx)(Te,{children:"Add a signer to Farcaster"}),(0,me.jsxs)(Pe,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),(0,me.jsx)(ma,{children:v?.status==="pending_approval"?(0,me.jsx)(jn,{url:v.signer_approval_url,size:275,squareLogoElement:$o}):(0,me.jsx)(At,{})}),(0,me.jsxs)(jt,{children:[(0,me.jsx)(Pe,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),v?.status==="pending_approval"&&(0,me.jsx)(Kn,{text:v.signer_approval_url,itemName:"link",color:I1})]})]})}),(0,me.jsx)(J,{})]})},M1=cu.default.div`
1529
+ `;var Qn=require("react"),Os=require("react-device-detect"),pu=y(require("styled-components"));var fe=require("react/jsx-runtime"),L1="#8a63d2",D1=1e3,z5=D1*2,$5=D1*300,U1=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=P(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=W(),[a,l]=(0,Qn.useState)(void 0),[s,c]=(0,Qn.useState)(!1),[m,f]=(0,Qn.useState)(!1),u=(0,Qn.useRef)([]),w=ot,v=r?.farcasterSigner;(0,Qn.useEffect)(()=>{let E=Date.now(),S=setInterval(async()=>{if(!v?.public_key){clearInterval(S),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}v.status==="approved"&&(clearInterval(S),c(!1),f(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),w)));let R=await n(v?.public_key),_=Date.now()-E;R.status==="approved"?(clearInterval(S),c(!1),f(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),w))):_>$5?(clearInterval(S),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):R.status==="revoked"&&(clearInterval(S),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},z5);return()=>{clearInterval(S),u.current.forEach(R=>clearTimeout(R))}},[]);let g=v?.status==="pending_approval"?v.signer_approval_url:void 0;return Os.isMobile||s?(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(x,{backFn:e?t:void 0,onClose:i},"header"),(0,fe.jsx)(se,{}),Os.isIOS?(0,fe.jsx)(fe.Fragment,{children:(0,fe.jsxs)(K5,{children:[(0,fe.jsx)(vt,{children:(0,fe.jsxs)("div",{children:[(0,fe.jsx)(At,{success:m,fail:!!a}),(0,fe.jsx)(Ko,{style:{width:"38px",height:"38px"}})]})}),(0,fe.jsxs)(pt,{children:[(0,fe.jsx)(Te,{children:a?a.message:"Add a signer to Farcaster"}),(0,fe.jsx)(Pe,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&(0,fe.jsx)(H,{onClick:E=>{E.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):(0,fe.jsx)(fe.Fragment,{children:(0,fe.jsxs)(N1,{children:[(0,fe.jsx)(vt,{children:(0,fe.jsxs)("div",{children:[(0,fe.jsx)(At,{success:m,fail:!!a}),(0,fe.jsx)(Ko,{style:{width:"38px",height:"38px"}})]})}),(0,fe.jsxs)(pt,{children:[(0,fe.jsx)(Te,{children:a?a.message:"Requesting signer from Farcaster"}),(0,fe.jsx)(Pe,{children:a?a.detail:"This should only take a moment"}),(0,fe.jsx)(jt,{children:g&&Os.isMobile&&(0,fe.jsx)(zc,{text:"Take me to Warpcast",url:g,color:L1})})]})]})}),(0,fe.jsx)(J,{})]}):(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(x,{backFn:e?t:void 0,onClose:i},"header"),(0,fe.jsx)(se,{}),(0,fe.jsx)(N1,{children:(0,fe.jsxs)("div",{children:[(0,fe.jsx)(Te,{children:"Add a signer to Farcaster"}),(0,fe.jsxs)(Pe,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),(0,fe.jsx)(ha,{children:v?.status==="pending_approval"?(0,fe.jsx)(Zn,{url:v.signer_approval_url,size:275,squareLogoElement:Ko}):(0,fe.jsx)(xt,{})}),(0,fe.jsxs)(jt,{children:[(0,fe.jsx)(Pe,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),v?.status==="pending_approval"&&(0,fe.jsx)(Yn,{text:v.signer_approval_url,itemName:"link",color:L1})]})]})}),(0,fe.jsx)(J,{})]})},N1=pu.default.div`
1530
1530
  display: flex;
1531
1531
  flex-direction: column;
1532
1532
  align-items: center;
@@ -1534,14 +1534,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1534
1534
  margin-left: 27px;
1535
1535
  margin-right: 27px;
1536
1536
  gap: 24px;
1537
- `,H5=cu.default.div`
1537
+ `,K5=pu.default.div`
1538
1538
  display: flex;
1539
1539
  flex-direction: column;
1540
1540
  align-items: center;
1541
1541
  justify-content: center;
1542
1542
  gap: 24px;
1543
1543
  width: 100%;
1544
- `;var fu=require("@ethersproject/address"),Yc=require("@ethersproject/units"),V1=require("@heroicons/react/24/outline"),Yo=require("react"),q1=y(require("styled-components")),Zc=require("@privy-io/js-sdk-core");var L1=require("react/jsx-runtime");function Hr({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=A(),i;return t==="FUNDING_MANUAL_TRANSFER_SCREEN"?i=r:t===n?.funding?.methodScreen?n.funding.comingFromSendTransactionScreen?i=()=>o("EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"):i=void 0:i=n?.funding?.methodScreen?()=>o(n.funding.methodScreen):void 0,(0,L1.jsx)(k,{title:e,backFn:i})}var Os=y(require("styled-components")),Ma=require("react/jsx-runtime"),du=()=>(0,Ma.jsx)(G5,{children:(0,Ma.jsxs)(V5,{children:[(0,Ma.jsx)(q5,{}),(0,Ma.jsx)(z5,{})]})}),G5=Os.default.div`
1544
+ `;var yu=require("@ethersproject/address"),Qc=require("@ethersproject/units"),K1=require("@heroicons/react/24/outline"),Zo=require("react"),j1=y(require("styled-components")),Jc=require("@privy-io/js-sdk-core");var F1=require("react/jsx-runtime");function Gr({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=P(),i;return t==="FUNDING_MANUAL_TRANSFER_SCREEN"?i=r:t===n?.funding?.methodScreen?n.funding.comingFromSendTransactionScreen?i=()=>o("EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"):i=void 0:i=n?.funding?.methodScreen?()=>o(n.funding.methodScreen):void 0,(0,F1.jsx)(x,{title:e,backFn:i})}var Ls=y(require("styled-components")),Oa=require("react/jsx-runtime"),uu=()=>(0,Oa.jsx)(j5,{children:(0,Oa.jsxs)(Y5,{children:[(0,Oa.jsx)(Z5,{}),(0,Oa.jsx)(Q5,{})]})}),j5=Ls.default.div`
1545
1545
  display: flex;
1546
1546
  justify-content: center;
1547
1547
  align-items: center;
@@ -1550,14 +1550,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1550
1550
  @media all and (display-mode: standalone) {
1551
1551
  margin-bottom: 30px;
1552
1552
  }
1553
- `,V5=Os.default.div`
1553
+ `,Y5=Ls.default.div`
1554
1554
  position: relative;
1555
1555
  height: 96px;
1556
1556
  width: 96px;
1557
1557
 
1558
1558
  opacity: 1;
1559
1559
  animation: fadein 200ms ease;
1560
- `,q5=Os.default.div`
1560
+ `,Z5=Ls.default.div`
1561
1561
  position: absolute;
1562
1562
  top: 0;
1563
1563
  right: 0;
@@ -1570,7 +1570,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1570
1570
  border: 4px solid #f1f2f9;
1571
1571
  border-radius: 50%;
1572
1572
  }
1573
- `,z5=Os.default.div`
1573
+ `,Q5=Ls.default.div`
1574
1574
  position: absolute;
1575
1575
  top: 0;
1576
1576
  right: 0;
@@ -1594,40 +1594,40 @@ You will need this password to access your ${e} wallet on a new device. Please k
1594
1594
  transform: rotate(360deg);
1595
1595
  }
1596
1596
  }
1597
- `;var pu=y(require("styled-components")),qc=pu.default.span`
1597
+ `;var mu=y(require("styled-components")),$c=mu.default.span`
1598
1598
  display: flex;
1599
1599
  flex-direction: column;
1600
1600
  gap: 0.35rem;
1601
1601
  width: 100%;
1602
- `,Gr=pu.default.span`
1602
+ `,Vr=mu.default.span`
1603
1603
  display: flex;
1604
1604
  width: 100%;
1605
1605
  justify-content: space-between;
1606
- `;var N1=y(require("styled-components")),Vr=N1.default.span`
1606
+ `;var B1=y(require("styled-components")),qr=B1.default.span`
1607
1607
  color: var(--privy-color-foreground-3);
1608
1608
  font-size: 0.875rem;
1609
1609
  font-weight: 400;
1610
1610
  line-height: 1.375rem; /* 157.143% */
1611
- `;var D1=y(require("styled-components"));var qr=D1.default.span`
1611
+ `;var H1=y(require("styled-components"));var zr=H1.default.span`
1612
1612
  color: var(--privy-color-foreground);
1613
1613
  font-size: 0.875rem;
1614
1614
  font-weight: 500;
1615
1615
  line-height: 1.375rem; /* 157.143% */
1616
1616
 
1617
- ${Ac}
1618
- `;var $5=require("@ethersproject/providers"),U1=require("@privy-io/js-sdk-core");async function zc(e,t,r,o,n,i){o=Object.assign({chainId:an},o),K5(o);let l=(await r.rpc({address:t,accessToken:e,requesterAppId:i,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(l)}async function Wa(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub((0,U1.QuantityToBigNumber)(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function K5(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!j5(o))throw new Error(`Transaction request property '${r}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof e.chainId!="number")throw new Error("Transaction request property 'chainId' must be a number")}function j5(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&Y5(e);return t||r||o}function Y5(e){return/^-?0x[a-f0-9]+$/i.test(e)}function $c(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var Oa=require("react");var Ko=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=W(),[n,i]=(0,Oa.useState)(!0),[a,l]=(0,Oa.useState)(void 0),[s,c]=(0,Oa.useState)(void 0);return(0,Oa.useEffect)(()=>{let m=e.chainId||an,f=o.find(w=>w.id===Number(m));if(!f)throw new we(`Unsupported chain: ${m}`);(async()=>{if(!t){i(!1);return}try{i(!0);let w=await r(f);w?c(w):l(new Error(`Unable to fetch token price on chain id ${f.id}`))}catch(w){l(w)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var Kc=require("react"),uu=(0,Kc.createContext)(null);function mo(){let e=(0,Kc.useContext)(uu);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}function La(e){let r=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(r)return parseInt(r);throw new Error("Chain ID not compatible with CAIP-2 format.")}var F1=require("@ethersproject/bignumber"),mu=require("@ethersproject/units"),B1=require("@privy-io/js-sdk-core");var Z5=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),H1=e=>Z5.format(e),jc=(e,t)=>{let r=H1(t*parseFloat(e));return r!=="$0.00"?r:"<$0.01"},jo=(e,t)=>{let r=H1(t*parseFloat((0,mu.formatEther)(e)));return r==="$0.00"?"<$0.01":r},zr=(e,t,r=6,o=!1)=>{let i=parseFloat((0,mu.formatEther)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},Ls=e=>e.map(B1.QuantityToBigNumber).reduce((t,r)=>t.add(r),F1.BigNumber.from(0)).toHexString(),G1=(e,t)=>{let{chains:r}=W(),o=`https://etherscan.io/address/${t}`,n=`${cf(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n};var ye=require("react/jsx-runtime"),z1=()=>{let{chains:e,rpcConfig:t,appId:r,closePrivyModal:o}=W(),{navigate:n,setModalData:i,app:a,data:l}=A(),[s,c]=(0,Yo.useState)(null),[m,f]=(0,Yo.useState)(null),[u,w]=(0,Yo.useState)(null),[v,g]=(0,Yo.useState)(null),[E,T]=(0,Yo.useState)(!1),R=l?.funding&&(0,Yc.parseUnits)(l.funding.amount,"ether").toHexString(),S=l?.funding&&l.funding.chain.id,{wallets:x}=mo(),{tokenPrice:I,isTokenPriceLoading:M}=Ko({chainId:s?.chainId&&La(s.chainId)?La(s.chainId):void 0}),U=async Q=>{for(let re of Q)S&&La(re.chainId)!==S&&await re.switchChain(S)},G=new rt(async()=>{let Q=x[0];if(!Q){console.error("Connected wallet wasn't found."),n("ERROR_SCREEN",!1);return}c(Q);let re=x.find(at=>(0,fu.getAddress)(at.address)===(0,fu.getAddress)(l?.funding?.address??""));if(!re){console.error("Connected wallet wasn't found."),n("ERROR_SCREEN",!1);return}if(f(re),!S){console.error(`Chain ID not found for input ${l?.funding?.chain.id}.`),n("ERROR_SCREEN",!1);return}let ie=Er(S,e,t,{appId:r}),Fe={from:Q.address,to:re.address,value:R,chainId:S},De=await(0,Zc.populateTransactionRequest)(Q.address,Fe,ie),{totalGasEstimate:ut}=await(0,Zc.calculateTotalGasEstimate)(De,ie),{balance:lt,hasSufficientFunds:Dt}=await Wa(Q.address,De,ut,ie);if(g({gas:ut.toHexString(),balance:lt.toHexString()}),!Dt){w(new b(`Wallet ${Wt(Q.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}await U([Q,re]);try{let ge=await(await Q.getEthersProvider()).getSigner(),{wait:Cr}=await ge.sendTransaction(De);await Cr(1),T(!0)}catch(at){w(at)}});(0,Yo.useEffect)(()=>{G.execute()},[]),(0,Yo.useEffect)(()=>{if(!u)return;let Q={error:u,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};i({funding:l?.funding,sendTransaction:l?.sendTransaction,errorModalData:Q}),n("ERROR_SCREEN",!1)},[u]);let Y=s?Un(s.walletClientType,s.connectorType,s.walletClientType)||"wallet":null,Z=!s||!v||M||!l?.funding||!R,L=Z?void 0:Ls([v.gas,R]),F=L&&I?jo(L,I):void 0,O=L?zr(L,"ETH"):void 0,Me=v&&I?jo(v.gas,I):void 0,je=v?zr(v.gas,"ETH"):void 0;return(0,Yo.useEffect)(()=>{if(!E)return;let Q=setTimeout(o,Il);return()=>clearTimeout(Q)},[E]),Z?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Hr,{}),(0,ye.jsx)(du,{}),(0,ye.jsx)("div",{style:{marginTop:"1rem"}}),(0,ye.jsx)(j,{})]}):E?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Hr,{}),(0,ye.jsx)(pe,{}),(0,ye.jsxs)(Dr,{children:[(0,ye.jsx)(V1.CheckCircleIcon,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,ye.jsx)(ke,{title:"Success!",description:`You\u2019ve successfully added ${(0,Yc.formatUnits)(R,"ether")} ETH to your ${a.name} wallet. It may take a minute before the funds are available to use.`})]}),(0,ye.jsx)(fe,{}),(0,ye.jsx)(j,{})]}):(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Hr,{}),(0,ye.jsx)(du,{}),(0,ye.jsx)(jt,{style:{marginTop:"16px"},children:(0,ye.jsx)(Pc,{icon:xc(s.walletClientType,s.connectorType,s.walletClientType),name:s.walletClientType})}),(0,ye.jsx)(ke,{style:{marginTop:"8px",marginBottom:"12px"},title:`Confirming with ${Y}`}),v&&(0,ye.jsx)(ye.Fragment,{children:(0,ye.jsxs)(qc,{children:[(0,ye.jsxs)(Gr,{children:[(0,ye.jsx)(Vr,{children:"Total"}),(0,ye.jsx)(qr,{children:F||O})]}),(0,ye.jsxs)(Gr,{children:[(0,ye.jsx)(Vr,{children:"To"}),(0,ye.jsx)(qr,{children:Wt(m?.address)})]}),(0,ye.jsxs)(Gr,{children:[(0,ye.jsx)(Vr,{children:"Network"}),(0,ye.jsx)(qr,{children:(0,ye.jsxs)(Q5,{children:[kc(l.funding.chain.id)," ",l.funding.chain.name]})})]}),(0,ye.jsxs)(Gr,{children:[(0,ye.jsx)(Vr,{children:"Estimated fee"}),(0,ye.jsx)(qr,{children:Me||je})]})]})}),(0,ye.jsx)(fa,{height:24}),(0,ye.jsx)(j,{})]})},Q5=q1.default.div`
1617
+ ${kc}
1618
+ `;var J5=require("@ethersproject/providers"),G1=require("@privy-io/js-sdk-core");async function Kc(e,t,r,o,n,i){o=Object.assign({chainId:sn},o),X5(o);let l=(await r.rpc({address:t,accessToken:e,requesterAppId:i,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(l)}async function La(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub((0,G1.QuantityToBigNumber)(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function X5(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!e6(o))throw new Error(`Transaction request property '${r}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof e.chainId!="number")throw new Error("Transaction request property 'chainId' must be a number")}function e6(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&t6(e);return t||r||o}function t6(e){return/^-?0x[a-f0-9]+$/i.test(e)}function jc(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var Na=require("react");var jo=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=W(),[n,i]=(0,Na.useState)(!0),[a,l]=(0,Na.useState)(void 0),[s,c]=(0,Na.useState)(void 0);return(0,Na.useEffect)(()=>{let m=e.chainId||sn,f=o.find(w=>w.id===Number(m));if(!f)throw new we(`Unsupported chain: ${m}`);(async()=>{if(!t){i(!1);return}try{i(!0);let w=await r(f);w?c(w):l(new Error(`Unable to fetch token price on chain id ${f.id}`))}catch(w){l(w)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var Yc=require("react"),fu=(0,Yc.createContext)(null);function fo(){let e=(0,Yc.useContext)(fu);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}function Da(e){let r=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(r)return parseInt(r);throw new Error("Chain ID not compatible with CAIP-2 format.")}var V1=require("@ethersproject/bignumber"),hu=require("@ethersproject/units"),q1=require("@privy-io/js-sdk-core");var r6=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),z1=e=>r6.format(e),Zc=(e,t)=>{let r=z1(t*parseFloat(e));return r!=="$0.00"?r:"<$0.01"},Yo=(e,t)=>{let r=z1(t*parseFloat((0,hu.formatEther)(e)));return r==="$0.00"?"<$0.01":r},$r=(e,t,r=6,o=!1)=>{let i=parseFloat((0,hu.formatEther)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},Ns=e=>e.map(q1.QuantityToBigNumber).reduce((t,r)=>t.add(r),V1.BigNumber.from(0)).toHexString(),$1=(e,t)=>{let{chains:r}=W(),o=`https://etherscan.io/address/${t}`,n=`${uf(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n};var ye=require("react/jsx-runtime"),Y1=()=>{let{chains:e,rpcConfig:t,appId:r,closePrivyModal:o}=W(),{navigate:n,setModalData:i,app:a,data:l}=P(),[s,c]=(0,Zo.useState)(null),[m,f]=(0,Zo.useState)(null),[u,w]=(0,Zo.useState)(null),[v,g]=(0,Zo.useState)(null),[E,S]=(0,Zo.useState)(!1),R=l?.funding&&(0,Qc.parseUnits)(l.funding.amount,"ether").toHexString(),_=l?.funding&&l.funding.chain.id,{wallets:k}=fo(),{tokenPrice:I,isTokenPriceLoading:M}=jo({chainId:s?.chainId&&Da(s.chainId)?Da(s.chainId):void 0}),U=async Q=>{for(let re of Q)_&&Da(re.chainId)!==_&&await re.switchChain(_)},G=new rt(async()=>{let Q=k[0];if(!Q){console.error("Connected wallet wasn't found."),n("ERROR_SCREEN",!1);return}c(Q);let re=k.find(at=>(0,yu.getAddress)(at.address)===(0,yu.getAddress)(l?.funding?.address??""));if(!re){console.error("Connected wallet wasn't found."),n("ERROR_SCREEN",!1);return}if(f(re),!_){console.error(`Chain ID not found for input ${l?.funding?.chain.id}.`),n("ERROR_SCREEN",!1);return}let ie=Er(_,e,t,{appId:r}),Fe={from:Q.address,to:re.address,value:R,chainId:_},De=await(0,Jc.populateTransactionRequest)(Q.address,Fe,ie),{totalGasEstimate:ut}=await(0,Jc.calculateTotalGasEstimate)(De,ie),{balance:lt,hasSufficientFunds:Dt}=await La(Q.address,De,ut,ie);if(g({gas:ut.toHexString(),balance:lt.toHexString()}),!Dt){w(new b(`Wallet ${Wt(Q.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}await U([Q,re]);try{let ge=await(await Q.getEthersProvider()).getSigner(),{wait:Cr}=await ge.sendTransaction(De);await Cr(1),S(!0)}catch(at){w(at)}});(0,Zo.useEffect)(()=>{G.execute()},[]),(0,Zo.useEffect)(()=>{if(!u)return;let Q={error:u,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};i({funding:l?.funding,sendTransaction:l?.sendTransaction,errorModalData:Q}),n("ERROR_SCREEN",!1)},[u]);let Y=s?Bn(s.walletClientType,s.connectorType,s.walletClientType)||"wallet":null,Z=!s||!v||M||!l?.funding||!R,L=Z?void 0:Ns([v.gas,R]),F=L&&I?Yo(L,I):void 0,O=L?$r(L,"ETH"):void 0,Me=v&&I?Yo(v.gas,I):void 0,je=v?$r(v.gas,"ETH"):void 0;return(0,Zo.useEffect)(()=>{if(!E)return;let Q=setTimeout(o,Ml);return()=>clearTimeout(Q)},[E]),Z?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Gr,{}),(0,ye.jsx)(uu,{}),(0,ye.jsx)("div",{style:{marginTop:"1rem"}}),(0,ye.jsx)(K,{})]}):E?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Gr,{}),(0,ye.jsx)(se,{}),(0,ye.jsxs)(Ur,{children:[(0,ye.jsx)(K1.CheckCircleIcon,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,ye.jsx)(xe,{title:"Success!",description:`You\u2019ve successfully added ${(0,Qc.formatUnits)(R,"ether")} ETH to your ${a.name} wallet. It may take a minute before the funds are available to use.`})]}),(0,ye.jsx)(ue,{}),(0,ye.jsx)(K,{})]}):(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Gr,{}),(0,ye.jsx)(uu,{}),(0,ye.jsx)(jt,{style:{marginTop:"16px"},children:(0,ye.jsx)(xc,{icon:Rc(s.walletClientType,s.connectorType,s.walletClientType),name:s.walletClientType})}),(0,ye.jsx)(xe,{style:{marginTop:"8px",marginBottom:"12px"},title:`Confirming with ${Y}`}),v&&(0,ye.jsx)(ye.Fragment,{children:(0,ye.jsxs)($c,{children:[(0,ye.jsxs)(Vr,{children:[(0,ye.jsx)(qr,{children:"Total"}),(0,ye.jsx)(zr,{children:F||O})]}),(0,ye.jsxs)(Vr,{children:[(0,ye.jsx)(qr,{children:"To"}),(0,ye.jsx)(zr,{children:Wt(m?.address)})]}),(0,ye.jsxs)(Vr,{children:[(0,ye.jsx)(qr,{children:"Network"}),(0,ye.jsx)(zr,{children:(0,ye.jsxs)(o6,{children:[Ic(l.funding.chain.id)," ",l.funding.chain.name]})})]}),(0,ye.jsxs)(Vr,{children:[(0,ye.jsx)(qr,{children:"Estimated fee"}),(0,ye.jsx)(zr,{children:Me||je})]})]})}),(0,ye.jsx)(ya,{height:24}),(0,ye.jsx)(K,{})]})},o6=j1.default.div`
1619
1619
  display: flex;
1620
1620
  flex-direction: row;
1621
1621
  align-items: center;
1622
1622
  gap: 4px;
1623
- `;var J1=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),X1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),ki=require("react"),hu=y(require("styled-components"));async function Qc({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(i=>i.provider_app_id===r);if(!n)throw new b("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function $1({api:e,appId:t}){let r=pi(),o=Ki(),n=await ji(r);try{let{url:i}=await e.post(gl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw Ce(i)}}async function K1({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new b("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new b("User denied confirmation during cross-app auth flow");try{return(await e.post(vl,{authorization_code:n,state_code:r,code_verifier:o,provider:`privy:${t}`})).oauth_tokens?.access_token}catch(i){let a=Ce(i);throw a.privyErrorCode?new b(a.message||"Invalid code during cross-app auth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during cross-app auth flow"?new b("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new b("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var Jc=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:i})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let a=e?.linkedAccounts.find(u=>!!(u.type==="cross_app"&&u.embeddedWallets.find(w=>w.address===t)));if(!e||!a)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new b("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await Qc({api:r.api,requesterAppId:n,providerAppId:a.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new b("Cannot transact against a read-only provider app");await i({appId:a.providerApp.id})&&(l=r.getProviderAccessToken(a.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new b("Transactions require a valid token");let c=window.open(void 0,void 0,Ns({w:400,h:680}));if(!c)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new b("Failed to initialize signature request");let m=new URL(`${s.apiUrl}/oauth/transact`);return m.searchParams.set("token",l||""),m.searchParams.set("request",J5(o)),c.location=m.href,new Promise((u,w)=>{let g=setTimeout(()=>{R(),w(new b("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),E=setInterval(()=>{c.closed&&(R(),w(new b("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),T=S=>{S.data&&(S.data.token?.action==="set"&&S.data.token?.value!==void 0?r.storeProviderAccessToken(a.providerApp.id,S.data.token.value):S.data.token?.action==="clear"&&r.storeProviderAccessToken(a.providerApp.id,null),S.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&S.data.result&&(R(),u(S.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:o.method}})),S.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&S.data.error&&(R(),w(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",T);let R=()=>{c.close(),clearInterval(E),clearTimeout(g),window.removeEventListener("message",T)}})},J5=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Ns=({w:e,h:t})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,o=window.screenTop!==void 0?window.screenTop:window.screenY,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=n/window.screen.availWidth,l=i/window.screen.availHeight,s=(n-e)/2/a+r,c=(i-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${c}`};var Na="sdk_fiat_on_ramp_completed_with_status";var j1={1:"ethereum",8453:"base",10:"optimism",137:"polygon",42161:"arbitrum"},Y1=e=>!!j1[e];function Z1(e){let t=j1[e];if(!t)throw new b(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}var Q1=({input:e,amount:t,blockchain:r})=>{let o=new URL("https://pay.coinbase.com/buy/select-asset");return o.searchParams.set("appId",e.app_id),o.searchParams.set("sessionToken",e.session_token),o.searchParams.set("defaultExperience","buy"),o.searchParams.set("presetCryptoAmount",t),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};var ft=require("react/jsx-runtime"),X5=240,e2=1500,e6=Math.floor(X5*1e3/e2),t2=()=>{let{data:e,setModalData:t,navigate:r}=A(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=W(),l=e?.funding,[s,c]=(0,ki.useState)(!1),[m,f]=(0,ki.useState)(!1);return(0,ki.useEffect)(()=>{if(s)return;c(!0);let u=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp"}});let v=window.open(void 0,void 0,Ns({w:440,h:680})),g=Z1(l.chain.id),E=await i({addresses:[{address:l.address,blockchains:[g]}]}),{url:T}=Q1({input:E,amount:l.amount,blockchain:g});if(!v)throw new Error("Unable to initiate Coinbase Onramp flow.");v.location=T.toString();let R=0,S=!1;for(;R<e6;){R++;let{status:x}=await a({partnerUserId:E.partner_user_id});if(x==="success"){S=!0;break}if(x==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(v.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(I=>setTimeout(I,e2))}if(!S)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:Na,payload:{status:"success",provider:"coinbase-onramp"}}),f(!0)}catch(v){console.error(v),n({eventName:Na,payload:{status:"failure",provider:"coinbase-onramp",error:v.message}}),t({funding:{...l,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),r("FUNDING_METHOD_SELECTION_SCREEN")}finally{c(!1)}},w=setTimeout(()=>void u(),500);return()=>clearTimeout(w)},[]),(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(k,{title:"Fund account"},"header"),(0,ft.jsx)(r6,{isSucccess:m,onClickCta:o}),(0,ft.jsx)(j,{})]})},t6=e=>e?{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"}:{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""},r6=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,ki.useMemo)(()=>t6(e),[e]);return(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsxs)(s6,{children:[(0,ft.jsx)(i6,{isSucccess:e}),(0,ft.jsxs)(pt,{children:[(0,ft.jsx)("h3",{children:r}),(0,ft.jsx)(a6,{children:o})]})]}),n&&(0,ft.jsx)(H,{onClick:t,children:n})]})},o6=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",n6=e=>e?X1.default:()=>(0,ft.jsx)(J1.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),i6=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return(0,ft.jsxs)("div",{style:{position:"relative"},children:[(0,ft.jsx)(At,{color:o,style:{position:"absolute"}}),(0,ft.jsx)(Cs,{color:o}),(0,ft.jsx)(ln,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=n6(e),r=o6(e);return(0,ft.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,ft.jsx)(t,{width:"4rem",height:"4rem",color:r})})},a6=hu.default.p`
1623
+ `;var r2=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),o2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Ii=require("react"),gu=y(require("styled-components"));async function Xc({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(i=>i.provider_app_id===r);if(!n)throw new b("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function Z1({api:e,appId:t}){let r=fi(),o=Yi(),n=await Zi(r);try{let{url:i}=await e.post(vl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw Ce(i)}}async function Q1({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new b("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new b("User denied confirmation during cross-app auth flow");try{return(await e.post(Cl,{authorization_code:n,state_code:r,code_verifier:o,provider:`privy:${t}`})).oauth_tokens?.access_token}catch(i){let a=Ce(i);throw a.privyErrorCode?new b(a.message||"Invalid code during cross-app auth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during cross-app auth flow"?new b("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new b("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var ed=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:i})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let a=e?.linkedAccounts.find(u=>!!(u.type==="cross_app"&&u.embeddedWallets.find(w=>w.address===t)));if(!e||!a)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new b("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await Xc({api:r.api,requesterAppId:n,providerAppId:a.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new b("Cannot transact against a read-only provider app");await i({appId:a.providerApp.id})&&(l=r.getProviderAccessToken(a.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new b("Transactions require a valid token");let c=window.open(void 0,void 0,Ds({w:400,h:680}));if(!c)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new b("Failed to initialize signature request");let m=new URL(`${s.apiUrl}/oauth/transact`);return m.searchParams.set("token",l||""),m.searchParams.set("request",n6(o)),c.location=m.href,new Promise((u,w)=>{let g=setTimeout(()=>{R(),w(new b("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),E=setInterval(()=>{c.closed&&(R(),w(new b("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),S=_=>{_.data&&(_.data.token?.action==="set"&&_.data.token?.value!==void 0?r.storeProviderAccessToken(a.providerApp.id,_.data.token.value):_.data.token?.action==="clear"&&r.storeProviderAccessToken(a.providerApp.id,null),_.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&_.data.result&&(R(),u(_.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:o.method}})),_.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&_.data.error&&(R(),w(_.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:_.data.error,address:t}})))};window.addEventListener("message",S);let R=()=>{c.close(),clearInterval(E),clearTimeout(g),window.removeEventListener("message",S)}})},n6=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Ds=({w:e,h:t})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,o=window.screenTop!==void 0?window.screenTop:window.screenY,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=n/window.screen.availWidth,l=i/window.screen.availHeight,s=(n-e)/2/a+r,c=(i-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${c}`};var Ua="sdk_fiat_on_ramp_completed_with_status";var J1={1:"ethereum",8453:"base",10:"optimism",137:"polygon",42161:"arbitrum"},X1=e=>!!J1[e];function e2(e){let t=J1[e];if(!t)throw new b(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}var t2=({input:e,amount:t,blockchain:r})=>{let o=new URL("https://pay.coinbase.com/buy/select-asset");return o.searchParams.set("appId",e.app_id),o.searchParams.set("sessionToken",e.session_token),o.searchParams.set("defaultExperience","buy"),o.searchParams.set("presetCryptoAmount",t),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};var ft=require("react/jsx-runtime"),i6=240,n2=1500,a6=Math.floor(i6*1e3/n2),i2=()=>{let{data:e,setModalData:t,navigate:r}=P(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=W(),l=e?.funding,[s,c]=(0,Ii.useState)(!1),[m,f]=(0,Ii.useState)(!1);return(0,Ii.useEffect)(()=>{if(s)return;c(!0);let u=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp"}});let v=window.open(void 0,void 0,Ds({w:440,h:680})),g=e2(l.chain.id),E=await i({addresses:[{address:l.address,blockchains:[g]}]}),{url:S}=t2({input:E,amount:l.amount,blockchain:g});if(!v)throw new Error("Unable to initiate Coinbase Onramp flow.");v.location=S.toString();let R=0,_=!1;for(;R<a6;){R++;let{status:k}=await a({partnerUserId:E.partner_user_id});if(k==="success"){_=!0;break}if(k==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(v.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(I=>setTimeout(I,n2))}if(!_)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:Ua,payload:{status:"success",provider:"coinbase-onramp"}}),f(!0)}catch(v){console.error(v),n({eventName:Ua,payload:{status:"failure",provider:"coinbase-onramp",error:v.message}}),t({funding:{...l,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),r("FUNDING_METHOD_SELECTION_SCREEN")}finally{c(!1)}},w=setTimeout(()=>void u(),500);return()=>clearTimeout(w)},[]),(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(x,{title:"Fund account"},"header"),(0,ft.jsx)(l6,{isSucccess:m,onClickCta:o}),(0,ft.jsx)(K,{})]})},s6=e=>e?{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"}:{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""},l6=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,Ii.useMemo)(()=>s6(e),[e]);return(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsxs)(m6,{children:[(0,ft.jsx)(p6,{isSucccess:e}),(0,ft.jsxs)(pt,{children:[(0,ft.jsx)("h3",{children:r}),(0,ft.jsx)(u6,{children:o})]})]}),n&&(0,ft.jsx)(H,{onClick:t,children:n})]})},c6=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",d6=e=>e?o2.default:()=>(0,ft.jsx)(r2.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),p6=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return(0,ft.jsxs)("div",{style:{position:"relative"},children:[(0,ft.jsx)(xt,{color:o,style:{position:"absolute"}}),(0,ft.jsx)(ws,{color:o}),(0,ft.jsx)(cn,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=d6(e),r=c6(e);return(0,ft.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,ft.jsx)(t,{width:"4rem",height:"4rem",color:r})})},u6=gu.default.p`
1624
1624
  font-size: 1rem;
1625
1625
  color: var(--privy-color-foreground-3);
1626
1626
  margin-bottom: 1rem;
1627
1627
  display: flex;
1628
1628
  flex-direction: column;
1629
1629
  gap: 1rem;
1630
- `,s6=hu.default.div`
1630
+ `,m6=gu.default.div`
1631
1631
  display: flex;
1632
1632
  flex-direction: column;
1633
1633
  align-items: center;
@@ -1635,7 +1635,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1635
1635
  margin-left: 1.75rem;
1636
1636
  margin-right: 1.75rem;
1637
1637
  padding: 2rem 0;
1638
- `;var vu=require("@ethersproject/address"),ad=require("@heroicons/react/24/outline"),Fa=require("react");var r2=require("@heroicons/react/24/outline"),o2=y(require("styled-components")),Xc=require("react/jsx-runtime"),n2=({children:e})=>(0,Xc.jsxs)(l6,{children:[(0,Xc.jsx)(r2.ExclamationTriangleIcon,{width:"3rem",color:"var(--privy-color-error)"}),e]}),l6=o2.default.div`
1638
+ `;var wu=require("@ethersproject/address"),ld=require("@heroicons/react/24/outline"),Ha=require("react");var a2=require("@heroicons/react/24/outline"),s2=y(require("styled-components")),td=require("react/jsx-runtime"),l2=({children:e})=>(0,td.jsxs)(f6,{children:[(0,td.jsx)(a2.ExclamationTriangleIcon,{width:"3rem",color:"var(--privy-color-error)"}),e]}),f6=s2.default.div`
1639
1639
  display: flex;
1640
1640
  gap: 0.5rem;
1641
1641
  background-color: var(--privy-color-error-light);
@@ -1654,7 +1654,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1654
1654
  border: 1px solid var(--privy-color-error);
1655
1655
  border-radius: var(--privy-border-radius-sm);
1656
1656
  }
1657
- `;var Da=require("react/jsx-runtime"),Ua=({size:e=61,...t})=>(0,Da.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,Da.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,Da.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,Da.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var gr=y(require("styled-components"));var s2=y(require("@heroicons/react/24/outline/ClockIcon")),l2=y(require("@heroicons/react/24/outline/TrashIcon")),c2=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),d2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),p2=y(require("@heroicons/react/24/solid/LockClosedIcon")),Zn=require("react"),cr=y(require("styled-components"));var yu=require("react/jsx-runtime"),Ri=({style:e,...t})=>(0,yu.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,yu.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var ze=require("react/jsx-runtime"),Ii=({style:e,...t})=>(0,ze.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,ze.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,ze.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,ze.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,ze.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,ze.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,ze.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,ze.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,ze.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,ze.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,ze.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,ze.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,ze.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,ze.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,ze.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,ze.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,ze.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,ze.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,ze.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,ze.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,ze.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,ze.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,ze.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,ze.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,ze.jsx)("defs",{children:(0,ze.jsx)("clipPath",{id:"clip0_113_33841",children:(0,ze.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var ee=require("react/jsx-runtime"),i2=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=(0,Zn.useState)([]),a=t?e.length:2,l=c=>c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device",s=async c=>{i(m=>m.concat([c])),await r(c),i(m=>m.filter(f=>f!==c))};return(0,ee.jsxs)("div",{children:[(0,ee.jsx)(f6,{children:"Your passkeys"}),(0,ee.jsxs)(m2,{children:[e.slice(0,a).map(c=>(0,ee.jsxs)(g6,{children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)(h6,{children:l(c)}),(0,ee.jsxs)(y6,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),(0,ee.jsx)(C6,{disabled:n.includes(c.credentialId),onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?(0,ee.jsx)(Bo,{}):(0,ee.jsx)(l2.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,ee.jsx)(gu,{onClick:o,children:"View all"})]})]})},c6=()=>(0,ee.jsxs)(m2,{children:[(0,ee.jsxs)(xr,{children:[(0,ee.jsx)(Ar,{children:(0,ee.jsx)(c2.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,ee.jsxs)(xr,{children:[(0,ee.jsx)(Ar,{children:(0,ee.jsx)(p2.default,{})}),"More secure than a password."]}),(0,ee.jsxs)(xr,{children:[(0,ee.jsx)(Ar,{children:(0,ee.jsx)(s2.default,{})}),"Takes seconds to set up and use."]})]}),u2=()=>{let{user:e,unlinkPasskey:t}=$(),{linkWithPasskey:r,closePrivyModal:o}=W(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[i,a]=(0,Zn.useState)(!1),[l,s]=(0,Zn.useState)(""),[c,m]=(0,Zn.useState)(!1),[f,u]=(0,Zn.useState)(!1);(0,Zn.useEffect)(()=>{n.length===0&&u(!1)},[n.length]);let w=()=>{a(!0),r().then(()=>m(!0)).catch(g=>{if(g instanceof wt){if(g.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},v=async g=>(a(!0),await t(g).then(()=>m(!0)).catch(E=>{if(E instanceof wt&&E.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(k,{onClose:()=>o()},"header"),(0,ee.jsx)(Ye,{children:(0,ee.jsx)(mt,{status:"success",children:(0,ee.jsx)(d2.default,{})})}),(0,ee.jsx)(a2,{children:"Passkey added"}),(0,ee.jsx)(u6,{children:"From now on, you can use your passkey to log in."}),(0,ee.jsx)(ir,{children:(0,ee.jsx)(H,{onClick:()=>o(),children:"Done"})}),(0,ee.jsx)(J,{})]}):f?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(k,{backFn:()=>u(!1),onClose:()=>o()},"header"),(0,ee.jsx)(i2,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),(0,ee.jsx)(J,{})]}):(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(k,{onClose:()=>o()},"header"),(0,ee.jsx)(Ye,{children:(0,ee.jsxs)(ed,{children:[(0,ee.jsx)(Ri,{}),(0,ee.jsx)(Ii,{})]})}),(0,ee.jsx)(a2,{children:"Secure your account with a passkey"}),(0,ee.jsx)(m6,{}),n.length===0?(0,ee.jsx)(c6,{}):(0,ee.jsx)(i2,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),(0,ee.jsxs)(ir,{style:{marginTop:"12px"},children:[l&&(0,ee.jsx)(d6,{fail:!0,children:l}),(0,ee.jsx)(H,{onClick:w,loading:i,children:"Add new passkey"})]}),(0,ee.jsx)(J,{})]})},ed=cr.default.div`
1657
+ `;var Fa=require("react/jsx-runtime"),Ba=({size:e=61,...t})=>(0,Fa.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,Fa.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,Fa.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,Fa.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var gr=y(require("styled-components"));var p2=y(require("@heroicons/react/24/outline/ClockIcon")),u2=y(require("@heroicons/react/24/outline/TrashIcon")),m2=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),f2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),h2=y(require("@heroicons/react/24/solid/LockClosedIcon")),Jn=require("react"),cr=y(require("styled-components"));var vu=require("react/jsx-runtime"),Mi=({style:e,...t})=>(0,vu.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,vu.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var ze=require("react/jsx-runtime"),Wi=({style:e,...t})=>(0,ze.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,ze.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,ze.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,ze.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,ze.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,ze.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,ze.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,ze.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,ze.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,ze.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,ze.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,ze.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,ze.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,ze.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,ze.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,ze.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,ze.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,ze.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,ze.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,ze.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,ze.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,ze.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,ze.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,ze.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,ze.jsx)("defs",{children:(0,ze.jsx)("clipPath",{id:"clip0_113_33841",children:(0,ze.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var ee=require("react/jsx-runtime"),c2=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=(0,Jn.useState)([]),a=t?e.length:2,l=c=>c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device",s=async c=>{i(m=>m.concat([c])),await r(c),i(m=>m.filter(f=>f!==c))};return(0,ee.jsxs)("div",{children:[(0,ee.jsx)(w6,{children:"Your passkeys"}),(0,ee.jsxs)(g2,{children:[e.slice(0,a).map(c=>(0,ee.jsxs)(T6,{children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)(b6,{children:l(c)}),(0,ee.jsxs)(E6,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),(0,ee.jsx)(_6,{disabled:n.includes(c.credentialId),onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?(0,ee.jsx)(Ho,{}):(0,ee.jsx)(u2.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,ee.jsx)(Cu,{onClick:o,children:"View all"})]})]})},h6=()=>(0,ee.jsxs)(g2,{children:[(0,ee.jsxs)(xr,{children:[(0,ee.jsx)(Ar,{children:(0,ee.jsx)(m2.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,ee.jsxs)(xr,{children:[(0,ee.jsx)(Ar,{children:(0,ee.jsx)(h2.default,{})}),"More secure than a password."]}),(0,ee.jsxs)(xr,{children:[(0,ee.jsx)(Ar,{children:(0,ee.jsx)(p2.default,{})}),"Takes seconds to set up and use."]})]}),y2=()=>{let{user:e,unlinkPasskey:t}=z(),{linkWithPasskey:r,closePrivyModal:o}=W(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[i,a]=(0,Jn.useState)(!1),[l,s]=(0,Jn.useState)(""),[c,m]=(0,Jn.useState)(!1),[f,u]=(0,Jn.useState)(!1);(0,Jn.useEffect)(()=>{n.length===0&&u(!1)},[n.length]);let w=()=>{a(!0),r().then(()=>m(!0)).catch(g=>{if(g instanceof wt){if(g.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},v=async g=>(a(!0),await t(g).then(()=>m(!0)).catch(E=>{if(E instanceof wt&&E.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(x,{onClose:()=>o()},"header"),(0,ee.jsx)(Ye,{children:(0,ee.jsx)(mt,{status:"success",children:(0,ee.jsx)(f2.default,{})})}),(0,ee.jsx)(d2,{children:"Passkey added"}),(0,ee.jsx)(v6,{children:"From now on, you can use your passkey to log in."}),(0,ee.jsx)(ir,{children:(0,ee.jsx)(H,{onClick:()=>o(),children:"Done"})}),(0,ee.jsx)(J,{})]}):f?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(x,{backFn:()=>u(!1),onClose:()=>o()},"header"),(0,ee.jsx)(c2,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),(0,ee.jsx)(J,{})]}):(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(x,{onClose:()=>o()},"header"),(0,ee.jsx)(Ye,{children:(0,ee.jsxs)(rd,{children:[(0,ee.jsx)(Mi,{}),(0,ee.jsx)(Wi,{})]})}),(0,ee.jsx)(d2,{children:"Secure your account with a passkey"}),(0,ee.jsx)(C6,{}),n.length===0?(0,ee.jsx)(h6,{}):(0,ee.jsx)(c2,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),(0,ee.jsxs)(ir,{style:{marginTop:"12px"},children:[l&&(0,ee.jsx)(y6,{fail:!0,children:l}),(0,ee.jsx)(H,{onClick:w,loading:i,children:"Add new passkey"})]}),(0,ee.jsx)(J,{})]})},rd=cr.default.div`
1658
1658
  display: flex;
1659
1659
  align-items: center;
1660
1660
  justify-content: center;
@@ -1670,7 +1670,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1670
1670
  stroke: var(--privy-color-accent) !important;
1671
1671
  fill: var(--privy-color-accent) !important;
1672
1672
  }
1673
- `,d6=cr.default.div`
1673
+ `,y6=cr.default.div`
1674
1674
  line-height: 20px;
1675
1675
  height: 20px;
1676
1676
  font-size: 13px;
@@ -1678,7 +1678,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1678
1678
  display: flex;
1679
1679
  justify-content: flex-beginngin;
1680
1680
  width: 100%;
1681
- `,p6=cr.css`
1681
+ `,g6=cr.css`
1682
1682
  && {
1683
1683
  width: 100%;
1684
1684
  font-size: 0.875rem;
@@ -1703,9 +1703,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1703
1703
  box-shadow: none;
1704
1704
  }
1705
1705
  }
1706
- `,gu=cr.default.button`
1707
- ${p6}
1708
- `,m2=cr.default.div`
1706
+ `,Cu=cr.default.button`
1707
+ ${g6}
1708
+ `,g2=cr.default.div`
1709
1709
  display: flex;
1710
1710
  flex-direction: column;
1711
1711
  align-items: stretch;
@@ -1713,18 +1713,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1713
1713
  padding: 0.5rem 0rem 0rem;
1714
1714
  flex-grow: 1;
1715
1715
  width: 100%;
1716
- `,a2=cr.default.div`
1716
+ `,d2=cr.default.div`
1717
1717
  font-size: 18px;
1718
1718
  line-height: 18px;
1719
1719
  text-align: center;
1720
1720
  font-weight: 600;
1721
- `,u6=cr.default.div`
1721
+ `,v6=cr.default.div`
1722
1722
  font-size: 0.875rem;
1723
1723
  text-align: center;
1724
1724
  margin-top: 10px;
1725
- `,m6=cr.default.div`
1725
+ `,C6=cr.default.div`
1726
1726
  height: 32px;
1727
- `,f6=cr.default.div`
1727
+ `,w6=cr.default.div`
1728
1728
  line-height: 20px;
1729
1729
  height: 20px;
1730
1730
  font-size: 1em;
@@ -1732,18 +1732,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1732
1732
  display: flex;
1733
1733
  justify-content: flex-beginning;
1734
1734
  width: 100%;
1735
- `,h6=cr.default.div`
1735
+ `,b6=cr.default.div`
1736
1736
  font-size: 1em;
1737
1737
  line-height: 1.3em;
1738
1738
  font-weight: 500;
1739
1739
  color: var(--privy-color-foreground-2);
1740
1740
  padding: 0.2em 0;
1741
- `,y6=cr.default.div`
1741
+ `,E6=cr.default.div`
1742
1742
  font-size: 0.875rem;
1743
1743
  line-height: 1rem;
1744
1744
  color: #64668b;
1745
1745
  padding: 0.2em 0;
1746
- `,g6=cr.default.div`
1746
+ `,T6=cr.default.div`
1747
1747
  display: flex;
1748
1748
  align-items: center;
1749
1749
  justify-content: space-between;
@@ -1756,7 +1756,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1756
1756
  border: 1px solid #e2e3f0 !important;
1757
1757
  width: 100%;
1758
1758
  height: 5em;
1759
- `,v6=cr.css`
1759
+ `,S6=cr.css`
1760
1760
  :focus,
1761
1761
  :hover,
1762
1762
  :active {
@@ -1773,15 +1773,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
1773
1773
  svg:hover {
1774
1774
  color: var(--privy-color-foreground-3);
1775
1775
  }
1776
- `,C6=cr.default.button`
1777
- ${v6}
1778
- `;var f2=gr.default.div`
1776
+ `,_6=cr.default.button`
1777
+ ${S6}
1778
+ `;var v2=gr.default.div`
1779
1779
  display: flex;
1780
1780
  flex-direction: column;
1781
1781
  gap: 12px;
1782
1782
  padding-top: 24px;
1783
1783
  padding-bottom: 24px;
1784
- `,td=gr.default.div`
1784
+ `,od=gr.default.div`
1785
1785
  width: 24px;
1786
1786
  height: 24px;
1787
1787
  display: flex;
@@ -1791,19 +1791,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
1791
1791
  svg {
1792
1792
  border-radius: var(--privy-border-radius-sm);
1793
1793
  }
1794
- `,rd=gr.default.div`
1794
+ `,nd=gr.default.div`
1795
1795
  display: flex;
1796
1796
  flex-direction: column;
1797
1797
  justify-content: center;
1798
1798
  align-items: center;
1799
1799
  gap: 8px;
1800
- `,od=gr.default.div`
1800
+ `,id=gr.default.div`
1801
1801
  display: flex;
1802
1802
  align-items: baseline;
1803
1803
  gap: 4px;
1804
- `,h2=gr.default.div`
1804
+ `,C2=gr.default.div`
1805
1805
  font-size: 42px !important;
1806
- `,y2=gr.default.input`
1806
+ `,w2=gr.default.input`
1807
1807
  font-size: 42px !important;
1808
1808
  text-align: right;
1809
1809
  background-color: var(--privy-color-background);
@@ -1818,17 +1818,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
1818
1818
  border: none !important;
1819
1819
  box-shadow: none !important;
1820
1820
  }
1821
- `,g2=gr.default.div`
1821
+ `,b2=gr.default.div`
1822
1822
  cursor: pointer;
1823
1823
  padding-left: 4px;
1824
- `,nd=gr.default.div`
1824
+ `,ad=gr.default.div`
1825
1825
  font-size: 18px;
1826
- `,id=gr.default.div`
1826
+ `,sd=gr.default.div`
1827
1827
  font-size: 12px;
1828
1828
  color: var(--privy-color-foreground-3);
1829
1829
  // we need this container to maintain a static height if there's no content
1830
1830
  height: 20px;
1831
- `,v2=gr.default.div`
1831
+ `,E2=gr.default.div`
1832
1832
  display: flex;
1833
1833
  flex-direction: row;
1834
1834
  line-height: 22px;
@@ -1838,34 +1838,34 @@ You will need this password to access your ${e} wallet on a new device. Please k
1838
1838
  margin-right: 6px;
1839
1839
  margin: auto;
1840
1840
  }
1841
- `,C2=(0,gr.default)(gu)`
1841
+ `,T2=(0,gr.default)(Cu)`
1842
1842
  margin-top: 16px;
1843
- `,w6=gr.keyframes`
1843
+ `,P6=gr.keyframes`
1844
1844
  from {
1845
1845
  opacity: 0;
1846
1846
  }
1847
1847
  to {
1848
1848
  opacity: 1;
1849
1849
  }
1850
- `,w2=(0,gr.default)(Ln)`
1850
+ `,S2=(0,gr.default)(Dn)`
1851
1851
  border-radius: var(--privy-border-radius-md) !important;
1852
- animation: ${w6} 0.3s ease-in-out;
1853
- `;var Ke=require("react/jsx-runtime"),b2=()=>{let{wallets:e}=mo(),{app:t,navigate:r,data:o,setModalData:n}=A(),i=o?.funding,a=(0,Fa.useRef)(null),[l,s]=(0,Fa.useState)(!1);(0,Fa.useEffect)(()=>{a.current&&a.current.style.setProperty("--funding-input-length",Math.max(i.amount.length,1).toString())},[i.amount]);let c=t.fundingConfig?.methods.slice()??[],{tokenPrice:m}=Ko({chainId:i.chain.id}),f=m?jc(i.amount,m):void 0,u=e.find(E=>(0,vu.getAddress)(E.address)===(0,vu.getAddress)(i.address)),w=u&&u.walletClientType!=="privy"?Un(u.walletClientType,u.connectorType,u.walletClientType):t.name,v=parseFloat(i.amount),g=!isNaN(v)&&v>0;return(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(Hr,{}),(0,Ke.jsxs)("h3",{children:["Add funds to your"," ",w?.toLowerCase().endsWith("wallet")?w:w+" wallet"]}),(0,Ke.jsx)(Nn,{style:{marginTop:"32px"},children:(0,Ke.jsxs)(rd,{children:[(0,Ke.jsxs)(od,{onClick:()=>a.current?.focus(),children:[(0,Ke.jsx)(y2,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:E=>{let T=E.target.value;/^[0-9.]*$/.test(T)&&T.split(".").length-1<=1&&n({...o,funding:{...i,amount:T}})}}),(0,Ke.jsx)(nd,{children:i.chain.nativeCurrency.symbol}),!l&&(0,Ke.jsx)(g2,{children:(0,Ke.jsx)(ad.PencilIcon,{width:12,height:12})})]}),(0,Ke.jsx)(id,{children:f&&g?f:""})]})}),(0,Ke.jsxs)(f2,{children:[i.errorMessage&&(0,Ke.jsx)(n2,{children:i.errorMessage}),c.sort().map(E=>{switch(E){case"moonpay":return(0,Ke.jsxs)(Oe,{disabled:!g,onClick:()=>{r("MOONPAY_PROMPT_SCREEN")},children:[(0,Ke.jsx)(td,{children:(0,Ke.jsx)(Ua,{style:{width:24}})}),"Moonpay"]},E);case"coinbase-onramp":return Y1(Number(i.chain.id))?(0,Ke.jsxs)(Oe,{disabled:!g,onClick:()=>{r("COINBASE_ONRAMP_STATUS_SCREEN")},children:[(0,Ke.jsx)(td,{children:(0,Ke.jsx)(ln,{style:{width:24}})}),"Coinbase Onramp"]},E):null;case"external":return(0,Ke.jsxs)(Oe,{disabled:!g,onClick:()=>{r("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[(0,Ke.jsx)(td,{children:(0,Ke.jsx)(ad.WalletIcon,{style:{width:24}})}),"Transfer from wallet"]},E)}}),(0,Ke.jsx)(C2,{disabled:!g,onClick:()=>r("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),(0,Ke.jsx)(j,{})]})};var R2=require("@ethersproject/units"),Ba=require("@heroicons/react/24/outline"),Qn=require("react"),Mi=y(require("styled-components"));var k2=y(require("styled-components"));var E2=y(require("styled-components")),T2=E2.default.div`
1852
+ animation: ${P6} 0.3s ease-in-out;
1853
+ `;var Ke=require("react/jsx-runtime"),_2=()=>{let{wallets:e}=fo(),{app:t,navigate:r,data:o,setModalData:n}=P(),i=o?.funding,a=(0,Ha.useRef)(null),[l,s]=(0,Ha.useState)(!1);(0,Ha.useEffect)(()=>{a.current&&a.current.style.setProperty("--funding-input-length",Math.max(i.amount.length,1).toString())},[i.amount]);let c=t.fundingConfig?.methods.slice()??[],{tokenPrice:m}=jo({chainId:i.chain.id}),f=m?Zc(i.amount,m):void 0,u=e.find(E=>(0,wu.getAddress)(E.address)===(0,wu.getAddress)(i.address)),w=u&&u.walletClientType!=="privy"?Bn(u.walletClientType,u.connectorType,u.walletClientType):t.name,v=parseFloat(i.amount),g=!isNaN(v)&&v>0;return(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(Gr,{}),(0,Ke.jsxs)("h3",{children:["Add funds to your"," ",w?.toLowerCase().endsWith("wallet")?w:w+" wallet"]}),(0,Ke.jsx)(Un,{style:{marginTop:"32px"},children:(0,Ke.jsxs)(nd,{children:[(0,Ke.jsxs)(id,{onClick:()=>a.current?.focus(),children:[(0,Ke.jsx)(w2,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:E=>{let S=E.target.value;/^[0-9.]*$/.test(S)&&S.split(".").length-1<=1&&n({...o,funding:{...i,amount:S}})}}),(0,Ke.jsx)(ad,{children:i.chain.nativeCurrency.symbol}),!l&&(0,Ke.jsx)(b2,{children:(0,Ke.jsx)(ld.PencilIcon,{width:12,height:12})})]}),(0,Ke.jsx)(sd,{children:f&&g?f:""})]})}),(0,Ke.jsxs)(v2,{children:[i.errorMessage&&(0,Ke.jsx)(l2,{children:i.errorMessage}),c.sort().map(E=>{switch(E){case"moonpay":return(0,Ke.jsxs)(Oe,{disabled:!g,onClick:()=>{r("MOONPAY_PROMPT_SCREEN")},children:[(0,Ke.jsx)(od,{children:(0,Ke.jsx)(Ba,{style:{width:24}})}),"Moonpay"]},E);case"coinbase-onramp":return X1(Number(i.chain.id))?(0,Ke.jsxs)(Oe,{disabled:!g,onClick:()=>{r("COINBASE_ONRAMP_STATUS_SCREEN")},children:[(0,Ke.jsx)(od,{children:(0,Ke.jsx)(cn,{style:{width:24}})}),"Coinbase Onramp"]},E):null;case"external":return(0,Ke.jsxs)(Oe,{disabled:!g,onClick:()=>{r("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[(0,Ke.jsx)(od,{children:(0,Ke.jsx)(ld.WalletIcon,{style:{width:24}})}),"Transfer from wallet"]},E)}}),(0,Ke.jsx)(T2,{disabled:!g,onClick:()=>r("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),(0,Ke.jsx)(K,{})]})};var O2=require("@ethersproject/units"),Ga=require("@heroicons/react/24/outline"),Xn=require("react"),Oi=y(require("styled-components"));var W2=y(require("styled-components"));var P2=y(require("styled-components")),A2=P2.default.div`
1854
1854
  display: flex;
1855
1855
  flex-direction: column;
1856
- `;var S2=y(require("styled-components")),Ds=S2.default.span`
1856
+ `;var x2=y(require("styled-components")),Us=x2.default.span`
1857
1857
  text-align: left;
1858
1858
  font-size: 0.75rem;
1859
1859
  font-weight: 500;
1860
1860
  line-height: 1.125rem; /* 150% */
1861
1861
 
1862
1862
  color: var(--privy-color-error);
1863
- `;var _2=y(require("styled-components")),P2=_2.default.span`
1863
+ `;var k2=y(require("styled-components")),R2=k2.default.span`
1864
1864
  color: var(--privy-color-foreground-3);
1865
1865
  font-size: 0.75rem;
1866
1866
  font-weight: 500;
1867
1867
  line-height: 1.125rem; /* 150% */
1868
- `;var A2=y(require("@heroicons/react/24/outline/Square2StackIcon")),x2=y(require("styled-components"));var Us=require("react/jsx-runtime"),Fs=({address:e,showCopyIcon:t,url:r,className:o})=>r?(0,Us.jsx)("a",{title:e,className:o,href:`${r}/address/${e}`,target:"_blank",children:Wt(e)}):(0,Us.jsxs)("button",{title:e,className:o,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[Wt(e),t&&(0,Us.jsx)(b6,{})]}),b6=(0,x2.default)(A2.default)`
1868
+ `;var I2=y(require("@heroicons/react/24/outline/Square2StackIcon")),M2=y(require("styled-components"));var Fs=require("react/jsx-runtime"),Bs=({address:e,showCopyIcon:t,url:r,className:o})=>r?(0,Fs.jsx)("a",{title:e,className:o,href:`${r}/address/${e}`,target:"_blank",children:Wt(e)}):(0,Fs.jsxs)("button",{title:e,className:o,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[Wt(e),t&&(0,Fs.jsx)(A6,{})]}),A6=(0,M2.default)(I2.default)`
1869
1869
  && {
1870
1870
  display: inline;
1871
1871
  }
@@ -1874,7 +1874,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1874
1874
  width: 0.875rem;
1875
1875
  margin-left: 0.125rem;
1876
1876
  color: var(--privy-color-foreground-3);
1877
- `;var Mo=require("react/jsx-runtime"),sd=({errMsg:e,balance:t,address:r,isLoading:o,className:n,title:i,isPulsing:a,statusColor:l="green"})=>{let s;return l?s=l:e?s="red":s="green",(0,Mo.jsxs)(Mo.Fragment,{children:[(0,Mo.jsxs)(E6,{className:n,$state:e?"error":void 0,children:[(0,Mo.jsxs)(T2,{children:[(0,Mo.jsx)(P2,{children:i||"Pay with"}),(0,Mo.jsx)(Fs,{address:r,showCopyIcon:!!e})]}),(0,Mo.jsx)(kr,{isLoading:o,isPulsing:a,color:s,children:t})]}),e&&(0,Mo.jsx)(Ds,{style:{marginTop:"0.25rem"},children:e})]})},E6=k2.default.div`
1877
+ `;var Wo=require("react/jsx-runtime"),cd=({errMsg:e,balance:t,address:r,isLoading:o,className:n,title:i,isPulsing:a,statusColor:l="green"})=>{let s;return l?s=l:e?s="red":s="green",(0,Wo.jsxs)(Wo.Fragment,{children:[(0,Wo.jsxs)(x6,{className:n,$state:e?"error":void 0,children:[(0,Wo.jsxs)(A2,{children:[(0,Wo.jsx)(R2,{children:i||"Pay with"}),(0,Wo.jsx)(Bs,{address:r,showCopyIcon:!!e})]}),(0,Wo.jsx)(Rr,{isLoading:o,isPulsing:a,color:s,children:t})]}),e&&(0,Wo.jsx)(Us,{style:{marginTop:"0.25rem"},children:e})]})},x6=W2.default.div`
1878
1878
  && {
1879
1879
  border-width: 1px;
1880
1880
  }
@@ -1888,11 +1888,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1888
1888
  align-items: center;
1889
1889
 
1890
1890
  ${e=>e.$state==="error"?"border-color: var(--privy-color-error);":""}
1891
- `;var ce=require("react/jsx-runtime"),T6=2e3,I2=()=>{let{wallets:e}=mo(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=A(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:c}=W(),[m,f]=(0,Qn.useState)("default"),[u,w]=(0,Qn.useState)(void 0),v=r?.funding,{tokenPrice:g}=Ko({chainId:v.chain.id}),E=g?jc(v.amount,g):void 0,T=e.find(I=>Wt(I.address)===Wt(v.address)),R=T&&T.walletClientType!=="privy"?Un(T.walletClientType,T.connectorType,T.walletClientType):t.name;if(!v)return o({errorModalData:{error:new Error("Couldn't find funding config"),previousScreen:i||"FUNDING_METHOD_SELECTION_SCREEN"},funding:r?.funding,sendTransaction:r?.sendTransaction}),n("ERROR_SCREEN"),(0,ce.jsx)(ce.Fragment,{});(0,Qn.useEffect)(()=>{let I=Er(v.chain.id,a,l,{appId:s});function M(){I.getBalance(v.address).then(G=>w(parseFloat((0,R2.formatUnits)(G,"ether")))).catch(()=>w(void 0))}let U=setInterval(M,T6);return M(),()=>clearInterval(U)},[]);let S=(0,Qn.useMemo)(()=>u!==void 0?u>=parseFloat(v.amount):!1,[u,v.amount]),x=(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(sd,{title:"Your wallet",errMsg:void 0,isLoading:!v||u===void 0,isPulsing:!S,balance:`${u!==void 0?u.toPrecision(2):""} ETH`,address:v.address,statusColor:S?"green":"gray"}),S&&(0,ce.jsx)(w2,{onClick:()=>c(),children:"Close"})]});return m==="qr-code"?(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(k,{backFn:()=>f("default")}),(0,ce.jsxs)(Nn,{style:{gap:"24px",marginBottom:"24px"},children:[(0,ce.jsxs)("div",{children:[(0,ce.jsx)(Te,{children:"Scan QR code"}),(0,ce.jsxs)(Pe,{children:["Scan this code using your mobile wallet to send funds to your ",R," ","wallet."]})]}),(0,ce.jsx)(jn,{url:v.address,size:200,squareLogoElement:S6}),x]}),(0,ce.jsx)(j,{})]}):(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(Hr,{}),(0,ce.jsx)(ke,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),(0,ce.jsxs)(Nn,{style:{gap:"16px"},children:[(0,ce.jsxs)(A6,{children:[(0,ce.jsx)(Ba.InformationCircleIcon,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),(0,ce.jsxs)(x6,{children:["Make sure to send on ",v.chain.name,"."]})]}),(0,ce.jsxs)(k6,{children:[(0,ce.jsx)(fa,{height:16}),(0,ce.jsxs)(rd,{children:[(0,ce.jsxs)(od,{children:[(0,ce.jsx)(h2,{children:v.amount}),(0,ce.jsx)(nd,{children:v.chain.nativeCurrency.symbol})]}),(0,ce.jsx)(id,{children:E?`${E} USD`:"..."}),(0,ce.jsxs)(v2,{children:[kc(v.chain.id),v.chain.name]})]}),(0,ce.jsx)(fa,{height:8}),(0,ce.jsxs)(P6,{children:[(0,ce.jsx)(_6,{text:v.address}),(0,ce.jsx)(W2,{onClick:()=>f("qr-code"),children:(0,ce.jsxs)(M2,{children:[(0,ce.jsx)(Ba.QrCodeIcon,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),x]}),(0,ce.jsx)(fa,{height:16}),(0,ce.jsx)(j,{})]})},S6=({...e})=>(0,ce.jsx)(Mn,{color:"black",...e}),_6=e=>{let[t,r]=(0,Qn.useState)(!1);return(0,ce.jsx)(W2,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:(0,ce.jsxs)(M2,{children:[t?(0,ce.jsx)(Ia,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):(0,ce.jsx)(Ba.DocumentDuplicateIcon,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},P6=Mi.default.div`
1891
+ `;var de=require("react/jsx-runtime"),k6=2e3,L2=()=>{let{wallets:e}=fo(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=P(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:c}=W(),[m,f]=(0,Xn.useState)("default"),[u,w]=(0,Xn.useState)(void 0),v=r?.funding,{tokenPrice:g}=jo({chainId:v.chain.id}),E=g?Zc(v.amount,g):void 0,S=e.find(I=>Wt(I.address)===Wt(v.address)),R=S&&S.walletClientType!=="privy"?Bn(S.walletClientType,S.connectorType,S.walletClientType):t.name;if(!v)return o({errorModalData:{error:new Error("Couldn't find funding config"),previousScreen:i||"FUNDING_METHOD_SELECTION_SCREEN"},funding:r?.funding,sendTransaction:r?.sendTransaction}),n("ERROR_SCREEN"),(0,de.jsx)(de.Fragment,{});(0,Xn.useEffect)(()=>{let I=Er(v.chain.id,a,l,{appId:s});function M(){I.getBalance(v.address).then(G=>w(parseFloat((0,O2.formatUnits)(G,"ether")))).catch(()=>w(void 0))}let U=setInterval(M,k6);return M(),()=>clearInterval(U)},[]);let _=(0,Xn.useMemo)(()=>u!==void 0?u>=parseFloat(v.amount):!1,[u,v.amount]),k=(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(cd,{title:"Your wallet",errMsg:void 0,isLoading:!v||u===void 0,isPulsing:!_,balance:`${u!==void 0?u.toPrecision(2):""} ETH`,address:v.address,statusColor:_?"green":"gray"}),_&&(0,de.jsx)(S2,{onClick:()=>c(),children:"Close"})]});return m==="qr-code"?(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(x,{backFn:()=>f("default")}),(0,de.jsxs)(Un,{style:{gap:"24px",marginBottom:"24px"},children:[(0,de.jsxs)("div",{children:[(0,de.jsx)(Te,{children:"Scan QR code"}),(0,de.jsxs)(Pe,{children:["Scan this code using your mobile wallet to send funds to your ",R," ","wallet."]})]}),(0,de.jsx)(Zn,{url:v.address,size:200,squareLogoElement:R6}),k]}),(0,de.jsx)(K,{})]}):(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(Gr,{}),(0,de.jsx)(xe,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),(0,de.jsxs)(Un,{style:{gap:"16px"},children:[(0,de.jsxs)(W6,{children:[(0,de.jsx)(Ga.InformationCircleIcon,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),(0,de.jsxs)(O6,{children:["Make sure to send on ",v.chain.name,"."]})]}),(0,de.jsxs)(L6,{children:[(0,de.jsx)(ya,{height:16}),(0,de.jsxs)(nd,{children:[(0,de.jsxs)(id,{children:[(0,de.jsx)(C2,{children:v.amount}),(0,de.jsx)(ad,{children:v.chain.nativeCurrency.symbol})]}),(0,de.jsx)(sd,{children:E?`${E} USD`:"..."}),(0,de.jsxs)(E2,{children:[Ic(v.chain.id),v.chain.name]})]}),(0,de.jsx)(ya,{height:8}),(0,de.jsxs)(M6,{children:[(0,de.jsx)(I6,{text:v.address}),(0,de.jsx)(D2,{onClick:()=>f("qr-code"),children:(0,de.jsxs)(N2,{children:[(0,de.jsx)(Ga.QrCodeIcon,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),k]}),(0,de.jsx)(ya,{height:16}),(0,de.jsx)(K,{})]})},R6=({...e})=>(0,de.jsx)(On,{color:"black",...e}),I6=e=>{let[t,r]=(0,Xn.useState)(!1);return(0,de.jsx)(D2,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:(0,de.jsxs)(N2,{children:[t?(0,de.jsx)(Wa,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):(0,de.jsx)(Ga.DocumentDuplicateIcon,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},M6=Oi.default.div`
1892
1892
  display: flex;
1893
1893
  flex-direction: row;
1894
1894
  gap: 8px;
1895
- `,A6=Mi.default.div`
1895
+ `,W6=Oi.default.div`
1896
1896
  display: flex;
1897
1897
  flex-direction: row;
1898
1898
  padding: 8px;
@@ -1901,11 +1901,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1901
1901
  svg {
1902
1902
  margin-right: 12px;
1903
1903
  }
1904
- `,x6=Mi.default.div`
1904
+ `,O6=Oi.default.div`
1905
1905
  line-height: 20px;
1906
1906
  font-size: 18px
1907
1907
  text-align: center;
1908
- `,k6=Mi.default.div`
1908
+ `,L6=Oi.default.div`
1909
1909
  display: flex;
1910
1910
  flex-direction: column;
1911
1911
  background-color: var(--privy-color-background-2);
@@ -1915,11 +1915,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1915
1915
  }
1916
1916
  padding: 16px;
1917
1917
  gap: 8px;
1918
- `,M2=Mi.default.span`
1918
+ `,N2=Oi.default.span`
1919
1919
  display: flex;
1920
1920
  align-items: center;
1921
1921
  margin: auto;
1922
- `,W2=Mi.default.button`
1922
+ `,D2=Oi.default.button`
1923
1923
  display: flex;
1924
1924
  align-items: center;
1925
1925
  width: 100%;
@@ -1956,7 +1956,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1956
1956
  width: 18px;
1957
1957
  height: 18px;
1958
1958
  }
1959
- `;var dd=require("react");var O2=y(require("@heroicons/react/24/outline/ClockIcon")),L2=y(require("@heroicons/react/24/outline/EyeSlashIcon")),N2=y(require("@heroicons/react/24/outline/LinkIcon")),Wo=y(require("styled-components"));var Je=require("react/jsx-runtime"),Cu=({title:e,desc:t,icon:r})=>(0,Je.jsxs)(L6,{children:[(0,Je.jsx)(D6,{children:r}),(0,Je.jsxs)(N6,{children:[(0,Je.jsx)(W6,{children:e}),(0,Je.jsx)(O6,{children:t})]})]}),D2=({app:e,signedUrl:t,onContinue:r})=>(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(I6,{children:[(0,Je.jsx)(Ua,{size:"3.75rem"}),(0,Je.jsxs)(M6,{children:[e?.name," uses ",(0,Je.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,Je.jsxs)(U6,{children:[(0,Je.jsx)(Cu,{icon:(0,Je.jsx)(N2.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,Je.jsxs)(Je.Fragment,{children:["Connect a payment method (",(0,Je.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,Je.jsx)(Cu,{icon:(0,Je.jsx)(O2.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,Je.jsx)(Cu,{icon:(0,Je.jsx)(L2.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,Je.jsx)(F6,{className:"mobile-only"})]}),(0,Je.jsx)(R6,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,Je.jsx)(mc,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),R6=Wo.default.span`
1959
+ `;var ud=require("react");var U2=y(require("@heroicons/react/24/outline/ClockIcon")),F2=y(require("@heroicons/react/24/outline/EyeSlashIcon")),B2=y(require("@heroicons/react/24/outline/LinkIcon")),Oo=y(require("styled-components"));var Je=require("react/jsx-runtime"),bu=({title:e,desc:t,icon:r})=>(0,Je.jsxs)(H6,{children:[(0,Je.jsx)(V6,{children:r}),(0,Je.jsxs)(G6,{children:[(0,Je.jsx)(F6,{children:e}),(0,Je.jsx)(B6,{children:t})]})]}),H2=({app:e,signedUrl:t,onContinue:r})=>(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(D6,{children:[(0,Je.jsx)(Ba,{size:"3.75rem"}),(0,Je.jsxs)(U6,{children:[e?.name," uses ",(0,Je.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,Je.jsxs)(q6,{children:[(0,Je.jsx)(bu,{icon:(0,Je.jsx)(B2.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,Je.jsxs)(Je.Fragment,{children:["Connect a payment method (",(0,Je.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,Je.jsx)(bu,{icon:(0,Je.jsx)(U2.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,Je.jsx)(bu,{icon:(0,Je.jsx)(F2.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,Je.jsx)(z6,{className:"mobile-only"})]}),(0,Je.jsx)(N6,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,Je.jsx)(hc,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),N6=Oo.default.span`
1960
1960
  display: inline-block;
1961
1961
  color: var(--privy-color-foreground-3);
1962
1962
  text-align: center;
@@ -1965,13 +1965,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
1965
1965
  font-weight: 400;
1966
1966
  line-height: 140%; /* 0.875rem */
1967
1967
  margin-bottom: 0.25rem;
1968
- `,I6=Wo.default.div`
1968
+ `,D6=Oo.default.div`
1969
1969
  display: flex;
1970
1970
  flex-direction: column;
1971
1971
  align-items: center;
1972
1972
  justify-content: center;
1973
1973
  padding: 1.5rem 0;
1974
- `,M6=Wo.default.span`
1974
+ `,U6=Oo.default.span`
1975
1975
  color: var(--privy-color-foreground);
1976
1976
  text-align: center;
1977
1977
  font-size: 1.125rem;
@@ -1980,46 +1980,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
1980
1980
  margin: 1.5rem 0;
1981
1981
  text-align: center;
1982
1982
  max-width: 19.5rem;
1983
- `,W6=Wo.default.span`
1983
+ `,F6=Oo.default.span`
1984
1984
  color: var(--privy-color-foreground);
1985
1985
  font-size: 0.875rem;
1986
1986
  font-weight: 500;
1987
1987
  line-height: 1.225rem;
1988
1988
  width: 100%;
1989
- `,O6=Wo.default.span`
1989
+ `,B6=Oo.default.span`
1990
1990
  color: var(--privy-color-foreground-2);
1991
1991
  font-size: 0.875rem;
1992
1992
  font-weight: 400;
1993
1993
  line-height: 1.225rem;
1994
- `,L6=Wo.default.div`
1994
+ `,H6=Oo.default.div`
1995
1995
  display: flex;
1996
1996
  align-items: flex-start;
1997
1997
  gap: 0.5rem;
1998
1998
  align-self: stretch;
1999
- `,N6=Wo.default.div`
1999
+ `,G6=Oo.default.div`
2000
2000
  display: flex;
2001
2001
  flex-direction: column;
2002
2002
  gap: 0.25rem;
2003
2003
  align-items: flex-start;
2004
2004
  text-align: left;
2005
2005
  flex: 1 0 0;
2006
- `,D6=Wo.default.div`
2006
+ `,V6=Oo.default.div`
2007
2007
  padding-top: 2px;
2008
- `,U6=Wo.default.div`
2008
+ `,q6=Oo.default.div`
2009
2009
  display: flex;
2010
2010
  flex-direction: column;
2011
2011
  gap: 1.25rem;
2012
2012
  margin: 0 0.5rem;
2013
- `,F6=Wo.default.div`
2013
+ `,z6=Oo.default.div`
2014
2014
  margin: 30px 0;
2015
- `;var U2=require("ofetch"),Ha=require("react");var ld="moonpay";function F2(e){switch(e){case"eip155:42161":return"ETH_ARBITRUM";case"eip155:43114":return"AVAX_CCHAIN";case"eip155:8453":return"ETH_BASE";case"eip155:42220":return"CELO_CELO";case"eip155:137":return"MATIC_POLYGON";case"eip155:1":return"ETH_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function B2(e){return parseFloat(e)}function H2(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function cd(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function G2(e,t,r,o,n=!1){let i=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...i,...a}})}async function B6(e,t){let r=t?Tf:Ef,o=t?_f:Sf;return(0,U2.ofetch)(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function V2(e,t=!1){let[r,o]=(0,Ha.useState)(null),{createAnalyticsEvent:n}=W(),{data:i,navigate:a,setModalData:l}=A(),s=i?.funding,c=(0,Ha.useRef)(0);return(0,Ha.useEffect)(()=>{let m=setInterval(async()=>{if(e)try{let[f]=await B6(e,t),u=f.status==="waitingAuthorization"&&f.paymentMethod==="credit_debit_card"?"pending":f.status;if(["failed","completed","awaitingAuthorization"].includes(u)&&(n({eventName:Na,payload:{status:u,provider:ld,paymentMethod:f.paymentMethod,cardPaymentType:f.cardPaymentType,currency:f.currency?.code,baseCurrencyAmount:f.baseCurrencyAmount,quoteCurrencyAmount:f.quoteCurrencyAmount,feeAmount:f.feeAmount,extraFeeAmount:f.extraFeeAmount,networkFeeAmount:f.networkFeeAmount}}),clearInterval(m)),u==="failed"||u==="serviceFailure"){l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN");return}o(u)}catch(f){f.response?.status!==404&&(c.current+=1),c.current>=3&&(n({eventName:Na,payload:{status:"serviceFailure",provider:ld}}),clearInterval(m),l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN"))}},3e3);return()=>clearInterval(m)},[e,c]),r}var Jn=require("react/jsx-runtime"),q2=()=>{let{app:e,data:t,navigate:r,setModalData:o}=A(),{createAnalyticsEvent:n,getMoonpaySignedUrl:i}=W(),[a,l]=(0,dd.useState)(null),s=t?.funding;return(0,dd.useEffect)(()=>{if(a||!s)return;async function c(){if(!e.fundingConfig)return;let{signedUrl:m,externalTransactionId:f}=await i(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??F2(`eip155:${s.chain.id}`),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??B2(s.amount)});l(m),o({moonpayStatus:{externalTransactionId:f},funding:t?.funding})}c()},[a,s]),(0,Jn.jsxs)(Jn.Fragment,{children:[(0,Jn.jsx)(Hr,{}),(0,Jn.jsx)(D2,{app:e,signedUrl:a,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:ld}}),r("MOONPAY_STATUS_SCREEN")}}),(0,Jn.jsx)(j,{})]})};var z2=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),$2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),K2=require("react"),wu=y(require("styled-components"));var ht=require("react/jsx-runtime"),j2=()=>{let{app:e,data:t}=A(),{closePrivyModal:r}=W(),{externalTransactionId:o}=t?.moonpayStatus,n=V2(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsx)(k,{title:"Fund account"},"header"),(0,ht.jsx)(G6,{status:n,onClickCta:r}),(0,ht.jsx)(j,{})]})},H6=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},G6=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,K2.useMemo)(()=>H6(e),[e]);return(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsxs)(K6,{children:[(0,ht.jsx)(z6,{status:e}),(0,ht.jsxs)(pt,{children:[(0,ht.jsx)("h3",{children:r}),(0,ht.jsx)($6,{children:o})]})]}),n&&(0,ht.jsx)(H,{onClick:t,children:n})]})},V6=e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)",q6=e=>{switch(e){case"completed":return $2.default;case"waitingAuthorization":return()=>(0,ht.jsx)(z2.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},z6=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return(0,ht.jsxs)("div",{style:{position:"relative"},children:[(0,ht.jsx)(At,{color:o,style:{position:"absolute"}}),(0,ht.jsx)(Cs,{color:o}),(0,ht.jsx)(Ua,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=q6(e),r=V6(e);return(0,ht.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,ht.jsx)(t,{width:"4rem",height:"4rem",color:r})})},$6=wu.default.p`
2015
+ `;var G2=require("ofetch"),Va=require("react");var dd="moonpay";function V2(e){switch(e){case"eip155:42161":return"ETH_ARBITRUM";case"eip155:43114":return"AVAX_CCHAIN";case"eip155:8453":return"ETH_BASE";case"eip155:42220":return"CELO_CELO";case"eip155:137":return"MATIC_POLYGON";case"eip155:1":return"ETH_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function q2(e){return parseFloat(e)}function z2(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function pd(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function $2(e,t,r,o,n=!1){let i=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...i,...a}})}async function $6(e,t){let r=t?Pf:_f,o=t?xf:Af;return(0,G2.ofetch)(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function K2(e,t=!1){let[r,o]=(0,Va.useState)(null),{createAnalyticsEvent:n}=W(),{data:i,navigate:a,setModalData:l}=P(),s=i?.funding,c=(0,Va.useRef)(0);return(0,Va.useEffect)(()=>{let m=setInterval(async()=>{if(e)try{let[f]=await $6(e,t),u=f.status==="waitingAuthorization"&&f.paymentMethod==="credit_debit_card"?"pending":f.status;if(["failed","completed","awaitingAuthorization"].includes(u)&&(n({eventName:Ua,payload:{status:u,provider:dd,paymentMethod:f.paymentMethod,cardPaymentType:f.cardPaymentType,currency:f.currency?.code,baseCurrencyAmount:f.baseCurrencyAmount,quoteCurrencyAmount:f.quoteCurrencyAmount,feeAmount:f.feeAmount,extraFeeAmount:f.extraFeeAmount,networkFeeAmount:f.networkFeeAmount}}),clearInterval(m)),u==="failed"||u==="serviceFailure"){l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN");return}o(u)}catch(f){f.response?.status!==404&&(c.current+=1),c.current>=3&&(n({eventName:Ua,payload:{status:"serviceFailure",provider:dd}}),clearInterval(m),l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN"))}},3e3);return()=>clearInterval(m)},[e,c]),r}var ei=require("react/jsx-runtime"),j2=()=>{let{app:e,data:t,navigate:r,setModalData:o}=P(),{createAnalyticsEvent:n,getMoonpaySignedUrl:i}=W(),[a,l]=(0,ud.useState)(null),s=t?.funding;return(0,ud.useEffect)(()=>{if(a||!s)return;async function c(){if(!e.fundingConfig)return;let{signedUrl:m,externalTransactionId:f}=await i(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??V2(`eip155:${s.chain.id}`),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??q2(s.amount)});l(m),o({moonpayStatus:{externalTransactionId:f},funding:t?.funding})}c()},[a,s]),(0,ei.jsxs)(ei.Fragment,{children:[(0,ei.jsx)(Gr,{}),(0,ei.jsx)(H2,{app:e,signedUrl:a,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:dd}}),r("MOONPAY_STATUS_SCREEN")}}),(0,ei.jsx)(K,{})]})};var Y2=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),Z2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Q2=require("react"),Eu=y(require("styled-components"));var ht=require("react/jsx-runtime"),J2=()=>{let{app:e,data:t}=P(),{closePrivyModal:r}=W(),{externalTransactionId:o}=t?.moonpayStatus,n=K2(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsx)(x,{title:"Fund account"},"header"),(0,ht.jsx)(j6,{status:n,onClickCta:r}),(0,ht.jsx)(K,{})]})},K6=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},j6=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,Q2.useMemo)(()=>K6(e),[e]);return(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsxs)(X6,{children:[(0,ht.jsx)(Q6,{status:e}),(0,ht.jsxs)(pt,{children:[(0,ht.jsx)("h3",{children:r}),(0,ht.jsx)(J6,{children:o})]})]}),n&&(0,ht.jsx)(H,{onClick:t,children:n})]})},Y6=e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)",Z6=e=>{switch(e){case"completed":return Z2.default;case"waitingAuthorization":return()=>(0,ht.jsx)(Y2.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},Q6=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return(0,ht.jsxs)("div",{style:{position:"relative"},children:[(0,ht.jsx)(xt,{color:o,style:{position:"absolute"}}),(0,ht.jsx)(ws,{color:o}),(0,ht.jsx)(Ba,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=Z6(e),r=Y6(e);return(0,ht.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,ht.jsx)(t,{width:"4rem",height:"4rem",color:r})})},J6=Eu.default.p`
2016
2016
  font-size: 1rem;
2017
2017
  color: var(--privy-color-foreground-3);
2018
2018
  margin-bottom: 1rem;
2019
2019
  display: flex;
2020
2020
  flex-direction: column;
2021
2021
  gap: 1rem;
2022
- `,K6=wu.default.div`
2022
+ `,X6=Eu.default.div`
2023
2023
  display: flex;
2024
2024
  flex-direction: column;
2025
2025
  align-items: center;
@@ -2027,7 +2027,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2027
2027
  margin-left: 1.75rem;
2028
2028
  margin-right: 1.75rem;
2029
2029
  padding: 2rem 0;
2030
- `;var fd=require("react");var Y2=y(require("styled-components")),Ga=Y2.default.span`
2030
+ `;var yd=require("react");var X2=y(require("styled-components")),qa=X2.default.span`
2031
2031
  margin-top: 4px;
2032
2032
  color: var(--privy-color-foreground);
2033
2033
  text-align: center;
@@ -2035,7 +2035,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2035
2035
  font-size: 0.875rem;
2036
2036
  font-weight: 400;
2037
2037
  line-height: 1.375rem; /* 157.143% */
2038
- `;var pd=y(require("styled-components"));var Z2=require("react/jsx-runtime"),ud=()=>{let{enabled:e,token:t}=We(),{navigate:r,setModalData:o}=A(),{initLoginWithPasskey:n}=W();return(0,Z2.jsx)(bu,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:a=>n(a),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSKEY_SYSTEM_DIALOGUE",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await n(),r("AWAITING_PASSKEY_SYSTEM_DIALOGUE"))},children:"I have a passkey"})},j6=pd.css`
2038
+ `;var md=y(require("styled-components"));var ev=require("react/jsx-runtime"),fd=()=>{let{enabled:e,token:t}=We(),{navigate:r,setModalData:o}=P(),{initLoginWithPasskey:n}=W();return(0,ev.jsx)(Tu,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:a=>n(a),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSKEY_SYSTEM_DIALOGUE",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await n(),r("AWAITING_PASSKEY_SYSTEM_DIALOGUE"))},children:"I have a passkey"})},eb=md.css`
2039
2039
  && {
2040
2040
  width: 100%;
2041
2041
  font-size: 0.875rem;
@@ -2060,9 +2060,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
2060
2060
  box-shadow: none;
2061
2061
  }
2062
2062
  }
2063
- `,bu=pd.default.button`
2064
- ${j6}
2065
- `;var Q2=y(require("@heroicons/react/24/outline/ChevronRightIcon")),J2=y(require("@heroicons/react/24/outline/WalletIcon"));var Va=require("react/jsx-runtime"),md=({onClick:e,text:t})=>(0,Va.jsxs)(Oe,{onClick:e,children:[(0,Va.jsx)(J2.default,{}),(0,Va.jsx)(Ho,{children:t}),(0,Va.jsx)(Q2.default,{})]});var Qt=require("react/jsx-runtime"),X2=()=>{let{connectors:e}=W(),{app:t,setModalData:r,data:o,navigate:n}=A(),[i,a]=(0,fd.useState)("default"),l=Fn(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=(0,Qt.jsx)(md,{text:"More wallets",onClick:()=>a("overflow")});return(0,fd.useEffect)(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),i==="overflow"?(0,Qt.jsxs)(Qt.Fragment,{children:[(0,Qt.jsx)(k,{backFn:()=>a("default")},"header"),(0,Qt.jsxs)(Pr,{children:[(0,Qt.jsx)(Ga,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),(0,Qt.jsx)(j,{})]}):(0,Qt.jsxs)(Qt.Fragment,{children:[(0,Qt.jsx)(Hr,{}),(0,Qt.jsx)(ke,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),(0,Qt.jsxs)(Pr,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,(0,Qt.jsx)(bu,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),(0,Qt.jsx)(j,{})]})};var ev=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),tv=y(require("styled-components"));var $r=require("react/jsx-runtime"),rv=()=>{let{closePrivyModal:e}=W();return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(k,{},"header"),(0,$r.jsx)(Y6,{children:(0,$r.jsx)(ev.default,{style:{width:32,height:32}})}),(0,$r.jsx)(Vo,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,$r.jsx)(lo,{children:(0,$r.jsx)(H,{onClick:()=>e(),children:"Close"})}),(0,$r.jsx)(fe,{}),(0,$r.jsx)(j,{})]})},Y6=tv.default.div`
2063
+ `,Tu=md.default.button`
2064
+ ${eb}
2065
+ `;var tv=y(require("@heroicons/react/24/outline/ChevronRightIcon")),rv=y(require("@heroicons/react/24/outline/WalletIcon"));var za=require("react/jsx-runtime"),hd=({onClick:e,text:t})=>(0,za.jsxs)(Oe,{onClick:e,children:[(0,za.jsx)(rv.default,{}),(0,za.jsx)(Go,{children:t}),(0,za.jsx)(tv.default,{})]});var Qt=require("react/jsx-runtime"),ov=()=>{let{connectors:e}=W(),{app:t,setModalData:r,data:o,navigate:n}=P(),[i,a]=(0,yd.useState)("default"),l=Hn(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=(0,Qt.jsx)(hd,{text:"More wallets",onClick:()=>a("overflow")});return(0,yd.useEffect)(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),i==="overflow"?(0,Qt.jsxs)(Qt.Fragment,{children:[(0,Qt.jsx)(x,{backFn:()=>a("default")},"header"),(0,Qt.jsxs)(Pr,{children:[(0,Qt.jsx)(qa,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),(0,Qt.jsx)(K,{})]}):(0,Qt.jsxs)(Qt.Fragment,{children:[(0,Qt.jsx)(Gr,{}),(0,Qt.jsx)(xe,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),(0,Qt.jsxs)(Pr,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,(0,Qt.jsx)(Tu,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),(0,Qt.jsx)(K,{})]})};var nv=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),iv=y(require("styled-components"));var Kr=require("react/jsx-runtime"),av=()=>{let{closePrivyModal:e}=W();return(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(x,{},"header"),(0,Kr.jsx)(tb,{children:(0,Kr.jsx)(nv.default,{style:{width:32,height:32}})}),(0,Kr.jsx)(qo,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Kr.jsx)(kr,{children:(0,Kr.jsx)(H,{onClick:()=>e(),children:"Close"})}),(0,Kr.jsx)(ue,{}),(0,Kr.jsx)(K,{})]})},tb=iv.default.div`
2066
2066
  border-radius: 50%;
2067
2067
  height: 68px;
2068
2068
  width: 68px;
@@ -2072,18 +2072,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
2072
2072
  background-color: var(--privy-color-accent);
2073
2073
  color: white;
2074
2074
  margin: 0 auto 24px auto;
2075
- `;var iv=y(require("react-device-detect")),av=y(require("styled-components"));var hd=y(require("styled-components"));var Eu=require("react/jsx-runtime"),ov=({style:e,...t})=>(0,Eu.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,Eu.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var gd=require("react/jsx-runtime"),nv=hd.default.div`
2075
+ `;var cv=y(require("react-device-detect")),dv=y(require("styled-components"));var gd=y(require("styled-components"));var Su=require("react/jsx-runtime"),sv=({style:e,...t})=>(0,Su.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,Su.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var Cd=require("react/jsx-runtime"),lv=gd.default.div`
2076
2076
  display: flex;
2077
2077
  flex-direction: column;
2078
2078
  justify-content: flex-start;
2079
2079
  gap: 4px;
2080
- `,Tu=hd.default.div`
2080
+ `,_u=gd.default.div`
2081
2081
  &&& {
2082
2082
  margin-left: 7px; /* TODO: This is a total hack */
2083
2083
  border-left: 2px solid var(--privy-color-foreground-4);
2084
2084
  height: 12px;
2085
2085
  }
2086
- `,yd=({children:e})=>(0,gd.jsxs)(Z6,{children:[(0,gd.jsx)(ov,{style:{width:"16px",height:"16px"}}),e]}),Z6=hd.default.div`
2086
+ `,vd=({children:e})=>(0,Cd.jsxs)(rb,{children:[(0,Cd.jsx)(sv,{style:{width:"16px",height:"16px"}}),e]}),rb=gd.default.div`
2087
2087
  display: flex;
2088
2088
  justify-content: flex-start;
2089
2089
  justify-items: center;
@@ -2101,22 +2101,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
2101
2101
  margin-bottom: auto;
2102
2102
  }
2103
2103
  }
2104
- `;var nt=require("react/jsx-runtime"),Q6=()=>(0,nt.jsxs)(J6,{children:[(0,nt.jsx)(wi,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,nt.jsx)(jt,{children:(0,nt.jsx)(Uo,{style:{width:"152px",height:"152px"}})}),(0,nt.jsxs)(nv,{children:[(0,nt.jsx)(yd,{children:(0,nt.jsxs)("div",{children:[(0,nt.jsx)("span",{children:"Install the "}),(0,nt.jsx)("a",{href:iv.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),(0,nt.jsx)(Tu,{}),(0,nt.jsx)(yd,{children:"Set up your first wallet"}),(0,nt.jsx)(Tu,{}),(0,nt.jsx)(yd,{children:"Store your recovery phrase in a safe place!"})]}),(0,nt.jsx)(Ln,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),sv=()=>{let{navigateBack:e}=A();return(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(k,{backFn:e},"header"),(0,nt.jsx)(pe,{}),(0,nt.jsx)(Q6,{}),(0,nt.jsx)(fe,{}),(0,nt.jsxs)(J,{children:[(0,nt.jsx)("span",{children:"Still not sure? "}),(0,nt.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},J6=(0,av.default)(jt)`
2104
+ `;var nt=require("react/jsx-runtime"),ob=()=>(0,nt.jsxs)(nb,{children:[(0,nt.jsx)(Ei,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,nt.jsx)(jt,{children:(0,nt.jsx)(Fo,{style:{width:"152px",height:"152px"}})}),(0,nt.jsxs)(lv,{children:[(0,nt.jsx)(vd,{children:(0,nt.jsxs)("div",{children:[(0,nt.jsx)("span",{children:"Install the "}),(0,nt.jsx)("a",{href:cv.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),(0,nt.jsx)(_u,{}),(0,nt.jsx)(vd,{children:"Set up your first wallet"}),(0,nt.jsx)(_u,{}),(0,nt.jsx)(vd,{children:"Store your recovery phrase in a safe place!"})]}),(0,nt.jsx)(Dn,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),pv=()=>{let{navigateBack:e}=P();return(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(x,{backFn:e},"header"),(0,nt.jsx)(se,{}),(0,nt.jsx)(ob,{}),(0,nt.jsx)(ue,{}),(0,nt.jsxs)(J,{children:[(0,nt.jsx)("span",{children:"Still not sure? "}),(0,nt.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},nb=(0,dv.default)(jt)`
2105
2105
  gap: 30px;
2106
2106
 
2107
2107
  > :first-child > svg {
2108
2108
  margin-top: 20px;
2109
2109
  }
2110
- `;var kv=y(require("@heroicons/react/24/outline/UserCircleIcon")),Vs=require("react"),Rv=require("react-device-detect"),Iv=y(require("styled-components"));var X6={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",cross_app:"privy:"},Xn=e=>{let t=X6[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};var pv=y(require("styled-components"));var lv=y(require("react"));var dv=require("react/jsx-runtime"),cv=()=>{let{app:e}=A(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,dv.jsx)("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?lv.default.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var Su=require("react/jsx-runtime"),vd=e=>{let{app:t}=A();return t?.appearance.logo?(0,Su.jsx)(eb,{...e,children:(0,Su.jsx)(cv,{})}):null},eb=pv.default.div`
2110
+ `;var Wv=y(require("@heroicons/react/24/outline/UserCircleIcon")),qs=require("react"),Ov=require("react-device-detect"),Lv=y(require("styled-components"));var ib={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",cross_app:"privy:"},ti=e=>{let t=ib[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};var hv=y(require("styled-components"));var uv=y(require("react"));var fv=require("react/jsx-runtime"),mv=()=>{let{app:e}=P(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,fv.jsx)("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?uv.default.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var Pu=require("react/jsx-runtime"),wd=e=>{let{app:t}=P();return t?.appearance.logo?(0,Pu.jsx)(ab,{...e,children:(0,Pu.jsx)(mv,{})}):null},ab=hv.default.div`
2111
2111
  display: flex;
2112
2112
  flex-direction: column;
2113
2113
  align-items: center;
2114
2114
  padding: 24px 0;
2115
2115
  flex-grow: 1;
2116
2116
  justify-content: center;
2117
- `;var mv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),fv=require("react");var uv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),qa=require("react"),_u=y(require("styled-components"));var Kr=require("react/jsx-runtime"),Cd=(0,qa.forwardRef)((e,t)=>{let[r,o]=(0,qa.useState)(""),[n,i]=(0,qa.useState)(!1),{authenticated:a}=$(),{initLoginWithEmail:l}=W(),{navigate:s,setModalData:c,currentScreen:m}=A(),{enabled:f,token:u}=We(),[w,v]=(0,qa.useState)(!1),{accountType:g}=ar(),E=Sl(r),T=n,R=n||!E,S=I=>{i(!0),l(r,I).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(M=>{c({errorModalData:{error:M,previousScreen:m||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},x=()=>{f&&!u&&!a?(c({captchaModalData:{callback:I=>l(r,I),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):S(u)};return(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(tb,{children:(0,Kr.jsxs)(rb,{stacked:e.stacked,children:[(0,Kr.jsx)(uv.default,{}),(0,Kr.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>v(!0),onChange:I=>o(I.target.value),onKeyUp:I=>{I.key==="Enter"&&x()},value:r,autoComplete:"email"}),g==="email"&&!w?(0,Kr.jsx)(kr,{color:"gray",children:"Recent"}):e.stacked?(0,Kr.jsx)("span",{}):(0,Kr.jsx)(pa,{isSubmitting:T,onClick:x,disabled:R,children:"Submit"})]})}),e.stacked?(0,Kr.jsx)(H,{loadingText:null,loading:T,disabled:R,onClick:x,children:"Submit"}):null]})}),tb=_u.default.div`
2117
+ `;var gv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),vv=require("react");var yv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),$a=require("react"),Au=y(require("styled-components"));var jr=require("react/jsx-runtime"),bd=(0,$a.forwardRef)((e,t)=>{let[r,o]=(0,$a.useState)(""),[n,i]=(0,$a.useState)(!1),{authenticated:a}=z(),{initLoginWithEmail:l}=W(),{navigate:s,setModalData:c,currentScreen:m}=P(),{enabled:f,token:u}=We(),[w,v]=(0,$a.useState)(!1),{accountType:g}=ar(),E=_l(r),S=n,R=n||!E,_=I=>{i(!0),l(r,I).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(M=>{c({errorModalData:{error:M,previousScreen:m||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},k=()=>{f&&!u&&!a?(c({captchaModalData:{callback:I=>l(r,I),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):_(u)};return(0,jr.jsxs)(jr.Fragment,{children:[(0,jr.jsx)(sb,{children:(0,jr.jsxs)(lb,{stacked:e.stacked,children:[(0,jr.jsx)(yv.default,{}),(0,jr.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>v(!0),onChange:I=>o(I.target.value),onKeyUp:I=>{I.key==="Enter"&&k()},value:r,autoComplete:"email"}),g==="email"&&!w?(0,jr.jsx)(Rr,{color:"gray",children:"Recent"}):e.stacked?(0,jr.jsx)("span",{}):(0,jr.jsx)(ma,{isSubmitting:S,onClick:k,disabled:R,children:"Submit"})]})}),e.stacked?(0,jr.jsx)(H,{loadingText:null,loading:S,disabled:R,onClick:k,children:"Submit"}):null]})}),sb=Au.default.div`
2118
2118
  width: 100%;
2119
- `,rb=_u.default.label`
2119
+ `,lb=Au.default.label`
2120
2120
  display: block;
2121
2121
  position: relative;
2122
2122
  width: 100%;
@@ -2183,11 +2183,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
2183
2183
  && > input::placeholder {
2184
2184
  color: var(--privy-color-foreground-3);
2185
2185
  }
2186
- `;var Zo=require("react/jsx-runtime"),wd=({isEditable:e,setIsEditable:t})=>{let r=(0,fv.useRef)(null);return(0,Zo.jsxs)(Zo.Fragment,{children:[(0,Zo.jsx)(Ao,{if:!e,children:(0,Zo.jsx)(Cd,{ref:r})}),(0,Zo.jsx)(Ao,{if:e,children:(0,Zo.jsxs)(Oe,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Zo.jsx)(mv.default,{})," Continue with Email"]})})]})};var hv=require("react"),yv=y(require("styled-components"));var Wi=require("react/jsx-runtime"),bd=()=>{let[e,t]=(0,hv.useState)(!1),{currentScreen:r,navigate:o,setModalData:n}=A(),{enabled:i,token:a}=We(),{initLoginWithFarcaster:l}=W(),{accountType:s}=ar();return(0,Wi.jsxs)(Oe,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:m=>l(m),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(m){n({errorModalData:{error:m,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,Wi.jsx)($o,{})," Farcaster",e&&(0,Wi.jsx)("span",{children:(0,Wi.jsx)(Bo,{})}),s==="farcaster"&&(0,Wi.jsx)(ob,{color:"gray",children:"Recent"})]})},ob=(0,yv.default)(kr)`
2186
+ `;var Qo=require("react/jsx-runtime"),Ed=({isEditable:e,setIsEditable:t})=>{let r=(0,vv.useRef)(null);return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(xo,{if:!e,children:(0,Qo.jsx)(bd,{ref:r})}),(0,Qo.jsx)(xo,{if:e,children:(0,Qo.jsxs)(Oe,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Qo.jsx)(gv.default,{})," Continue with Email"]})})]})};var Cv=require("react"),wv=y(require("styled-components"));var Li=require("react/jsx-runtime"),Td=()=>{let[e,t]=(0,Cv.useState)(!1),{currentScreen:r,navigate:o,setModalData:n}=P(),{enabled:i,token:a}=We(),{initLoginWithFarcaster:l}=W(),{accountType:s}=ar();return(0,Li.jsxs)(Oe,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:m=>l(m),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(m){n({errorModalData:{error:m,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,Li.jsx)(Ko,{})," Farcaster",e&&(0,Li.jsx)("span",{children:(0,Li.jsx)(Ho,{})}),s==="farcaster"&&(0,Li.jsx)(cb,{color:"gray",children:"Recent"})]})},cb=(0,wv.default)(Rr)`
2187
2187
  margin-left: auto;
2188
- `;var Ev=y(require("@heroicons/react/24/outline/PhoneIcon")),Tv=require("react");var Oi=require("react"),Pu=y(require("styled-components"));var gv=y(require("libphonenumber-js/examples.mobile.json")),jr=require("libphonenumber-js/min"),Td=require("react/jsx-runtime");var Bs=(e,t)=>(0,jr.isPossiblePhoneNumber)(String(e),t),Ed=(e,t)=>`+${(0,jr.getCountryCallingCode)(t)} ${e}`,vv=e=>`*${e.replaceAll("-","").slice(-4)}`,Cv=e=>new jr.AsYouType(e),nb=(0,jr.getCountries)().map(e=>({code:e,callCode:(0,jr.getCountryCallingCode)(e)})),wv=e=>{let t=(0,jr.getExampleNumber)(e,gv.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},bv=({value:e,onChange:t})=>(0,Td.jsx)("select",{value:e,onChange:t,children:nb.map(r=>(0,Td.jsxs)("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});var Yr=require("react/jsx-runtime"),za=(0,Oi.forwardRef)((e,t)=>{let{app:r}=A(),[o,n]=(0,Oi.useState)(!1),{accountType:i}=ar(),[a,l]=(0,Oi.useState)(""),[s,c]=(0,Oi.useState)(r?.intl.defaultCountry??"US"),m=Bs(a,s),f=Cv(s),u=wv(s),w=(0,jr.getCountryCallingCode)(s),v=!m,[g,E]=(0,Oi.useState)(!1),T=w.length,R=I=>{let M=I.target.value;c(M),l(""),e.onChange&&e.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:Ed(a,M),countryCode:M,isValid:Bs(a,s)})},S=I=>{try{let M=I.replace(/\D/g,""),U=a.replace(/\D/g,""),G=M===U?I:f.input(I);l(G),e.onChange&&e.onChange({rawPhoneNumber:G,qualifiedPhoneNumber:Ed(I,s),countryCode:s,isValid:Bs(I,s)})}catch(M){console.error("Error processing phone number:",M)}},x=()=>{E(!0);let I=Ed(a,s);e.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:I,countryCode:s,isValid:Bs(a,s)}).finally(()=>E(!1))};return(0,Yr.jsxs)(Yr.Fragment,{children:[(0,Yr.jsx)(ib,{children:(0,Yr.jsxs)(ab,{callingCodeLength:T,stacked:e.stacked,children:[(0,Yr.jsx)(bv,{value:s,onChange:R}),(0,Yr.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:u,onFocus:()=>n(!0),onChange:I=>{S(I.target.value)},onKeyUp:I=>{I.key==="Enter"&&x()},value:a,autoComplete:"tel"}),i==="phone"&&!o?(0,Yr.jsx)(kr,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?(0,Yr.jsx)(pa,{isSubmitting:g,onClick:x,disabled:v,children:"Submit"}):(0,Yr.jsx)("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?(0,Yr.jsx)(H,{loading:g,loadingText:null,onClick:x,disabled:v,children:"Submit"}):null]})}),ib=Pu.default.div`
2188
+ `;var Pv=y(require("@heroicons/react/24/outline/PhoneIcon")),Av=require("react");var Ni=require("react"),xu=y(require("styled-components"));var bv=y(require("libphonenumber-js/examples.mobile.json")),Yr=require("libphonenumber-js/min"),_d=require("react/jsx-runtime");var Hs=(e,t)=>(0,Yr.isPossiblePhoneNumber)(String(e),t),Sd=(e,t)=>`+${(0,Yr.getCountryCallingCode)(t)} ${e}`,Ev=e=>`*${e.replaceAll("-","").slice(-4)}`,Tv=e=>new Yr.AsYouType(e),db=(0,Yr.getCountries)().map(e=>({code:e,callCode:(0,Yr.getCountryCallingCode)(e)})),Sv=e=>{let t=(0,Yr.getExampleNumber)(e,bv.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},_v=({value:e,onChange:t})=>(0,_d.jsx)("select",{value:e,onChange:t,children:db.map(r=>(0,_d.jsxs)("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});var Zr=require("react/jsx-runtime"),ri=(0,Ni.forwardRef)((e,t)=>{let{app:r}=P(),[o,n]=(0,Ni.useState)(!1),{accountType:i}=ar(),[a,l]=(0,Ni.useState)(""),[s,c]=(0,Ni.useState)(r?.intl.defaultCountry??"US"),m=Hs(a,s),f=Tv(s),u=Sv(s),w=(0,Yr.getCountryCallingCode)(s),v=!m,[g,E]=(0,Ni.useState)(!1),S=w.length,R=I=>{let M=I.target.value;c(M),l(""),e.onChange&&e.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:Sd(a,M),countryCode:M,isValid:Hs(a,s)})},_=I=>{try{let M=I.replace(/\D/g,""),U=a.replace(/\D/g,""),G=M===U?I:f.input(I);l(G),e.onChange&&e.onChange({rawPhoneNumber:G,qualifiedPhoneNumber:Sd(I,s),countryCode:s,isValid:Hs(I,s)})}catch(M){console.error("Error processing phone number:",M)}},k=()=>{E(!0);let I=Sd(a,s);e.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:I,countryCode:s,isValid:Hs(a,s)}).finally(()=>E(!1))};return(0,Zr.jsxs)(Zr.Fragment,{children:[(0,Zr.jsx)(pb,{children:(0,Zr.jsxs)(ub,{callingCodeLength:S,stacked:e.stacked,children:[(0,Zr.jsx)(_v,{value:s,onChange:R}),(0,Zr.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:u,onFocus:()=>n(!0),onChange:I=>{_(I.target.value)},onKeyUp:I=>{I.key==="Enter"&&k()},value:a,autoComplete:"tel"}),i==="phone"&&!o&&!e.hideRecent?(0,Zr.jsx)(Rr,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?(0,Zr.jsx)(ma,{isSubmitting:g,onClick:k,disabled:v,children:"Submit"}):(0,Zr.jsx)("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?(0,Zr.jsx)(H,{loading:g,loadingText:null,onClick:k,disabled:v,children:"Submit"}):null]})}),pb=xu.default.div`
2189
2189
  width: 100%;
2190
- `,ab=Pu.default.label`
2190
+ `,ub=xu.default.label`
2191
2191
  --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
2192
2192
  --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
2193
2193
  display: block;
@@ -2280,15 +2280,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
2280
2280
  && > input::placeholder {
2281
2281
  color: var(--privy-color-foreground-3);
2282
2282
  }
2283
- `;var Qo=require("react/jsx-runtime"),Sd=({isEditable:e,setIsEditable:t})=>{let r=(0,Tv.useRef)(null),{authenticated:o}=$(),{navigate:n,setModalData:i,currentScreen:a}=A(),{initLoginWithSms:l}=W(),{enabled:s,token:c}=We();async function m({qualifiedPhoneNumber:f}){if(s&&!c&&!o)i({captchaModalData:{callback:u=>l(f,u),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(f,c),n("AWAITING_PASSWORDLESS_CODE")}catch(u){i({errorModalData:{error:u,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Ao,{if:!e,children:(0,Qo.jsx)(za,{ref:r,onSubmit:m})}),(0,Qo.jsx)(Ao,{if:e,children:(0,Qo.jsxs)(Oe,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Qo.jsx)(Ev.default,{})," Continue with SMS"]})})]})};var Sv=require("react"),_v=y(require("styled-components"));var Zr=require("react/jsx-runtime"),sb={apple:{logo:(0,Zr.jsx)(Dl,{}),displayName:"Apple"},discord:{logo:(0,Zr.jsx)(Ul,{}),displayName:"Discord"},github:{logo:(0,Zr.jsx)(Fl,{}),displayName:"GitHub"},google:{logo:(0,Zr.jsx)(Bl,{}),displayName:"Google"},linkedin:{logo:(0,Zr.jsx)(Gl,{}),displayName:"LinkedIn"},spotify:{logo:(0,Zr.jsx)(Vl,{}),displayName:"Spotify"},instagram:{logo:(0,Zr.jsx)(Hl,{}),displayName:"Instagram"},twitter:{logo:(0,Zr.jsx)(zl,{}),displayName:"Twitter"},tiktok:{logo:(0,Zr.jsx)(ql,{}),displayName:"TikTok"}},dr=({provider:e})=>{let{enabled:t,token:r}=We(),{navigate:o,setModalData:n}=A(),[i,a]=(0,Sv.useState)(!1),{initLoginWithOAuth:l}=W(),{accountType:s}=ar(),c=s?Xn(s):null,{displayName:m,logo:f}=sb[e];return(0,Zr.jsxs)(Oe,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:w=>l(e,w),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[f," ",m,c?.loginMethod===e&&(0,Zr.jsx)(lb,{color:"gray",children:"Recent"})]})},lb=(0,_v.default)(kr)`
2283
+ `;var Jo=require("react/jsx-runtime"),Pd=({isEditable:e,setIsEditable:t})=>{let r=(0,Av.useRef)(null),{authenticated:o}=z(),{navigate:n,setModalData:i,currentScreen:a}=P(),{initLoginWithSms:l}=W(),{enabled:s,token:c}=We();async function m({qualifiedPhoneNumber:f}){if(s&&!c&&!o)i({captchaModalData:{callback:u=>l(f,u),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(f,c),n("AWAITING_PASSWORDLESS_CODE")}catch(u){i({errorModalData:{error:u,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Jo.jsxs)(Jo.Fragment,{children:[(0,Jo.jsx)(xo,{if:!e,children:(0,Jo.jsx)(ri,{ref:r,onSubmit:m})}),(0,Jo.jsx)(xo,{if:e,children:(0,Jo.jsxs)(Oe,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Jo.jsx)(Pv.default,{})," Continue with SMS"]})})]})};var xv=require("react"),kv=y(require("styled-components"));var Qr=require("react/jsx-runtime"),mb={apple:{logo:(0,Qr.jsx)(Ul,{}),displayName:"Apple"},discord:{logo:(0,Qr.jsx)(Fl,{}),displayName:"Discord"},github:{logo:(0,Qr.jsx)(Bl,{}),displayName:"GitHub"},google:{logo:(0,Qr.jsx)(Hl,{}),displayName:"Google"},linkedin:{logo:(0,Qr.jsx)(Vl,{}),displayName:"LinkedIn"},spotify:{logo:(0,Qr.jsx)(ql,{}),displayName:"Spotify"},instagram:{logo:(0,Qr.jsx)(Gl,{}),displayName:"Instagram"},twitter:{logo:(0,Qr.jsx)($l,{}),displayName:"Twitter"},tiktok:{logo:(0,Qr.jsx)(zl,{}),displayName:"TikTok"}},dr=({provider:e})=>{let{enabled:t,token:r}=We(),{navigate:o,setModalData:n}=P(),[i,a]=(0,xv.useState)(!1),{initLoginWithOAuth:l}=W(),{accountType:s}=ar(),c=s?ti(s):null,{displayName:m,logo:f}=mb[e];return(0,Qr.jsxs)(Oe,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:w=>l(e,w),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[f," ",m,c?.loginMethod===e&&(0,Qr.jsx)(fb,{color:"gray",children:"Recent"})]})},fb=(0,kv.default)(Rr)`
2284
2284
  margin-left: auto;
2285
- `;var Pv=require("react"),Av=y(require("styled-components"));var fo=require("react/jsx-runtime");function _d(e){return(0,fo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[(0,fo.jsx)("defs",{children:(0,fo.jsxs)("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[(0,fo.jsx)("stop",{offset:"0",stopColor:"#1d93d2"}),(0,fo.jsx)("stop",{offset:"1",stopColor:"#38b0e3"})]})}),(0,fo.jsx)("title",{children:"Telegram_logo"}),(0,fo.jsx)("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),(0,fo.jsx)("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),(0,fo.jsx)("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),(0,fo.jsx)("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}var Hs=require("react/jsx-runtime"),Pd=()=>{let{enabled:e,token:t}=We(),{navigate:r,setModalData:o}=A(),[n,i]=(0,Pv.useState)(!1),{initLoginWithTelegram:a}=W(),{accountType:l}=ar();async function s(m){try{await a(m),r("TELEGRAM_AUTH_SCREEN")}catch(f){console.error(f),i(!1)}}async function c(){if(i(!0),e&&!t){o({captchaModalData:{callback:s,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await s()}return(0,Hs.jsxs)(Oe,{onClick:c,disabled:n,children:[(0,Hs.jsx)(_d,{}),"Telegram",l==="telegram"&&(0,Hs.jsx)(cb,{color:"gray",children:"Recent"})]})},cb=(0,Av.default)(kr)`
2285
+ `;var Rv=require("react"),Iv=y(require("styled-components"));var ho=require("react/jsx-runtime");function Ad(e){return(0,ho.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[(0,ho.jsx)("defs",{children:(0,ho.jsxs)("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[(0,ho.jsx)("stop",{offset:"0",stopColor:"#1d93d2"}),(0,ho.jsx)("stop",{offset:"1",stopColor:"#38b0e3"})]})}),(0,ho.jsx)("title",{children:"Telegram_logo"}),(0,ho.jsx)("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),(0,ho.jsx)("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),(0,ho.jsx)("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),(0,ho.jsx)("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}var Gs=require("react/jsx-runtime"),xd=()=>{let{enabled:e,token:t}=We(),{navigate:r,setModalData:o}=P(),[n,i]=(0,Rv.useState)(!1),{initLoginWithTelegram:a}=W(),{accountType:l}=ar();async function s(m){try{await a(m),r("TELEGRAM_AUTH_SCREEN")}catch(f){console.error(f),i(!1)}}async function c(){if(i(!0),e&&!t){o({captchaModalData:{callback:s,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await s()}return(0,Gs.jsxs)(Oe,{onClick:c,disabled:n,children:[(0,Gs.jsx)(Ad,{}),"Telegram",l==="telegram"&&(0,Gs.jsx)(hb,{color:"gray",children:"Recent"})]})},hb=(0,Iv.default)(Rr)`
2286
2286
  margin-left: auto;
2287
- `;var xv=y(require("@heroicons/react/24/outline/ChevronRightIcon"));var Gs=require("react/jsx-runtime"),Ad=({onClick:e,text:t,icon:r})=>(0,Gs.jsxs)(Oe,{onClick:e,children:[r,(0,Gs.jsx)(Ho,{children:t}),(0,Gs.jsx)(xv.default,{})]});var qe=require("react/jsx-runtime"),kd=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=A(),{appearance:{palette:{colorScheme:i}}}=dt(),{accountType:a,walletClientType:l}=ar(),s=a?Xn(a):null,c=o.loginMethodsAndOrder?.primary??[],m=o.loginMethodsAndOrder?.overflow??[],f=[...c,...m],u=o.loginMethods.passkey,w=[];l&&f.includes(l)?w.push(l):a&&f.includes(s?.loginMethod)&&w.push(s?.loginMethod);let[v,g]=(0,Vs.useState)("default"),[E,T]=(0,Vs.useState)(a==="phone"?"sms":"email");(0,Vs.useEffect)(()=>{a==="phone"&&T("sms");let F=f.indexOf("sms"),O=f.indexOf("email");F>-1&&F<O&&T("sms")},[a,c,m]);let R=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{g("default")},150)};n.current=R;let S=F=>F==="email"?(0,qe.jsx)(wd,{isEditable:E==="email",setIsEditable:()=>{T("email")}},F):F==="sms"?(0,qe.jsx)(Sd,{isEditable:E==="sms",setIsEditable:()=>{T("sms")}},F):F==="apple"?(0,qe.jsx)(dr,{provider:"apple"},F):F==="discord"?(0,qe.jsx)(dr,{provider:"discord"},F):F==="farcaster"?(0,qe.jsx)(bd,{},F):F==="github"?(0,qe.jsx)(dr,{provider:"github"},F):F==="google"?(0,qe.jsx)(dr,{provider:"google"},F):F==="linkedin"?(0,qe.jsx)(dr,{provider:"linkedin"},F):F==="tiktok"?(0,qe.jsx)(dr,{provider:"tiktok"},F):F==="twitter"&&(!Rv.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)?(0,qe.jsx)(dr,{provider:"twitter"},F):F==="telegram"?(0,qe.jsx)(Pd,{},F):Fn([F],r,e,f,o.externalWallets.walletConnect.enabled),x=w.flatMap(S),I=c.filter(F=>F!==l&&F!==s?.loginMethod).flatMap(S),M=m.filter(F=>F!==l&&F!==s?.loginMethod).flatMap(S),U=[...x,...I,...M],G=db({primary:I.length+x.length,overflow:M.length}),[Y,Z]=rf(U,G),L=v==="default"?void 0:()=>{g("default")};return(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(k,{title:o.appearance.landingHeader,onClose:R,backFn:L}),v==="default"&&(0,qe.jsx)(pb,{}),v==="default"&&(typeof o.appearance.loginMessage=="string"?(0,qe.jsx)(hc,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,qe.jsx)(fc,{style:{overflow:"hidden"},children:(0,qe.jsxs)(sy,{colorScheme:i,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[v==="default"&&(0,qe.jsxs)(qe.Fragment,{children:[...Y,Z.length>0&&(0,qe.jsx)(Ad,{text:"More options",icon:(0,qe.jsx)(kv.default,{}),onClick:()=>g("overflow")})]}),v==="overflow"&&(0,qe.jsxs)(qe.Fragment,{children:[...Z]}),u&&v==="default"&&(0,qe.jsx)(ud,{})]})}),o&&(0,qe.jsx)(ua,{app:o}),(0,qe.jsx)(j,{})]})},xd=5,db=({primary:e,overflow:t})=>e<xd?e:e===xd&&t===0?xd:xd-1,pb=(0,Iv.default)(vd)`
2287
+ `;var Mv=y(require("@heroicons/react/24/outline/ChevronRightIcon"));var Vs=require("react/jsx-runtime"),kd=({onClick:e,text:t,icon:r})=>(0,Vs.jsxs)(Oe,{onClick:e,children:[r,(0,Vs.jsx)(Go,{children:t}),(0,Vs.jsx)(Mv.default,{})]});var qe=require("react/jsx-runtime"),Id=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=P(),{appearance:{palette:{colorScheme:i}}}=dt(),{accountType:a,walletClientType:l}=ar(),s=a?ti(a):null,c=o.loginMethodsAndOrder?.primary??[],m=o.loginMethodsAndOrder?.overflow??[],f=[...c,...m],u=o.loginMethods.passkey,w=[];l&&f.includes(l)?w.push(l):a&&f.includes(s?.loginMethod)&&w.push(s?.loginMethod);let[v,g]=(0,qs.useState)("default"),[E,S]=(0,qs.useState)(a==="phone"?"sms":"email");(0,qs.useEffect)(()=>{a==="phone"&&S("sms");let F=f.indexOf("sms"),O=f.indexOf("email");F>-1&&F<O&&S("sms")},[a,c,m]);let R=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{g("default")},150)};n.current=R;let _=F=>F==="email"?(0,qe.jsx)(Ed,{isEditable:E==="email",setIsEditable:()=>{S("email")}},F):F==="sms"?(0,qe.jsx)(Pd,{isEditable:E==="sms",setIsEditable:()=>{S("sms")}},F):F==="apple"?(0,qe.jsx)(dr,{provider:"apple"},F):F==="discord"?(0,qe.jsx)(dr,{provider:"discord"},F):F==="farcaster"?(0,qe.jsx)(Td,{},F):F==="github"?(0,qe.jsx)(dr,{provider:"github"},F):F==="google"?(0,qe.jsx)(dr,{provider:"google"},F):F==="linkedin"?(0,qe.jsx)(dr,{provider:"linkedin"},F):F==="tiktok"?(0,qe.jsx)(dr,{provider:"tiktok"},F):F==="twitter"&&(!Ov.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)?(0,qe.jsx)(dr,{provider:"twitter"},F):F==="telegram"?(0,qe.jsx)(xd,{},F):Hn([F],r,e,f,o.externalWallets.walletConnect.enabled),k=w.flatMap(_),I=c.filter(F=>F!==l&&F!==s?.loginMethod).flatMap(_),M=m.filter(F=>F!==l&&F!==s?.loginMethod).flatMap(_),U=[...k,...I,...M],G=yb({primary:I.length+k.length,overflow:M.length}),[Y,Z]=af(U,G),L=v==="default"?void 0:()=>{g("default")};return(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(x,{title:o.appearance.landingHeader,onClose:R,backFn:L}),v==="default"&&(0,qe.jsx)(gb,{}),v==="default"&&(typeof o.appearance.loginMessage=="string"?(0,qe.jsx)(gc,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,qe.jsx)(yc,{style:{overflow:"hidden"},children:(0,qe.jsxs)(py,{colorScheme:i,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[v==="default"&&(0,qe.jsxs)(qe.Fragment,{children:[...Y,Z.length>0&&(0,qe.jsx)(kd,{text:"More options",icon:(0,qe.jsx)(Wv.default,{}),onClick:()=>g("overflow")})]}),v==="overflow"&&(0,qe.jsxs)(qe.Fragment,{children:[...Z]}),u&&v==="default"&&(0,qe.jsx)(fd,{})]})}),o&&(0,qe.jsx)(fa,{app:o}),(0,qe.jsx)(K,{})]})},Rd=5,yb=({primary:e,overflow:t})=>e<Rd?e:e===Rd&&t===0?Rd:Rd-1,gb=(0,Lv.default)(wd)`
2288
2288
  margin-bottom: 16px;
2289
- `;var Ov=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Lv=y(require("@heroicons/react/24/outline/PhoneIcon")),Nv=y(require("@heroicons/react/24/outline/UserCircleIcon")),ei=require("react"),Dv=require("react-device-detect"),Uv=y(require("styled-components")),Fv=require("@privy-io/js-sdk-core");var gn=require("react/jsx-runtime"),Mv=({...e})=>(0,gn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,gn.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,gn.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,gn.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,gn.jsx)("defs",{children:(0,gn.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,gn.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var Se=require("react/jsx-runtime"),Rd=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=A(),i=dt(),{accountType:a,walletClientType:l}=ar(),s=a?Xn(a):null,c=o?.login,m=(0,ei.useMemo)(()=>c?.loginMethods?(0,Fv.toObjectKeys)(c.loginMethods,!0):null,[c]),{email:f,sms:u,google:w,twitter:v,discord:g,github:E,spotify:T,instagram:R,tiktok:S,linkedin:x,apple:I,wallet:M,farcaster:U,telegram:G}=m??i.loginMethods,{passkey:Y}=i.loginMethods,Z=[f&&"email",u&&"sms",w&&"google",v&&"twitter",g&&"discord",E&&"github",T&&"spotify",R&&"instagram",S&&"tiktok",x&&"linkedin",I&&"apple",U&&"farcaster",G&&"telegram"].filter(V=>!!V),L=Z.length>0,F=(0,ei.useMemo)(()=>M&&!L?"web3-first":M&&i?.appearance.loginGroupPriority||"web2-first",[M,L,i?.appearance.loginGroupPriority]),O=i?.appearance.hideDirectWeb2Inputs,[Me,je]=(0,ei.useState)("default"),[Q,re]=(0,ei.useState)(Wv({accountType:a,sms:u,email:f}));(0,ei.useEffect)(()=>{re(Wv({accountType:a,sms:u,email:f}))},[f,u,a]);let ie=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{je("default")},150)};n.current=ie;let Fe=[];l&&M?Fe.push(l):s?.loginMethod&&Z.includes(s.loginMethod)&&Fe.push(s.loginMethod);let De=V=>V==="email"?(0,Se.jsx)(wd,{isEditable:Q==="email",setIsEditable:()=>{re("email")}},V):V==="sms"?(0,Se.jsx)(Sd,{isEditable:Q==="sms",setIsEditable:()=>{re("sms")}},V):V==="apple"?(0,Se.jsx)(dr,{provider:"apple"},V):V==="discord"?(0,Se.jsx)(dr,{provider:"discord"},V):V==="farcaster"?(0,Se.jsx)(bd,{},V):V==="github"?(0,Se.jsx)(dr,{provider:"github"},V):V==="google"?(0,Se.jsx)(dr,{provider:"google"},V):V==="linkedin"?(0,Se.jsx)(dr,{provider:"linkedin"},V):V==="tiktok"?(0,Se.jsx)(dr,{provider:"tiktok"},V):V==="twitter"&&(!Dv.isMobile||i?.loginConfig.twitterOAuthOnMobileEnabled)?(0,Se.jsx)(dr,{provider:"twitter"},V):V==="telegram"?(0,Se.jsx)(Pd,{},V):Fn([V],r,e,[],i.externalWallets.walletConnect.enabled),ut=Fn(i.appearance.walletList.filter(V=>V!==l),r,e,[...i.appearance.walletList,l],i.externalWallets.walletConnect.enabled),lt=Z.filter(V=>V!==s?.loginMethod).flatMap(De),Dt=Fe.flatMap(De);F==="web3-first"&&Me==="default"?ut.unshift(...Dt):F==="web2-first"&&lt.unshift(...Dt);let at=Me==="default"?void 0:()=>{je("default")},ge=Z.filter(V=>V!=="email"&&V!=="sms"),Cr=mb({priority:F,email:f,sms:u,social:ge}),go=fb({priority:F,email:f,sms:u,social:ge}),Lo=hb({priority:F}),N=(0,Se.jsx)(md,{text:Lo,onClick:()=>je("web3-overflow")}),_t=(0,Se.jsx)(Ad,{text:Cr,icon:go,onClick:()=>je("web2-overflow")}),vo=O?0:1;return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(k,{title:i.appearance.landingHeader,onClose:ie,backFn:at}),Me==="default"&&(0,Se.jsx)(ub,{}),Me==="default"&&(typeof i.appearance.loginMessage=="string"?(0,Se.jsx)(hc,{children:i.appearance.loginMessage}):i.appearance.loginMessage),(0,Se.jsx)(fc,{style:{overflow:"hidden",padding:2},children:(0,Se.jsxs)(Pr,{children:[Me==="default"&&F==="web2-first"&&(0,Se.jsxs)(Se.Fragment,{children:[...lt.length>4?lt.slice(0,3):lt,lt.length>4&&_t,M&&N]}),Me==="default"&&F==="web3-first"&&(0,Se.jsxs)(Se.Fragment,{children:[M&&(0,Se.jsxs)(Se.Fragment,{children:[...ut.length>4?ut.slice(0,3):ut,ut.length>4&&N]}),lt.length>vo&&_t,lt.length===vo&&lt[0]]}),Me==="web2-overflow"&&(0,Se.jsxs)(Se.Fragment,{children:[...F==="web3-first"?lt:lt.slice(3)]}),...Me==="web3-overflow"?ut:[],Y&&Me==="default"&&(0,Se.jsx)(ud,{})]})}),i&&(0,Se.jsx)(ua,{app:i}),(0,Se.jsx)(j,{})]})},ub=(0,Uv.default)(vd)`
2289
+ `;var Uv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Fv=y(require("@heroicons/react/24/outline/PhoneIcon")),Bv=y(require("@heroicons/react/24/outline/UserCircleIcon")),oi=require("react"),Hv=require("react-device-detect"),Gv=y(require("styled-components")),Vv=require("@privy-io/js-sdk-core");var vn=require("react/jsx-runtime"),Nv=({...e})=>(0,vn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,vn.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,vn.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,vn.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,vn.jsx)("defs",{children:(0,vn.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,vn.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var Se=require("react/jsx-runtime"),Md=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=P(),i=dt(),{accountType:a,walletClientType:l}=ar(),s=a?ti(a):null,c=o?.login,m=(0,oi.useMemo)(()=>c?.loginMethods?(0,Vv.toObjectKeys)(c.loginMethods,!0):null,[c]),{email:f,sms:u,google:w,twitter:v,discord:g,github:E,spotify:S,instagram:R,tiktok:_,linkedin:k,apple:I,wallet:M,farcaster:U,telegram:G}=m??i.loginMethods,{passkey:Y}=i.loginMethods,Z=[f&&"email",u&&"sms",w&&"google",v&&"twitter",g&&"discord",E&&"github",S&&"spotify",R&&"instagram",_&&"tiktok",k&&"linkedin",I&&"apple",U&&"farcaster",G&&"telegram"].filter(V=>!!V),L=Z.length>0,F=(0,oi.useMemo)(()=>M&&!L?"web3-first":M&&i?.appearance.loginGroupPriority||"web2-first",[M,L,i?.appearance.loginGroupPriority]),O=i?.appearance.hideDirectWeb2Inputs,[Me,je]=(0,oi.useState)("default"),[Q,re]=(0,oi.useState)(Dv({accountType:a,sms:u,email:f}));(0,oi.useEffect)(()=>{re(Dv({accountType:a,sms:u,email:f}))},[f,u,a]);let ie=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{je("default")},150)};n.current=ie;let Fe=[];l&&M?Fe.push(l):s?.loginMethod&&Z.includes(s.loginMethod)&&Fe.push(s.loginMethod);let De=V=>V==="email"?(0,Se.jsx)(Ed,{isEditable:Q==="email",setIsEditable:()=>{re("email")}},V):V==="sms"?(0,Se.jsx)(Pd,{isEditable:Q==="sms",setIsEditable:()=>{re("sms")}},V):V==="apple"?(0,Se.jsx)(dr,{provider:"apple"},V):V==="discord"?(0,Se.jsx)(dr,{provider:"discord"},V):V==="farcaster"?(0,Se.jsx)(Td,{},V):V==="github"?(0,Se.jsx)(dr,{provider:"github"},V):V==="google"?(0,Se.jsx)(dr,{provider:"google"},V):V==="linkedin"?(0,Se.jsx)(dr,{provider:"linkedin"},V):V==="tiktok"?(0,Se.jsx)(dr,{provider:"tiktok"},V):V==="twitter"&&(!Hv.isMobile||i?.loginConfig.twitterOAuthOnMobileEnabled)?(0,Se.jsx)(dr,{provider:"twitter"},V):V==="telegram"?(0,Se.jsx)(xd,{},V):Hn([V],r,e,[],i.externalWallets.walletConnect.enabled),ut=Hn(i.appearance.walletList.filter(V=>V!==l),r,e,[...i.appearance.walletList,l],i.externalWallets.walletConnect.enabled),lt=Z.filter(V=>V!==s?.loginMethod).flatMap(De),Dt=Fe.flatMap(De);F==="web3-first"&&Me==="default"?ut.unshift(...Dt):F==="web2-first"&&lt.unshift(...Dt);let at=Me==="default"?void 0:()=>{je("default")},ge=Z.filter(V=>V!=="email"&&V!=="sms"),Cr=Cb({priority:F,email:f,sms:u,social:ge}),vo=wb({priority:F,email:f,sms:u,social:ge}),No=bb({priority:F}),N=(0,Se.jsx)(hd,{text:No,onClick:()=>je("web3-overflow")}),_t=(0,Se.jsx)(kd,{text:Cr,icon:vo,onClick:()=>je("web2-overflow")}),Co=O?0:1;return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(x,{title:i.appearance.landingHeader,onClose:ie,backFn:at}),Me==="default"&&(0,Se.jsx)(vb,{}),Me==="default"&&(typeof i.appearance.loginMessage=="string"?(0,Se.jsx)(gc,{children:i.appearance.loginMessage}):i.appearance.loginMessage),(0,Se.jsx)(yc,{style:{overflow:"hidden",padding:2},children:(0,Se.jsxs)(Pr,{children:[Me==="default"&&F==="web2-first"&&(0,Se.jsxs)(Se.Fragment,{children:[...lt.length>4?lt.slice(0,3):lt,lt.length>4&&_t,M&&N]}),Me==="default"&&F==="web3-first"&&(0,Se.jsxs)(Se.Fragment,{children:[M&&(0,Se.jsxs)(Se.Fragment,{children:[...ut.length>4?ut.slice(0,3):ut,ut.length>4&&N]}),lt.length>Co&&_t,lt.length===Co&&lt[0]]}),Me==="web2-overflow"&&(0,Se.jsxs)(Se.Fragment,{children:[...F==="web3-first"?lt:lt.slice(3)]}),...Me==="web3-overflow"?ut:[],Y&&Me==="default"&&(0,Se.jsx)(fd,{})]})}),i&&(0,Se.jsx)(fa,{app:i}),(0,Se.jsx)(K,{})]})},vb=(0,Gv.default)(wd)`
2290
2290
  margin-bottom: 16px;
2291
- `,mb=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"?"Other socials":t&&r&&o.length>0||t&&o.length>0?"Log in with email or socials":r&&o.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",fb=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,Se.jsx)(Nv.default,{}):t&&r?(0,Se.jsx)(Mv,{}):t?(0,Se.jsx)(Ov.default,{}):r?(0,Se.jsx)(Lv.default,{}):null,hb=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",Wv=({accountType:e,sms:t,email:r})=>e==="email"&&r?"email":e==="phone"&&t||t&&!r?"sms":"email";var Au=require("react/jsx-runtime"),Bv=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Au.jsx)(kd,{connectOnly:!0}):(0,Au.jsx)(Rd,{connectOnly:!0})};var xu=require("react/jsx-runtime"),Hv=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,xu.jsx)(kd,{connectOnly:!1}):(0,xu.jsx)(Rd,{connectOnly:!1})};var Gv=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Qr=require("react/jsx-runtime"),Vv=()=>{let{app:e}=A();return(0,Qr.jsxs)(Qr.Fragment,{children:[(0,Qr.jsx)(k,{},"header"),(0,Qr.jsx)(pe,{}),(0,Qr.jsx)(ke,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Qr.jsx)(Gv.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Qr.jsx)(lo,{children:(0,Qr.jsx)(Cd,{stacked:!0})}),(0,Qr.jsx)(fe,{}),(0,Qr.jsx)(j,{})]})};var qv=y(require("@heroicons/react/24/outline/PhoneIcon"));var Jr=require("react/jsx-runtime"),zv=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=A(),{initLoginWithSms:i}=W();async function a({qualifiedPhoneNumber:l}){try{await i(l),o("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return(0,Jr.jsxs)(Jr.Fragment,{children:[(0,Jr.jsx)(k,{},"header"),(0,Jr.jsx)(pe,{}),(0,Jr.jsx)(ke,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Jr.jsx)(qv.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Jr.jsx)(lo,{children:(0,Jr.jsx)(za,{stacked:!0,onSubmit:a})}),(0,Jr.jsx)(fe,{}),(0,Jr.jsx)(j,{})]})};var Jo=require("react/jsx-runtime"),$v=()=>{let{linkingOrConnectingHint:e}=W(),{app:t}=A(),r=e?`Link the wallet with address ${Wt(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,Jo.jsxs)(Jo.Fragment,{children:[(0,Jo.jsx)(k,{},"header"),(0,Jo.jsx)(Vo,{title:"Link your wallet",description:r}),(0,Jo.jsx)(Pr,{children:(0,Jo.jsx)(ga,{connectOnly:!1})}),(0,Jo.jsx)(j,{})]})};var qs=require("react/jsx-runtime"),Kv=({style:e,...t})=>(0,qs.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,qs.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,qs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var Mr=require("react/jsx-runtime"),jv=()=>{let{closePrivyModal:e}=W(),{navigate:t}=A();return(0,Mr.jsxs)(Mr.Fragment,{children:[(0,Mr.jsx)(k,{},"header"),(0,Mr.jsx)(pe,{}),(0,Mr.jsx)(Kv,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Mr.jsx)(Vo,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Mr.jsxs)(lo,{children:[(0,Mr.jsx)(H,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Mr.jsx)(_o,{onClick:()=>e(),children:"Cancel"})]}),(0,Mr.jsx)(fe,{}),(0,Mr.jsx)(j,{})]})};var bC=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),EC=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),TC=y(require("@heroicons/react/24/solid/IdentificationIcon")),SC=y(require("@heroicons/react/24/solid/PhoneIcon")),_C=y(require("@heroicons/react/24/solid/QuestionMarkCircleIcon")),Wu=y(require("@heroicons/react/24/solid/ShieldCheckIcon")),vn=require("react");var Yv=require("react");function $a(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=(0,Yv.useContext)(Ue);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}var Zv=require("react");function ho(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=(0,Zv.useContext)(Ue);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}var Qv=y(require("styled-components")),zs=require("react/jsx-runtime"),Jv=e=>(0,zs.jsxs)(yb,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,zs.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,zs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),yb=Qv.default.svg`
2291
+ `,Cb=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"?"Other socials":t&&r&&o.length>0||t&&o.length>0?"Log in with email or socials":r&&o.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",wb=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,Se.jsx)(Bv.default,{}):t&&r?(0,Se.jsx)(Nv,{}):t?(0,Se.jsx)(Uv.default,{}):r?(0,Se.jsx)(Fv.default,{}):null,bb=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",Dv=({accountType:e,sms:t,email:r})=>e==="email"&&r?"email":e==="phone"&&t||t&&!r?"sms":"email";var ku=require("react/jsx-runtime"),qv=()=>{let{app:e}=P();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,ku.jsx)(Id,{connectOnly:!0}):(0,ku.jsx)(Md,{connectOnly:!0})};var Ru=require("react/jsx-runtime"),zv=()=>{let{app:e}=P();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Ru.jsx)(Id,{connectOnly:!1}):(0,Ru.jsx)(Md,{connectOnly:!1})};var $v=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Jr=require("react/jsx-runtime"),Kv=()=>{let{app:e}=P();return(0,Jr.jsxs)(Jr.Fragment,{children:[(0,Jr.jsx)(x,{},"header"),(0,Jr.jsx)(se,{}),(0,Jr.jsx)(xe,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Jr.jsx)($v.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Jr.jsx)(kr,{children:(0,Jr.jsx)(bd,{stacked:!0})}),(0,Jr.jsx)(ue,{}),(0,Jr.jsx)(K,{})]})};var jv=y(require("@heroicons/react/24/outline/PhoneIcon"));var Xr=require("react/jsx-runtime"),Yv=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=P(),{initLoginWithSms:i}=W();async function a({qualifiedPhoneNumber:l}){try{await i(l),o("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsx)(x,{},"header"),(0,Xr.jsx)(se,{}),(0,Xr.jsx)(xe,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Xr.jsx)(jv.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Xr.jsx)(kr,{children:(0,Xr.jsx)(ri,{stacked:!0,onSubmit:a,hideRecent:!0})}),(0,Xr.jsx)(ue,{}),(0,Xr.jsx)(K,{})]})};var Xo=require("react/jsx-runtime"),Zv=()=>{let{linkingOrConnectingHint:e}=W(),{app:t}=P(),r=e?`Link the wallet with address ${Wt(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,Xo.jsxs)(Xo.Fragment,{children:[(0,Xo.jsx)(x,{},"header"),(0,Xo.jsx)(qo,{title:"Link your wallet",description:r}),(0,Xo.jsx)(Pr,{children:(0,Xo.jsx)(Ca,{connectOnly:!1})}),(0,Xo.jsx)(K,{})]})};var zs=require("react/jsx-runtime"),Qv=({style:e,...t})=>(0,zs.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,zs.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,zs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var Wr=require("react/jsx-runtime"),Jv=()=>{let{closePrivyModal:e}=W(),{navigate:t}=P();return(0,Wr.jsxs)(Wr.Fragment,{children:[(0,Wr.jsx)(x,{},"header"),(0,Wr.jsx)(se,{}),(0,Wr.jsx)(Qv,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Wr.jsx)(qo,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Wr.jsxs)(kr,{children:[(0,Wr.jsx)(H,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Wr.jsx)(Po,{onClick:()=>e(),children:"Cancel"})]}),(0,Wr.jsx)(ue,{}),(0,Wr.jsx)(K,{})]})};var _C=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),PC=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),AC=y(require("@heroicons/react/24/solid/IdentificationIcon")),xC=y(require("@heroicons/react/24/solid/PhoneIcon")),kC=y(require("@heroicons/react/24/solid/QuestionMarkCircleIcon")),Lu=y(require("@heroicons/react/24/solid/ShieldCheckIcon")),Cn=require("react");var Xv=require("react");function Ka(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=(0,Xv.useContext)(Ue);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}var eC=require("react");function yo(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=(0,eC.useContext)(Ue);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}var tC=y(require("styled-components")),$s=require("react/jsx-runtime"),rC=e=>(0,$s.jsxs)(Eb,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,$s.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,$s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),Eb=tC.default.svg`
2292
2292
  height: 90px;
2293
2293
  width: 90px;
2294
2294
 
@@ -2299,7 +2299,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2299
2299
  > path {
2300
2300
  fill: white;
2301
2301
  }
2302
- `;var Id=y(require("@heroicons/react/20/solid/CheckIcon")),Xv=y(require("@heroicons/react/24/outline/ChevronRightIcon")),eC=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),tC=y(require("@heroicons/react/24/outline/FingerPrintIcon")),rC=y(require("@heroicons/react/24/outline/PhoneIcon")),Md=y(require("@heroicons/react/24/outline/TrashIcon")),oC=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var se=require("react/jsx-runtime"),nC=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:c,setRemovingMfaMethod:m})=>{let f=t.reduce((w,v)=>({...w,[v]:!0}),{}),u=r.reduce((w,v)=>({...w,[v]:!0}),{});return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(k,{backFn:e?s:void 0,onClose:l},"header"),(0,se.jsx)(Ye,{children:(0,se.jsx)(mt,{children:(0,se.jsx)(oC.default,{})})}),(0,se.jsx)(Te,{children:"Choose a verification method"}),t.length>0?(0,se.jsx)(Pe,{children:"To add or delete verification methods, verification is required."}):(0,se.jsx)(Pe,{children:"How would you like to verify your identity? You can change this later."}),a&&(0,se.jsx)(bc,{style:{marginTop:"1.25rem"},children:a.message}),(0,se.jsxs)(yc,{children:[(u.totp||f.totp)&&(0,se.jsxs)(gc,{children:[(0,se.jsx)(Oe,{style:{justifyContent:"center"},disabled:f.totp||n,onClick:()=>c("totp"),children:n?(0,se.jsx)(At,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,se.jsxs)(wc,{children:[(0,se.jsxs)(Cc,{children:[(0,se.jsx)(eC.default,{}),"Authenticator App"]}),f.totp?(0,se.jsxs)(Ci,{children:[(0,se.jsx)(Id.default,{}),"Added"]}):(0,se.jsx)(Ci,{children:"Recommended"})]})}),f.totp&&(0,se.jsx)(vc,{onClick:()=>m("totp"),children:(0,se.jsx)(Md.default,{})})]},"totp"),(u.sms||f.sms)&&(0,se.jsxs)(gc,{children:[(0,se.jsx)(Oe,{disabled:f.sms||o,onClick:()=>c("sms"),children:(0,se.jsxs)(wc,{children:[(0,se.jsxs)(Cc,{children:[(0,se.jsx)(rC.default,{}),"SMS"]}),f.sms&&(0,se.jsxs)(Ci,{children:[(0,se.jsx)(Id.default,{}),"Added"]}),o&&(0,se.jsx)(Ci,{children:"Disabled"})]})}),f.sms&&(0,se.jsx)(vc,{onClick:()=>m("sms"),children:(0,se.jsx)(Md.default,{})})]},"sms"),(u.passkey||f.passkey)&&(0,se.jsxs)(gc,{children:[(0,se.jsx)(Oe,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:f.passkey||i,children:i?(0,se.jsx)(At,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,se.jsxs)(wc,{children:[(0,se.jsxs)(Cc,{children:[(0,se.jsx)(tC.default,{}),"Passkey"]}),f.passkey?(0,se.jsxs)(Ci,{children:[(0,se.jsx)(Id.default,{}),"Added"]}):(0,se.jsx)(Ci,{isAccent:!0,children:(0,se.jsx)(Xv.default,{})})]})}),f.passkey&&(0,se.jsx)(vc,{onClick:()=>m("passkey"),children:(0,se.jsx)(Md.default,{})})]},"passkey")]}),(0,se.jsx)(J,{})]})};var aC=y(require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon")),sC=y(require("@heroicons/react/24/outline/ClockIcon")),lC=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),cC=y(require("@heroicons/react/24/solid/CheckCircleIcon")),ti=require("react"),$s=y(require("styled-components"));var te=require("react/jsx-runtime"),dC=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=$(),{data:n}=A(),{initLinkWithPasskey:i,linkWithPasskey:a}=W(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=ho(),[c,m]=(0,ti.useState)(!1),[f,u]=(0,ti.useState)(!1),[w,v]=(0,ti.useState)(!1),[g,E]=(0,ti.useState)(null),T=(0,ti.useMemo)(()=>o?.linkedAccounts.filter(I=>I.type==="passkey")??[],[o]),R=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},S=async I=>{m(!0);try{await l(),await s({credentialIds:I}),v(!0)}catch(M){E(M)}finally{m(!1)}},x=async()=>{u(!0),E(null);try{await i();let M=(await a())?.linkedAccounts.filter(U=>U.type==="passkey").map(U=>U.credentialId)??[];await S(M)}catch(I){E(I)}finally{u(!1)}};return T.length===0||f?(0,te.jsx)(gb,{onReset:r,onClose:t,onClick:x,isCreating:f}):w?(0,te.jsx)(Cb,{onClick:R,onClose:R}):g?(0,te.jsx)(Ai,{error:g,backFn:()=>E(null),onClick:()=>E(null)}):(0,te.jsx)(vb,{passkeys:T,isSubmitting:c,isCreating:f,onReset:r,onClose:t,onSubmitEnrollment:()=>S(T.map(I=>I.credentialId)),onAddPasskey:x})},gb=({onReset:e,onClose:t,onClick:r,isCreating:o})=>(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{backFn:e,onClose:t},"header"),(0,te.jsx)(Ye,{children:(0,te.jsxs)(ed,{children:[(0,te.jsx)(Ri,{}),(0,te.jsx)(Ii,{})]})}),(0,te.jsx)(Te,{children:"Set up passkey verification"}),(0,te.jsxs)(vi,{children:[(0,te.jsxs)(xr,{children:[(0,te.jsx)(Ar,{children:(0,te.jsx)(lC.default,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),(0,te.jsxs)(xr,{children:[(0,te.jsx)(Ar,{children:(0,te.jsx)(sC.default,{})}),"Takes seconds to set up and use"]}),(0,te.jsxs)(xr,{children:[(0,te.jsx)(Ar,{children:(0,te.jsx)(aC.default,{})}),"Use your passkey to verify transactions and login to your account"]})]}),(0,te.jsx)(H,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),(0,te.jsx)(J,{})]}),vb=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=(0,ti.useState)(!1),c=l?n.length:n.length>3?2:3;return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&(0,te.jsx)(Ye,{children:(0,te.jsxs)(ed,{children:[(0,te.jsx)(Ri,{}),(0,te.jsx)(Ii,{})]})}),(0,te.jsx)(Te,{children:"Enable your passkeys for verification"}),(0,te.jsxs)(vi,{children:[n.slice(0,c).map(m=>(0,te.jsxs)(wb,{children:[(0,te.jsx)(bb,{children:Tb(m)}),(0,te.jsxs)(Eb,{children:["Last used: ",m.latestVerifiedAt?.toLocaleString()]})]},m.credentialId)),!l&&n.length>3&&(0,te.jsx)(iC,{onClick:()=>s(!0),children:"View All"})]}),(0,te.jsx)(H,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&(0,te.jsx)(iC,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?(0,te.jsx)(At,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),(0,te.jsx)(J,{})]})},Cb=({onClick:e,onClose:t})=>(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{onClose:t},"header"),(0,te.jsx)(Ye,{children:(0,te.jsx)(mt,{status:"success",children:(0,te.jsx)(cC.default,{})})}),(0,te.jsx)(Te,{children:"Passkey verification added"}),(0,te.jsx)(Pe,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),(0,te.jsx)(ir,{children:(0,te.jsx)(H,{onClick:e,children:"Done"})}),(0,te.jsx)(J,{})]}),wb=$s.default.div`
2302
+ `;var Wd=y(require("@heroicons/react/20/solid/CheckIcon")),oC=y(require("@heroicons/react/24/outline/ChevronRightIcon")),nC=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),iC=y(require("@heroicons/react/24/outline/FingerPrintIcon")),aC=y(require("@heroicons/react/24/outline/PhoneIcon")),Od=y(require("@heroicons/react/24/outline/TrashIcon")),sC=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var le=require("react/jsx-runtime"),lC=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:c,setRemovingMfaMethod:m})=>{let f=t.reduce((w,v)=>({...w,[v]:!0}),{}),u=r.reduce((w,v)=>({...w,[v]:!0}),{});return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(x,{backFn:e?s:void 0,onClose:l},"header"),(0,le.jsx)(Ye,{children:(0,le.jsx)(mt,{children:(0,le.jsx)(sC.default,{})})}),(0,le.jsx)(Te,{children:"Choose a verification method"}),t.length>0?(0,le.jsx)(Pe,{children:"To add or delete verification methods, verification is required."}):(0,le.jsx)(Pe,{children:"How would you like to verify your identity? You can change this later."}),a&&(0,le.jsx)(Tc,{style:{marginTop:"1.25rem"},children:a.message}),(0,le.jsxs)(vc,{children:[(u.totp||f.totp)&&(0,le.jsxs)(Cc,{children:[(0,le.jsx)(Oe,{style:{justifyContent:"center"},disabled:f.totp||n,onClick:()=>c("totp"),children:n?(0,le.jsx)(xt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,le.jsxs)(Ec,{children:[(0,le.jsxs)(bc,{children:[(0,le.jsx)(nC.default,{}),"Authenticator App"]}),f.totp?(0,le.jsxs)(bi,{children:[(0,le.jsx)(Wd.default,{}),"Added"]}):(0,le.jsx)(bi,{children:"Recommended"})]})}),f.totp&&(0,le.jsx)(wc,{onClick:()=>m("totp"),children:(0,le.jsx)(Od.default,{})})]},"totp"),(u.sms||f.sms)&&(0,le.jsxs)(Cc,{children:[(0,le.jsx)(Oe,{disabled:f.sms||o,onClick:()=>c("sms"),children:(0,le.jsxs)(Ec,{children:[(0,le.jsxs)(bc,{children:[(0,le.jsx)(aC.default,{}),"SMS"]}),f.sms&&(0,le.jsxs)(bi,{children:[(0,le.jsx)(Wd.default,{}),"Added"]}),o&&(0,le.jsx)(bi,{children:"Disabled"})]})}),f.sms&&(0,le.jsx)(wc,{onClick:()=>m("sms"),children:(0,le.jsx)(Od.default,{})})]},"sms"),(u.passkey||f.passkey)&&(0,le.jsxs)(Cc,{children:[(0,le.jsx)(Oe,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:f.passkey||i,children:i?(0,le.jsx)(xt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,le.jsxs)(Ec,{children:[(0,le.jsxs)(bc,{children:[(0,le.jsx)(iC.default,{}),"Passkey"]}),f.passkey?(0,le.jsxs)(bi,{children:[(0,le.jsx)(Wd.default,{}),"Added"]}):(0,le.jsx)(bi,{isAccent:!0,children:(0,le.jsx)(oC.default,{})})]})}),f.passkey&&(0,le.jsx)(wc,{onClick:()=>m("passkey"),children:(0,le.jsx)(Od.default,{})})]},"passkey")]}),(0,le.jsx)(J,{})]})};var dC=y(require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon")),pC=y(require("@heroicons/react/24/outline/ClockIcon")),uC=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),mC=y(require("@heroicons/react/24/solid/CheckCircleIcon")),ni=require("react"),Ks=y(require("styled-components"));var te=require("react/jsx-runtime"),fC=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=z(),{data:n}=P(),{initLinkWithPasskey:i,linkWithPasskey:a}=W(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=yo(),[c,m]=(0,ni.useState)(!1),[f,u]=(0,ni.useState)(!1),[w,v]=(0,ni.useState)(!1),[g,E]=(0,ni.useState)(null),S=(0,ni.useMemo)(()=>o?.linkedAccounts.filter(I=>I.type==="passkey")??[],[o]),R=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},_=async I=>{m(!0);try{await l(),await s({credentialIds:I}),v(!0)}catch(M){E(M)}finally{m(!1)}},k=async()=>{u(!0),E(null);try{await i();let M=(await a())?.linkedAccounts.filter(U=>U.type==="passkey").map(U=>U.credentialId)??[];await _(M)}catch(I){E(I)}finally{u(!1)}};return S.length===0||f?(0,te.jsx)(Tb,{onReset:r,onClose:t,onClick:k,isCreating:f}):w?(0,te.jsx)(_b,{onClick:R,onClose:R}):g?(0,te.jsx)(ki,{error:g,backFn:()=>E(null),onClick:()=>E(null)}):(0,te.jsx)(Sb,{passkeys:S,isSubmitting:c,isCreating:f,onReset:r,onClose:t,onSubmitEnrollment:()=>_(S.map(I=>I.credentialId)),onAddPasskey:k})},Tb=({onReset:e,onClose:t,onClick:r,isCreating:o})=>(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(x,{backFn:e,onClose:t},"header"),(0,te.jsx)(Ye,{children:(0,te.jsxs)(rd,{children:[(0,te.jsx)(Mi,{}),(0,te.jsx)(Wi,{})]})}),(0,te.jsx)(Te,{children:"Set up passkey verification"}),(0,te.jsxs)(wi,{children:[(0,te.jsxs)(xr,{children:[(0,te.jsx)(Ar,{children:(0,te.jsx)(uC.default,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),(0,te.jsxs)(xr,{children:[(0,te.jsx)(Ar,{children:(0,te.jsx)(pC.default,{})}),"Takes seconds to set up and use"]}),(0,te.jsxs)(xr,{children:[(0,te.jsx)(Ar,{children:(0,te.jsx)(dC.default,{})}),"Use your passkey to verify transactions and login to your account"]})]}),(0,te.jsx)(H,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),(0,te.jsx)(J,{})]}),Sb=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=(0,ni.useState)(!1),c=l?n.length:n.length>3?2:3;return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(x,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&(0,te.jsx)(Ye,{children:(0,te.jsxs)(rd,{children:[(0,te.jsx)(Mi,{}),(0,te.jsx)(Wi,{})]})}),(0,te.jsx)(Te,{children:"Enable your passkeys for verification"}),(0,te.jsxs)(wi,{children:[n.slice(0,c).map(m=>(0,te.jsxs)(Pb,{children:[(0,te.jsx)(Ab,{children:kb(m)}),(0,te.jsxs)(xb,{children:["Last used: ",m.latestVerifiedAt?.toLocaleString()]})]},m.credentialId)),!l&&n.length>3&&(0,te.jsx)(cC,{onClick:()=>s(!0),children:"View All"})]}),(0,te.jsx)(H,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&(0,te.jsx)(cC,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?(0,te.jsx)(xt,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),(0,te.jsx)(J,{})]})},_b=({onClick:e,onClose:t})=>(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(x,{onClose:t},"header"),(0,te.jsx)(Ye,{children:(0,te.jsx)(mt,{status:"success",children:(0,te.jsx)(mC.default,{})})}),(0,te.jsx)(Te,{children:"Passkey verification added"}),(0,te.jsx)(Pe,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),(0,te.jsx)(ir,{children:(0,te.jsx)(H,{onClick:e,children:"Done"})}),(0,te.jsx)(J,{})]}),Pb=Ks.default.div`
2303
2303
  && {
2304
2304
  padding: 0.75rem 1rem;
2305
2305
  text-align: left;
@@ -2307,19 +2307,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
2307
2307
  border: 1px solid var(--privy-color-foreground-4);
2308
2308
  width: 100%;
2309
2309
  }
2310
- `,bb=$s.default.div`
2310
+ `,Ab=Ks.default.div`
2311
2311
  font-size: 0.875rem;
2312
2312
  line-height: 1.375rem;
2313
2313
  font-weight: 500;
2314
2314
 
2315
2315
  color: var(--privy-color-foreground-1);
2316
- `,Eb=$s.default.div`
2316
+ `,xb=Ks.default.div`
2317
2317
  font-size: 0.75rem;
2318
2318
  font-weight: 400;
2319
2319
  line-height: 1.125rem;
2320
2320
 
2321
2321
  color: var(--privy-color-foreground-2);
2322
- `,Tb=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device",iC=$s.default.button`
2322
+ `,kb=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device",cC=Ks.default.button`
2323
2323
  && {
2324
2324
  width: 100%;
2325
2325
  font-size: 0.875rem;
@@ -2344,7 +2344,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2344
2344
  box-shadow: none;
2345
2345
  }
2346
2346
  }
2347
- `;var mC=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Iu=y(require("@heroicons/react/24/solid/PhoneIcon")),js=require("react");var Wd=require("react"),uC=require("react-device-detect"),Ru=y(require("styled-components")),Xo=require("react/jsx-runtime"),Ks=6,Sb=new Array(Ks).fill("");function _b(e){return e.replace(/\s+/g,"")}function ku(e){return/^[0-9]{1}$/.test(e)}function pC(e){return e.length===Ks&&e.every(ku)}function Pb(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var Li=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=(0,Wd.useState)(Sb),[a,l]=(0,Wd.useState)(null),[s,c]=(0,Wd.useState)(null),m=async v=>{v.preventDefault();let g=_b(v.currentTarget.value);if(g==="")return;let E=Pb(n,ku),T=g.split(""),R=!T.every(ku),S=T.length+E>Ks;if(R){l("Passcode can only be numbers"),c(1);return}if(S){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let x=Number(v.currentTarget.name?.charAt(4)),I=[...g||[""]].slice(0,Ks-x),M=[...n.slice(0,x),...I,...n.slice(x+I.length)];i(M);let U=I.length,G=Math.min(Math.max(x+U,0),Ks-1);if(document.querySelector(`input[name=pin-${G}]`)?.focus(),pC(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${G}]`)?.blur()}catch(Z){c(1),l(Z.message)}else try{await e(null)}catch(Z){c(1),l(Z.message)}},f=v=>{s===1&&(l(null),c(null));let g=[...n.slice(0,v),"",...n.slice(v+1)];i(g),v>0&&document.querySelector(`input[name=pin-${v-1}]`)?.focus(),pC(g)?e(g.join("")):e(null)},w=o?"success":!!(r||a)?"fail":"";return(0,Xo.jsx)(Xo.Fragment,{children:(0,Xo.jsxs)(Ab,{children:[(0,Xo.jsx)("div",{children:n.map((v,g)=>(0,Xo.jsx)("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:m,onKeyUp:E=>{E.key==="Backspace"&&f(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:w,autoComplete:uC.isMobile?"one-time-code":"off",disabled:t},g))}),(0,Xo.jsx)("div",{children:(0,Xo.jsx)(xb,{fail:!!r||!!a,children:r||a})})]})})},Ab=Ru.default.div`
2347
+ `;var gC=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Wu=y(require("@heroicons/react/24/solid/PhoneIcon")),Ys=require("react");var Ld=require("react"),yC=require("react-device-detect"),Mu=y(require("styled-components")),en=require("react/jsx-runtime"),js=6,Rb=new Array(js).fill("");function Ib(e){return e.replace(/\s+/g,"")}function Iu(e){return/^[0-9]{1}$/.test(e)}function hC(e){return e.length===js&&e.every(Iu)}function Mb(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var Di=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=(0,Ld.useState)(Rb),[a,l]=(0,Ld.useState)(null),[s,c]=(0,Ld.useState)(null),m=async v=>{v.preventDefault();let g=Ib(v.currentTarget.value);if(g==="")return;let E=Mb(n,Iu),S=g.split(""),R=!S.every(Iu),_=S.length+E>js;if(R){l("Passcode can only be numbers"),c(1);return}if(_){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let k=Number(v.currentTarget.name?.charAt(4)),I=[...g||[""]].slice(0,js-k),M=[...n.slice(0,k),...I,...n.slice(k+I.length)];i(M);let U=I.length,G=Math.min(Math.max(k+U,0),js-1);if(document.querySelector(`input[name=pin-${G}]`)?.focus(),hC(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${G}]`)?.blur()}catch(Z){c(1),l(Z.message)}else try{await e(null)}catch(Z){c(1),l(Z.message)}},f=v=>{s===1&&(l(null),c(null));let g=[...n.slice(0,v),"",...n.slice(v+1)];i(g),v>0&&document.querySelector(`input[name=pin-${v-1}]`)?.focus(),hC(g)?e(g.join("")):e(null)},w=o?"success":!!(r||a)?"fail":"";return(0,en.jsx)(en.Fragment,{children:(0,en.jsxs)(Wb,{children:[(0,en.jsx)("div",{children:n.map((v,g)=>(0,en.jsx)("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:m,onKeyUp:E=>{E.key==="Backspace"&&f(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:w,autoComplete:yC.isMobile?"one-time-code":"off",disabled:t},g))}),(0,en.jsx)("div",{children:(0,en.jsx)(Ob,{fail:!!r||!!a,children:r||a})})]})})},Wb=Mu.default.div`
2348
2348
  display: flex;
2349
2349
  flex-direction: column;
2350
2350
  width: 100%;
@@ -2412,7 +2412,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2412
2412
  transform: translate(1px, 0px);
2413
2413
  }
2414
2414
  }
2415
- `,xb=Ru.default.div`
2415
+ `,Ob=Mu.default.div`
2416
2416
  line-height: 20px;
2417
2417
  font-size: 13px;
2418
2418
  display: flex;
@@ -2420,7 +2420,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2420
2420
  width: 100%;
2421
2421
 
2422
2422
  color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
2423
- `;var be=require("react/jsx-runtime"),fC=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,js.useState)(""),[i,a]=(0,js.useState)(!1),[l,s]=(0,js.useState)(null),[c,m]=(0,js.useState)("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:u}=ho(),{app:w,data:v}=A();function g(){v?.mfaEnrollmentFlow?.onSuccess(),e()}async function E({qualifiedPhoneNumber:S}){try{await f({phoneNumber:S}),n(S),m("verify")}catch(x){s(x)}}async function T(S){try{if(!S)return;await u({phoneNumber:o,mfaCode:S}),a(!0)}catch(x){throw Wc(x)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Hn(x)?new Error("The code you entered is not valid"):Bn(x)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Oc(x)?new Error("Verification canceled"):new Error("Unknown error")}}function R(){c==="verify"?m("enroll"):t()}return l?(0,be.jsx)(Ai,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):c==="enroll"?(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(k,{backFn:t,onClose:r},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{children:(0,be.jsx)(Iu.default,{})})}),(0,be.jsx)(Te,{children:"Set up SMS verification"}),(0,be.jsx)(Pe,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,be.jsxs)(so,{children:[(0,be.jsx)(za,{onSubmit:E}),(0,be.jsxs)(py,{children:["By providing your mobile number, you agree to receive text messages from ",w?.name,". Some carrier charges may apply"]})]}),(0,be.jsx)(J,{})]}):i?(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(k,{onClose:g},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{status:"success",children:(0,be.jsx)(mC.default,{})})}),(0,be.jsx)(Te,{children:"SMS verification added"}),(0,be.jsx)(Pe,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,be.jsx)(ir,{children:(0,be.jsx)(H,{onClick:g,children:"Done"})}),(0,be.jsx)(J,{})]}):(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(k,{backFn:R,onClose:r},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{children:(0,be.jsx)(Iu.default,{})})}),(0,be.jsx)(Te,{children:"Enter enrollment code"}),(0,be.jsxs)(so,{children:[(0,be.jsx)(Li,{onChange:T}),(0,be.jsxs)(Pe,{children:["To continue, enter the 6-digit code sent to ",(0,be.jsx)("strong",{children:vv(o)})]})]}),(0,be.jsx)(J,{})]})};var vC=y(require("@heroicons/react/24/solid/CheckCircleIcon")),CC=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Mu=require("react");var hC=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var gC=require("react/jsx-runtime");var yC=({size:e,authUrl:t})=>(0,gC.jsx)(jn,{url:t,squareLogoElement:hC.default,size:e,fgColor:"#1F1F1F"});var _e=require("react/jsx-runtime"),wC=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=(0,Mu.useState)("enroll"),[a,l]=(0,Mu.useState)(!1),{submitEnrollmentWithTotp:s}=ho(),{data:c}=A();function m(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function f(){i("verify")}async function u(v){try{if(!v)return;await s({mfaCode:v}),l(!0)}catch(g){throw Wc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Hn(g)?new Error("The code you entered is not valid"):Bn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Oc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function w(){n==="verify"?i("enroll"):r()}return n==="enroll"?(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(k,{backFn:r,onClose:t},"header"),(0,_e.jsx)(Te,{children:"Scan QR code"}),(0,_e.jsx)(Pe,{children:"Open your authenticator app and scan the QR code to continue."}),(0,_e.jsx)(ma,{children:(0,_e.jsx)(yC,{authUrl:o.authUrl,size:200})}),(0,_e.jsxs)(ir,{children:[(0,_e.jsx)(jt,{children:(0,_e.jsx)(Kn,{itemName:"secret",text:o.secret})}),(0,_e.jsx)(H,{onClick:f,children:"Continue"})]}),(0,_e.jsx)(J,{})]}):a?(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(k,{onClose:m},"header"),(0,_e.jsx)(Ye,{children:(0,_e.jsx)(mt,{status:"success",children:(0,_e.jsx)(vC.default,{})})}),(0,_e.jsx)(Te,{children:"Authenticator app verification added"}),(0,_e.jsx)(Pe,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,_e.jsx)(ir,{children:(0,_e.jsx)(H,{onClick:m,children:"Done"})}),(0,_e.jsx)(J,{})]}):(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(k,{backFn:w,onClose:t},"header"),(0,_e.jsx)(Ye,{children:(0,_e.jsx)(mt,{children:(0,_e.jsx)(CC.default,{})})}),(0,_e.jsx)(Te,{children:"Enter enrollment code"}),(0,_e.jsx)(so,{children:(0,_e.jsx)(Li,{onChange:u})}),(0,_e.jsxs)(Pe,{children:["To continue, enter the 6-digit code generated from your ",(0,_e.jsx)("strong",{children:"authenticator app"})]}),(0,_e.jsx)(J,{})]})};var z=require("react/jsx-runtime"),PC=()=>{let{user:e,enrollInMfa:t}=$(),[r,o]=(0,vn.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=ho(),{app:l,ready:s,data:c,onUserCloseViaDialogOrKeybindRef:m}=A(),{closePrivyModal:f}=W(),{promptMfa:u}=$a(),{initEnrollmentWithTotp:w}=ho(),[v,g]=(0,vn.useState)(!1),[E,T]=(0,vn.useState)(null),[R,S]=(0,vn.useState)(null),x=()=>{f({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),T(null)},500)},{initEnrollmentWithPasskey:I,submitEnrollmentWithPasskey:M}=ho(),[U,G]=(0,vn.useState)(!1),[Y,Z]=(0,vn.useState)(null);m.current=x;let L=e?.mfaMethods.includes("sms"),F=!!e?.phone,O=e?.mfaMethods.includes("totp"),Me=e?.mfaMethods.includes("passkey"),je=L||O||Me,Q=e?.linkedAccounts.filter(ge=>ge.type==="passkey").map(ge=>ge.credentialId)??[];(0,vn.useEffect)(()=>{je&&g(!0)},[je]);function re(){o(null),T(null)}function ie(){g(!1)}async function Fe(){G(!0);try{await I(),await M({credentialIds:Q})}catch(ge){Z(ge)}finally{G(!1)}}async function De(ge){if(await u().catch(Z),ge==="totp"){T(ge),S(null),w().then(Cr=>{S(Cr)}).catch(()=>{S(null),re()});return}if(ge==="passkey"&&Q.length===1)return await Fe();T(ge)}if(!s||!e||!l)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(k,{onClose:x},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(Jv,{})}),(0,z.jsx)(so,{children:(0,z.jsx)(At,{})}),(0,z.jsx)(J,{})]});async function ut(){o(null);try{await n()}catch{o(null)}}async function lt(){o(null);try{await i()}catch{o(null)}}async function Dt(){o(null);try{await u(),await a()}catch{o(null)}}if(r==="sms")return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(k,{backFn:re,onClose:x},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(SC.default,{})})}),(0,z.jsx)(Te,{children:"Remove SMS verification?"}),(0,z.jsxs)(Pe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,z.jsx)(ir,{children:(0,z.jsx)(H,{warn:!0,onClick:ut,children:"Remove SMS for MFA"})}),(0,z.jsx)(J,{})]});if(r==="totp")return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(k,{backFn:re,onClose:x},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(EC.default,{})})}),(0,z.jsx)(Te,{children:"Remove Authenticator App verification?"}),(0,z.jsxs)(Pe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,z.jsx)(ir,{children:(0,z.jsx)(H,{warn:!0,onClick:lt,children:"Remove Authenticator App for MFA"})}),(0,z.jsx)(J,{})]});if(r==="passkey")return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(k,{backFn:re,onClose:x},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(_C.default,{})})}),(0,z.jsx)(Te,{children:"Are you sure you want to remove passkey verification?"}),(0,z.jsx)(Pe,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),(0,z.jsx)(ir,{children:(0,z.jsx)(H,{warn:!0,onClick:Dt,children:"Yes, remove"})}),(0,z.jsx)(J,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!je)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(k,{onClose:x},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(Wu.default,{})})}),(0,z.jsx)(Te,{children:"Add more security"}),(0,z.jsxs)(Pe,{children:[l?.name," does not have any verification methods enabled."]}),(0,z.jsx)(ir,{children:(0,z.jsx)(H,{onClick:x,children:"Close"})}),(0,z.jsx)(J,{})]});let at=!je&&!v;return at?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(k,{onClose:x},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(Wu.default,{})})}),(0,z.jsx)(Te,{children:"Transaction Protection"}),(0,z.jsx)(Pe,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,z.jsxs)(vi,{children:[(0,z.jsxs)(xr,{children:[(0,z.jsx)(Ar,{children:(0,z.jsx)(bC.default,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),(0,z.jsxs)(xr,{children:[(0,z.jsx)(Ar,{children:(0,z.jsx)(TC.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,z.jsxs)(ir,{children:[(0,z.jsx)(H,{onClick:()=>g(!0),children:"Continue"}),(0,z.jsx)(_o,{onClick:x,children:"Not now"})]}),(0,z.jsx)(J,{})]}):E==="sms"?(0,z.jsx)(fC,{onComplete:x,onReset:re,onClose:x}):E==="totp"&&R?(0,z.jsx)(wC,{onComplete:x,onClose:x,onReset:re,totpInfo:R}):E==="passkey"?(0,z.jsx)(dC,{onComplete:x,onReset:re,onClose:x}):(0,z.jsx)(nC,{showIntro:at,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:F,onBackToIntro:ie,handleSelectMethod:De,isTotpLoading:E==="totp"&&!R,isPasskeyLoading:U,error:Y,onClose:x,setRemovingMfaMethod:o})};var ZC=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),QC=y(require("@heroicons/react/24/outline/FingerPrintIcon")),JC=y(require("@heroicons/react/24/outline/PhoneIcon")),XC=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),e3=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),t3=y(require("@heroicons/react/24/solid/PhoneIcon")),ri=require("react");var Ni=require("react"),zC=y(require("styled-components")),Ud=require("@privy-io/js-sdk-core");var Uu=y(require("styled-components"));var Ou=y(require("styled-components")),Ys=require("react/jsx-runtime"),Od=({label:e,children:t,valueStyles:r})=>(0,Ys.jsxs)(kb,{children:[(0,Ys.jsx)("div",{children:e}),(0,Ys.jsx)(Rb,{style:{...r},children:t})]}),kb=Ou.default.div`
2423
+ `;var be=require("react/jsx-runtime"),vC=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,Ys.useState)(""),[i,a]=(0,Ys.useState)(!1),[l,s]=(0,Ys.useState)(null),[c,m]=(0,Ys.useState)("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:u}=yo(),{app:w,data:v}=P();function g(){v?.mfaEnrollmentFlow?.onSuccess(),e()}async function E({qualifiedPhoneNumber:_}){try{await f({phoneNumber:_}),n(_),m("verify")}catch(k){s(k)}}async function S(_){try{if(!_)return;await u({phoneNumber:o,mfaCode:_}),a(!0)}catch(k){throw Lc(k)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Vn(k)?new Error("The code you entered is not valid"):Gn(k)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Nc(k)?new Error("Verification canceled"):new Error("Unknown error")}}function R(){c==="verify"?m("enroll"):t()}return l?(0,be.jsx)(ki,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):c==="enroll"?(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(x,{backFn:t,onClose:r},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{children:(0,be.jsx)(Wu.default,{})})}),(0,be.jsx)(Te,{children:"Set up SMS verification"}),(0,be.jsx)(Pe,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,be.jsxs)(co,{children:[(0,be.jsx)(ri,{onSubmit:E,hideRecent:!0}),(0,be.jsxs)(hy,{children:["By providing your mobile number, you agree to receive text messages from ",w?.name,". Some carrier charges may apply"]})]}),(0,be.jsx)(J,{})]}):i?(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(x,{onClose:g},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{status:"success",children:(0,be.jsx)(gC.default,{})})}),(0,be.jsx)(Te,{children:"SMS verification added"}),(0,be.jsx)(Pe,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,be.jsx)(ir,{children:(0,be.jsx)(H,{onClick:g,children:"Done"})}),(0,be.jsx)(J,{})]}):(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(x,{backFn:R,onClose:r},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{children:(0,be.jsx)(Wu.default,{})})}),(0,be.jsx)(Te,{children:"Enter enrollment code"}),(0,be.jsxs)(co,{children:[(0,be.jsx)(Di,{onChange:S}),(0,be.jsxs)(Pe,{children:["To continue, enter the 6-digit code sent to ",(0,be.jsx)("strong",{children:Ev(o)})]})]}),(0,be.jsx)(J,{})]})};var EC=y(require("@heroicons/react/24/solid/CheckCircleIcon")),TC=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Ou=require("react");var CC=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var bC=require("react/jsx-runtime");var wC=({size:e,authUrl:t})=>(0,bC.jsx)(Zn,{url:t,squareLogoElement:CC.default,size:e,fgColor:"#1F1F1F"});var _e=require("react/jsx-runtime"),SC=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=(0,Ou.useState)("enroll"),[a,l]=(0,Ou.useState)(!1),{submitEnrollmentWithTotp:s}=yo(),{data:c}=P();function m(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function f(){i("verify")}async function u(v){try{if(!v)return;await s({mfaCode:v}),l(!0)}catch(g){throw Lc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Vn(g)?new Error("The code you entered is not valid"):Gn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Nc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function w(){n==="verify"?i("enroll"):r()}return n==="enroll"?(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(x,{backFn:r,onClose:t},"header"),(0,_e.jsx)(Te,{children:"Scan QR code"}),(0,_e.jsx)(Pe,{children:"Open your authenticator app and scan the QR code to continue."}),(0,_e.jsx)(ha,{children:(0,_e.jsx)(wC,{authUrl:o.authUrl,size:200})}),(0,_e.jsxs)(ir,{children:[(0,_e.jsx)(jt,{children:(0,_e.jsx)(Yn,{itemName:"secret",text:o.secret})}),(0,_e.jsx)(H,{onClick:f,children:"Continue"})]}),(0,_e.jsx)(J,{})]}):a?(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(x,{onClose:m},"header"),(0,_e.jsx)(Ye,{children:(0,_e.jsx)(mt,{status:"success",children:(0,_e.jsx)(EC.default,{})})}),(0,_e.jsx)(Te,{children:"Authenticator app verification added"}),(0,_e.jsx)(Pe,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,_e.jsx)(ir,{children:(0,_e.jsx)(H,{onClick:m,children:"Done"})}),(0,_e.jsx)(J,{})]}):(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(x,{backFn:w,onClose:t},"header"),(0,_e.jsx)(Ye,{children:(0,_e.jsx)(mt,{children:(0,_e.jsx)(TC.default,{})})}),(0,_e.jsx)(Te,{children:"Enter enrollment code"}),(0,_e.jsx)(co,{children:(0,_e.jsx)(Di,{onChange:u})}),(0,_e.jsxs)(Pe,{children:["To continue, enter the 6-digit code generated from your ",(0,_e.jsx)("strong",{children:"authenticator app"})]}),(0,_e.jsx)(J,{})]})};var $=require("react/jsx-runtime"),RC=()=>{let{user:e,enrollInMfa:t}=z(),[r,o]=(0,Cn.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=yo(),{app:l,ready:s,data:c,onUserCloseViaDialogOrKeybindRef:m}=P(),{closePrivyModal:f}=W(),{promptMfa:u}=Ka(),{initEnrollmentWithTotp:w}=yo(),[v,g]=(0,Cn.useState)(!1),[E,S]=(0,Cn.useState)(null),[R,_]=(0,Cn.useState)(null),k=()=>{f({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),S(null)},500)},{initEnrollmentWithPasskey:I,submitEnrollmentWithPasskey:M}=yo(),[U,G]=(0,Cn.useState)(!1),[Y,Z]=(0,Cn.useState)(null);m.current=k;let L=e?.mfaMethods.includes("sms"),F=!!e?.phone,O=e?.mfaMethods.includes("totp"),Me=e?.mfaMethods.includes("passkey"),je=L||O||Me,Q=e?.linkedAccounts.filter(ge=>ge.type==="passkey").map(ge=>ge.credentialId)??[];(0,Cn.useEffect)(()=>{je&&g(!0)},[je]);function re(){o(null),S(null)}function ie(){g(!1)}async function Fe(){G(!0);try{await I(),await M({credentialIds:Q})}catch(ge){Z(ge)}finally{G(!1)}}async function De(ge){if(await u().catch(Z),ge==="totp"){S(ge),_(null),w().then(Cr=>{_(Cr)}).catch(()=>{_(null),re()});return}if(ge==="passkey"&&Q.length===1)return await Fe();S(ge)}if(!s||!e||!l)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(x,{onClose:k},"header"),(0,$.jsx)(Ye,{children:(0,$.jsx)(rC,{})}),(0,$.jsx)(co,{children:(0,$.jsx)(xt,{})}),(0,$.jsx)(J,{})]});async function ut(){o(null);try{await n()}catch{o(null)}}async function lt(){o(null);try{await i()}catch{o(null)}}async function Dt(){o(null);try{await u(),await a()}catch{o(null)}}if(r==="sms")return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(x,{backFn:re,onClose:k},"header"),(0,$.jsx)(Ye,{children:(0,$.jsx)(mt,{children:(0,$.jsx)(xC.default,{})})}),(0,$.jsx)(Te,{children:"Remove SMS verification?"}),(0,$.jsxs)(Pe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,$.jsx)(ir,{children:(0,$.jsx)(H,{warn:!0,onClick:ut,children:"Remove SMS for MFA"})}),(0,$.jsx)(J,{})]});if(r==="totp")return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(x,{backFn:re,onClose:k},"header"),(0,$.jsx)(Ye,{children:(0,$.jsx)(mt,{children:(0,$.jsx)(PC.default,{})})}),(0,$.jsx)(Te,{children:"Remove Authenticator App verification?"}),(0,$.jsxs)(Pe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,$.jsx)(ir,{children:(0,$.jsx)(H,{warn:!0,onClick:lt,children:"Remove Authenticator App for MFA"})}),(0,$.jsx)(J,{})]});if(r==="passkey")return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(x,{backFn:re,onClose:k},"header"),(0,$.jsx)(Ye,{children:(0,$.jsx)(mt,{children:(0,$.jsx)(kC.default,{})})}),(0,$.jsx)(Te,{children:"Are you sure you want to remove passkey verification?"}),(0,$.jsx)(Pe,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),(0,$.jsx)(ir,{children:(0,$.jsx)(H,{warn:!0,onClick:Dt,children:"Yes, remove"})}),(0,$.jsx)(J,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!je)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(x,{onClose:k},"header"),(0,$.jsx)(Ye,{children:(0,$.jsx)(mt,{children:(0,$.jsx)(Lu.default,{})})}),(0,$.jsx)(Te,{children:"Add more security"}),(0,$.jsxs)(Pe,{children:[l?.name," does not have any verification methods enabled."]}),(0,$.jsx)(ir,{children:(0,$.jsx)(H,{onClick:k,children:"Close"})}),(0,$.jsx)(J,{})]});let at=!je&&!v;return at?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(x,{onClose:k},"header"),(0,$.jsx)(Ye,{children:(0,$.jsx)(mt,{children:(0,$.jsx)(Lu.default,{})})}),(0,$.jsx)(Te,{children:"Transaction Protection"}),(0,$.jsx)(Pe,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,$.jsxs)(wi,{children:[(0,$.jsxs)(xr,{children:[(0,$.jsx)(Ar,{children:(0,$.jsx)(_C.default,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),(0,$.jsxs)(xr,{children:[(0,$.jsx)(Ar,{children:(0,$.jsx)(AC.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,$.jsxs)(ir,{children:[(0,$.jsx)(H,{onClick:()=>g(!0),children:"Continue"}),(0,$.jsx)(Po,{onClick:k,children:"Not now"})]}),(0,$.jsx)(J,{})]}):E==="sms"?(0,$.jsx)(vC,{onComplete:k,onReset:re,onClose:k}):E==="totp"&&R?(0,$.jsx)(SC,{onComplete:k,onClose:k,onReset:re,totpInfo:R}):E==="passkey"?(0,$.jsx)(fC,{onComplete:k,onReset:re,onClose:k}):(0,$.jsx)(lC,{showIntro:at,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:F,onBackToIntro:ie,handleSelectMethod:De,isTotpLoading:E==="totp"&&!R,isPasskeyLoading:U,error:Y,onClose:k,setRemovingMfaMethod:o})};var e3=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),t3=y(require("@heroicons/react/24/outline/FingerPrintIcon")),r3=y(require("@heroicons/react/24/outline/PhoneIcon")),o3=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),n3=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),i3=y(require("@heroicons/react/24/solid/PhoneIcon")),ii=require("react");var Ui=require("react"),YC=y(require("styled-components")),Bd=require("@privy-io/js-sdk-core");var Bu=y(require("styled-components"));var Nu=y(require("styled-components")),Zs=require("react/jsx-runtime"),Nd=({label:e,children:t,valueStyles:r})=>(0,Zs.jsxs)(Lb,{children:[(0,Zs.jsx)("div",{children:e}),(0,Zs.jsx)(Nb,{style:{...r},children:t})]}),Lb=Nu.default.div`
2424
2424
  display: flex;
2425
2425
  align-items: center;
2426
2426
  justify-content: space-between;
@@ -2435,7 +2435,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2435
2435
  color: var(--privy-color-foreground-2);
2436
2436
  text-align: right;
2437
2437
  }
2438
- `,Rb=Ou.default.div`
2438
+ `,Nb=Nu.default.div`
2439
2439
  font-size: 14px;
2440
2440
  line-height: 100%;
2441
2441
  display: flex;
@@ -2444,28 +2444,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
2444
2444
  border-radius: var(--privy-border-radius-full);
2445
2445
  background-color: var(--privy-color-background-2);
2446
2446
  padding: 4px 8px;
2447
- `;var Zs=y(require("styled-components"));var en=require("react/jsx-runtime"),AC=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ls(e),n=t?jo(o,t):void 0,i=zr(o,r);return(0,en.jsx)(xC,{children:n||i})},Lu=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ls(e),n=t?jo(o,t):void 0,i=zr(o,r);return(0,en.jsx)(xC,{children:n?(0,en.jsxs)(en.Fragment,{children:[(0,en.jsx)(Ib,{children:"USD"}),n==="<$0.01"?(0,en.jsxs)(Wb,{children:[(0,en.jsx)(Mb,{children:"<"}),"$0.01"]}):n]}):i})},xC=Zs.default.span`
2447
+ `;var Qs=y(require("styled-components"));var tn=require("react/jsx-runtime"),IC=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ns(e),n=t?Yo(o,t):void 0,i=$r(o,r);return(0,tn.jsx)(MC,{children:n||i})},Du=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ns(e),n=t?Yo(o,t):void 0,i=$r(o,r);return(0,tn.jsx)(MC,{children:n?(0,tn.jsxs)(tn.Fragment,{children:[(0,tn.jsx)(Db,{children:"USD"}),n==="<$0.01"?(0,tn.jsxs)(Fb,{children:[(0,tn.jsx)(Ub,{children:"<"}),"$0.01"]}):n]}):i})},MC=Qs.default.span`
2448
2448
  font-size: 14px;
2449
2449
  line-height: 140%;
2450
2450
  display: flex;
2451
2451
  gap: 4px;
2452
2452
  align-items: center;
2453
- `,Ib=Zs.default.span`
2453
+ `,Db=Qs.default.span`
2454
2454
  font-size: 12px;
2455
2455
  line-height: 12px;
2456
2456
  color: var(--privy-color-foreground-3);
2457
- `,Mb=Zs.default.span`
2457
+ `,Ub=Qs.default.span`
2458
2458
  font-size: 10px;
2459
- `,Wb=Zs.default.span`
2459
+ `,Fb=Qs.default.span`
2460
2460
  display: flex;
2461
2461
  align-items: center;
2462
- `;var Ld=y(require("styled-components")),Nu=require("@privy-io/js-sdk-core");var Wr=require("react/jsx-runtime"),kC=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,Wr.jsxs)(Nn,{style:{paddingBottom:"12px"},children:[(0,Wr.jsxs)(IC,{children:[(0,Wr.jsx)(WC,{children:"Est. Fees"}),(0,Wr.jsx)("div",{children:(0,Wr.jsx)(Lu,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,Wr.jsx)(MC,{children:`${zr(e,r)}`})]}),RC=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=(0,Nu.QuantityToBigNumber)(e.value||0).add((0,Nu.QuantityToBigNumber)(t)).toHexString();return(0,Wr.jsxs)(Nn,{children:[(0,Wr.jsxs)(IC,{children:[(0,Wr.jsx)(WC,{children:"Total (including fees)"}),(0,Wr.jsx)("div",{children:(0,Wr.jsx)(Lu,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&(0,Wr.jsx)(MC,{children:zr(n,o)})]})},IC=Ld.default.div`
2462
+ `;var Dd=y(require("styled-components")),Uu=require("@privy-io/js-sdk-core");var Or=require("react/jsx-runtime"),WC=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,Or.jsxs)(Un,{style:{paddingBottom:"12px"},children:[(0,Or.jsxs)(LC,{children:[(0,Or.jsx)(DC,{children:"Est. Fees"}),(0,Or.jsx)("div",{children:(0,Or.jsx)(Du,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,Or.jsx)(NC,{children:`${$r(e,r)}`})]}),OC=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=(0,Uu.QuantityToBigNumber)(e.value||0).add((0,Uu.QuantityToBigNumber)(t)).toHexString();return(0,Or.jsxs)(Un,{children:[(0,Or.jsxs)(LC,{children:[(0,Or.jsx)(DC,{children:"Total (including fees)"}),(0,Or.jsx)("div",{children:(0,Or.jsx)(Du,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&(0,Or.jsx)(NC,{children:$r(n,o)})]})},LC=Dd.default.div`
2463
2463
  display: flex;
2464
2464
  flex-direction: row;
2465
2465
  justify-content: space-between;
2466
2466
  align-items: center;
2467
2467
  padding-top: 4px;
2468
- `,MC=Ld.default.div`
2468
+ `,NC=Dd.default.div`
2469
2469
  display: flex;
2470
2470
  flex-direction: row;
2471
2471
  height: 12px;
@@ -2474,23 +2474,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
2474
2474
  line-height: 12px;
2475
2475
  color: var(--privy-color-foreground-3);
2476
2476
  font-weight: 400;
2477
- `,WC=Ld.default.div`
2477
+ `,DC=Dd.default.div`
2478
2478
  font-size: 14px;
2479
2479
  line-height: 22.4px;
2480
2480
  font-weight: 400;
2481
- `;var OC=y(require("@heroicons/react/24/outline/ChevronDownIcon")),tn=require("react"),Cn=y(require("styled-components"));var Nd=require("react"),Ka=(0,Nd.createContext)(void 0);var Qs=(0,Nd.createContext)(void 0);var Jt=require("react/jsx-runtime"),LC=({defaultValue:e,children:t})=>{let[r,o]=(0,tn.useState)(e||null),n=i=>{o(r===i?null:i)};return(0,Jt.jsx)(Ka.Provider,{value:{activePanel:r,togglePanel:n},children:(0,Jt.jsx)(Ob,{children:t})})},NC=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=(0,tn.useContext)(Ka),n=r===e;return(0,Jt.jsx)(Qs.Provider,{value:{onToggle:()=>o(e),value:e},children:(0,Jt.jsx)(Ub,{isActive:n,"data-open":n,children:t})})},DC=({children:e})=>{let{activePanel:t}=(0,tn.useContext)(Ka),{onToggle:r,value:o}=(0,tn.useContext)(Qs),n=t===o;return(0,Jt.jsxs)(Jt.Fragment,{children:[(0,Jt.jsxs)(Lb,{onClick:r,"data-open":n,children:[(0,Jt.jsx)(Db,{children:e}),(0,Jt.jsx)(Bb,{isactive:n,children:(0,Jt.jsx)(OC.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,Jt.jsx)(Nb,{})]})},UC=({children:e})=>{let{activePanel:t}=(0,tn.useContext)(Ka),{value:r}=(0,tn.useContext)(Qs);return(0,Jt.jsx)(Fb,{"data-open":t===r,children:(0,Jt.jsx)(BC,{children:e})})},FC=({children:e})=>{let{activePanel:t}=(0,tn.useContext)(Ka),{value:r}=(0,tn.useContext)(Qs);return(0,Jt.jsx)(BC,{children:typeof e=="function"?e({isActive:t===r}):e})},Ob=Cn.default.div`
2481
+ `;var UC=y(require("@heroicons/react/24/outline/ChevronDownIcon")),rn=require("react"),wn=y(require("styled-components"));var Ud=require("react"),ja=(0,Ud.createContext)(void 0);var Js=(0,Ud.createContext)(void 0);var Jt=require("react/jsx-runtime"),FC=({defaultValue:e,children:t})=>{let[r,o]=(0,rn.useState)(e||null),n=i=>{o(r===i?null:i)};return(0,Jt.jsx)(ja.Provider,{value:{activePanel:r,togglePanel:n},children:(0,Jt.jsx)(Bb,{children:t})})},BC=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=(0,rn.useContext)(ja),n=r===e;return(0,Jt.jsx)(Js.Provider,{value:{onToggle:()=>o(e),value:e},children:(0,Jt.jsx)(qb,{isActive:n,"data-open":n,children:t})})},HC=({children:e})=>{let{activePanel:t}=(0,rn.useContext)(ja),{onToggle:r,value:o}=(0,rn.useContext)(Js),n=t===o;return(0,Jt.jsxs)(Jt.Fragment,{children:[(0,Jt.jsxs)(Hb,{onClick:r,"data-open":n,children:[(0,Jt.jsx)(Vb,{children:e}),(0,Jt.jsx)($b,{isactive:n,children:(0,Jt.jsx)(UC.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,Jt.jsx)(Gb,{})]})},GC=({children:e})=>{let{activePanel:t}=(0,rn.useContext)(ja),{value:r}=(0,rn.useContext)(Js);return(0,Jt.jsx)(zb,{"data-open":t===r,children:(0,Jt.jsx)(qC,{children:e})})},VC=({children:e})=>{let{activePanel:t}=(0,rn.useContext)(ja),{value:r}=(0,rn.useContext)(Js);return(0,Jt.jsx)(qC,{children:typeof e=="function"?e({isActive:t===r}):e})},Bb=wn.default.div`
2482
2482
  display: flex;
2483
2483
  flex-direction: column;
2484
2484
  width: 100%;
2485
2485
  gap: 8px;
2486
- `,Lb=Cn.default.div`
2486
+ `,Hb=wn.default.div`
2487
2487
  display: flex;
2488
2488
  justify-content: space-between;
2489
2489
  align-items: center;
2490
2490
  width: 100%;
2491
2491
  cursor: pointer;
2492
2492
  padding-bottom: 8px;
2493
- `,Nb=Cn.default.div`
2493
+ `,Gb=wn.default.div`
2494
2494
  width: 100%;
2495
2495
 
2496
2496
  && {
@@ -2498,13 +2498,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2498
2498
  border-color: var(--privy-color-foreground-4);
2499
2499
  }
2500
2500
  padding-bottom: 12px;
2501
- `,Db=Cn.default.div`
2501
+ `,Vb=wn.default.div`
2502
2502
  font-size: 14px;
2503
2503
  font-weight: 500;
2504
2504
  line-height: 19.6px;
2505
2505
  width: 100%;
2506
2506
  padding-right: 8px;
2507
- `,Ub=Cn.default.div`
2507
+ `,qb=wn.default.div`
2508
2508
  display: flex;
2509
2509
  flex-direction: column;
2510
2510
  width: 100%;
@@ -2516,7 +2516,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2516
2516
  border-color: var(--privy-color-foreground-4);
2517
2517
  border-radius: var(--privy-border-radius-md);
2518
2518
  }
2519
- `,Fb=Cn.default.div`
2519
+ `,zb=wn.default.div`
2520
2520
  position: relative;
2521
2521
  overflow: hidden;
2522
2522
  transition: max-height 25ms ease-out;
@@ -2528,36 +2528,36 @@ You will need this password to access your ${e} wallet on a new device. Please k
2528
2528
  &[data-open='false'] {
2529
2529
  max-height: 0;
2530
2530
  }
2531
- `,BC=Cn.default.div`
2531
+ `,qC=wn.default.div`
2532
2532
  display: flex;
2533
2533
  flex-direction: column;
2534
2534
  gap: 12px;
2535
2535
  flex: 1 1 auto;
2536
2536
  min-height: 1px;
2537
- `,Bb=Cn.default.div`
2537
+ `,$b=wn.default.div`
2538
2538
  transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2539
- `;var HC=y(require("styled-components"));var GC=require("react/jsx-runtime"),Du=({walletAddress:e,chainId:t=an})=>(0,GC.jsx)(Hb,{href:G1(t,e),target:"_blank",children:Wt(e)}),Hb=HC.default.a`
2539
+ `;var zC=y(require("styled-components"));var $C=require("react/jsx-runtime"),Fu=({walletAddress:e,chainId:t=sn})=>(0,$C.jsx)(Kb,{href:$1(t,e),target:"_blank",children:Wt(e)}),Kb=zC.default.a`
2540
2540
  &:hover {
2541
2541
  text-decoration: underline;
2542
2542
  }
2543
- `;var Gt=require("react/jsx-runtime"),Dd=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0,s=dt();return(0,Gt.jsx)(LC,{...s.render.standalone?{defaultValue:"details"}:{},children:(0,Gt.jsxs)(NC,{value:"details",children:[(0,Gt.jsx)(DC,{children:(0,Gt.jsxs)(Gb,{children:[(0,Gt.jsx)("div",{children:o?.title||o?.actionDescription||"Details"}),(0,Gt.jsx)(Vb,{children:(0,Gt.jsx)(AC,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),(0,Gt.jsxs)(UC,{children:[(0,Gt.jsx)(Od,{label:"From",children:(0,Gt.jsx)(Du,{walletAddress:e,chainId:r.chainId||an})}),(0,Gt.jsx)(Od,{label:"To",children:(0,Gt.jsx)(Du,{walletAddress:t,chainId:r.chainId||an})}),o&&o.action&&(0,Gt.jsx)(Od,{label:"Action",children:o.action}),i&&(0,Gt.jsx)(kC,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),(0,Gt.jsx)(FC,{children:({isActive:c})=>(0,Gt.jsx)(RC,{transactionData:r,displayFee:c,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},Gb=Uu.default.div`
2543
+ `;var Gt=require("react/jsx-runtime"),Fd=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0,s=dt();return(0,Gt.jsx)(FC,{...s.render.standalone?{defaultValue:"details"}:{},children:(0,Gt.jsxs)(BC,{value:"details",children:[(0,Gt.jsx)(HC,{children:(0,Gt.jsxs)(jb,{children:[(0,Gt.jsx)("div",{children:o?.title||o?.actionDescription||"Details"}),(0,Gt.jsx)(Yb,{children:(0,Gt.jsx)(IC,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),(0,Gt.jsxs)(GC,{children:[(0,Gt.jsx)(Nd,{label:"From",children:(0,Gt.jsx)(Fu,{walletAddress:e,chainId:r.chainId||sn})}),(0,Gt.jsx)(Nd,{label:"To",children:(0,Gt.jsx)(Fu,{walletAddress:t,chainId:r.chainId||sn})}),o&&o.action&&(0,Gt.jsx)(Nd,{label:"Action",children:o.action}),i&&(0,Gt.jsx)(WC,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),(0,Gt.jsx)(VC,{children:({isActive:c})=>(0,Gt.jsx)(OC,{transactionData:r,displayFee:c,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},jb=Bu.default.div`
2544
2544
  display: flex;
2545
2545
  flex-direction: row;
2546
2546
  justify-content: space-between;
2547
- `,Vb=Uu.default.div`
2547
+ `,Yb=Bu.default.div`
2548
2548
  flex-shrink: 0;
2549
2549
  padding-left: 8px;
2550
- `;var VC=y(require("styled-components")),qC=VC.default.img`
2550
+ `;var KC=y(require("styled-components")),jC=KC.default.img`
2551
2551
  && {
2552
2552
  height: ${e=>e.size==="sm"?"65px":"140px"};
2553
2553
  width: ${e=>e.size==="sm"?"65px":"140px"};
2554
2554
  border-radius: 16px;
2555
2555
  margin-bottom: 12px;
2556
2556
  }
2557
- `;var Fu=require("react/jsx-runtime"),Js=({pendingTransaction:e})=>{let{getAccessToken:t}=$(),{wallets:r}=mo(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=W(),[s,c]=(0,Ni.useState)(null),[m,f]=(0,Ni.useState)(e),{tokenPrice:u}=Ko(m),w=l(e.chainId)||"ETH",v=(0,Ni.useMemo)(()=>r.find(g=>g.walletClientType==="privy"),[r]);return(0,Ni.useEffect)(()=>{async function g(){if(!await t()||!o||!v)return m;let T=Er(m.chainId,i,n,{appId:a}),R=await(0,Ud.populateTransactionRequest)(v.address,m,T),{totalGasEstimate:S}=await(0,Ud.calculateTotalGasEstimate)(R,T);return c(S.toHexString()),R}g().then(f).catch(console.error)},[o]),v?(0,Fu.jsx)(qb,{children:(0,Fu.jsx)(Dd,{from:v.address,to:m.to,txn:m,gas:s??void 0,tokenPrice:u,tokenSymbol:w})}):null},qb=zC.default.div`
2557
+ `;var Hu=require("react/jsx-runtime"),Xs=({pendingTransaction:e})=>{let{getAccessToken:t}=z(),{wallets:r}=fo(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=W(),[s,c]=(0,Ui.useState)(null),[m,f]=(0,Ui.useState)(e),{tokenPrice:u}=jo(m),w=l(e.chainId)||"ETH",v=(0,Ui.useMemo)(()=>r.find(g=>g.walletClientType==="privy"),[r]);return(0,Ui.useEffect)(()=>{async function g(){if(!await t()||!o||!v)return m;let S=Er(m.chainId,i,n,{appId:a}),R=await(0,Bd.populateTransactionRequest)(v.address,m,S),{totalGasEstimate:_}=await(0,Bd.calculateTotalGasEstimate)(R,S);return c(_.toHexString()),R}g().then(f).catch(console.error)},[o]),v?(0,Hu.jsx)(Zb,{children:(0,Hu.jsx)(Fd,{from:v.address,to:m.to,txn:m,gas:s??void 0,tokenPrice:u,tokenSymbol:w})}):null},Zb=YC.default.div`
2558
2558
  width: 100%;
2559
2559
  padding: 1rem 0;
2560
- `;var $C=y(require("@heroicons/react/24/outline/CalendarIcon")),KC=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),jC=y(require("@heroicons/react/24/outline/ShieldCheckIcon"));var Xe=require("react/jsx-runtime"),YC=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=W();return(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(k,{onClose:r},"header"),(0,Xe.jsx)(vt,{children:(0,Xe.jsxs)("div",{children:[(0,Xe.jsx)(Pt,{success:a,fail:!!t}),t?(0,Xe.jsx)(KC.default,{style:{width:"38px",height:"38px"}}):(0,Xe.jsx)(Ri,{style:{width:"38px",height:"38px"}})]})}),(0,Xe.jsx)(Te,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),(0,Xe.jsxs)(vi,{children:[(0,Xe.jsxs)(xr,{children:[(0,Xe.jsx)(Ar,{children:(0,Xe.jsx)(jC.default,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),(0,Xe.jsxs)(xr,{children:[(0,Xe.jsx)(Ar,{children:(0,Xe.jsx)($C.default,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&(0,Xe.jsx)(so,{children:(0,Xe.jsx)(Js,{pendingTransaction:l})}),t&&(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(bc,{style:{marginTop:"1.25rem"},children:t.message}),(0,Xe.jsx)(H,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&(0,Xe.jsx)(bs,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),(0,Xe.jsx)(J,{})]})};var ae=require("react/jsx-runtime"),Bu=({open:e,onClose:t})=>{let{user:r}=$(),[o,n]=(0,ri.useState)(null),{init:i,cancel:a,submit:l}=$a(),[s,c]=(0,ri.useState)(!1),[m,f]=(0,ri.useState)(!1),[u,w]=(0,ri.useState)(null),[v,g]=(0,ri.useState)(null);(0,ri.useEffect)(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?R(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let E=I=>Mc(I)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Hn(I)?(c(!1),new Error("The code you entered is not valid")):Bn(I)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(I),c(!1),new Error("Something went wrong."));async function T(I){g(null);try{if(!I||!o)return;await l(o,I),f(!0),c(!1),t()}catch(M){throw E(M)}}async function R(I){if(I==="passkey"){try{n(I);let M=await i(I);if(!M)throw new Error("something went wrong");w(M),await l(I,M),f(!0),c(!1),t()}catch(M){g(E(M))}return}try{n(I),await i(I)}catch(M){console.error(M)}}let S=()=>{n(null),g(null),a(),t()},x=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let I=r.linkedAccounts.filter(M=>M.type==="passkey"&&M.enrolledInMfa).sort((M,U)=>U.firstVerifiedAt.valueOf()-M.firstVerifiedAt.valueOf())[0];return(0,ae.jsx)(YC,{account:I,selectedMethod:o,submitSuccess:m,hasBlockingError:s,error:v,onClose:S,onBack:x,handleSubmit:()=>T(u).catch(g)})}return o?(0,ae.jsx)(zb,{submitSuccess:m,hasBlockingError:s,handleSubmitCode:T,selectedMethod:o,onClose:S,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k,{onClose:S},"header"),(0,ae.jsx)(Ye,{children:(0,ae.jsx)(mt,{children:(0,ae.jsx)(XC.default,{})})}),(0,ae.jsx)(Te,{children:"Verify your identity"}),(0,ae.jsx)(Pe,{children:"Choose a verification method"}),(0,ae.jsxs)(yc,{children:[r.mfaMethods.includes("totp")&&(0,ae.jsxs)(Oe,{onClick:()=>R("totp"),children:[(0,ae.jsx)(ZC.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,ae.jsxs)(Oe,{onClick:()=>R("sms"),children:[(0,ae.jsx)(JC.default,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&(0,ae.jsxs)(Oe,{onClick:()=>R("passkey"),children:[(0,ae.jsx)(QC.default,{}),"Passkey"]},"passkey")]}),(0,ae.jsx)(J,{})]})},zb=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=A(),{pendingTransaction:l}=W();switch(e){case"sms":return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k,{onClose:o},"header"),(0,ae.jsx)(Ye,{children:(0,ae.jsx)(mt,{children:(0,ae.jsx)(t3.default,{})})}),(0,ae.jsx)(Te,{children:"Enter verification code"}),(0,ae.jsxs)(so,{children:[(0,ae.jsx)(Li,{success:t,disabled:r,onChange:i}),(0,ae.jsxs)(Pe,{children:["To continue, please enter the 6-digit code sent to your ",(0,ae.jsx)("strong",{children:"mobile device"})]}),l&&(0,ae.jsx)(Js,{pendingTransaction:l})]}),n&&(0,ae.jsx)(bs,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,ae.jsx)(_o,{onClick:o,children:"Not now"}),(0,ae.jsx)(J,{})]});case"totp":return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k,{onClose:o},"header"),(0,ae.jsx)(Ye,{children:(0,ae.jsx)(mt,{children:(0,ae.jsx)(e3.default,{})})}),(0,ae.jsx)(Te,{children:"Enter verification code"}),(0,ae.jsxs)(so,{children:[(0,ae.jsx)(Li,{success:t,disabled:r,onChange:i}),(0,ae.jsxs)(Pe,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,ae.jsx)("strong",{children:"authenticator app"})]}),l&&(0,ae.jsx)(Js,{pendingTransaction:l})]}),n&&(0,ae.jsx)(bs,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,ae.jsx)(_o,{onClick:o,children:"Not now"}),(0,ae.jsx)(J,{})]});default:return null}};var ja=require("react"),r3=y(require("styled-components"));var Vt=require("react/jsx-runtime"),o3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=$(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=A(),{getAuthMeta:s,initLoginWithOAuth:c,loginWithOAuth:m,updateWallets:f,setReadyToTrue:u,closePrivyModal:w,createAnalyticsEvent:v}=W(),[g,E]=(0,ja.useState)(!1),[T,R]=(0,ja.useState)(void 0),S=s()?.provider||"google",{name:x,component:I}=us(S),M=da(),U=ot;(0,ja.useEffect)(()=>{m(S).then(Z=>{E(!0),u(!0),Z&&M("login","onOAuthLoginComplete",Z)}).catch(Z=>{if(u(!1),Z?.privyErrorCode==="allowlist_rejected"){R(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(Z?.privyErrorCode==="max_accounts_reached"){console.error(new ro(Z).toString()),R(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(Z?.privyErrorCode==="user_does_not_exist"){R(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:L,detail:F}=Of(Z,S);R({retryable:L,detail:F,message:"Authentication failed"})}).finally(()=>{mi()})},[x,S]),(0,ja.useEffect)(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let L=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},U);return()=>clearTimeout(L)}if(Sr(o,n?.embeddedWallets?.createOnLogin)){let L=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:F=>{console.error(F),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:F,provider:S,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},U);return()=>clearTimeout(L)}else{let L=setTimeout(()=>w({shouldCallAuthOnSuccess:!0,isSuccess:!0}),U);return f(),()=>clearTimeout(L)}}},[r,e,g,o]);let G=g?`Successfully connected with ${x}`:T?T.message:`Verifying connection to ${x}`,Y="";return g?Y="You\u2019re good to go!":T?Y=T.detail:Y="Just a few moments more",(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)(k,{}),(0,Vt.jsx)(pe,{}),(0,Vt.jsxs)($b,{children:[(0,Vt.jsx)(vt,{children:(0,Vt.jsxs)("div",{children:[(0,Vt.jsx)(Pt,{success:g,fail:!!T}),(0,Vt.jsx)(I,{style:{width:"38px",height:"38px"}})]})}),(0,Vt.jsxs)(pt,{children:[(0,Vt.jsx)("h3",{children:G}),(0,Vt.jsx)("p",{children:Y})]}),T&&T?.retryable?(0,Vt.jsx)(Ln,{onClick:()=>{mi(),c(S),R(void 0)},disabled:!g&&!T?.retryable,children:"Retry"}):null]}),(0,Vt.jsx)(fe,{}),(0,Vt.jsx)(J,{})]})},$b=r3.default.div`
2560
+ `;var ZC=y(require("@heroicons/react/24/outline/CalendarIcon")),QC=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),JC=y(require("@heroicons/react/24/outline/ShieldCheckIcon"));var Xe=require("react/jsx-runtime"),XC=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=W();return(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(x,{onClose:r},"header"),(0,Xe.jsx)(vt,{children:(0,Xe.jsxs)("div",{children:[(0,Xe.jsx)(At,{success:a,fail:!!t}),t?(0,Xe.jsx)(QC.default,{style:{width:"38px",height:"38px"}}):(0,Xe.jsx)(Mi,{style:{width:"38px",height:"38px"}})]})}),(0,Xe.jsx)(Te,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),(0,Xe.jsxs)(wi,{children:[(0,Xe.jsxs)(xr,{children:[(0,Xe.jsx)(Ar,{children:(0,Xe.jsx)(JC.default,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),(0,Xe.jsxs)(xr,{children:[(0,Xe.jsx)(Ar,{children:(0,Xe.jsx)(ZC.default,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&(0,Xe.jsx)(co,{children:(0,Xe.jsx)(Xs,{pendingTransaction:l})}),t&&(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(Tc,{style:{marginTop:"1.25rem"},children:t.message}),(0,Xe.jsx)(H,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&(0,Xe.jsx)(Es,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),(0,Xe.jsx)(J,{})]})};var ae=require("react/jsx-runtime"),Gu=({open:e,onClose:t})=>{let{user:r}=z(),[o,n]=(0,ii.useState)(null),{init:i,cancel:a,submit:l}=Ka(),[s,c]=(0,ii.useState)(!1),[m,f]=(0,ii.useState)(!1),[u,w]=(0,ii.useState)(null),[v,g]=(0,ii.useState)(null);(0,ii.useEffect)(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?R(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let E=I=>Oc(I)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Vn(I)?(c(!1),new Error("The code you entered is not valid")):Gn(I)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(I),c(!1),new Error("Something went wrong."));async function S(I){g(null);try{if(!I||!o)return;await l(o,I),f(!0),c(!1),t()}catch(M){throw E(M)}}async function R(I){if(I==="passkey"){try{n(I);let M=await i(I);if(!M)throw new Error("something went wrong");w(M),await l(I,M),f(!0),c(!1),t()}catch(M){g(E(M))}return}try{n(I),await i(I)}catch(M){console.error(M)}}let _=()=>{n(null),g(null),a(),t()},k=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let I=r.linkedAccounts.filter(M=>M.type==="passkey"&&M.enrolledInMfa).sort((M,U)=>U.firstVerifiedAt.valueOf()-M.firstVerifiedAt.valueOf())[0];return(0,ae.jsx)(XC,{account:I,selectedMethod:o,submitSuccess:m,hasBlockingError:s,error:v,onClose:_,onBack:k,handleSubmit:()=>S(u).catch(g)})}return o?(0,ae.jsx)(Qb,{submitSuccess:m,hasBlockingError:s,handleSubmitCode:S,selectedMethod:o,onClose:_,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(x,{onClose:_},"header"),(0,ae.jsx)(Ye,{children:(0,ae.jsx)(mt,{children:(0,ae.jsx)(o3.default,{})})}),(0,ae.jsx)(Te,{children:"Verify your identity"}),(0,ae.jsx)(Pe,{children:"Choose a verification method"}),(0,ae.jsxs)(vc,{children:[r.mfaMethods.includes("totp")&&(0,ae.jsxs)(Oe,{onClick:()=>R("totp"),children:[(0,ae.jsx)(e3.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,ae.jsxs)(Oe,{onClick:()=>R("sms"),children:[(0,ae.jsx)(r3.default,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&(0,ae.jsxs)(Oe,{onClick:()=>R("passkey"),children:[(0,ae.jsx)(t3.default,{}),"Passkey"]},"passkey")]}),(0,ae.jsx)(J,{})]})},Qb=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=P(),{pendingTransaction:l}=W();switch(e){case"sms":return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(x,{onClose:o},"header"),(0,ae.jsx)(Ye,{children:(0,ae.jsx)(mt,{children:(0,ae.jsx)(i3.default,{})})}),(0,ae.jsx)(Te,{children:"Enter verification code"}),(0,ae.jsxs)(co,{children:[(0,ae.jsx)(Di,{success:t,disabled:r,onChange:i}),(0,ae.jsxs)(Pe,{children:["To continue, please enter the 6-digit code sent to your ",(0,ae.jsx)("strong",{children:"mobile device"})]}),l&&(0,ae.jsx)(Xs,{pendingTransaction:l})]}),n&&(0,ae.jsx)(Es,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,ae.jsx)(Po,{onClick:o,children:"Not now"}),(0,ae.jsx)(J,{})]});case"totp":return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(x,{onClose:o},"header"),(0,ae.jsx)(Ye,{children:(0,ae.jsx)(mt,{children:(0,ae.jsx)(n3.default,{})})}),(0,ae.jsx)(Te,{children:"Enter verification code"}),(0,ae.jsxs)(co,{children:[(0,ae.jsx)(Di,{success:t,disabled:r,onChange:i}),(0,ae.jsxs)(Pe,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,ae.jsx)("strong",{children:"authenticator app"})]}),l&&(0,ae.jsx)(Xs,{pendingTransaction:l})]}),n&&(0,ae.jsx)(Es,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,ae.jsx)(Po,{onClick:o,children:"Not now"}),(0,ae.jsx)(J,{})]});default:return null}};var Ya=require("react"),a3=y(require("styled-components"));var Vt=require("react/jsx-runtime"),s3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=z(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=P(),{getAuthMeta:s,initLoginWithOAuth:c,loginWithOAuth:m,updateWallets:f,setReadyToTrue:u,closePrivyModal:w,createAnalyticsEvent:v}=W(),[g,E]=(0,Ya.useState)(!1),[S,R]=(0,Ya.useState)(void 0),_=s()?.provider||"google",{name:k,component:I}=ms(_),M=ua(),U=ot;(0,Ya.useEffect)(()=>{m(_).then(Z=>{E(!0),u(!0),Z&&M("login","onOAuthLoginComplete",Z)}).catch(Z=>{if(u(!1),Z?.privyErrorCode==="allowlist_rejected"){R(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(Z?.privyErrorCode==="max_accounts_reached"){console.error(new no(Z).toString()),R(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(Z?.privyErrorCode==="user_does_not_exist"){R(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:L,detail:F}=Df(Z,_);R({retryable:L,detail:F,message:"Authentication failed"})}).finally(()=>{yi()})},[k,_]),(0,Ya.useEffect)(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let L=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},U);return()=>clearTimeout(L)}if(Sr(o,n?.embeddedWallets?.createOnLogin)){let L=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:F=>{console.error(F),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:F,provider:_,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},U);return()=>clearTimeout(L)}else{let L=setTimeout(()=>w({shouldCallAuthOnSuccess:!0,isSuccess:!0}),U);return f(),()=>clearTimeout(L)}}},[r,e,g,o]);let G=g?`Successfully connected with ${k}`:S?S.message:`Verifying connection to ${k}`,Y="";return g?Y="You\u2019re good to go!":S?Y=S.detail:Y="Just a few moments more",(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)(x,{}),(0,Vt.jsx)(se,{}),(0,Vt.jsxs)(Jb,{children:[(0,Vt.jsx)(vt,{children:(0,Vt.jsxs)("div",{children:[(0,Vt.jsx)(At,{success:g,fail:!!S}),(0,Vt.jsx)(I,{style:{width:"38px",height:"38px"}})]})}),(0,Vt.jsxs)(pt,{children:[(0,Vt.jsx)("h3",{children:G}),(0,Vt.jsx)("p",{children:Y})]}),S&&S?.retryable?(0,Vt.jsx)(Dn,{onClick:()=>{yi(),c(_),R(void 0)},disabled:!g&&!S?.retryable,children:"Retry"}):null]}),(0,Vt.jsx)(ue,{}),(0,Vt.jsx)(J,{})]})},Jb=a3.default.div`
2561
2561
  display: flex;
2562
2562
  flex-direction: column;
2563
2563
  align-items: center;
@@ -2565,17 +2565,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
2565
2565
  margin-left: 27px;
2566
2566
  margin-right: 27px;
2567
2567
  gap: 24px;
2568
- `;var wn=require("react"),Hu=y(require("styled-components"));var Xt=require("react/jsx-runtime"),n3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=A(),{loginWithPasskey:o,closePrivyModal:n}=W(),i=ot,[a,l]=(0,wn.useState)("loading"),[s,c]=(0,wn.useState)(null),m=(0,wn.useRef)([]),f=E=>{m.current=[E,...m.current]};(0,wn.useEffect)(()=>()=>{m.current.forEach(E=>clearTimeout(E)),m.current=[]},[]);let u=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},w=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2568
+ `;var bn=require("react"),Vu=y(require("styled-components"));var Xt=require("react/jsx-runtime"),l3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=P(),{loginWithPasskey:o,closePrivyModal:n}=W(),i=ot,[a,l]=(0,bn.useState)("loading"),[s,c]=(0,bn.useState)(null),m=(0,bn.useRef)([]),f=E=>{m.current=[E,...m.current]};(0,bn.useEffect)(()=>()=>{m.current.forEach(E=>clearTimeout(E)),m.current=[]},[]);let u=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},w=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2569
2569
  You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof wt){if(s.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(s.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
2570
2570
  You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
2571
- You will have to sign up with another method first to register a passkey for your account.`}},v=()=>{switch(a){case"loading":case"success":return(0,Xt.jsx)(H,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return(0,Xt.jsx)(H,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{l("loading");try{await o(),l("success")}catch(E){c(E),l("error")}};return(0,wn.useEffect)(()=>{a==="success"&&f(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),(0,wn.useEffect)(()=>{g()},[]),(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(k,{backFn:!e||t===e?void 0:r}),(0,Xt.jsxs)(Kb,{children:[(0,Xt.jsx)(vt,{children:(0,Xt.jsxs)("div",{children:[(0,Xt.jsx)(Pt,{success:a==="success",fail:a==="error"}),(0,Xt.jsx)(Ii,{style:{width:"38px",height:"38px"}})]})}),(0,Xt.jsxs)(pt,{children:[(0,Xt.jsx)("h3",{children:u()}),(0,Xt.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:w()})]}),v()]}),(0,Xt.jsx)(J,{})]})},Kb=Hu.default.div`
2571
+ You will have to sign up with another method first to register a passkey for your account.`}},v=()=>{switch(a){case"loading":case"success":return(0,Xt.jsx)(H,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return(0,Xt.jsx)(H,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{l("loading");try{await o(),l("success")}catch(E){c(E),l("error")}};return(0,bn.useEffect)(()=>{a==="success"&&f(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),(0,bn.useEffect)(()=>{g()},[]),(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(x,{backFn:!e||t===e?void 0:r}),(0,Xt.jsxs)(Xb,{children:[(0,Xt.jsx)(vt,{children:(0,Xt.jsxs)("div",{children:[(0,Xt.jsx)(At,{success:a==="success",fail:a==="error"}),(0,Xt.jsx)(Wi,{style:{width:"38px",height:"38px"}})]})}),(0,Xt.jsxs)(pt,{children:[(0,Xt.jsx)("h3",{children:u()}),(0,Xt.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:w()})]}),v()]}),(0,Xt.jsx)(J,{})]})},Xb=Vu.default.div`
2572
2572
  display: flex;
2573
2573
  flex-direction: column;
2574
2574
  align-items: center;
2575
2575
  justify-content: center;
2576
2576
  gap: 24px;
2577
2577
  width: 100%;
2578
- `,bH=Hu.default.div`
2578
+ `,kH=Vu.default.div`
2579
2579
  display: flex;
2580
2580
  align-items: center;
2581
2581
  justify-content: center;
@@ -2591,9 +2591,9 @@ You will have to sign up with another method first to register a passkey for you
2591
2591
  stroke: var(--privy-color-accent) !important;
2592
2592
  fill: var(--privy-color-accent) !important;
2593
2593
  }
2594
- `;var Xs=require("react"),s3=y(require("styled-components"));var i3=require("react-device-detect");var a3=(e,t)=>{let r=new URL(window.location.href),o=encodeURIComponent(r.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!An()&&i3.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};var vr=require("react/jsx-runtime"),l3=()=>{let{forkSession:e,ready:t,authenticated:r}=$(),[o,n]=(0,Xs.useState)(""),[i,a]=(0,Xs.useState)(!1);(0,Xs.useEffect)(()=>{t&&r&&e().then(n)},[t,r]);let l=a3(o,!i),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(k,{},"header"),(0,vr.jsx)(pe,{}),(0,vr.jsx)(Vo,{title:s.title,description:s.description}),(0,vr.jsxs)(lo,{children:[(0,vr.jsx)(jb,{children:(0,vr.jsx)(Uo,{style:{width:"72px",height:"72px"}})}),(0,vr.jsx)(mc,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?(0,vr.jsx)("p",{children:s.footnote}):null]}),(0,vr.jsx)(fe,{}),(0,vr.jsx)(j,{})]})},jb=(0,s3.default)(jt)`
2594
+ `;var el=require("react"),p3=y(require("styled-components"));var c3=require("react-device-detect");var d3=(e,t)=>{let r=new URL(window.location.href),o=encodeURIComponent(r.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!xn()&&c3.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};var vr=require("react/jsx-runtime"),u3=()=>{let{forkSession:e,ready:t,authenticated:r}=z(),[o,n]=(0,el.useState)(""),[i,a]=(0,el.useState)(!1);(0,el.useEffect)(()=>{t&&r&&e().then(n)},[t,r]);let l=d3(o,!i),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(x,{},"header"),(0,vr.jsx)(se,{}),(0,vr.jsx)(qo,{title:s.title,description:s.description}),(0,vr.jsxs)(kr,{children:[(0,vr.jsx)(eE,{children:(0,vr.jsx)(Fo,{style:{width:"72px",height:"72px"}})}),(0,vr.jsx)(hc,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?(0,vr.jsx)("p",{children:s.footnote}):null]}),(0,vr.jsx)(ue,{}),(0,vr.jsx)(K,{})]})},eE=(0,p3.default)(jt)`
2595
2595
  margin: 16px auto;
2596
- `;var c3=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),Di=require("react"),Ui=y(require("styled-components"));var it=require("react/jsx-runtime"),d3=()=>{let[e,t]=(0,Di.useState)(!0),{authenticated:r,getAccessToken:o}=$(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),[m,f]=(0,Di.useState)(void 0),[u,w]=(0,Di.useState)(""),[v,g]=(0,Di.useState)(!1),{privyWallet:E,onCompleteNavigateTo:T,onSuccess:R,onFailure:S}=s.recoverWallet,x=(U="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),S(typeof U=="string"?new ur(U):U)};c.current=x,(0,Di.useEffect)(()=>{if(!r||!E)return x("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let I=U=>{U&&f(U)};return(0,it.jsxs)(it.Fragment,{children:[(0,it.jsx)(k,{onClose:x}),(0,it.jsx)(pe,{}),(0,it.jsxs)(Zb,{children:[(0,it.jsxs)(Yb,{children:[(0,it.jsx)(c3.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,it.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),(0,it.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,it.jsxs)("div",{children:[(0,it.jsxs)(qn,{children:[(0,it.jsx)(Ta,{type:e?"password":"text",onChange:U=>I(U.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),(0,it.jsx)(Sa,{style:{right:"0.75rem"},children:e?(0,it.jsx)(_a,{onClick:()=>t(!1)}):(0,it.jsx)(Pa,{onClick:()=>t(!0)})})]}),!!u&&(0,it.jsx)(Qb,{children:u})]}),(0,it.jsxs)("div",{children:[(0,it.jsxs)(vy,{children:[(0,it.jsx)("h4",{children:"Why is this necessary?"}),(0,it.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,it.jsx)(Jb,{loading:v||!n,disabled:!m,onClick:async()=>{g(!0);let U=await o();if(U&&E&&m!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:E.address}}),await n?.recover({address:E.address,accessToken:U,recoveryPin:m,recoveryMethod:E.recoveryMethod}),w(""),T?l(T):i({shouldCallAuthOnSuccess:!1}),R?.(E),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:E.address}})}catch(G){dg(G)?w("Invalid recovery password, please try again."):w("An error has occurred, please try again.")}finally{g(!1)}else return x("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!E&&v,children:"Recover your account"})]})]}),(0,it.jsx)(fe,{}),(0,it.jsx)(j,{})]})},Yb=Ui.default.div`
2596
+ `;var m3=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),Fi=require("react"),Bi=y(require("styled-components"));var it=require("react/jsx-runtime"),f3=()=>{let[e,t]=(0,Fi.useState)(!0),{authenticated:r,getAccessToken:o}=z(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=P(),[m,f]=(0,Fi.useState)(void 0),[u,w]=(0,Fi.useState)(""),[v,g]=(0,Fi.useState)(!1),{privyWallet:E,onCompleteNavigateTo:S,onSuccess:R,onFailure:_}=s.recoverWallet,k=(U="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),_(typeof U=="string"?new ur(U):U)};c.current=k,(0,Fi.useEffect)(()=>{if(!r||!E)return k("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let I=U=>{U&&f(U)};return(0,it.jsxs)(it.Fragment,{children:[(0,it.jsx)(x,{onClose:k}),(0,it.jsx)(se,{}),(0,it.jsxs)(rE,{children:[(0,it.jsxs)(tE,{children:[(0,it.jsx)(m3.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,it.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),(0,it.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,it.jsxs)("div",{children:[(0,it.jsxs)($n,{children:[(0,it.jsx)(_a,{type:e?"password":"text",onChange:U=>I(U.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),(0,it.jsx)(Pa,{style:{right:"0.75rem"},children:e?(0,it.jsx)(Aa,{onClick:()=>t(!1)}):(0,it.jsx)(xa,{onClick:()=>t(!0)})})]}),!!u&&(0,it.jsx)(oE,{children:u})]}),(0,it.jsxs)("div",{children:[(0,it.jsxs)(Ey,{children:[(0,it.jsx)("h4",{children:"Why is this necessary?"}),(0,it.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,it.jsx)(nE,{loading:v||!n,disabled:!m,onClick:async()=>{g(!0);let U=await o();if(U&&E&&m!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:E.address}}),await n?.recover({address:E.address,accessToken:U,recoveryPin:m,recoveryMethod:E.recoveryMethod}),w(""),S?l(S):i({shouldCallAuthOnSuccess:!1}),R?.(E),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:E.address}})}catch(G){fg(G)?w("Invalid recovery password, please try again."):w("An error has occurred, please try again.")}finally{g(!1)}else return k("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!E&&v,children:"Recover your account"})]})]}),(0,it.jsx)(ue,{}),(0,it.jsx)(K,{})]})},tE=Bi.default.div`
2597
2597
  display: flex;
2598
2598
  flex-direction: column;
2599
2599
  align-items: center;
@@ -2615,48 +2615,48 @@ You will have to sign up with another method first to register a passkey for you
2615
2615
  font-weight: 400;
2616
2616
  line-height: 20px;
2617
2617
  }
2618
- `,Zb=Ui.default.div`
2618
+ `,rE=Bi.default.div`
2619
2619
  display: flex;
2620
2620
  flex-direction: column;
2621
2621
  justify-content: space-between;
2622
- `,Qb=Ui.default.div`
2622
+ `,oE=Bi.default.div`
2623
2623
  line-height: 20px;
2624
2624
  height: 20px;
2625
2625
  font-size: 13px;
2626
2626
  color: var(--privy-color-error);
2627
2627
  text-align: left;
2628
2628
  margin-top: 0.5rem;
2629
- `,Jb=(0,Ui.default)(H)`
2630
- ${e=>e.hideAnimations&&Ui.css`
2629
+ `,nE=(0,Bi.default)(H)`
2630
+ ${e=>e.hideAnimations&&Bi.css`
2631
2631
  && {
2632
2632
  // Remove animations because the recoverWallet task on the iframe partially
2633
2633
  // blocks the renderer, so the animation stutters and doesn't look good
2634
2634
  transition: none;
2635
2635
  }
2636
2636
  `}
2637
- `;var bn=require("react");var oi=require("react/jsx-runtime"),Fd=e=>(0,oi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,oi.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,oi.jsx)("defs",{children:(0,oi.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,oi.jsx)("stop",{stopColor:"#3E82F4"}),(0,oi.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]});var Xr=require("react/jsx-runtime"),Bd=({style:e,...t})=>(0,Xr.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Xr.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,Xr.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,Xr.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,Xr.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,Xr.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,Xr.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,Xr.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,Xr.jsx)("defs",{children:(0,Xr.jsx)("clipPath",{id:"clip0_2115_829",children:(0,Xr.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]});var Gu=y(require("styled-components")),el=Gu.default.div`
2637
+ `;var En=require("react");var ai=require("react/jsx-runtime"),Hd=e=>(0,ai.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,ai.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,ai.jsx)("defs",{children:(0,ai.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,ai.jsx)("stop",{stopColor:"#3E82F4"}),(0,ai.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]});var eo=require("react/jsx-runtime"),Gd=({style:e,...t})=>(0,eo.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,eo.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,eo.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,eo.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,eo.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,eo.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,eo.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,eo.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,eo.jsx)("defs",{children:(0,eo.jsx)("clipPath",{id:"clip0_2115_829",children:(0,eo.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]});var qu=y(require("styled-components")),tl=qu.default.div`
2638
2638
  display: flex;
2639
2639
  flex-direction: column;
2640
2640
  gap: 12px;
2641
2641
  padding-top: 24px;
2642
2642
  padding-bottom: 24px;
2643
- `,p3=Gu.default.div`
2643
+ `,h3=qu.default.div`
2644
2644
  padding-bottom: 24px;
2645
- `;var er=require("react/jsx-runtime"),u3={"google-drive":{name:"Google Drive",component:Bd},icloud:{name:"iCloud",component:Fd}},m3=()=>{let{logout:e}=$(),{navigate:t,setModalData:r,data:o}=A(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),[l,s]=(0,bn.useState)(!1),{provider:c,action:m,isInAccountCreateFlow:f}=o?.recoveryOAuthStatus,[u,w]=(0,bn.useState)(void 0),[v,g]=(0,bn.useState)(m==="create-wallet");if(c==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let E=u3[c].name,T=u3[c].component,R=o?.recoverWallet?.onCompleteNavigateTo,S=new rt(async(Z="create-wallet")=>(g(!0),new Promise((L,F)=>{setTimeout(async()=>{try{let O=window.open();await n(c,Z,O),s(!0),L()}catch{w({message:`${Z==="recover"?"Recovery":"Back up"} with ${E} unsuccessful`,detail:m==="recover"?`Please verify that you are selecting the ${E} account associated with your backup.`:"",retryable:!0}),F()}},0)})));(0,bn.useEffect)(()=>{m!=="recover"&&S.execute(f?"create-wallet":"set-recovery")},[]),(0,bn.useEffect)(()=>{if(!l)return;let Z=setTimeout(()=>{f?(r({createWallet:{onSuccess:()=>{},onFailure:L=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:L,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},ot);return()=>clearTimeout(Z)},[l]);let x=(0,bn.useCallback)(async()=>{await S.execute("recover"),R?t(R):s(!0)},[]),I=c==="google-drive"?"Google Drive":"Apple iCloud",M=m==="recover"?"recovered":"backed up",U=m==="recover"?"Recovering":"Backing up",G=l&&`Successfully ${M} with ${I}.`||u&&u.message||`${U} with ${I}...`,Y=u?u.detail:"";return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(k,{}),v?(0,er.jsx)(er.Fragment,{children:(0,er.jsxs)(el,{children:[(0,er.jsx)(ke,{title:G,icon:(0,er.jsx)(T,{style:{width:"38px",height:"38px"}}),description:Y}),u&&u?.retryable?(0,er.jsx)(H,{onClick:()=>{mi(),w(void 0),m==="create-wallet"?S.execute("create-wallet"):x()},disabled:!l&&!u?.retryable,children:"Try again"}):null]})}):(0,er.jsxs)(el,{children:[(0,er.jsx)(ke,{title:"Confirm it's really you",icon:(0,er.jsx)(T,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${I} where your account is backed up.`}),(0,er.jsxs)(H,{onClick:x,children:["Confirm with ",I]})]}),(0,er.jsx)(j,{})]})};var En=require("react");var h3=require("react/jsx-runtime"),f3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=A(),[n,i]=(0,En.useState)(""),[a,l]=(0,En.useState)(!1),[s,c]=(0,En.useState)(),[m,f]=(0,En.useState)(null),{authenticated:u}=$(),{closePrivyModal:w,isNewUserThisSession:v,initializeWalletProxy:g}=W(),{onSuccess:E,onFailure:T,callAuthOnSuccessOnClose:R}=r.createWallet,{createWallet:S}=Uc(),[x,I]=(0,En.useState)(null),M=new rt(async()=>{try{let Y=await S(s);if(!Y)return;I(Y),v?t("EMBEDDED_WALLET_CREATED_SCREEN"):(E(Y),w({shouldCallAuthOnSuccess:R}))}catch(Y){i(Y.message)}});(0,En.useEffect)(()=>{m||g(3e4).then(Y=>f(Y))},[m]),(0,En.useEffect)(()=>{if(!u){t("LANDING"),T(new Error("User must be authenticated before creating a Privy wallet"));return}},[u]);let U=()=>{x&&x?.recoveryMethod!=="user-passcode"?(T(new ur("User created a wallet but failed to set a password for it")),w({shouldCallAuthOnSuccess:!1})):x?(E(x),w({shouldCallAuthOnSuccess:R})):(T(new ur("User wallet creation failed")),w({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let G=async()=>{l(!0);let Y=250;return M.execute().then(()=>new Promise(Z=>setTimeout(Z,Y))).finally(()=>l(!1))};return(0,h3.jsx)(Hc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!m,buttonLoading:a,buttonHideAnimations:!x&&a,isResettingPassword:!1,error:n,password:s||"",onClose:U,onPasswordChange:c,onPasswordGenerate:()=>c(Bc()),onSubmit:G})};var y3=y(require("@heroicons/react/24/outline/LockClosedIcon")),g3=y(require("@heroicons/react/24/outline/PencilSquareIcon")),v3=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),C3=require("react"),w3=y(require("styled-components"));var Le=require("react/jsx-runtime"),Vu=w3.default.div`
2645
+ `;var er=require("react/jsx-runtime"),y3={"google-drive":{name:"Google Drive",component:Gd},icloud:{name:"iCloud",component:Hd}},g3=()=>{let{logout:e}=z(),{navigate:t,setModalData:r,data:o}=P(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),[l,s]=(0,En.useState)(!1),{provider:c,action:m,isInAccountCreateFlow:f}=o?.recoveryOAuthStatus,[u,w]=(0,En.useState)(void 0),[v,g]=(0,En.useState)(m==="create-wallet");if(c==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let E=y3[c].name,S=y3[c].component,R=o?.recoverWallet?.onCompleteNavigateTo,_=new rt(async(Z="create-wallet")=>(g(!0),new Promise((L,F)=>{setTimeout(async()=>{try{let O=window.open();await n(c,Z,O),s(!0),L()}catch{w({message:`${Z==="recover"?"Recovery":"Back up"} with ${E} unsuccessful`,detail:m==="recover"?`Please verify that you are selecting the ${E} account associated with your backup.`:"",retryable:!0}),F()}},0)})));(0,En.useEffect)(()=>{m!=="recover"&&_.execute(f?"create-wallet":"set-recovery")},[]),(0,En.useEffect)(()=>{if(!l)return;let Z=setTimeout(()=>{f?(r({createWallet:{onSuccess:()=>{},onFailure:L=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:L,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},ot);return()=>clearTimeout(Z)},[l]);let k=(0,En.useCallback)(async()=>{await _.execute("recover"),R?t(R):s(!0)},[]),I=c==="google-drive"?"Google Drive":"Apple iCloud",M=m==="recover"?"recovered":"backed up",U=m==="recover"?"Recovering":"Backing up",G=l&&`Successfully ${M} with ${I}.`||u&&u.message||`${U} with ${I}...`,Y=u?u.detail:"";return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(x,{}),v?(0,er.jsx)(er.Fragment,{children:(0,er.jsxs)(tl,{children:[(0,er.jsx)(xe,{title:G,icon:(0,er.jsx)(S,{style:{width:"38px",height:"38px"}}),description:Y}),u&&u?.retryable?(0,er.jsx)(H,{onClick:()=>{yi(),w(void 0),m==="create-wallet"?_.execute("create-wallet"):k()},disabled:!l&&!u?.retryable,children:"Try again"}):null]})}):(0,er.jsxs)(tl,{children:[(0,er.jsx)(xe,{title:"Confirm it's really you",icon:(0,er.jsx)(S,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${I} where your account is backed up.`}),(0,er.jsxs)(H,{onClick:k,children:["Confirm with ",I]})]}),(0,er.jsx)(K,{})]})};var Tn=require("react");var C3=require("react/jsx-runtime"),v3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=P(),[n,i]=(0,Tn.useState)(""),[a,l]=(0,Tn.useState)(!1),[s,c]=(0,Tn.useState)(),[m,f]=(0,Tn.useState)(null),{authenticated:u}=z(),{closePrivyModal:w,isNewUserThisSession:v,initializeWalletProxy:g}=W(),{onSuccess:E,onFailure:S,callAuthOnSuccessOnClose:R}=r.createWallet,{createWallet:_}=Bc(),[k,I]=(0,Tn.useState)(null),M=new rt(async()=>{try{let Y=await _(s);if(!Y)return;I(Y),v?t("EMBEDDED_WALLET_CREATED_SCREEN"):(E(Y),w({shouldCallAuthOnSuccess:R}))}catch(Y){i(Y.message)}});(0,Tn.useEffect)(()=>{m||g(3e4).then(Y=>f(Y))},[m]),(0,Tn.useEffect)(()=>{if(!u){t("LANDING"),S(new Error("User must be authenticated before creating a Privy wallet"));return}},[u]);let U=()=>{k&&k?.recoveryMethod!=="user-passcode"?(S(new ur("User created a wallet but failed to set a password for it")),w({shouldCallAuthOnSuccess:!1})):k?(E(k),w({shouldCallAuthOnSuccess:R})):(S(new ur("User wallet creation failed")),w({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let G=async()=>{l(!0);let Y=250;return M.execute().then(()=>new Promise(Z=>setTimeout(Z,Y))).finally(()=>l(!1))};return(0,C3.jsx)(Vc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!m,buttonLoading:a,buttonHideAnimations:!k&&a,isResettingPassword:!1,error:n,password:s||"",onClose:U,onPasswordChange:c,onPasswordGenerate:()=>c(Gc()),onSubmit:G})};var w3=y(require("@heroicons/react/24/outline/LockClosedIcon")),b3=y(require("@heroicons/react/24/outline/PencilSquareIcon")),E3=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),T3=require("react"),S3=y(require("styled-components"));var Le=require("react/jsx-runtime"),zu=S3.default.div`
2646
2646
  width: 24px;
2647
2647
  height: 24px;
2648
2648
  display: flex;
2649
2649
  justify-content: center;
2650
2650
  align-items: center;
2651
- `,Xb={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},eE=({onClose:e})=>(0,Le.jsxs)(p3,{children:[(0,Le.jsx)(ke,{title:"Why do I need to secure my account?",icon:(0,Le.jsx)(v3.default,{width:48}),description:(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),(0,Le.jsx)("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),(0,Le.jsx)(H,{onClick:e,children:"Select backup method"})]}),b3=()=>{let[e,t]=(0,C3.useState)(!1),{navigate:r,setModalData:o,data:n}=A(),{user:i}=$(),{embeddedWallets:a}=dt(),l=xe(i),s=l===null,{isInAccountCreateFlow:c,isResettingPassword:m}=n.recoverySelection,f=l?.recoveryMethod!=="privy",u=f?"Update backup method":"Secure your account",w=f?(0,Le.jsxs)("span",{children:["Your account is currently secured using"," ",(0,Le.jsx)("strong",{children:Xb[l?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function v(g){o({recoveryOAuthStatus:{provider:g,action:s?"create-wallet":"set-recovery",isInAccountCreateFlow:c}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}return(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(k,{backFn:e?()=>t(!1):void 0,infoFn:e?void 0:()=>t(!0)},"header"),e?(0,Le.jsx)(eE,{onClose:()=>t(!1)}):(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(ke,{title:u,icon:(0,Le.jsx)(y3.default,{width:48}),description:w}),(0,Le.jsx)(el,{children:a.userOwnedRecoveryOptions.filter(g=>["icloud","google-drive"].includes(l?.recoveryMethod||"")?g!==l?.recoveryMethod:!0).sort().map(g=>{switch(g){case"google-drive":return(0,Le.jsxs)(Oe,{onClick:()=>v("google-drive"),children:[(0,Le.jsx)(Vu,{children:(0,Le.jsx)(Bd,{style:{width:18}})}),"Back up to Google Drive"]},g);case"icloud":return(0,Le.jsxs)(Oe,{onClick:()=>v("icloud"),children:[(0,Le.jsx)(Vu,{children:(0,Le.jsx)(Fd,{style:{width:24}})}),"Back up to Apple iCloud"]},g);case"user-passcode":return(0,Le.jsxs)(Oe,{onClick:()=>{let E=Xp({isCreatingWallet:s,skipSplashScreen:!0});r(E)},children:[(0,Le.jsx)(Vu,{children:(0,Le.jsx)(g3.default,{style:{width:18}})}),m?"Reset your":"Set a"," password"]},g);default:return null}})})]}),(0,Le.jsx)(j,{})]})};var $u=require("@ethersproject/address"),eo=require("react"),Qa=require("@privy-io/js-sdk-core");var E3=["FUNDING_METHOD_SELECTION_SCREEN","FUNDING_TRANSFER_FROM_WALLET_SCREEN","FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN","FUNDING_MANUAL_TRANSFER_SCREEN","MOONPAY_PROMPT_SCREEN","MOONPAY_STATUS_SCREEN"],T3={["FUNDING_METHOD_SELECTION_SCREEN"]:null,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:"external",["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:"external",["FUNDING_MANUAL_TRANSFER_SCREEN"]:"manual",["MOONPAY_PROMPT_SCREEN"]:"moonpay",["MOONPAY_STATUS_SCREEN"]:"moonpay"},tE={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function Hd({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?tE[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}var qu=y(require("styled-components"));var S3=y(require("styled-components")),Gd=S3.default.span`
2651
+ `,iE={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},aE=({onClose:e})=>(0,Le.jsxs)(h3,{children:[(0,Le.jsx)(xe,{title:"Why do I need to secure my account?",icon:(0,Le.jsx)(E3.default,{width:48}),description:(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),(0,Le.jsx)("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),(0,Le.jsx)(H,{onClick:e,children:"Select backup method"})]}),_3=()=>{let[e,t]=(0,T3.useState)(!1),{navigate:r,setModalData:o,data:n}=P(),{user:i}=z(),{embeddedWallets:a}=dt(),l=ke(i),s=l===null,{isInAccountCreateFlow:c,isResettingPassword:m}=n.recoverySelection,f=l?.recoveryMethod!=="privy",u=f?"Update backup method":"Secure your account",w=f?(0,Le.jsxs)("span",{children:["Your account is currently secured using"," ",(0,Le.jsx)("strong",{children:iE[l?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function v(g){o({recoveryOAuthStatus:{provider:g,action:s?"create-wallet":"set-recovery",isInAccountCreateFlow:c}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}return(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(x,{backFn:e?()=>t(!1):void 0,infoFn:e?void 0:()=>t(!0)},"header"),e?(0,Le.jsx)(aE,{onClose:()=>t(!1)}):(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(xe,{title:u,icon:(0,Le.jsx)(w3.default,{width:48}),description:w}),(0,Le.jsx)(tl,{children:a.userOwnedRecoveryOptions.filter(g=>["icloud","google-drive"].includes(l?.recoveryMethod||"")?g!==l?.recoveryMethod:!0).sort().map(g=>{switch(g){case"google-drive":return(0,Le.jsxs)(Oe,{onClick:()=>v("google-drive"),children:[(0,Le.jsx)(zu,{children:(0,Le.jsx)(Gd,{style:{width:18}})}),"Back up to Google Drive"]},g);case"icloud":return(0,Le.jsxs)(Oe,{onClick:()=>v("icloud"),children:[(0,Le.jsx)(zu,{children:(0,Le.jsx)(Hd,{style:{width:24}})}),"Back up to Apple iCloud"]},g);case"user-passcode":return(0,Le.jsxs)(Oe,{onClick:()=>{let E=tu({isCreatingWallet:s,skipSplashScreen:!0});r(E)},children:[(0,Le.jsx)(zu,{children:(0,Le.jsx)(b3.default,{style:{width:18}})}),m?"Reset your":"Set a"," password"]},g);default:return null}})})]}),(0,Le.jsx)(K,{})]})};var ju=require("@ethersproject/address"),to=require("react"),Ja=require("@privy-io/js-sdk-core");var P3=["FUNDING_METHOD_SELECTION_SCREEN","FUNDING_TRANSFER_FROM_WALLET_SCREEN","FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN","FUNDING_MANUAL_TRANSFER_SCREEN","MOONPAY_PROMPT_SCREEN","MOONPAY_STATUS_SCREEN"],A3={["FUNDING_METHOD_SELECTION_SCREEN"]:null,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:"external",["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:"external",["FUNDING_MANUAL_TRANSFER_SCREEN"]:"manual",["MOONPAY_PROMPT_SCREEN"]:"moonpay",["MOONPAY_STATUS_SCREEN"]:"moonpay"},sE={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function Vd({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?sE[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}var $u=y(require("styled-components"));var x3=y(require("styled-components")),qd=x3.default.span`
2652
2652
  color: var(--privy-color-foreground);
2653
2653
  font-size: 1.125rem;
2654
2654
  font-weight: 600;
2655
2655
  line-height: 1.875rem; /* 166.667% */
2656
2656
  text-align: center;
2657
- `;var Ee=require("react/jsx-runtime"),_3=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:i,title:a,subtitle:l,total:s,to:c,network:m,hasFunds:f,fee:u,from:w,cta:v,chain:g,isSubmitting:E,isPreparing:T,isTokenPriceLoading:R,isTokenContractInfoLoading:S,symbol:x,balance:I,onClick:M,spender:U})=>(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(k,{onClose:o}),e&&(0,Ee.jsx)(iE,{children:e}),(0,Ee.jsx)(Gd,{style:{marginTop:e?"1.5rem":0},children:a}),(0,Ee.jsx)(Ga,{children:l}),(0,Ee.jsxs)(qc,{style:{marginTop:"2rem"},children:[s&&(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Total"}),(0,Ee.jsx)(qr,{$isLoading:T||R,children:s})]}),n&&n!=="transaction"&&(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Action"}),(0,Ee.jsx)(qr,{children:n})]}),i?(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Amount"}),(0,Ee.jsxs)(qr,{$isLoading:S,children:[nE(i)," ",x]})]}):null,U?(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Spender"}),(0,Ee.jsx)(qr,{children:(0,Ee.jsx)(Fs,{address:U,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,c&&(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"To"}),(0,Ee.jsx)(qr,{children:(0,Ee.jsx)(Fs,{address:c,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Network"}),(0,Ee.jsx)(qr,{children:m})]}),(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Estimated fee"}),(0,Ee.jsx)(qr,{$isLoading:T||R,children:u})]})]}),(0,Ee.jsx)(Ho,{}),t?(0,Ee.jsx)(Ds,{style:{marginTop:"2rem"},children:t.message}):r?(0,Ee.jsx)(Ds,{style:{marginTop:"2rem"},children:oE}):null,(0,Ee.jsx)(rE,{$useSmallMargins:!!(r||t),address:w,balance:I,isLoading:T||R,errMsg:!T&&!r&&!t&&!f?`Add funds on ${g?.name} to complete transaction.`:void 0}),(0,Ee.jsx)(uc,{style:{marginTop:"1rem"},loading:E,onClick:M,children:v}),(0,Ee.jsx)(j,{})]}),rE=(0,qu.default)(sd)`
2657
+ `;var Ee=require("react/jsx-runtime"),k3=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:i,title:a,subtitle:l,total:s,to:c,network:m,hasFunds:f,fee:u,from:w,cta:v,chain:g,isSubmitting:E,isPreparing:S,isTokenPriceLoading:R,isTokenContractInfoLoading:_,symbol:k,balance:I,onClick:M,spender:U})=>(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(x,{onClose:o}),e&&(0,Ee.jsx)(pE,{children:e}),(0,Ee.jsx)(qd,{style:{marginTop:e?"1.5rem":0},children:a}),(0,Ee.jsx)(qa,{children:l}),(0,Ee.jsxs)($c,{style:{marginTop:"2rem"},children:[s&&(0,Ee.jsxs)(Vr,{children:[(0,Ee.jsx)(qr,{children:"Total"}),(0,Ee.jsx)(zr,{$isLoading:S||R,children:s})]}),n&&n!=="transaction"&&(0,Ee.jsxs)(Vr,{children:[(0,Ee.jsx)(qr,{children:"Action"}),(0,Ee.jsx)(zr,{children:n})]}),i?(0,Ee.jsxs)(Vr,{children:[(0,Ee.jsx)(qr,{children:"Amount"}),(0,Ee.jsxs)(zr,{$isLoading:_,children:[dE(i)," ",k]})]}):null,U?(0,Ee.jsxs)(Vr,{children:[(0,Ee.jsx)(qr,{children:"Spender"}),(0,Ee.jsx)(zr,{children:(0,Ee.jsx)(Bs,{address:U,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,c&&(0,Ee.jsxs)(Vr,{children:[(0,Ee.jsx)(qr,{children:"To"}),(0,Ee.jsx)(zr,{children:(0,Ee.jsx)(Bs,{address:c,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),(0,Ee.jsxs)(Vr,{children:[(0,Ee.jsx)(qr,{children:"Network"}),(0,Ee.jsx)(zr,{children:m})]}),(0,Ee.jsxs)(Vr,{children:[(0,Ee.jsx)(qr,{children:"Estimated fee"}),(0,Ee.jsx)(zr,{$isLoading:S||R,children:u})]})]}),(0,Ee.jsx)(Go,{}),t?(0,Ee.jsx)(Us,{style:{marginTop:"2rem"},children:t.message}):r?(0,Ee.jsx)(Us,{style:{marginTop:"2rem"},children:cE}):null,(0,Ee.jsx)(lE,{$useSmallMargins:!!(r||t),address:w,balance:I,isLoading:S||R,errMsg:!S&&!r&&!t&&!f?`Add funds on ${g?.name} to complete transaction.`:void 0}),(0,Ee.jsx)(fc,{style:{marginTop:"1rem"},loading:E,onClick:M,children:v}),(0,Ee.jsx)(K,{})]}),lE=(0,$u.default)(cd)`
2658
2658
  ${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
2659
- `,oE="There was an error preparing your transaction. Your transaction request will likely fail.",nE=e=>e.toLocaleString(),iE=qu.default.div`
2659
+ `,cE="There was an error preparing your transaction. Your transaction request will likely fail.",dE=e=>e.toLocaleString(),pE=$u.default.div`
2660
2660
  display: flex;
2661
2661
  width: 100%;
2662
2662
  justify-content: center;
@@ -2666,12 +2666,12 @@ You will have to sign up with another method first to register a passkey for you
2666
2666
  object-fit: contain;
2667
2667
  border-radius: var(--privy-border-radius-sm);
2668
2668
  }
2669
- `;var Ya=require("@heroicons/react/24/outline"),I3=require("react"),Or=y(require("styled-components"));var tl=require("@ethersproject/logger"),aE=new Set([tl.ErrorCode.CALL_EXCEPTION,tl.ErrorCode.NONCE_EXPIRED,tl.ErrorCode.REPLACEMENT_UNDERPRICED,tl.ErrorCode.TRANSACTION_REPLACED]),P3=e=>{let t;return e.code&&e.code!==-32e3&&aE.has(e.code)&&(t=e.transactionHash),t},A3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";var et=require("react/jsx-runtime"),sE=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=P3(e),o=A3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},lE=()=>(0,et.jsxs)(uE,{children:[(0,et.jsx)(fE,{}),(0,et.jsx)(mE,{})]}),M3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=W(),[i,a]=(0,I3.useState)(!1),{errorCode:l,transactionHash:s,errorMessage:c}=sE(e),m=n.find(f=>f.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(k,{onClose:r}),(0,et.jsxs)(cE,{children:[(0,et.jsx)(lE,{}),(0,et.jsx)(dE,{children:l}),(0,et.jsx)(pE,{children:"Please try again."}),(0,et.jsxs)(k3,{children:[(0,et.jsx)(x3,{children:"Error message"}),(0,et.jsx)(R3,{clickable:!1,children:c})]}),s&&(0,et.jsxs)(k3,{children:[(0,et.jsx)(x3,{children:"Transaction hash"}),(0,et.jsxs)(yE,{children:["Copy this hash to view details about the transaction on a"," ",(0,et.jsx)("u",{children:(0,et.jsx)("a",{href:m,children:"block explorer"})}),"."]}),(0,et.jsxs)(R3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,(0,et.jsx)(CE,{clicked:i})]})]}),(0,et.jsx)(hE,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),(0,et.jsx)(J,{})]})},cE=Or.default.div`
2669
+ `;var Za=require("@heroicons/react/24/outline"),L3=require("react"),Lr=y(require("styled-components"));var rl=require("@ethersproject/logger"),uE=new Set([rl.ErrorCode.CALL_EXCEPTION,rl.ErrorCode.NONCE_EXPIRED,rl.ErrorCode.REPLACEMENT_UNDERPRICED,rl.ErrorCode.TRANSACTION_REPLACED]),R3=e=>{let t;return e.code&&e.code!==-32e3&&uE.has(e.code)&&(t=e.transactionHash),t},I3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";var et=require("react/jsx-runtime"),mE=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=R3(e),o=I3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},fE=()=>(0,et.jsxs)(vE,{children:[(0,et.jsx)(wE,{}),(0,et.jsx)(CE,{})]}),N3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=W(),[i,a]=(0,L3.useState)(!1),{errorCode:l,transactionHash:s,errorMessage:c}=mE(e),m=n.find(f=>f.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(x,{onClose:r}),(0,et.jsxs)(hE,{children:[(0,et.jsx)(fE,{}),(0,et.jsx)(yE,{children:l}),(0,et.jsx)(gE,{children:"Please try again."}),(0,et.jsxs)(W3,{children:[(0,et.jsx)(M3,{children:"Error message"}),(0,et.jsx)(O3,{clickable:!1,children:c})]}),s&&(0,et.jsxs)(W3,{children:[(0,et.jsx)(M3,{children:"Transaction hash"}),(0,et.jsxs)(EE,{children:["Copy this hash to view details about the transaction on a"," ",(0,et.jsx)("u",{children:(0,et.jsx)("a",{href:m,children:"block explorer"})}),"."]}),(0,et.jsxs)(O3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,(0,et.jsx)(_E,{clicked:i})]})]}),(0,et.jsx)(bE,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),(0,et.jsx)(J,{})]})},hE=Lr.default.div`
2670
2670
  display: flex;
2671
2671
  flex-direction: column;
2672
2672
  align-items: center;
2673
2673
  justify-content: center;
2674
- `,dE=Or.default.span`
2674
+ `,yE=Lr.default.span`
2675
2675
  color: var(--privy-color-foreground);
2676
2676
  text-align: center;
2677
2677
  font-size: 1.125rem;
@@ -2679,7 +2679,7 @@ You will have to sign up with another method first to register a passkey for you
2679
2679
  line-height: 1.25rem; /* 111.111% */
2680
2680
  text-align: center;
2681
2681
  margin: 10px;
2682
- `,pE=Or.default.span`
2682
+ `,gE=Lr.default.span`
2683
2683
  margin-top: 4px;
2684
2684
  margin-bottom: 10px;
2685
2685
  color: var(--privy-color-foreground-3);
@@ -2690,7 +2690,7 @@ You will have to sign up with another method first to register a passkey for you
2690
2690
  font-weight: 400;
2691
2691
  line-height: 20px; /* 142.857% */
2692
2692
  letter-spacing: -0.008px;
2693
- `,uE=Or.default.div`
2693
+ `,vE=Lr.default.div`
2694
2694
  position: relative;
2695
2695
  width: 60px;
2696
2696
  height: 60px;
@@ -2698,37 +2698,37 @@ You will have to sign up with another method first to register a passkey for you
2698
2698
  display: flex;
2699
2699
  justify-content: center;
2700
2700
  align-items: center;
2701
- `,mE=(0,Or.default)(Ya.ExclamationCircleIcon)`
2701
+ `,CE=(0,Lr.default)(Za.ExclamationCircleIcon)`
2702
2702
  position: absolute;
2703
2703
  width: 35px;
2704
2704
  height: 35px;
2705
2705
  color: var(--privy-color-error);
2706
- `,fE=Or.default.div`
2706
+ `,wE=Lr.default.div`
2707
2707
  position: absolute;
2708
2708
  width: 60px;
2709
2709
  height: 60px;
2710
2710
  border-radius: 50%;
2711
2711
  background-color: var(--privy-color-error);
2712
2712
  opacity: 0.1;
2713
- `,hE=(0,Or.default)(H)`
2713
+ `,bE=(0,Lr.default)(H)`
2714
2714
  && {
2715
2715
  margin-top: 24px;
2716
2716
  }
2717
2717
  transition: color 350ms ease, background-color 350ms ease;
2718
- `,x3=Or.default.span`
2718
+ `,M3=Lr.default.span`
2719
2719
  width: 100%;
2720
2720
  text-align: left;
2721
2721
  font-size: 0.825rem;
2722
2722
  color: var(--privy-color-foreground);
2723
2723
  padding: 4px;
2724
- `,k3=Or.default.div`
2724
+ `,W3=Lr.default.div`
2725
2725
  width: 100%;
2726
2726
  margin: 5px;
2727
2727
  display: flex;
2728
2728
  flex-direction: column;
2729
2729
  justify-content: center;
2730
2730
  align-items: center;
2731
- `,yE=Or.default.text`
2731
+ `,EE=Lr.default.text`
2732
2732
  position: relative;
2733
2733
  width: 100%;
2734
2734
  padding: 5px;
@@ -2736,7 +2736,7 @@ You will have to sign up with another method first to register a passkey for you
2736
2736
  color: var(--privy-color-foreground-3);
2737
2737
  text-align: left;
2738
2738
  word-wrap: break-word;
2739
- `,R3=Or.default.span`
2739
+ `,O3=Lr.default.span`
2740
2740
  position: relative;
2741
2741
  width: 100%;
2742
2742
  background-color: var(--privy-color-background-2);
@@ -2754,24 +2754,24 @@ You will have to sign up with another method first to register a passkey for you
2754
2754
  &:hover {
2755
2755
  background-color: var(--privy-color-foreground-4);
2756
2756
  }`}
2757
- `,gE=(0,Or.default)(Ya.ClipboardDocumentIcon)`
2757
+ `,TE=(0,Lr.default)(Za.ClipboardDocumentIcon)`
2758
2758
  position: absolute;
2759
2759
  top: 13px;
2760
2760
  right: 13px;
2761
2761
  width: 24px;
2762
2762
  height: 24px;
2763
- `,vE=(0,Or.default)(Ya.ClipboardDocumentCheckIcon)`
2763
+ `,SE=(0,Lr.default)(Za.ClipboardDocumentCheckIcon)`
2764
2764
  position: absolute;
2765
2765
  top: 13px;
2766
2766
  right: 13px;
2767
2767
  width: 24px;
2768
2768
  height: 24px;
2769
- `,CE=({clicked:e})=>e?(0,et.jsx)(vE,{}):(0,et.jsx)(gE,{});var Vd=require("@ethersproject/bignumber"),W3=y(require("styled-components"));var yo=require("react/jsx-runtime"),wE=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Vd.BigNumber.from(e.gasUsed),o=Vd.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Vd.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},O3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>(0,yo.jsxs)(yo.Fragment,{children:[(0,yo.jsx)(k,{onClose:o}),(0,yo.jsx)(wi,{title:l??"Transaction complete!",description:s??"You're all set."}),(0,yo.jsx)(Dd,{tokenPrice:n,from:t.from,to:t.to,gas:wE(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),(0,yo.jsx)(Ho,{}),(0,yo.jsx)(bE,{loading:!1,onClick:o,children:"All Done"}),(0,yo.jsx)(fe,{}),(0,yo.jsx)(j,{})]}),bE=(0,W3.default)(H)`
2769
+ `,_E=({clicked:e})=>e?(0,et.jsx)(SE,{}):(0,et.jsx)(TE,{});var zd=require("@ethersproject/bignumber"),D3=y(require("styled-components"));var go=require("react/jsx-runtime"),PE=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=zd.BigNumber.from(e.gasUsed),o=zd.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=zd.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},U3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>(0,go.jsxs)(go.Fragment,{children:[(0,go.jsx)(x,{onClose:o}),(0,go.jsx)(Ei,{title:l??"Transaction complete!",description:s??"You're all set."}),(0,go.jsx)(Fd,{tokenPrice:n,from:t.from,to:t.to,gas:PE(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),(0,go.jsx)(Go,{}),(0,go.jsx)(AE,{loading:!1,onClick:o,children:"All Done"}),(0,go.jsx)(ue,{}),(0,go.jsx)(K,{})]}),AE=(0,D3.default)(H)`
2770
2770
  && {
2771
2771
  margin-top: 24px;
2772
2772
  }
2773
2773
  transition: color 350ms ease, background-color 350ms ease;
2774
- `;var qd=require("viem");var EE=(e,t)=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/Math.pow(10,t)),L3=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],N3=async({address:e,chain:t,amount:r,rpcConfig:o,privyAppId:n})=>{if(!r)return{value:"",symbol:""};try{let i=(0,qd.createPublicClient)({chain:t,transport:(0,qd.http)(lp(t,o,n))}),[a,l]=await Promise.all([i.readContract({abi:L3,address:e,functionName:"symbol"}),i.readContract({abi:L3,address:e,functionName:"decimals"})]);return{value:EE(parseFloat(r.toString()),l),symbol:a}}catch(i){return console.log(i),{value:r.toString(),symbol:""}}};var zu=require("viem"),D3=e=>{let t=SE(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=PE(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},TE=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],SE=e=>{try{return(0,zu.decodeFunctionData)({abi:TE,data:e})}catch{return null}},_E=[{constant:!1,inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],PE=e=>{try{return(0,zu.decodeFunctionData)({abi:_E,data:e})}catch{return null}};var U3=require("@ethersproject/bignumber"),zd=require("react"),$d=require("@privy-io/js-sdk-core");var F3=(e,t)=>{let[r,o]=(0,zd.useState)(null),{getAccessToken:n,user:i}=$(),{walletProxy:a}=W(),l=xe(i),s=async()=>{if(!await n()||!a||!l)return null;let m=[],f=await(0,$d.populateTransactionRequest)(l.address,e,t).catch(E=>(m.push(E),e)),{totalGasEstimate:u,l1ExecutionFeeEstimate:w}=await(0,$d.calculateTotalGasEstimate)(f,t).catch(E=>(m.push(E),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:v,hasSufficientFunds:g}=await Wa(l.address,f,u??U3.BigNumber.from(0),t).catch(E=>(m.push(E),{balance:null,hasSufficientFunds:!1}));return{tx:f,totalGasEstimate:u,l1ExecutionFeeEstimate:w,balance:v,hasFunds:g,errors:m}};return(0,zd.useEffect)(()=>{r&&o(null),s().then(o)},[e]),r};var Za=require("react/jsx-runtime"),B3=new Kt(new oo("There was an issue preparing your transaction",Qa.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),H3=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=A(),{rpcConfig:n,chains:i,closePrivyModal:a,walletProxy:l}=W(),{getAccessToken:s,user:c}=$(),{wallets:m}=mo(),f=dt(),[u,w]=(0,eo.useState)(e?.sendTransaction?.transactionRequest),[v,g]=(0,eo.useState)(null),[E,T]=(0,eo.useState)(!1),[R,S]=(0,eo.useState)(null),[x,I]=(0,eo.useState)(null);if(!u||!e?.sendTransaction)return(0,Za.jsx)(Ai,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(B3),a({shouldCallAuthOnSuccess:!1})}});let M=(0,eo.useMemo)(()=>u.from?m.find(q=>(0,$u.getAddress)(q.address)===(0,$u.getAddress)(u.from)):xe(c),[u.from]),U=(0,eo.useMemo)(()=>i.find(q=>Number(q.id)===Number(u.chainId)),[u.chainId]),G=U?.nativeCurrency.symbol??"ETH",{action:Y,amount:Z,spender:L,isErc20Ish:F}=(0,eo.useMemo)(()=>D3(u.data),[u.data]);(0,eo.useEffect)(()=>{u.to&&U&&F&&N3({amount:Z,address:u.to,chain:U,rpcConfig:f.rpcConfig,privyAppId:f.id}).then(g).catch(console.error)},[u.to,Z,U]);let{tokenPrice:O,isTokenPriceLoading:Me}=Ko(u),je=(0,eo.useMemo)(()=>Er(Number(u.chainId),i,n,{appId:f.id}),[u.chainId,n]),Q=F3(u,je),re=()=>{if(!E)return R?(e?.sendTransaction?.onSuccess(R.response),a({shouldCallAuthOnSuccess:!1})):!x&&!Q?.errors[0]?(e?.sendTransaction?.onFailure(new Kt(new oo("The user rejected the request",Qa.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(x??Q?.errors[0]??B3),a({shouldCallAuthOnSuccess:!1}))};t.current=re;let ie=async()=>{T(!0);try{let q=await s();if(E||!q||!M||!l)return;let he=await zc(q,M.address,l,Q?.tx??u,je,e.sendTransaction?.requesterAppId),It=await he.wait();S({receipt:$c(It),response:he})}catch(q){console.warn({transaction:Q?.tx??u,error:q}),I(q)}finally{T(!1)}},Fe=async()=>{if(!xe(c))return;if(!f.fundingConfig||f.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let he=Hd({fundingMethods:f.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:he}}),o(he)},De=f.embeddedWallets.priceDisplay.primary==="fiat-currency",ut=(0,Qa.QuantityToBigNumber)(Q?.tx.value??0).add((0,Qa.QuantityToBigNumber)(Q?.totalGasEstimate?.toBigInt()??0)).toHexString(),lt=zr(ut,G),Dt=De&&O?jo(ut,O):void 0,at=zr(Q?.totalGasEstimate?.toString()??0,G),ge=De&&O?jo(Q?.totalGasEstimate?.toString()??0,O):void 0,Cr=zr(Q?.balance?.toString()??0,G,void 0,!0),go=De&&O?jo(Q?.balance?.toString()??0,O):void 0,Lo=e.sendTransaction?.uiOptions?.transactionInfo?.title||(Y==="approve"?"Confirm address":`Approve ${Y}`),N=e.sendTransaction?.uiOptions?.description||`${f.name} wants your permission to approve the following transaction.`,_t=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?(0,Za.jsx)("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,vo=Q&&!Q.errors[0]&&!Q.hasFunds&&f.fundingConfig&&f.fundingConfig.methods.length>0,V=vo?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return R?.receipt?(0,Za.jsx)(O3,{txn:Q?.tx??u,onClose:re,receipt:R.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:O,tokenSymbol:G,l1GasEstimate:Q?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):x?(0,Za.jsx)(M3,{transactionError:x,chainId:Q?.tx.chainId??u.chainId,onClose:re,onRetry:({resetNonce:q})=>{I(null);let he={...Q?.tx??u};q&&(he.nonce=void 0),w(he)}}):(0,Za.jsx)(_3,{isSubmitting:E,submitError:x,isPreparing:!Q,isTokenPriceLoading:Me,isTokenContractInfoLoading:!v,prepareError:Q?.errors[0],symbol:v?.symbol,chain:U,img:_t,title:Lo,subtitle:N,spender:L,total:u.value?Dt??lt:void 0,fee:ge??at,to:u.to,network:f.chains.find(q=>q.id===u.chainId)?.name??"",from:M?.address??"",cta:V,hasFunds:Q?.hasFunds,action:Y,balance:go??Cr,amount:v?.value??Z,onClose:re,onClick:vo?Fe:ie})};var G3=require("@ethersproject/bytes"),V3=require("@ethersproject/strings"),Tn=require("react"),Fi=y(require("styled-components")),Kd=require("@privy-io/js-sdk-core");var Ne=require("react/jsx-runtime"),AE=e=>{if(!(0,G3.isHexString)(e))return e;try{return(0,V3.toUtf8String)(e)}catch{return e}},xE=e=>JSON.stringify(e,null,2),kE=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?(0,Ne.jsx)(IE,{children:Object.entries(r).map(([o,n])=>(0,Ne.jsxs)("li",{children:[(0,Ne.jsxs)("strong",{children:[o,":"]})," ",t(n)]},o))}):(0,Ne.jsx)("span",{children:String(r)});return(0,Ne.jsx)("div",{children:t(e)})},RE=e=>{let{types:t,primaryType:r,...o}=e.typedData;return(0,Ne.jsxs)(Ne.Fragment,{children:[(0,Ne.jsx)(Ku,{children:(0,Ne.jsx)(kE,{data:o})}),(0,Ne.jsx)(Kn,{text:xE(e.typedData),itemName:"full payload to clipboard"})," "]})},q3=()=>{let{authenticated:e}=$(),{initializeWalletProxy:t,closePrivyModal:r}=W(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=A(),[a,l]=(0,Tn.useState)(!0),[s,c]=(0,Tn.useState)(""),[m,f]=(0,Tn.useState)(),[u,w]=(0,Tn.useState)(null),[v,g]=(0,Tn.useState)(!1),E=u!==null;(0,Tn.useEffect)(()=>{e||o("LANDING")},[e]),(0,Tn.useEffect)(()=>{t($i).then(Y=>{l(!1),Y||(c("An error has occurred, please try again."),f(new Kt(new oo(s,Kd.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:T,data:R,confirmAndSign:S,onSuccess:x,onFailure:I,uiOptions:M}=n.signMessage,U={title:M.title||"Sign message",description:M.description||"Signing this message will not cost you any fees.",buttonText:M.buttonText||"Sign and continue"},G=Y=>{Y?x(Y):I(m||new Kt(new oo("The user rejected the request.",Kd.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{w(null),c(""),f(void 0)},200)};return i.current=()=>{G(u)},(0,Ne.jsxs)(Ne.Fragment,{children:[(0,Ne.jsx)(k,{onClose:()=>G(u)}),(0,Ne.jsx)(pe,{}),M.iconUrl&&typeof M.iconUrl=="string"?(0,Ne.jsx)(OE,{children:(0,Ne.jsx)(qC,{size:"sm",src:M.iconUrl,alt:"app image"})}):null,(0,Ne.jsx)(Gd,{children:U.title}),(0,Ne.jsx)(Ga,{children:U.description}),T==="personal_sign"&&(0,Ne.jsx)(Ku,{children:AE(R)}),T==="eth_signTypedData_v4"&&(0,Ne.jsx)(RE,{typedData:R}),T==="solana_signMessage"&&(0,Ne.jsx)(Ku,{children:R}),(0,Ne.jsx)(LE,{}),(0,Ne.jsx)(ME,{fail:!0,children:s}),(0,Ne.jsx)(uc,{disabled:v||E||a,loading:v,onClick:async()=>{g(!0),c("");try{let Y=await S();w(Y),g(!1),setTimeout(()=>{G(Y)},ot)}catch(Y){console.error(Y),c("An error has occurred, please try again."),f(new Kt(new oo(s,Kd.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),g(!1)}},children:v?"Signing...":E?(0,Ne.jsxs)(WE,{children:[(0,Ne.jsx)(Ia,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,Ne.jsx)("span",{children:"Success"})]}):U.buttonText}),(0,Ne.jsx)(fe,{}),(0,Ne.jsx)(j,{})]})},Ku=Fi.default.div`
2774
+ `;var $d=require("viem");var xE=(e,t)=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/Math.pow(10,t)),F3=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],B3=async({address:e,chain:t,amount:r,rpcConfig:o,privyAppId:n})=>{if(!r)return{value:"",symbol:""};try{let i=(0,$d.createPublicClient)({chain:t,transport:(0,$d.http)(dp(t,o,n))}),[a,l]=await Promise.all([i.readContract({abi:F3,address:e,functionName:"symbol"}),i.readContract({abi:F3,address:e,functionName:"decimals"})]);return{value:xE(parseFloat(r.toString()),l),symbol:a}}catch(i){return console.log(i),{value:r.toString(),symbol:""}}};var Ku=require("viem"),H3=e=>{let t=RE(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=ME(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},kE=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],RE=e=>{try{return(0,Ku.decodeFunctionData)({abi:kE,data:e})}catch{return null}},IE=[{constant:!1,inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],ME=e=>{try{return(0,Ku.decodeFunctionData)({abi:IE,data:e})}catch{return null}};var G3=require("@ethersproject/bignumber"),Kd=require("react"),jd=require("@privy-io/js-sdk-core");var V3=(e,t)=>{let[r,o]=(0,Kd.useState)(null),{getAccessToken:n,user:i}=z(),{walletProxy:a}=W(),l=ke(i),s=async()=>{if(!await n()||!a||!l)return null;let m=[],f=await(0,jd.populateTransactionRequest)(l.address,e,t).catch(E=>(m.push(E),e)),{totalGasEstimate:u,l1ExecutionFeeEstimate:w}=await(0,jd.calculateTotalGasEstimate)(f,t).catch(E=>(m.push(E),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:v,hasSufficientFunds:g}=await La(l.address,f,u??G3.BigNumber.from(0),t).catch(E=>(m.push(E),{balance:null,hasSufficientFunds:!1}));return{tx:f,totalGasEstimate:u,l1ExecutionFeeEstimate:w,balance:v,hasFunds:g,errors:m}};return(0,Kd.useEffect)(()=>{r&&o(null),s().then(o)},[e]),r};var Qa=require("react/jsx-runtime"),q3=new Kt(new io("There was an issue preparing your transaction",Ja.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),z3=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=P(),{rpcConfig:n,chains:i,closePrivyModal:a,walletProxy:l}=W(),{getAccessToken:s,user:c}=z(),{wallets:m}=fo(),f=dt(),[u,w]=(0,to.useState)(e?.sendTransaction?.transactionRequest),[v,g]=(0,to.useState)(null),[E,S]=(0,to.useState)(!1),[R,_]=(0,to.useState)(null),[k,I]=(0,to.useState)(null);if(!u||!e?.sendTransaction)return(0,Qa.jsx)(ki,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(q3),a({shouldCallAuthOnSuccess:!1})}});let M=(0,to.useMemo)(()=>u.from?m.find(q=>(0,ju.getAddress)(q.address)===(0,ju.getAddress)(u.from)):ke(c),[u.from]),U=(0,to.useMemo)(()=>i.find(q=>Number(q.id)===Number(u.chainId)),[u.chainId]),G=U?.nativeCurrency.symbol??"ETH",{action:Y,amount:Z,spender:L,isErc20Ish:F}=(0,to.useMemo)(()=>H3(u.data),[u.data]);(0,to.useEffect)(()=>{u.to&&U&&F&&B3({amount:Z,address:u.to,chain:U,rpcConfig:f.rpcConfig,privyAppId:f.id}).then(g).catch(console.error)},[u.to,Z,U]);let{tokenPrice:O,isTokenPriceLoading:Me}=jo(u),je=(0,to.useMemo)(()=>Er(Number(u.chainId),i,n,{appId:f.id}),[u.chainId,n]),Q=V3(u,je),re=()=>{if(!E)return R?(e?.sendTransaction?.onSuccess(R.response),a({shouldCallAuthOnSuccess:!1})):!k&&!Q?.errors[0]?(e?.sendTransaction?.onFailure(new Kt(new io("The user rejected the request",Ja.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(k??Q?.errors[0]??q3),a({shouldCallAuthOnSuccess:!1}))};t.current=re;let ie=async()=>{S(!0);try{let q=await s();if(E||!q||!M||!l)return;let he=await Kc(q,M.address,l,Q?.tx??u,je,e.sendTransaction?.requesterAppId),Mt=await he.wait();_({receipt:jc(Mt),response:he})}catch(q){console.warn({transaction:Q?.tx??u,error:q}),I(q)}finally{S(!1)}},Fe=async()=>{if(!ke(c))return;if(!f.fundingConfig||f.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let he=Vd({fundingMethods:f.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:he}}),o(he)},De=f.embeddedWallets.priceDisplay.primary==="fiat-currency",ut=(0,Ja.QuantityToBigNumber)(Q?.tx.value??0).add((0,Ja.QuantityToBigNumber)(Q?.totalGasEstimate?.toBigInt()??0)).toHexString(),lt=$r(ut,G),Dt=De&&O?Yo(ut,O):void 0,at=$r(Q?.totalGasEstimate?.toString()??0,G),ge=De&&O?Yo(Q?.totalGasEstimate?.toString()??0,O):void 0,Cr=$r(Q?.balance?.toString()??0,G,void 0,!0),vo=De&&O?Yo(Q?.balance?.toString()??0,O):void 0,No=e.sendTransaction?.uiOptions?.transactionInfo?.title||(Y==="approve"?"Confirm address":`Approve ${Y}`),N=e.sendTransaction?.uiOptions?.description||`${f.name} wants your permission to approve the following transaction.`,_t=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?(0,Qa.jsx)("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,Co=Q&&!Q.errors[0]&&!Q.hasFunds&&f.fundingConfig&&f.fundingConfig.methods.length>0,V=Co?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return R?.receipt?(0,Qa.jsx)(U3,{txn:Q?.tx??u,onClose:re,receipt:R.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:O,tokenSymbol:G,l1GasEstimate:Q?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):k?(0,Qa.jsx)(N3,{transactionError:k,chainId:Q?.tx.chainId??u.chainId,onClose:re,onRetry:({resetNonce:q})=>{I(null);let he={...Q?.tx??u};q&&(he.nonce=void 0),w(he)}}):(0,Qa.jsx)(k3,{isSubmitting:E,submitError:k,isPreparing:!Q,isTokenPriceLoading:Me,isTokenContractInfoLoading:!v,prepareError:Q?.errors[0],symbol:v?.symbol,chain:U,img:_t,title:No,subtitle:N,spender:L,total:u.value?Dt??lt:void 0,fee:ge??at,to:u.to,network:f.chains.find(q=>q.id===u.chainId)?.name??"",from:M?.address??"",cta:V,hasFunds:Q?.hasFunds,action:Y,balance:vo??Cr,amount:v?.value??Z,onClose:re,onClick:Co?Fe:ie})};var $3=require("@ethersproject/bytes"),K3=require("@ethersproject/strings"),Sn=require("react"),Hi=y(require("styled-components")),Yd=require("@privy-io/js-sdk-core");var Ne=require("react/jsx-runtime"),WE=e=>{if(!(0,$3.isHexString)(e))return e;try{return(0,K3.toUtf8String)(e)}catch{return e}},OE=e=>JSON.stringify(e,null,2),LE=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?(0,Ne.jsx)(DE,{children:Object.entries(r).map(([o,n])=>(0,Ne.jsxs)("li",{children:[(0,Ne.jsxs)("strong",{children:[o,":"]})," ",t(n)]},o))}):(0,Ne.jsx)("span",{children:String(r)});return(0,Ne.jsx)("div",{children:t(e)})},NE=e=>{let{types:t,primaryType:r,...o}=e.typedData;return(0,Ne.jsxs)(Ne.Fragment,{children:[(0,Ne.jsx)(Yu,{children:(0,Ne.jsx)(LE,{data:o})}),(0,Ne.jsx)(Yn,{text:OE(e.typedData),itemName:"full payload to clipboard"})," "]})},j3=()=>{let{authenticated:e}=z(),{initializeWalletProxy:t,closePrivyModal:r}=W(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=P(),[a,l]=(0,Sn.useState)(!0),[s,c]=(0,Sn.useState)(""),[m,f]=(0,Sn.useState)(),[u,w]=(0,Sn.useState)(null),[v,g]=(0,Sn.useState)(!1),E=u!==null;(0,Sn.useEffect)(()=>{e||o("LANDING")},[e]),(0,Sn.useEffect)(()=>{t(ji).then(Y=>{l(!1),Y||(c("An error has occurred, please try again."),f(new Kt(new io(s,Yd.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:S,data:R,confirmAndSign:_,onSuccess:k,onFailure:I,uiOptions:M}=n.signMessage,U={title:M.title||"Sign message",description:M.description||"Signing this message will not cost you any fees.",buttonText:M.buttonText||"Sign and continue"},G=Y=>{Y?k(Y):I(m||new Kt(new io("The user rejected the request.",Yd.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{w(null),c(""),f(void 0)},200)};return i.current=()=>{G(u)},(0,Ne.jsxs)(Ne.Fragment,{children:[(0,Ne.jsx)(x,{onClose:()=>G(u)}),(0,Ne.jsx)(se,{}),M.iconUrl&&typeof M.iconUrl=="string"?(0,Ne.jsx)(BE,{children:(0,Ne.jsx)(jC,{size:"sm",src:M.iconUrl,alt:"app image"})}):null,(0,Ne.jsx)(qd,{children:U.title}),(0,Ne.jsx)(qa,{children:U.description}),S==="personal_sign"&&(0,Ne.jsx)(Yu,{children:WE(R)}),S==="eth_signTypedData_v4"&&(0,Ne.jsx)(NE,{typedData:R}),S==="solana_signMessage"&&(0,Ne.jsx)(Yu,{children:R}),(0,Ne.jsx)(HE,{}),(0,Ne.jsx)(UE,{fail:!0,children:s}),(0,Ne.jsx)(fc,{disabled:v||E||a,loading:v,onClick:async()=>{g(!0),c("");try{let Y=await _();w(Y),g(!1),setTimeout(()=>{G(Y)},ot)}catch(Y){console.error(Y),c("An error has occurred, please try again."),f(new Kt(new io(s,Yd.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),g(!1)}},children:v?"Signing...":E?(0,Ne.jsxs)(FE,{children:[(0,Ne.jsx)(Wa,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,Ne.jsx)("span",{children:"Success"})]}):U.buttonText}),(0,Ne.jsx)(ue,{}),(0,Ne.jsx)(K,{})]})},Yu=Hi.default.div`
2775
2775
  margin-top: 1.5rem;
2776
2776
  background-color: var(--privy-color-background-2);
2777
2777
  border-radius: var(--privy-border-radius-md);
@@ -2790,7 +2790,7 @@ You will have to sign up with another method first to register a passkey for you
2790
2790
  display: none; /* Safari and Chrome */
2791
2791
  }
2792
2792
  }
2793
- `,IE=Fi.default.ul`
2793
+ `,DE=Hi.default.ul`
2794
2794
  margin-left: 12px !important;
2795
2795
  white-space: nowrap;
2796
2796
 
@@ -2802,7 +2802,7 @@ You will have to sign up with another method first to register a passkey for you
2802
2802
  font-weight: 500 !important;
2803
2803
  }
2804
2804
  }
2805
- `,ME=Fi.default.div`
2805
+ `,UE=Hi.default.div`
2806
2806
  line-height: 20px;
2807
2807
  height: 20px;
2808
2808
  font-size: 13px;
@@ -2812,20 +2812,20 @@ You will have to sign up with another method first to register a passkey for you
2812
2812
  width: 100%;
2813
2813
  margin-top: 16px;
2814
2814
  margin-bottom: 4px;
2815
- `,WE=Fi.default.span`
2815
+ `,FE=Hi.default.span`
2816
2816
  display: flex;
2817
2817
  align-items: center;
2818
2818
  gap: 8px;
2819
- `,OE=Fi.default.div`
2819
+ `,BE=Hi.default.div`
2820
2820
  display: flex;
2821
2821
  flex-direction: column;
2822
2822
  justify-content: center;
2823
2823
  align-items: center;
2824
2824
  width: 100%;
2825
2825
  height: 82px;
2826
- `,LE=Fi.default.div`
2826
+ `,HE=Hi.default.div`
2827
2827
  flex-grow: 1;
2828
- `;var Ja=require("react"),z3=y(require("styled-components"));var qt=require("react/jsx-runtime"),$3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=$(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=A(),{initLoginWithTelegram:s,loginWithTelegram:c,updateWallets:m,setReadyToTrue:f,closePrivyModal:u,createAnalyticsEvent:w}=W(),[v,g]=(0,Ja.useState)(!1),[E,T]=(0,Ja.useState)(void 0),R=ot;async function S(){try{await c(),g(!0),f(!0)}catch(M){if(M?.privyErrorCode==="allowlist_rejected"){T(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(M?.privyErrorCode==="max_accounts_reached"){console.error(new ro(M).toString()),T(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(M?.privyErrorCode==="user_does_not_exist"){T(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:U,detail:G}=wp(M);T({retryable:U,detail:G,message:"Authentication failed"})}}(0,Ja.useEffect)(()=>{S()},[]),(0,Ja.useEffect)(()=>{if(!(r&&e&&v&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(G)}if(Sr(o,n?.embeddedWallets?.createOnLogin)){let G=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Y=>{console.error(Y),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Y,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},R);return()=>clearTimeout(G)}m();let U=setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R);return()=>clearTimeout(U)},[r,e,v,o]);let x=v?"Successfully connected with Telegram":E?E.message:"Verifying connection to Telegram",I="";return v?I="You\u2019re good to go!":E?I=E.detail:I="Just a few moments more",(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(k,{}),(0,qt.jsx)(pe,{}),(0,qt.jsxs)(NE,{children:[(0,qt.jsx)(vt,{children:(0,qt.jsxs)("div",{children:[(0,qt.jsx)(Pt,{success:v,fail:!!E}),(0,qt.jsx)(_d,{style:{width:"38px",height:"38px"}})]})}),(0,qt.jsxs)(pt,{children:[(0,qt.jsx)("h3",{children:x}),(0,qt.jsx)("p",{children:I})]}),E&&E?.retryable?(0,qt.jsx)(Ln,{onClick:()=>{s().then(async()=>S()).catch(M=>{let{retryable:U,detail:G}=wp(M);T({retryable:U,detail:G,message:"Authentication failed"})}),T(void 0)},disabled:!v&&!E?.retryable,children:"Retry"}):null]}),(0,qt.jsx)(fe,{}),(0,qt.jsx)(J,{})]})},NE=z3.default.div`
2828
+ `;var Xa=require("react"),Y3=y(require("styled-components"));var qt=require("react/jsx-runtime"),Z3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=z(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=P(),{initLoginWithTelegram:s,loginWithTelegram:c,updateWallets:m,setReadyToTrue:f,closePrivyModal:u,createAnalyticsEvent:w}=W(),[v,g]=(0,Xa.useState)(!1),[E,S]=(0,Xa.useState)(void 0),R=ot;async function _(){try{await c(),g(!0),f(!0)}catch(M){if(M?.privyErrorCode==="allowlist_rejected"){S(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(M?.privyErrorCode==="max_accounts_reached"){console.error(new no(M).toString()),S(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(M?.privyErrorCode==="user_does_not_exist"){S(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:U,detail:G}=Ep(M);S({retryable:U,detail:G,message:"Authentication failed"})}}(0,Xa.useEffect)(()=>{_()},[]),(0,Xa.useEffect)(()=>{if(!(r&&e&&v&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(G)}if(Sr(o,n?.embeddedWallets?.createOnLogin)){let G=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Y=>{console.error(Y),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Y,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},R);return()=>clearTimeout(G)}m();let U=setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R);return()=>clearTimeout(U)},[r,e,v,o]);let k=v?"Successfully connected with Telegram":E?E.message:"Verifying connection to Telegram",I="";return v?I="You\u2019re good to go!":E?I=E.detail:I="Just a few moments more",(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(x,{}),(0,qt.jsx)(se,{}),(0,qt.jsxs)(GE,{children:[(0,qt.jsx)(vt,{children:(0,qt.jsxs)("div",{children:[(0,qt.jsx)(At,{success:v,fail:!!E}),(0,qt.jsx)(Ad,{style:{width:"38px",height:"38px"}})]})}),(0,qt.jsxs)(pt,{children:[(0,qt.jsx)("h3",{children:k}),(0,qt.jsx)("p",{children:I})]}),E&&E?.retryable?(0,qt.jsx)(Dn,{onClick:()=>{s().then(async()=>_()).catch(M=>{let{retryable:U,detail:G}=Ep(M);S({retryable:U,detail:G,message:"Authentication failed"})}),S(void 0)},disabled:!v&&!E?.retryable,children:"Retry"}):null]}),(0,qt.jsx)(ue,{}),(0,qt.jsx)(J,{})]})},GE=Y3.default.div`
2829
2829
  display: flex;
2830
2830
  flex-direction: column;
2831
2831
  align-items: center;
@@ -2833,9 +2833,9 @@ You will have to sign up with another method first to register a passkey for you
2833
2833
  margin-left: 27px;
2834
2834
  margin-right: 27px;
2835
2835
  gap: 24px;
2836
- `;var Y3=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var K3=y(require("@heroicons/react/24/outline/EnvelopeIcon")),rl=require("react"),ju=y(require("styled-components"));var Oo=require("react/jsx-runtime"),j3=(0,rl.forwardRef)((e,t)=>{let[r,o]=(0,rl.useState)(""),[n,i]=(0,rl.useState)(!1),{authenticated:a,user:l}=$(),{initUpdateEmail:s}=W(),{navigate:c,setModalData:m,currentScreen:f}=A(),{enabled:u,token:w}=We(),v=Sl(r),g=n,E=n||!v,T=async S=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");i(!0);try{await s(l.email.address,r,S),c("AWAITING_PASSWORDLESS_CODE")}catch(x){m({errorModalData:{error:x,previousScreen:f||"LANDING"}})}i(!1)},R=()=>{u&&!w&&!a?(m({captchaModalData:{callback:S=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,S)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):T(w)};return(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(DE,{children:(0,Oo.jsxs)(UE,{children:[(0,Oo.jsx)(K3.default,{}),(0,Oo.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:S=>o(S.target.value),onKeyUp:S=>{S.key==="Enter"&&R()},value:r,autoComplete:"email"}),e.stacked?null:(0,Oo.jsx)(pa,{isSubmitting:g,onClick:R,disabled:E,children:"Submit"})]})}),e.stacked?(0,Oo.jsx)(H,{loadingText:null,loading:g,disabled:E,onClick:R,children:"Submit"}):null]})}),DE=ju.default.div`
2836
+ `;var X3=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Q3=y(require("@heroicons/react/24/outline/EnvelopeIcon")),ol=require("react"),Zu=y(require("styled-components"));var Lo=require("react/jsx-runtime"),J3=(0,ol.forwardRef)((e,t)=>{let[r,o]=(0,ol.useState)(""),[n,i]=(0,ol.useState)(!1),{authenticated:a,user:l}=z(),{initUpdateEmail:s}=W(),{navigate:c,setModalData:m,currentScreen:f}=P(),{enabled:u,token:w}=We(),v=_l(r),g=n,E=n||!v,S=async _=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");i(!0);try{await s(l.email.address,r,_),c("AWAITING_PASSWORDLESS_CODE")}catch(k){m({errorModalData:{error:k,previousScreen:f||"LANDING"}})}i(!1)},R=()=>{u&&!w&&!a?(m({captchaModalData:{callback:_=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,_)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):S(w)};return(0,Lo.jsxs)(Lo.Fragment,{children:[(0,Lo.jsx)(VE,{children:(0,Lo.jsxs)(qE,{children:[(0,Lo.jsx)(Q3.default,{}),(0,Lo.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:_=>o(_.target.value),onKeyUp:_=>{_.key==="Enter"&&R()},value:r,autoComplete:"email"}),e.stacked?null:(0,Lo.jsx)(ma,{isSubmitting:g,onClick:R,disabled:E,children:"Submit"})]})}),e.stacked?(0,Lo.jsx)(H,{loadingText:null,loading:g,disabled:E,onClick:R,children:"Submit"}):null]})}),VE=Zu.default.div`
2837
2837
  width: 100%;
2838
- `,UE=ju.default.label`
2838
+ `,qE=Zu.default.label`
2839
2839
  display: block;
2840
2840
  position: relative;
2841
2841
  width: 100%;
@@ -2893,7 +2893,7 @@ You will have to sign up with another method first to register a passkey for you
2893
2893
  && > input::placeholder {
2894
2894
  color: var(--privy-color-foreground-3);
2895
2895
  }
2896
- `;var to=require("react/jsx-runtime"),Z3=()=>(0,to.jsxs)(to.Fragment,{children:[(0,to.jsx)(k,{},"header"),(0,to.jsx)(pe,{}),(0,to.jsx)(ke,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,to.jsx)(Y3.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,to.jsx)(lo,{children:(0,to.jsx)(j3,{stacked:!0})}),(0,to.jsx)(fe,{}),(0,to.jsx)(j,{})]});var jd=y(require("styled-components"));var Yu=require("react/jsx-runtime"),Q3=({style:e,...t})=>(0,Yu.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:(0,Yu.jsx)("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});var Lr=require("react/jsx-runtime"),J3=()=>{let{navigate:e}=A();return(0,Lr.jsxs)(Lr.Fragment,{children:[(0,Lr.jsx)(k,{}),(0,Lr.jsxs)(FE,{children:[(0,Lr.jsx)(BE,{children:(0,Lr.jsx)(Q3,{})}),(0,Lr.jsxs)(HE,{children:[(0,Lr.jsx)("h3",{children:"Unable to sign in"}),(0,Lr.jsx)("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),(0,Lr.jsx)(H,{onClick:()=>{e("LANDING")},children:"Go back"})]}),(0,Lr.jsx)(j,{})]})},FE=jd.default.div`
2896
+ `;var ro=require("react/jsx-runtime"),e0=()=>(0,ro.jsxs)(ro.Fragment,{children:[(0,ro.jsx)(x,{},"header"),(0,ro.jsx)(se,{}),(0,ro.jsx)(xe,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,ro.jsx)(X3.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,ro.jsx)(kr,{children:(0,ro.jsx)(J3,{stacked:!0})}),(0,ro.jsx)(ue,{}),(0,ro.jsx)(K,{})]});var t0=y(require("@heroicons/react/24/outline/PhoneIcon"));var oo=require("react/jsx-runtime"),r0=()=>{let{currentScreen:e,data:t,navigate:r,setModalData:o}=P(),{user:n}=z(),{initUpdatePhone:i}=W();async function a({qualifiedPhoneNumber:l}){try{if(!n?.phone?.number)throw new Error("User is required to have an phone number to update it.");await i(n?.phone?.number,l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){o({errorModalData:{error:s,previousScreen:t?.errorModalData?.previousScreen||e||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(x,{},"header"),(0,oo.jsx)(se,{}),(0,oo.jsx)(xe,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:(0,oo.jsx)(t0.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,oo.jsx)(kr,{children:(0,oo.jsx)(ri,{stacked:!0,onSubmit:a,hideRecent:!0})}),(0,oo.jsx)(ue,{}),(0,oo.jsx)(K,{})]})};var Zd=y(require("styled-components"));var Qu=require("react/jsx-runtime"),o0=({style:e,...t})=>(0,Qu.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:(0,Qu.jsx)("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});var Nr=require("react/jsx-runtime"),n0=()=>{let{navigate:e}=P();return(0,Nr.jsxs)(Nr.Fragment,{children:[(0,Nr.jsx)(x,{}),(0,Nr.jsxs)(zE,{children:[(0,Nr.jsx)($E,{children:(0,Nr.jsx)(o0,{})}),(0,Nr.jsxs)(KE,{children:[(0,Nr.jsx)("h3",{children:"Unable to sign in"}),(0,Nr.jsx)("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),(0,Nr.jsx)(H,{onClick:()=>{e("LANDING")},children:"Go back"})]}),(0,Nr.jsx)(K,{})]})},zE=Zd.default.div`
2897
2897
  display: flex;
2898
2898
  flex-direction: column;
2899
2899
  align-items: center;
@@ -2902,7 +2902,7 @@ You will have to sign up with another method first to register a passkey for you
2902
2902
  width: 100%;
2903
2903
  padding-top: 8px;
2904
2904
  padding-bottom: 32px;
2905
- `,BE=jd.default.div`
2905
+ `,$E=Zd.default.div`
2906
2906
  display: flex;
2907
2907
  align-items: center;
2908
2908
  justify-content: center;
@@ -2911,11 +2911,11 @@ You will have to sign up with another method first to register a passkey for you
2911
2911
  color: var(--privy-color-error);
2912
2912
  background-color: var(--privy-color-error-light);
2913
2913
  border-radius: 50%;
2914
- `,HE=jd.default.div`
2914
+ `,KE=Zd.default.div`
2915
2915
  display: flex;
2916
2916
  flex-direction: column;
2917
2917
  gap: 8px;
2918
- `;var Yd=y(require("styled-components"));var GE=`
2918
+ `;var Qd=y(require("styled-components"));var jE=`
2919
2919
  *,
2920
2920
  ::before,
2921
2921
  ::after {
@@ -3145,7 +3145,7 @@ You will have to sign up with another method first to register a passkey for you
3145
3145
  [hidden] {
3146
3146
  display: none;
3147
3147
  }
3148
- `,X3=GE;var e0=Yd.createGlobalStyle`
3148
+ `,i0=jE;var a0=Qd.createGlobalStyle`
3149
3149
  :root {
3150
3150
  // Borders
3151
3151
  --privy-border-radius-sm: 6px;
@@ -3180,10 +3180,10 @@ You will have to sign up with another method first to register a passkey for you
3180
3180
  --privy-height-modal-full: 620px;
3181
3181
  --privy-height-modal-compact: 480px;
3182
3182
  };
3183
- `,Zu=Yd.default.div`
3183
+ `,Ju=Qd.default.div`
3184
3184
  // css normalize only the privy application to avoid conflicts
3185
3185
  // with consuming application
3186
- ${X3}
3186
+ ${i0}
3187
3187
 
3188
3188
  // Privy styles
3189
3189
  color: var(--privy-color-foreground-2);
@@ -3234,7 +3234,7 @@ You will have to sign up with another method first to register a passkey for you
3234
3234
  opacity: 1;
3235
3235
  }
3236
3236
  }
3237
- `;var Bi=require("@headlessui/react"),Zd=y(require("react")),Xa=y(require("styled-components")),Sn=require("react/jsx-runtime"),t0=({children:e,open:t,onClick:r,...o})=>(0,Sn.jsx)(Bi.Transition,{show:t,as:Zd.default.Fragment,children:(0,Sn.jsxs)(Bi.Dialog,{onClose:r,...o,as:qE,children:[(0,Sn.jsx)(Bi.Transition.Child,{as:Zd.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,Sn.jsx)(VE,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,Sn.jsx)(zE,{children:(0,Sn.jsx)(Bi.Transition.Child,{as:Zd.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,Sn.jsx)(Bi.Dialog.Panel,{as:$E,children:e})})})]})}),VE=Xa.default.div`
3237
+ `;var Gi=require("@headlessui/react"),Jd=y(require("react")),es=y(require("styled-components")),_n=require("react/jsx-runtime"),s0=({children:e,open:t,onClick:r,...o})=>(0,_n.jsx)(Gi.Transition,{show:t,as:Jd.default.Fragment,children:(0,_n.jsxs)(Gi.Dialog,{onClose:r,...o,as:ZE,children:[(0,_n.jsx)(Gi.Transition.Child,{as:Jd.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,_n.jsx)(YE,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,_n.jsx)(QE,{children:(0,_n.jsx)(Gi.Transition.Child,{as:Jd.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,_n.jsx)(Gi.Dialog.Panel,{as:JE,children:e})})})]})}),YE=es.default.div`
3238
3238
  position: fixed;
3239
3239
  inset: 0;
3240
3240
 
@@ -3247,10 +3247,10 @@ You will have to sign up with another method first to register a passkey for you
3247
3247
  backdrop-filter: unset;
3248
3248
  -webkit-backdrop-filter: unset;
3249
3249
  }
3250
- `,qE=Xa.default.div`
3250
+ `,ZE=es.default.div`
3251
3251
  position: relative;
3252
3252
  z-index: 999999;
3253
- `,zE=Xa.default.div`
3253
+ `,QE=es.default.div`
3254
3254
  position: fixed;
3255
3255
  inset: 0;
3256
3256
  display: flex;
@@ -3258,7 +3258,7 @@ You will have to sign up with another method first to register a passkey for you
3258
3258
  justify-content: center;
3259
3259
  width: 100vw;
3260
3260
  min-height: 100vh;
3261
- `,$E=Xa.default.div`
3261
+ `,JE=es.default.div`
3262
3262
  // reset some default dialog styles
3263
3263
  padding: 0;
3264
3264
  background: transparent;
@@ -3305,13 +3305,13 @@ You will have to sign up with another method first to register a passkey for you
3305
3305
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3306
3306
  border-radius: var(--privy-border-radius-lg);
3307
3307
  }
3308
- `,r0=Xa.default.div`
3308
+ `,l0=es.default.div`
3309
3309
  display: flex;
3310
3310
  flex-direction: column;
3311
3311
  align-items: center;
3312
3312
  justify-content: center;
3313
3313
  height: 100%;
3314
- `;var tt=require("react/jsx-runtime"),KE={["LANDING"]:Hv,["CONNECT_OR_CREATE"]:Bv,["AWAITING_PASSWORDLESS_CODE"]:xy,["AWAITING_CONNECTION"]:rg,["AWAITING_CONNECT_ONLY_CONNECTION"]:ig,["AWAITING_FARCASTER_CONNECTION"]:R1,["AWAITING_FARCASTER_SIGNER"]:O1,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:n3,["PHANTOM_INTERSTITIAL_SCREEN"]:l3,["LOGIN_FAILED_SCREEN"]:jv,["AWAITING_OAUTH_SCREEN"]:o3,["CROSS_APP_AUTH_SCREEN"]:lg,["ALLOWLIST_REJECTION_SCREEN"]:yy,["ACCOUNT_NOT_FOUND_SCREEN"]:dy,["USER_LIMIT_REACHED_SCREEN"]:J3,["INSTALL_PHANTOM_SCREEN"]:sv,["LINK_EMAIL_SCREEN"]:Vv,["LINK_PHONE_SCREEN"]:zv,["LINK_WALLET_SCREEN"]:$v,["LINK_PASSKEY_SCREEN"]:u2,["UPDATE_EMAIL_SCREEN"]:Z3,["CONNECT_ONLY_LANDING_SCREEN"]:Xy,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Jy,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Pg,["EMBEDDED_WALLET_CREATED_SCREEN"]:vg,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:hg,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:d3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:b3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:m3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Tg,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:q3,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:H3,["FUNDING_METHOD_SELECTION_SCREEN"]:b2,["MOONPAY_PROMPT_SCREEN"]:q2,["MOONPAY_STATUS_SCREEN"]:j2,["COINBASE_ONRAMP_STATUS_SCREEN"]:t2,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:X2,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:z1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:I2,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:m1,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:c1,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:f3,["MFA_ENROLLMENT_FLOW_SCREEN"]:PC,["CAPTCHA_SCREEN"]:Ny,["ERROR_SCREEN"]:y1,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:rv,["AFFIRMATIVE_CONSENT_SCREEN"]:fy,["TELEGRAM_AUTH_SCREEN"]:$3},jE=["LANDING","AWAITING_CONNECTION"],o0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=$(),{headless:n}=dt(),{ready:i,currentScreen:a}=A(),{status:l,execute:s,reset:c,enabled:m}=We(),f=o&&a&&jE.includes(a)&&!n&&l==="ready";if((0,_n.useEffect)(()=>{f&&s()},[f]),(0,_n.useEffect)(()=>{!o&&m&&c()},[o,m]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(k,{}),(0,tt.jsx)(pe,{}),(0,tt.jsx)(r0,{children:(0,tt.jsx)(At,{})}),(0,tt.jsx)(fe,{}),(0,tt.jsx)(J,{})]});if(!a&&e)return(0,tt.jsx)(Bu,{open:e,onClose:t});if(!a)return null;let u=KE[a];return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(Ao,{if:!!e,children:(0,tt.jsx)(u,{})}),(0,tt.jsx)(Ao,{if:!e,children:(0,tt.jsx)(Bu,{open:e,onClose:t})})]})},YE=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=(0,_n.useRef)(null),o=Qh(r);return(0,tt.jsx)(QE,{style:{height:o},id:"privy-modal-content",children:(0,tt.jsx)("div",{ref:r,children:(0,tt.jsx)(o0,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},ZE=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=A();return{gracefulClosePrivyModal:(0,_n.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Qd=({open:e})=>{let{app:t}=A(),{gracefulClosePrivyModal:r}=ZE(),[o,n]=(0,_n.useState)(!1);dc({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?(0,tt.jsx)(Zu,{children:(0,tt.jsx)(n0,{id:"privy-modal-content",children:(0,tt.jsx)(o0,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):(0,tt.jsx)(t0,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:(0,tt.jsx)(Zu,{children:(0,tt.jsx)(YE,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},n0=Qu.default.div`
3314
+ `;var tt=require("react/jsx-runtime"),XE={["LANDING"]:zv,["CONNECT_OR_CREATE"]:qv,["AWAITING_PASSWORDLESS_CODE"]:My,["AWAITING_CONNECTION"]:ag,["AWAITING_CONNECT_ONLY_CONNECTION"]:cg,["AWAITING_FARCASTER_CONNECTION"]:O1,["AWAITING_FARCASTER_SIGNER"]:U1,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:l3,["PHANTOM_INTERSTITIAL_SCREEN"]:u3,["LOGIN_FAILED_SCREEN"]:Jv,["AWAITING_OAUTH_SCREEN"]:s3,["CROSS_APP_AUTH_SCREEN"]:ug,["ALLOWLIST_REJECTION_SCREEN"]:wy,["ACCOUNT_NOT_FOUND_SCREEN"]:fy,["USER_LIMIT_REACHED_SCREEN"]:n0,["INSTALL_PHANTOM_SCREEN"]:pv,["LINK_EMAIL_SCREEN"]:Kv,["LINK_PHONE_SCREEN"]:Yv,["LINK_WALLET_SCREEN"]:Zv,["LINK_PASSKEY_SCREEN"]:y2,["UPDATE_EMAIL_SCREEN"]:e0,["UPDATE_PHONE_SCREEN"]:r0,["CONNECT_ONLY_LANDING_SCREEN"]:og,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:rg,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Rg,["EMBEDDED_WALLET_CREATED_SCREEN"]:Eg,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Cg,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:f3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:_3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:g3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Ag,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:j3,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:z3,["FUNDING_METHOD_SELECTION_SCREEN"]:_2,["MOONPAY_PROMPT_SCREEN"]:j2,["MOONPAY_STATUS_SCREEN"]:J2,["COINBASE_ONRAMP_STATUS_SCREEN"]:i2,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:ov,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:Y1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:L2,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:g1,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:m1,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:v3,["MFA_ENROLLMENT_FLOW_SCREEN"]:RC,["CAPTCHA_SCREEN"]:By,["ERROR_SCREEN"]:w1,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:av,["AFFIRMATIVE_CONSENT_SCREEN"]:vy,["TELEGRAM_AUTH_SCREEN"]:Z3},e7=["LANDING","AWAITING_CONNECTION"],c0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=z(),{headless:n}=dt(),{ready:i,currentScreen:a}=P(),{status:l,execute:s,reset:c,enabled:m}=We(),f=o&&a&&e7.includes(a)&&!n&&l==="ready";if((0,Pn.useEffect)(()=>{f&&s()},[f]),(0,Pn.useEffect)(()=>{!o&&m&&c()},[o,m]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(x,{}),(0,tt.jsx)(se,{}),(0,tt.jsx)(l0,{children:(0,tt.jsx)(xt,{})}),(0,tt.jsx)(ue,{}),(0,tt.jsx)(J,{})]});if(!a&&e)return(0,tt.jsx)(Gu,{open:e,onClose:t});if(!a)return null;let u=XE[a];return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(xo,{if:!!e,children:(0,tt.jsx)(u,{})}),(0,tt.jsx)(xo,{if:!e,children:(0,tt.jsx)(Gu,{open:e,onClose:t})})]})},t7=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=(0,Pn.useRef)(null),o=ty(r);return(0,tt.jsx)(o7,{style:{height:o},id:"privy-modal-content",children:(0,tt.jsx)("div",{ref:r,children:(0,tt.jsx)(c0,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},r7=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=P();return{gracefulClosePrivyModal:(0,Pn.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Xd=({open:e})=>{let{app:t}=P(),{gracefulClosePrivyModal:r}=r7(),[o,n]=(0,Pn.useState)(!1);uc({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?(0,tt.jsx)(Ju,{children:(0,tt.jsx)(d0,{id:"privy-modal-content",children:(0,tt.jsx)(c0,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):(0,tt.jsx)(s0,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:(0,tt.jsx)(Ju,{children:(0,tt.jsx)(t7,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},d0=Xu.default.div`
3315
3315
  display: flex;
3316
3316
  flex-direction: column;
3317
3317
  text-align: center;
@@ -3320,7 +3320,7 @@ You will have to sign up with another method first to register a passkey for you
3320
3320
  width: 100%;
3321
3321
  background: var(--privy-color-background);
3322
3322
  padding: 0 16px;
3323
- `,QE=(0,Qu.default)(n0)`
3323
+ `,o7=(0,Xu.default)(d0)`
3324
3324
  transition: height 150ms ease-out;
3325
3325
  overflow: hidden;
3326
3326
 
@@ -3334,4 +3334,4 @@ You will have to sign up with another method first to register a passkey for you
3334
3334
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3335
3335
  border-radius: var(--privy-border-radius-lg);
3336
3336
  }
3337
- `;var ol=require("react"),a0=require("react/jsx-runtime");function JE({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function i0(e){let t=(0,ol.useRef)(null),r=(0,ol.useRef)();return(0,ol.useEffect)(()=>{r.current?.remove(),r.current=JE(e),t.current?.after(r.current)},[e]),(0,a0.jsx)("div",{ref:t,hidden:!0})}var s0=require("react"),es=require("react");var Jd=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;case"privy:solana-wallet:create":return o;case"privy:solana-wallet:connect":return o;case"privy:solana-wallet:recover":return o;case"privy:solana-wallet:rpc":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function ni(e,t,r,o,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Ze("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((u,w)=>{r.current={resolve:u,reject:w};let v=1e3*60*5;setTimeout(()=>{let g=new Ze("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),w(g)},v)});return await e(f)}return await e()},s=4,c=null;for(let m=0;m<s;m++)try{c=await l(m),o.current?.resolve(void 0);break}catch(f){if(f.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),f}if(c===null){let m=new Ze("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(m),m}return c}var c0=require("react/jsx-runtime"),XE=function(e){return()=>`id-${e++}`}(0);function e7(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function zt(e){return e.error!==void 0}var Nt=new Jd,Ju=new Map,t7=(e,t)=>typeof t=="bigint"?t.toString():t,r7=(e,t)=>`${e}${JSON.stringify(t,t7)}`;function $t(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=r7(e,t);if(e==="privy:wallet:create"){let l=Ju.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=XE();Nt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{Ju.delete(i)});return Ju.set(i,a),a}function o7(e){switch(e.event){case"privy:iframe:ready":let t=Nt.dequeue(e.event,e.id);return zt(e)?t.reject(new Ze(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=Nt.dequeue(e.event,e.id);return zt(e)?r.reject(new Ze(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=Nt.dequeue(e.event,e.id);return zt(e)?o.reject(new Ze(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=Nt.dequeue(e.event,e.id);return zt(e)?n.reject(new Ze(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let i=Nt.dequeue(e.event,e.id);return zt(e)?i.reject(new Ze(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let a=Nt.dequeue(e.event,e.id);return zt(e)?a.reject(new Ze(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery":let l=Nt.dequeue(e.event,e.id);return zt(e)?l.reject(new Ze(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:verify":let s=Nt.dequeue(e.event,e.id);return zt(e)?s.reject(new Ze(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:init-enrollment":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:submit-enrollment":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:unenroll":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:clear":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:init-signer":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:sign":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:solana-wallet:create":let c=Nt.dequeue(e.event,e.id);return zt(e)?c.reject(new Ze(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let m=Nt.dequeue(e.event,e.id);return zt(e)?m.reject(new Ze(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=Nt.dequeue(e.event,e.id);return zt(e)?f.reject(new Ze(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function l0(e){let t=(0,es.useRef)(null),r=(0,es.useRef)(e.mfaMethods),o=da(),[n,i]=(0,s0.useState)(!1);return(0,es.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,es.useEffect)(()=>{if(!n)return;let a=t.current;if(!a)return;function l(u){u&&u.origin===e.origin&&e7(u.data)&&o7(u.data)}let s={create(u){return $t("privy:wallet:create",u,a,e.origin)},import(u){return $t("privy:wallet:import",u,a,e.origin)},connect(u){return $t("privy:wallet:connect",u,a,e.origin)},recover(u){return ni(w=>$t("privy:wallet:recover",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!u.recoveryMethod||u.recoveryMethod==="privy")},rpc(u){return ni(w=>$t("privy:wallet:rpc",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(u){return $t("privy:solana-wallet:create",u,a,e.origin)},connectSolana(u){return $t("privy:solana-wallet:connect",u,a,e.origin)},recoverSolana(u){return $t("privy:solana-wallet:recover",u,a,e.origin)},rpcSolana(u){return $t("privy:solana-wallet:rpc",u,a,e.origin)},setRecovery(u){return ni(w=>$t("privy:wallet:set-recovery",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return ni(w=>$t("privy:mfa:verify",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return ni(w=>$t("privy:mfa:init-enrollment",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return ni(w=>$t("privy:mfa:submit-enrollment",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(u){return ni(w=>$t("privy:mfa:unenroll",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(u){return $t("privy:mfa:clear",u,a,e.origin)},initFarcasterSigner(u){return $t("privy:farcaster:init-signer",u,a,e.origin)},signFarcasterMessage(u){return $t("privy:farcaster:sign",u,a,e.origin)}};window.addEventListener("message",l);let c=()=>e.onLoad(s),m=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},f=new AbortController;return os(()=>$t("privy:iframe:ready",{},a,e.origin),{abortSignal:f.signal}).then(c,m),()=>{window.removeEventListener("message",l),f.abort()}},[n]),(0,c0.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:_l(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Xd=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return await p0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await Ie())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await d0())throw new b("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};async function u0({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new b("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",m)}let s,c=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(c),clearTimeout(a),n(new b("User rejected request")))},300);function m(f){f.data&&(f.data.type==="PRIVY_OAUTH_RESPONSE"&&f.data.stateCode&&f.data.authorizationCode&&(clearTimeout(a),o(f.data),l()),f.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new b(f.data.error)),l()),f.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=m))}window.addEventListener("message",m)})}var n7="https://cdn.apple-cloudkit.com";async function Xu({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,i)=>{function a(){t?.close(),window.removeEventListener("message",l)}function l(s){s.data&&(s.data.type==="PRIVY_OAUTH_RESPONSE"&&s.data.stateCode&&s.data.authorizationCode&&(n(s.data),a()),s.origin===n7&&s.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:s.data.ckSession}),a()),s.data.type==="PRIVY_OAUTH_ERROR"&&(i(s.data.error),a()))}window.addEventListener("message",l)})}var m0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});var tr=require("react/jsx-runtime"),on;function i7(e){return typeof e=="string"&&e.length===25}function Ie(){if(!on){let e=X.get(ai);return Promise.resolve(e||null)}return on.getAccessToken()}var y0,Bf=(e,t,r)=>y0(e,t,r),g0,Hf=(e,t)=>g0(e,t),v0,Gf=(e,t)=>v0(e,t),C0,Vf=()=>C0(),w0,d0=()=>w0(),b0,p0=({message:e})=>b0({message:e}),a7=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(as,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},E0=({config:e,...t})=>{if(!i7(t.appId))throw new b("Cannot initialize the Privy provider with an invalid Privy app ID");on||(on=new la({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,tr.jsx)(Oh,{client:on,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,tr.jsx)(s7,{...t,client:on})})},s7=e=>{let t=e.client,[r,o]=(0,ve.useState)(!1),[n,i]=(0,ve.useState)(!1),[a,l]=(0,ve.useState)(!1),[s,c]=(0,ve.useState)(null),[m,f]=(0,ve.useState)([]),[u,w]=(0,ve.useState)(null),v=(0,ve.useRef)(m),[g,E]=(0,ve.useState)(!1),[T,R]=(0,ve.useState)(null),[S,x]=(0,ve.useState)(!1),[I,M]=(0,ve.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:_}),[U,G]=(0,ve.useState)({status:"initial"}),[Y,Z]=(0,ve.useState)(null),[L,F]=(0,ve.useState)(null),O=dt(),Me=ec(),[je,Q]=(0,ve.useState)(!0),[re,ie]=(0,ve.useState)({}),[Fe,De]=(0,ve.useState)(null),[ut,lt]=(0,ve.useState)(null),[Dt,at]=(0,ve.useState)(!1),[ge,Cr]=(0,ve.useState)(!1),go=(0,ve.useRef)(null),Lo=(0,ve.useRef)(null),N=(0,ve.useRef)(Jh),[_t,vo]=(0,ve.useState)(!1);t.onStoreToken=d=>{d&&B(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),B(N,"accessToken","onAccessTokenRemoved")};let V=(0,ve.useRef)(null),q=(0,ve.useRef)(null),he=d=>{R(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},It=d=>{O.embeddedWallets.createOnLogin!=="off"&&Q(!0),he(d)};(0,ve.useEffect)(()=>{let d=yi(s);if(!d||!L)return;let p={address:d.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Mn,id:"io.privy.solana.wallet"},getProvider:async()=>new Xd(L,d.address)};w(p)},[L,s]),(0,ve.useEffect)(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=xe(s),p=Kl(s);if(d||t.connectors?.removeEmbeddedWalletConnector(),p||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!L){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}d&&t.connectors.addEmbeddedWalletConnector(L,d.address,O.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,O.defaultChain,e.appId)},[L,s]),(0,ve.useEffect)(()=>{L&&ut?.(L)},[L]),(0,ve.useEffect)(()=>{(async()=>{if(!O.customAuth?.enabled)return;Q(!0);let{getCustomAccessToken:p,isLoading:h}=O.customAuth;if(!(!n||h))try{let C=await p();if(!C&&a){await Hi.logout();return}if(!C||a)return;t.startAuthFlow(new Vi(C));let{user:P,isNewUser:D}=await t.authenticate();if(!P){await Hi.logout();return}c(P||null),E(D||!1),l(!0),Cr(!0)}catch(C){console.warn(C),a&&await Hi.logout()}})()},[O.customAuth?.enabled,O.customAuth?.getCustomAccessToken,O.customAuth?.isLoading,n,a]),(0,ve.useEffect)(()=>{ge&&L&&s&&Sr(s,O.embeddedWallets.createOnLogin)&&(Cr(!1),im(s,$i).catch(console.error))},[ge&&L&&s]),(0,ve.useEffect)(()=>{async function d(){let p=rs(),h=il();a7();let C=(0,f0.createStore)();t.initializeConnectorManager({walletConnectCloudProjectId:O.walletConnectCloudProjectId,rpcConfig:O.rpcConfig,chains:O.chains,defaultChain:O.defaultChain,store:C,walletList:O.appearance.walletList,shouldEnforceDefaultChainOnConnect:O.shouldEnforceDefaultChainOnConnect,externalWalletConfig:O.externalWallets,appName:O.name??"Privy"});let P;t.connectors?.on("connectorInitialized",()=>{P&&clearTimeout(P);let Ae=t.connectors.walletConnectors.length,le=t.connectors.walletConnectors.reduce((yt,Be)=>yt+(Be.initialized?1:0),0);le===Ae?vo(!0):P=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:le,expected:Ae}),vo(!0)},1500)}),t.connectors?.initialize().then(()=>{iw()});let D=await t.getAuthenticatedUser(),K=!!D;if(O.customAuth?.enabled||(l(!!D),D&&B(N,"login","onComplete",D,!1,!0,null,null),c(D)),p){q.current=K?"link":"login";return}if(h&&!K){q.current="login",It("TELEGRAM_AUTH_SCREEN");return}de.setReadyToTrue(!!D)}!n&&Me&&d()},[t,Fe,n,Me]),(0,ve.useEffect)(()=>{if(!n)return;if(!s){at(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){at(!0);return}let p=!!m.find(h=>h.walletClientType==="privy");at(p)},[n,s,m]);let rs=()=>{let d=ms();if(d.inProgress&&d.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if(d.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode});return}let p="privy:";function h(C){return C.startsWith(p)}return d.inProgress&&h(d.provider)&&!d.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode}),window.close()),!d.inProgress||d.headless?!1:(t.startAuthFlow(new Do(d)),It("AWAITING_OAUTH_SCREEN"),!0)},il=()=>{let d=Nf();if(!d||!O.loginMethods.telegram||!O.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Zi;return t.startAuthFlow(p),d.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:d.id,first_name:d.first_name,last_name:d.last_name,auth_date:d.auth_date,username:d.username,photo_url:d.photo_url,hash:d.hash}),d.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:d.query_id,user:d.user,auth_date:d.auth_date,hash:d.hash}),!0},nw=async(d,p,h,C)=>{let P=await t.connectors?.createWalletConnector(d,p)||null;tp(P,p,h,C)};async function tp(d,p,h,C){if(d)M({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:_});else return M({status:"disconnected",connectedWallet:null,connectError:new we("Unable to connect to wallet."),connector:null,connectRetry:_}),C?.(null,h);d instanceof To&&p&&await d.resetConnection(p),M({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>tp(d,p,h,C)});try{let P=await d.connect({showPrompt:!0});if(O.shouldEnforceDefaultChainOnConnect&&!O.chains.find(D=>D.id===Number(P?.chainId.replace("eip155:","")))&&!(P?.connectorType==="wallet_connect_v2"&&P?.walletClientType==="metamask")){M(D=>({...D,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:_}));try{await P?.switchChain(O.defaultChain.id),P&&(P.chainId=zi(ii(O.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${O.defaultChain.id}`)}}return M(D=>({...D,status:"connected",connectedWallet:P,connectError:null,connectRetry:_})),P&&B(N,"connectWallet","onSuccess",P),C?.(P,h)}catch(P){return P instanceof wt?(console.warn(P.cause?P.cause:P.message),B(N,"connectWallet","onError",P.privyErrorCode||"generic_connect_wallet_error")):(console.warn(P),B(N,"connectWallet","onError","unknown_connect_wallet_error")),M(D=>({...D,status:"disconnected",connectedWallet:null,connectError:P})),C?.(null,h)}}let al=async(d,p)=>{if(d===null)return;let h=new sn(d,t,p);t.startAuthFlow(h)},iw=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),h=d.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!An()&&It("LOGIN_FAILED_SCREEN"),!t.connectors)throw new b("Connector not initialized");he("AWAITING_CONNECTION");let C=new URL(window.location.href);C.searchParams.delete("privy_connector"),C.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",C),nw(p,h,void 0,al)};(0,ve.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let Mt=d=>{if(!a)throw B(N,"linkAccount","onError","must_be_authenticated",{linkMethod:d}),new b("User must be authenticated before linking an account.")},nm=()=>{Mt("siwe"),V.current="siwe",q.current="link",he("LINK_WALLET_SCREEN")},aw=d=>{if(!a||!s)return!1;if(d.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},sw=async d=>{if(!t.connectors)throw new b("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(M(h=>({...h,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:_})),O.captchaEnabled&&!a){let h={callback:C=>al(d,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};ie({captchaModalData:h}),It("CAPTCHA_SCREEN")}else await al(d),It("AWAITING_CONNECTION")},lw=async(d,p)=>{let{signedUrl:h,externalTransactionId:C}=await G2(t,d,p??{},O.appearance.palette,O.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:C}},sl=()=>{f(d=>{let p=t.connectors?.wallets.map(h=>({...h,linked:aw(h),loginOrLink:async()=>{if(!await h.isConnected())throw new b("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new b("Cannot link or login with embedded wallet");sw(h)},fund:async C=>{await de.fundWallet(h.address,C)},unlink:async()=>{if(!a)throw new b("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new b("Cannot unlink an embedded wallet");let C=await t.unlinkWallet(h.address);c(C)}}))||[];return jl(d,p)?d:p})};(0,ve.useEffect)(()=>{sl()},[s?.linkedAccounts,a,n]),(0,ve.useEffect)(()=>{if(n){if(!t.connectors)throw new b("Connector not initialized");sl(),t.connectors.on("walletsUpdated",sl)}},[n]);let cw=d=>{if(d&&"suggestedAddress"in d&&d.suggestedAddress){let p=(0,rn.getAddress)(d.suggestedAddress);Z(p)}he(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,ve.useEffect)(()=>{if(!m[0])return;let d=m[0],p=v.current.find(C=>C.address===d.address),h;if(d.walletClientType==="privy"?h=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType==="privy"):h=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType!=="privy"),!p&&h){let C=Object.assign({},s);C.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(C)}v.current=m},[m]);let im=async(d,p)=>{if(xe(d))throw B(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[C,P]=await Promise.all([de.initializeWalletProxy(p),Ie()]);if(!C&&O.customAuth?.enabled)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!C||!P||O.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((D,K)=>{Q(!0),ie({createWallet:{onSuccess:le=>{B(N,"createWallet","onSuccess",le),D(le)},onFailure:le=>{B(N,"createWallet","onError","unknown_embedded_wallet_error"),K(le)},callAuthOnSuccessOnClose:!1}}),he("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await C.create({accessToken:P});let D=await de.refreshUser(),K=xe(D);if(!K)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return B(N,"createWallet","onSuccess",K),K}},dw=d=>{if(!O.chains.map(p=>p.id).includes(d))throw new we(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},am=(d,p,h)=>new Promise(async(C,P)=>{let{requesterAppId:D}=p||{};if(!a||!s){B(N,"sendTransaction","onError","must_be_authenticated"),P(new Error("User must be authenticated before signing with a Privy wallet"));return}let K=d.from,Ae=K?s?.linkedAccounts.find(gt=>gt.type==="wallet"&&gt.walletClientType==="privy"&&(0,rn.getAddress)(gt.address)===(0,rn.getAddress)(K)):xe(s);if(!Ae){B(N,"sendTransaction","onError","embedded_wallet_not_found"),P(new Error("Must have a Privy wallet before signing"));return}Q(!0);let le=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,yt=d.chainId?Number(d.chainId):le.chainId;dw(yt);let Be=Object.assign({},d,{chainId:yt}),br=async()=>{let gt=await Ie();if(!gt||!L){B(N,"sendTransaction","onError","embedded_wallet_not_found"),P(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await de.recoverEmbeddedEthereumWallet()){B(N,"sendTransaction","onError","unknown_connect_wallet_error"),P(new Error("Unable to connect to wallet"));return}let Gi=Er(Be.chainId,O.chains,O.rpcConfig,{appId:e.appId}),No=await(0,ts.populateTransactionRequest)(Ae.address,Be,Gi);if(O.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:mw}=await(0,ts.calculateTotalGasEstimate)(No,Gi),{hasSufficientFunds:fw}=await Wa(Ae.address,No,mw,Gi);if(!fw)throw new Kt(new oo("Wallet has insufficient funds for this transaction.",ts.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let pm=await zc(gt,Ae.address,L,No,Gi,D);B(N,"sendTransaction","onSuccess",pm),C(pm)}catch(cl){B(N,"sendTransaction","onError","transaction_failure"),P(cl)}};if(O.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),br();else{let gt={transactionRequest:Be,onSuccess:No=>{B(N,"sendTransaction","onSuccess",No),C(No)},onFailure:No=>{B(N,"sendTransaction","onError","transaction_failure"),P(No)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:D},cl={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:No=>{B(N,"sendTransaction","onError","unknown_connect_wallet_error"),P(No)}},Gi=cm({address:Ae.address,fundWalletConfig:h,chainIdOverride:Be.chainId,comingFromSendTransactionScreen:!0});ie({connectWallet:cl,sendTransaction:gt,funding:Gi}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function sm(){return new Promise(async(d,p)=>{let h=await Ie();if(!h||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:h}),d()}catch(C){p(C)}})}let lm=d=>d?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],wr=d=>{let p=s?.linkedAccounts.filter(P=>P.type===d).length??0,{displayName:h,loginMethod:C}=Xn(d);if(d==="passkey"&&p>=5||d!=="passkey"&&p>=1)throw B(N,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:C}),new b(`User already has an account of type ${h} linked.`)},pw=()=>{if(!O.loginConfig.telegramAuthConfiguration?.linkEnabled)throw B(N,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:"telegram"}),new b("User can't link an account because Telegram linking is disabled.")},cm=({address:d,fundWalletConfig:p,methodScreen:h,chainIdOverride:C=null,comingFromSendTransactionScreen:P=!1})=>{if(!O.fundingConfig||O.fundingConfig.methods.length===0)return;let D=cd(p)&&p.amount?p.amount:O.fundingConfig.defaultRecommendedAmount,K=cd(p)&&p.chain?p.chain.id:La(O.fundingConfig.defaultRecommendedCurrency.chain),Ae=cd(p)&&p.chain?p.chain:O.chains.find(le=>le.id===K);if(C&&O.chains.find(le=>le.id===C)&&(Ae=O.chains.find(le=>le.id===C)),!Ae)throw new b("Funding chain is not in PrivyProvider chains list");return{address:d,amount:D,chain:Ae,methodScreen:h,comingFromSendTransactionScreen:P,...H2(p)?{moonpayConfigOverride:p.config}:{}}};async function dm({legacySetWalletPasswordFlow:d=!1}){R(null);let p=d?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw B(N,p,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let h=xe(s);if(!h||!L)throw B(N,p,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(yi(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await sm()}catch(P){throw B(N,p,"onError","missing_or_invalid_mfa"),P}return new Promise((P,D)=>{Q(!0);let K={onSuccess:Be=>{B(N,p,"onSuccess","user-passcode",Be),P(Be)},onFailure:Be=>{B(N,p,"onError","user_exited_set_password_flow"),D(Be)},callAuthOnSuccessOnClose:!1},Ae=h.recoveryMethod==="user-passcode",yt={onCompleteNavigateTo:Lc({walletAction:"update",availableRecoveryMethods:O.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:d,isResettingPassword:Ae}),shouldForceMFA:!1,onFailure:Be=>{B(N,p,"onError","unknown_connect_wallet_error"),D(Be)}};ie({setWalletPassword:K,createWallet:K,connectWallet:yt,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Ae}}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function ll({appId:d}){Mt(`privy:${d}`),V.current=`privy:${d}`,q.current="link";let p=window.open(void 0,void 0,Ns({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{appId:d}}),new Promise(async(h,C)=>{let{name:P,logoUrl:D}=await Qc({api:t.api,providerAppId:d,requesterAppId:O.id});ie({crossAppAuth:{appId:d,name:P,logoUrl:D,popup:p,onSuccess:h,onError:C}}),It("CROSS_APP_AUTH_SCREEN")})}let Hi={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:cw,importWallet:async({privateKey:d})=>{Mt("siwe");let[p,h]=await Promise.all([de.initializeWalletProxy(15e3),Ie()]);if(p&&h){await p.import({privateKey:d,accessToken:h});let C=await de.refreshUser(),P=Kl(C);if(!P)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return B(N,"createWallet","onSuccess",P),P}else throw new b("User is not authenticated")},linkWallet:nm,linkCrossAppAccount:ll,linkEmail:()=>{Mt("email"),wr("email"),V.current="email",q.current="link",he("LINK_EMAIL_SCREEN")},linkPhone:()=>{Mt("sms"),wr("phone"),V.current="sms",q.current="link",he("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Mt("google"),wr("google_oauth"),q.current="link",await de.initLoginWithOAuth("google")},linkTwitter:async()=>{Mt("twitter"),wr("twitter_oauth"),q.current="link",await de.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Mt("discord"),wr("discord_oauth"),q.current="link",await de.initLoginWithOAuth("discord")},linkGithub:async()=>{Mt("github"),wr("github_oauth"),q.current="link",await de.initLoginWithOAuth("github")},linkSpotify:async()=>{Mt("spotify"),wr("spotify_oauth"),q.current="link",await de.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Mt("instagram"),wr("instagram_oauth"),q.current="link",await de.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Mt("tiktok"),wr("tiktok_oauth"),q.current="link",await de.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Mt("linkedin"),wr("linkedin_oauth"),q.current="link",await de.initLoginWithOAuth("linkedin")},linkApple:async()=>{Mt("apple"),wr("apple_oauth"),q.current="link",await de.initLoginWithOAuth("apple")},linkPasskey:async()=>{Mt("passkey"),wr("passkey"),await de.initLinkWithPasskey(),he("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{Mt("telegram"),wr("telegram"),pw(),q.current="link",V.current="telegram",await de.initLoginWithTelegram(),he("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{Mt("farcaster"),wr("farcaster"),await de.initLoginWithFarcaster(),q.current="link",V.current="farcaster",he("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Mt("email"),!s?.email)throw new b("User does not have an email linked to their account.");q.current="link",V.current="email",he("UPDATE_EMAIL_SCREEN")},login:async d=>{d&&"target"in d&&d&&(d=void 0);let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let h=await new Promise(C=>{De(P=>C.bind(P))});if(De(null),h){console.warn(p);return}}if(a){console.warn(p);return}q.current="login",ie({login:d}),It("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{De(()=>d)}),De(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(m[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}It("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),R(null),await t.logout(),s&&L)try{await L.clearMfa({userId:s.id})}catch{}c(null),l(!1),B(N,"logout","onSuccess"),q.current=null,V.current=null,o(!1),X.del(ss)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new ct;let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(C=>C.address===d?.address));return!d||!p?new ct:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new ep.Web3Provider(new wo(new ct));let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(C=>C.address===d?.address));return!d||!p?new ep.Web3Provider(new wo(new ct)):new ep.Web3Provider(new wo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new In(new ct);let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(C=>C.address===d?.address));return!d||!p?new In(new ct):new In(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkInstagram:async d=>{let p=await t.unlinkOAuth("instagram",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},unlinkTelegram:async d=>{let p=await t.unlinkTelegram(d);return c(p),p},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},unlinkCrossAppAccount:async({subject:d})=>{let p=s?.linkedAccounts.find(C=>C.type==="cross_app"&&C.subject===d)?.providerApp;if(!p)throw new b("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,d);return c(h),h},setActiveWallet:async d=>{let p=m.find(C=>(0,rn.getAddress)(C.address)===(0,rn.getAddress)(d)),h=s?.linkedAccounts.find(C=>C.type==="wallet"&&(0,rn.getAddress)(C.address)===(0,rn.getAddress)(d));if(!p||!await p.isConnected())Z(d),nm();else if(!p.linked)p.loginOrLink();else{let C=Object.assign({},s);C.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(C)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw B(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return im(s,15e3)},setWalletRecovery:async()=>dm({legacySetWalletPasswordFlow:!1}),setWalletPassword:async()=>dm({legacySetWalletPasswordFlow:!0}),signMessage:(d,p,h)=>new Promise(async(C,P)=>{let{requesterAppId:D}=p||{};if(!a||!s){B(N,"signMessage","onError","must_be_authenticated"),P(new Error("User must be authenticated before signing with a Privy wallet"));return}let K=h?s?.linkedAccounts.find(le=>le.type==="wallet"&&le.walletClientType==="privy"&&(0,rn.getAddress)(le.address)===(0,rn.getAddress)(h)):xe(s);if(!K){B(N,"signMessage","onError","embedded_wallet_not_found"),P(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){B(N,"signMessage","onError","invalid_message"),P(new Error("Message must be a non-empty string"));return}Q(!0);let Ae=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let le=await Ie();if(!L||!le)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:K.address,requesterAppId:D}});let{response:Be}=await L.rpc({accessToken:le,address:K.address,requesterAppId:D,request:{method:"personal_sign",params:[d,K.address]}}),br=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:K.address,requesterAppId:D}}),br};if(O.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let le=await Ae();B(N,"signMessage","onSuccess",le),C(le)}catch(le){B(N,"signMessage","onError","unable_to_sign"),P(le??new Kt("Unable to sign message"))}}else{let Be={method:"personal_sign",data:d,confirmAndSign:Ae,onSuccess:gt=>{B(N,"signMessage","onSuccess",gt),C(gt)},onFailure:gt=>{B(N,"signMessage","onError","unable_to_sign"),P(gt)},uiOptions:p||{}},br={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:gt=>{B(N,"signMessage","onError","unknown_connect_wallet_error"),P(gt)},address:K.address};ie({signMessage:Be,connectWallet:br}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(h,C)=>{let{requesterAppId:P}=p||{};if(!a||!s){B(N,"signTypedData","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let D=xe(s);if(!D){B(N,"signTypedData","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}Q(!0);let K=ns(d),Ae=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let le=await Ie();if(!L||!le)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:D.address,requesterAppId:P}});let{response:Be}=await L.rpc({accessToken:le,address:D.address,requesterAppId:P,request:{method:"eth_signTypedData_v4",params:[D.address,K]}}),br=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:D.address,requesterAppId:P}}),br};if(O.embeddedWallets.noPromptOnSignature||(O.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let le=await Ae();B(N,"signTypedData","onSuccess",le),h(le)}catch(le){B(N,"signTypedData","onError","unable_to_sign"),C(le??new Kt("Unable to sign message"))}}else{let Be={method:"eth_signTypedData_v4",data:K,confirmAndSign:Ae,onSuccess:gt=>{B(N,"signTypedData","onSuccess",gt),h(gt)},onFailure:gt=>{B(N,"signTypedData","onError","unable_to_sign"),C(gt)},uiOptions:p||{}},br={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:gt=>{B(N,"signMessage","onError","unknown_connect_wallet_error"),C(gt)}};ie({signMessage:Be,connectWallet:br}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,h)=>{let P=await(await am(d,p,h)).wait();return $c(P)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!xe(s)){p(new Error("Must have a Privy wallet before exporting"));return}Q(!0);let C={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p,shouldForceMFA:!0};if(ie(re),!await Ie()||!L){p(new Error("Must have valid access token to enroll in MFA"));return}if(!L){p(new Error("Must have a Privy wallet before exporting"));return}let D={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,onSuccess:d,onFailure:p};ie({keyExport:D,connectWallet:C}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:sm,async init(d){switch(d){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${d}`)}},async submit(d,p){switch(d){case"totp":case"sms":if(typeof p!="string")throw new b("Invalid MFA code");go.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((D,K)=>{Lo.current={resolve:D,reject:K}});break;case"passkey":if(typeof p=="string")throw new b("Invalid authenticator response");let C=await(await import("@simplewebauthn/browser")).startAuthentication(p),P=m0(C);go.current?.resolve({mfaMethod:d,mfaCode:P,relyingParty:window.origin}),await new Promise((D,K)=>{Lo.current={resolve:D,reject:K}});break;default:throw go.current?.reject(new b("Unsupported MFA method")),new b(`Unsupported MFA method: ${d}`)}},cancel(){go.current?.reject(new b("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,h)=>{if(!d){de.closePrivyModal(),p();return}O.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),ie({mfaEnrollmentFlow:{mfaMethods:O.mfa.methods,onSuccess:p,onFailure:h}}),he("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ie();if(!d||!L)throw new Error("Must have valid access token to enroll in MFA");let p=await L.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async submitEnrollmentWithTotp(d){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:d}){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:d});let h=await t.getAuthenticatedUser();c(h)},async unenroll(d){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to remove MFA");d==="passkey"?await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await L.unenrollMfa({method:d,accessToken:p});let h=await t.getAuthenticatedUser();c(h)},requestFarcasterSignerFromWarpcast:async()=>{let d=await Ie(),p=s?.linkedAccounts.find(P=>P.type==="wallet"&&P.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let C=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(C.status==="approved"){let P=await t.getAuthenticatedUser();c(P||s||null)}ie({farcasterSigner:C}),he("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let d=await Ie(),p=s?.linkedAccounts.find(P=>P.type==="wallet"&&P.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(P=>Uint8Array.from(P.match(/.{1,2}/g).map(D=>parseInt(D,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async d=>{let p=await Ie(),h=s?.linkedAccounts.find(K=>K.type==="wallet"&&K.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let P=await import("@simplewebauthn/browser"),D=await L.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:P.bufferToBase64URLString(d)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(P.base64URLStringToBuffer(D.signature))},isHeadlessOAuthLoading:S,loginWithCode(d){return de.loginWithCode(d)},initLoginWithEmail(d){return de.initLoginWithEmail(d)},initLoginWithSms(d){return de.initLoginWithSms(d)},otpState:U,fundWallet(d,p){return de.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return de.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return de.loginWithHeadlessOAuth(d)},generateSiweMessage({address:d,chainId:p}){return de.generateSiweMessage({address:d,chainId:p})},linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:C,connectorType:P}){return Mt("siwe"),de.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:C,connectorType:P})},signMessageWithCrossAppWallet(d,{address:p}){return Jc({user:s,client:t,address:p,requesterAppId:O.id,request:{method:"personal_sign",params:[d,p]},reconnect:ll})},signTypedDataWithCrossAppWallet(d,{address:p}){let h=ns(d);return Jc({user:s,client:t,address:p,requesterAppId:O.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:ll})},sendTransactionWithCrossAppWallet(d,{address:p}){return Jc({user:s,client:t,address:p,requesterAppId:O.id,request:{method:"eth_sendTransaction",params:[d]},reconnect:ll})},isModalOpen:r,mfaMethods:O.mfa.methods};y0=Hi.signMessage,g0=Hi.signTypedData,v0=async(...d)=>{let p=await am(...d);return O.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let de=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:Y,pendingTransaction:null,walletConnectionStatus:I,connectors:t.connectors?.walletConnectors??[],rpcConfig:O.rpcConfig,chains:O.chains,appId:e.appId,showFiatPrices:O.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>O.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(L)return L;let p=new Promise(P=>{lt(()=>D=>P(D))}),h=new Promise(P=>setTimeout(()=>P(null),d)),C=await Promise.race([p,h]);return lt(null),C},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;if(p&&V.current&&(h=lm(s)),q.current==="login"?d.shouldCallAuthOnSuccess&&p&&V.current?(B(N,"login","onComplete",s,g,!1,V.current,h??null),e.onSuccess?.(s,g)):B(N,"login","onError","exited_auth_flow"):q.current==="link"&&h&&(d.isSuccess&&p&&V.current?B(N,"linkAccount","onSuccess",s,V.current,h):V.current&&B(N,"linkAccount","onError","exited_link_flow",{linkMethod:V.current})),T&&E3.includes(T)&&re.funding){let C=T3[T]??null,P=Er(re.funding.chain.id,O.chains,O.rpcConfig,{appId:e.appId}),D;try{D=(await P.getBalance(re.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}B(N,"fundWallet","onUserExited",{address:re.funding.address,chain:re.funding.chain,fundingMethod:C,balance:D})}Z(null),q.current=null,V.current=null,E(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:d})=>new Promise(async(p,h)=>{let C=async()=>{let P=await t.getAccessToken();if(!P)throw new Error("User must be authenticated to use their embedded wallet.");if(!u)throw new Error("User must have an embedded Solana wallet to sign messages for Solana.");let D=de.walletProxy??await de.initializeWalletProxy(15e3);if(!D)throw new Error("Failed to initialize embedded wallet proxy.");let{response:K}=await D.rpcSolana({accessToken:P,publicKey:u.address,request:{method:"signMessage",params:{message:d}}});return K.data.signature};if(O.embeddedWallets.noPromptOnSignature)try{let P=await C();p({signature:P})}catch(P){h(P)}else ie({signMessage:{method:"solana_signMessage",data:d,confirmAndSign:C,onSuccess:Ae=>{p({signature:Ae})},onFailure:Ae=>{h(Ae)},uiOptions:{}}}),It("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:he,connectWallet:tp,initLoginWithWallet:async(d,p)=>{V.current="siwe",al(d,p)},loginWithWallet:async()=>{if(!n)throw new nn;if(!(t.authFlow instanceof sn))throw new b("Must initialize SIWE flow first.");let d,p;if(a)try{({user:d}=await t.link()),V.current="siwe"}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),V.current="siwe"}catch(h){throw B(N,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||s||null),E(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new is(d);t.startAuthFlow(p);try{V.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw q.current==="login"?B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new nn;if(!(t.authFlow instanceof is))throw new b("Must initialize Farcaster flow first.");let d,p;if(a)try{({user:d}=await t.link()),V.current="farcaster"}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),V.current="farcaster"}catch(h){throw B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d||null),E(p||!1),l(!0)},async crossAppAuthFlow({appId:d,popup:p}){let h=`privy:${d}`;V.current=h;let{url:C,stateCode:P,codeVerifier:D}=await $1({api:t.api,appId:d});if(!C)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:d}}),new b("No authorization URL returned for cross-app auth.");try{let K=await u0({url:C,popup:p,provider:h}),Ae=K.stateCode,le=K.authorizationCode;if(Ae!==P)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:P??"",returnedStateCode:Ae??""}}),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let yt=await K1({api:on.api,appId:d,codeVerifier:D,stateCode:Ae,authorizationCode:le});yt&&t.storeProviderAccessToken(d,yt);let Be=await de.refreshUser();if(!Be)throw new b("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{appId:d}}),Be}catch(K){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:K.toString(),provider:h}}),K}},async initLoginWithOAuth(d,p){if(V.current=d,ip()){if(d==="google"&&ha(window.navigator.userAgent)){It("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{It("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}d==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),X.del(ci);let h=new Do({provider:d});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let C=await t.authFlow.getAuthorizationUrl();C&&C.url&&(d==="twitter"&&h0.isAndroid&&(C.url=C.url.replace("x.com","twitter.com")),window.location.assign(C.url))},async initLoginWithTelegram(d){if(!n)throw new nn;V.current="telegram";let p=new Zi(d);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,C)=>{if(!O.loginConfig.telegramAuthConfiguration)return C(new b("Telegram Auth configuration is not loaded"));if(!window.Telegram)return C(new b("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:O.loginConfig.telegramAuthConfiguration.botId,request_access:!0},P=>P?h(P):C(new b("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Zi))throw new b("Must initialize Telegram flow before calling loginWithTelegram");let d,p;if(a)try{({user:d}=await t.link()),V.current="telegram"}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else try{let h=await t.authenticate();d=h.user,p=h.isNewUser,V.current="telegram"}catch(h){throw q.current==="login"?B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}c(d),E(p||!1),l(!0)},async recoveryOAuthFlow(d,p,h){let C,P;function D(K){if(!K)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new b("Recovery OAuth failed")}switch(d){case"google-drive":{let{url:K,codeVerifier:Ae,stateCode:le}=await eu({api:on.api,provider:d});D(K);let yt,Be;try{let br=await Xu({url:K,popup:h,provider:d});if(yt=br.stateCode,Be=br.authorizationCode,yt!==le)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:le??"",returnedStateCode:yt??""}}),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(br){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:br.toString(),provider:d}}),new b("Recovery OAuth failed")}[C,P]=await Promise.all([Ie(),pg({api:on.api,provider:d,codeVerifier:Ae,stateCode:yt,authorizationCode:Be})]);break}case"icloud":{let{url:K}=await eu({api:on.api,provider:d});D(K);let{ckWebAuthToken:Ae}=await Xu({url:K,popup:h,provider:d});P=Ae,C=await Ie();break}}if(!L)throw new b("Cannot connect to wallet proxy");if(!C)throw new b("Unable to authorize user");switch(p){case"recover":let K=re.recoverWallet?.privyWallet?.address;if(!K)throw new b("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:K,recoveryMethod:d}}),await L.recover({address:K,accessToken:C,recoveryAccessToken:P,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:K,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:C,recoveryAccessToken:P,recoveryMethod:d});let Ae=await de.refreshUser(),le=xe(Ae);if(!le)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:le.address}}),B(N,"createWallet","onSuccess",le);break;case"set-recovery":let yt=xe(s);if(!yt)throw B(N,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{recoveryMethod:d}}),await L.setRecovery({address:yt.address,accessToken:C,recoveryAccessToken:P,recoveryMethod:d});let Be=xe(await de.refreshUser());if(!Be)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:yt.address,recoveryMethod:d}}),B(N,"setWalletRecovery","onSuccess",d,Be);break;default:throw new b("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof Do))throw new b("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(si),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:h??""}}),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,P,D;if(a)try{let K=await t.link();C=K.user,D=K.oAuthTokens,V.current=d}catch(K){throw B(N,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:d}),K}else try{let K=await t.authenticate();C=K.user,P=K.isNewUser,D=K.oAuthTokens,V.current=d}catch(K){throw q.current==="login"?B(N,"login","onError",K.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:d}),K}return c(C),E(P||!1),l(!0),D&&C&&B(N,"oAuthAuthorization","onOAuthTokenGrant",D,{user:C}),D},async initLoginWithPasskey(d){let p=new fi(d);t.startAuthFlow(p),q.current="login";try{V.current="passkey",await p.initAuthenticationFlow()}catch(h){throw B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new nn;if(!(t.authFlow instanceof fi))throw new b("Must initialize Passkey flow first.");if(V.current!=="passkey")throw new b("Must init login with Passkey flow first.");let d,p;try{V.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(h){throw B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d),E(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new fi(d);t.startAuthFlow(p),q.current="link",V.current="passkey";try{await p.initLinkFlow()}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new nn;if(!(t.authFlow instanceof fi))throw new b("Must initialize Passkey flow first.");if(V.current!=="passkey")throw new b("Must init login with Passkey flow first.");let d;try{V.current="passkey",{user:d}=await t.link()}catch(p){throw B(N,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return c(d||s||null),d},async initLoginWithHeadlessOAuth(d,p){if(ip()){if(d==="google"&&ha(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let h=new Do({provider:d,headless:!0});p&&h.addCaptchaToken(p);let C=await t.startAuthFlow(h).getAuthorizationUrl();C?.url&&window.location.assign(C.url)},async loginWithHeadlessOAuth(d){x(!0),t.startAuthFlow(new Do(d));let p=X.get(si),h=d.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:h??""}}),x(!1),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,P;if(a)try{({user:C}=await t.link()),V.current=d.provider}catch(D){throw B(N,"linkAccount","onError",D.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),D}else try{({user:C,isNewUser:P}=await t.authenticate()),V.current=d.provider}catch(D){throw q.current==="login"?B(N,"login","onError",D.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",D.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),D}return c(C),E(P||!1),l(!0),x(!1),C??void 0},initLoginWithEmail:async(d,p)=>{let h=new Pn(d,p);t.startAuthFlow(h);try{V.current="email",await h.sendCodeEmail()}catch(C){throw q.current==="login"?B(N,"login","onError",C.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),C}},initUpdateEmail:async(d,p,h)=>{let C=new wl(d,p,h);t.startAuthFlow(C),await C.sendCodeEmail()},initLoginWithSms:async(d,p)=>{G({status:"sending-code"});let h=new hi(d,p);t.startAuthFlow(h);try{V.current="sms",await h.sendSmsCode(),G({status:"awaiting-code-input"})}catch(C){throw G({status:"error",error:C}),q.current==="login"?B(N,"login","onError",C.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),C}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(G({status:"submitting-code"}),!n){let C=new nn;throw G({status:"error",error:C}),C}if(t.authFlow instanceof Pn)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof hi)t.authFlow.meta.smsCode=d.trim();else{let C=new b("Must initialize a passwordless code flow first");throw G({status:"error",error:C}),C}await Ie();let p,h;if(q.current==="link")try{({user:p}=await t.link())}catch(C){throw G({status:"error",error:C}),B(N,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account",{linkMethod:V.current}),C}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(C){throw G({status:"error",error:C}),B(N,"login","onError",C.privyErrorCode||"unknown_auth_error"),C}c(p||s||null),E(h||!1),l(!0),G({status:"done"})},generateSiweMessage:async({address:d,chainId:p,captchaToken:h})=>{q.current="link",V.current="siwe";let C=await t.generateSiweNonce({address:d,captchaToken:h}),P=p.replace("eip155:","");return $l({address:d,chainId:P,nonce:C})},linkWithSiwe:async({message:d,signature:p,chainId:h,walletClientType:C,connectorType:P})=>{let D;try{if(q.current!=="link"||V.current!=="siwe")throw new b("Must ensure no other auth flow is in progress other than the SIWE signature flow.");D=await t.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:C,connectorType:P}),D=await de.refreshUser()??D;let K=lm(D);K&&B(N,"linkAccount","onSuccess",D,"siwe",K)}catch(K){throw B(N,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),q.current=null,V.current=null,K}c(D||s||null),q.current=null,V.current=null},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:L,createAnalyticsEvent:({eventName:d,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:d,payload:p,timestamp:h}),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedEthereumWallet:async()=>new Promise(async(d,p)=>{let h=xe(s)||Kl(s),C=await Ie();if(!C||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await L.connect({accessToken:C,address:h.address}),d(!0)}catch(P){if(_i(P)&&h.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recover({address:h.address,accessToken:C,recoveryMethod:h.recoveryMethod})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:h.address}}),d(!0);else if(_i(P)&&h.recoveryMethod!=="privy"){ie({recoverWallet:{privyWallet:h,onFailure:p,onSuccess:()=>d(!0)},recoveryOAuthStatus:{provider:h.recoveryMethod,action:"recover"}});let D=Nc(h.recoveryMethod);he(D)}else p(P)}}),embeddedSolanaWallet:u,createEmbeddedSolanaWallet:async()=>{Q(!0);let d=await Ie(),p=yi(s),h=xe(s);if(!s||!d)throw new b("User must be logged in to create a Solana wallet");if(p)throw new b("User already has an embedded Solana wallet.");if(h)if(h.recoveryMethod==="privy")await de.recoverEmbeddedEthereumWallet();else throw new b("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let C=await de.initializeWalletProxy(15e3);if(!C)throw new b("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await C.createSolana({accessToken:d,ethereumAddress:h?.address});let P=await de.refreshUser(),D=yi(P);if(!D)throw new b("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:D.address}}),D}catch(P){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new b("Failed to create Solana embedded wallet with error ",P)}},recoverEmbeddedSolanaWallet:async()=>new Promise(async(d,p)=>{let h=yi(s),C=await Ie();if(!C||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await L.connectSolana({accessToken:C,publicKey:h.address}),d(!0)}catch(P){_i(P)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recoverSolana({publicKey:h.address,accessToken:C})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),d(!0)):p(P)}}),getMoonpaySignedUrl:lw,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:d=>{i(!0),Fe?.(d)},updateWallets:()=>sl(),fundWallet:async(d,p)=>{if(!O.fundingConfig||O.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Hd({fundingMethods:O.fundingConfig.methods});ie({funding:cm({address:d,fundWalletConfig:p,methodScreen:h})}),he(h)},requestFarcasterSignerStatus:async d=>{let p=await Ie(),h=s?.linkedAccounts.find(P=>P.type==="wallet"&&P.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let C=await t.requestFarcasterSignerStatus(d);if(C.status==="approved"){let P=await t.getAuthenticatedUser();c(P||s||null)}return C}}))();C0=de.recoverEmbeddedEthereumWallet,w0=de.recoverEmbeddedSolanaWallet,b0=de.solanaSignMessage;let uw=(0,ve.useMemo)(()=>({wallets:m,ready:Dt&&_t}),[m,Dt,_t]);return(0,tr.jsx)(Ue.Provider,{value:Hi,children:(0,tr.jsx)(Op.Provider,{value:N,children:(0,tr.jsx)(uu.Provider,{value:uw,children:(0,tr.jsx)(jh,{...O,children:(0,tr.jsxs)(Wp.Provider,{value:de,children:[(0,tr.jsx)(Zy,{children:(0,tr.jsxs)(Dh,{data:re,setModalData:ie,setInitialScreen:R,initialScreen:T,authenticated:a,open:r,children:[e.children,!O.headless&&O.captchaEnabled&&n&&!a&&(0,tr.jsx)(ac,{delayedExecution:!1}),(0,tr.jsx)(e0,{theme:{...O.appearance.palette||{}}}),!O.render.standalone&&(0,tr.jsx)(Qd,{open:r})]})}),je&&Me?(0,tr.jsx)(l0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:go,mfaSubmitPromise:Lo,onLoad:F,onLoadFailed:()=>null}):null,O.loginMethods.telegram&&O.loginConfig.telegramAuthConfiguration&&(0,tr.jsx)(Ao,{if:!0,children:(0,tr.jsx)(i0,{scriptHost:e.apiUrl||Rl,botUsername:O.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};var T0=require("react");function S0(e){let{login:t}=(0,T0.useContext)(Ue);return He("login",e),{login:t}}var _0=require("react");function P0(e){let{logout:t}=(0,_0.useContext)(Ue);return He("logout",e),{logout:t}}var nl=require("react");function A0(){let e=We(),t=ec(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=$(),l=(0,nl.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new Nr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=(0,nl.useCallback)(async()=>{let c=ms();if(a)return console.warn("Cannot login with OAuth when already logged in"),a;if(!c.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!c.popupFlow)try{return await o(c)}catch(m){throw m}finally{mi()}},[o]);return(0,nl.useEffect)(()=>{let c=ms();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}var em=require("react");var x0=()=>{let e=We(),{initLoginWithEmail:t,loginWithCode:r}=$(),o=(0,em.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=(0,em.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new Nr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var tm=require("react");var k0=()=>{let e=We(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=$(),n=(0,tm.useCallback)(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=(0,tm.useCallback)(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new Nr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};var rm=require("react");var R0=()=>{let e=We(),{generateSiweMessage:t,linkWithSiwe:r}=$(),o=(0,rm.useCallback)(async({address:i,chainId:a})=>{if(!i||!a)throw new Error("wallet address and chainId required to generate nonce");return t({address:i,chainId:a}).then(l=>l)},[t]),n=(0,rm.useCallback)(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:c})=>{if(e.enabled&&e.status!=="success")throw new Nr(e.error,null,"captcha_failure");return r({message:a,signature:i,chainId:l,walletClientType:s,connectorType:c})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};var I0=require("react");function M0(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkTelegram:w,linkFarcaster:v}=(0,I0.useContext)(Ue);return He("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkFarcaster:v,linkTelegram:w}}var W0=require("react");function O0(e){let{connectWallet:t}=(0,W0.useContext)(Ue);return He("connectWallet",e),{connectWallet:t}}var L0=require("react");function N0(e){let{createWallet:t}=(0,L0.useContext)(Ue);return He("createWallet",e),{createWallet:t}}var D0=e=>{He("fundWallet",e);let{fundWallet:t}=$();return{fundWallet:t}};var U0=()=>{let{embeddedSolanaWallet:e,createEmbeddedSolanaWallet:t}=W();return{createWallet:t,wallets:e?[e]:[]}};var F0=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=$();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};var B0=require("react");function H0(e){let{sendTransaction:t}=(0,B0.useContext)(Ue);return He("sendTransaction",e),{sendTransaction:t}}var G0=require("react");function V0(e){let{setWalletPassword:t}=(0,G0.useContext)(Ue);return He("setWalletPassword",e),{setWalletPassword:t}}var q0=require("react");function z0(e){let{setWalletRecovery:t}=(0,q0.useContext)(Ue);return He("setWalletRecovery",e),{setWalletRecovery:t}}var $0=require("react");function K0(e){let{signMessage:t}=(0,$0.useContext)(Ue);return He("signMessage",e),{signMessage:t}}var j0=require("react");function Y0(e){let{signTypedData:t}=(0,j0.useContext)(Ue);return He("signTypedData",e),{signTypedData:t}}var Z0=require("react");var Q0=()=>{let{isModalOpen:e}=(0,Z0.useContext)(Ue);return{isOpen:e}};var J0=require("react");function X0(e){let{getAccessToken:t}=(0,J0.useContext)(Ue);return He("accessToken",e),{getAccessToken:t}}function ew(e){let{authenticated:t,user:r}=$(),{initLoginWithOAuth:o}=W(),n=da();return He("oAuthAuthorization",e),{reauthorize:i=>l7(t,r,o,n,i.provider)}}var l7=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new b("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new b(`OAuth account of type ${n} not linked to the account.`);await r(n)};var tw=om;function om(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=$();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function rw(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function ow(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,LoginModal,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,getEmbeddedConnectedWallet,useConnectWallet,useCreateWallet,useCrossAppAccounts,useExperimentalFarcasterSigner,useFarcasterSigner,useFundWallet,useLinkAccount,useLinkWithSiwe,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,useOAuthTokens,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSetWalletRecovery,useSignMessage,useSignTypedData,useSolanaWallets,useToken,useWallets});
3337
+ `;var nl=require("react"),u0=require("react/jsx-runtime");function n7({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function p0(e){let t=(0,nl.useRef)(null),r=(0,nl.useRef)();return(0,nl.useEffect)(()=>{r.current?.remove(),r.current=n7(e),t.current?.after(r.current)},[e]),(0,u0.jsx)("div",{ref:t,hidden:!0})}var m0=require("react"),ts=require("react");var ep=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;case"privy:solana-wallet:create":return o;case"privy:solana-wallet:connect":return o;case"privy:solana-wallet:recover":return o;case"privy:solana-wallet:rpc":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function si(e,t,r,o,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Ze("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((u,w)=>{r.current={resolve:u,reject:w};let v=1e3*60*5;setTimeout(()=>{let g=new Ze("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),w(g)},v)});return await e(f)}return await e()},s=4,c=null;for(let m=0;m<s;m++)try{c=await l(m),o.current?.resolve(void 0);break}catch(f){if(f.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),f}if(c===null){let m=new Ze("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(m),m}return c}var h0=require("react/jsx-runtime"),i7=function(e){return()=>`id-${e++}`}(0);function a7(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function zt(e){return e.error!==void 0}var Nt=new ep,em=new Map,s7=(e,t)=>typeof t=="bigint"?t.toString():t,l7=(e,t)=>`${e}${JSON.stringify(t,s7)}`;function $t(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=l7(e,t);if(e==="privy:wallet:create"){let l=em.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=i7();Nt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{em.delete(i)});return em.set(i,a),a}function c7(e){switch(e.event){case"privy:iframe:ready":let t=Nt.dequeue(e.event,e.id);return zt(e)?t.reject(new Ze(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=Nt.dequeue(e.event,e.id);return zt(e)?r.reject(new Ze(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=Nt.dequeue(e.event,e.id);return zt(e)?o.reject(new Ze(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=Nt.dequeue(e.event,e.id);return zt(e)?n.reject(new Ze(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let i=Nt.dequeue(e.event,e.id);return zt(e)?i.reject(new Ze(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let a=Nt.dequeue(e.event,e.id);return zt(e)?a.reject(new Ze(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery":let l=Nt.dequeue(e.event,e.id);return zt(e)?l.reject(new Ze(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:verify":let s=Nt.dequeue(e.event,e.id);return zt(e)?s.reject(new Ze(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:init-enrollment":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:submit-enrollment":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:unenroll":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:clear":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:init-signer":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:sign":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:solana-wallet:create":let c=Nt.dequeue(e.event,e.id);return zt(e)?c.reject(new Ze(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let m=Nt.dequeue(e.event,e.id);return zt(e)?m.reject(new Ze(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=Nt.dequeue(e.event,e.id);return zt(e)?f.reject(new Ze(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let u=Nt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function f0(e){let t=(0,ts.useRef)(null),r=(0,ts.useRef)(e.mfaMethods),o=ua(),[n,i]=(0,m0.useState)(!1);return(0,ts.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,ts.useEffect)(()=>{if(!n)return;let a=t.current;if(!a)return;function l(u){u&&u.origin===e.origin&&a7(u.data)&&c7(u.data)}let s={create(u){return $t("privy:wallet:create",u,a,e.origin)},import(u){return $t("privy:wallet:import",u,a,e.origin)},connect(u){return $t("privy:wallet:connect",u,a,e.origin)},recover(u){return si(w=>$t("privy:wallet:recover",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!u.recoveryMethod||u.recoveryMethod==="privy")},rpc(u){return si(w=>$t("privy:wallet:rpc",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(u){return $t("privy:solana-wallet:create",u,a,e.origin)},connectSolana(u){return $t("privy:solana-wallet:connect",u,a,e.origin)},recoverSolana(u){return $t("privy:solana-wallet:recover",u,a,e.origin)},rpcSolana(u){return $t("privy:solana-wallet:rpc",u,a,e.origin)},setRecovery(u){return si(w=>$t("privy:wallet:set-recovery",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return si(w=>$t("privy:mfa:verify",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return si(w=>$t("privy:mfa:init-enrollment",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return si(w=>$t("privy:mfa:submit-enrollment",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(u){return si(w=>$t("privy:mfa:unenroll",{...u,...w},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(u){return $t("privy:mfa:clear",u,a,e.origin)},initFarcasterSigner(u){return $t("privy:farcaster:init-signer",u,a,e.origin)},signFarcasterMessage(u){return $t("privy:farcaster:sign",u,a,e.origin)}};window.addEventListener("message",l);let c=()=>e.onLoad(s),m=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},f=new AbortController;return ns(()=>$t("privy:iframe:ready",{},a,e.origin),{abortSignal:f.signal}).then(c,m),()=>{window.removeEventListener("message",l),f.abort()}},[n]),(0,h0.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:Pl(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var tp=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return await g0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await Ie())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await y0())throw new b("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};async function v0({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new b("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",m)}let s,c=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(c),clearTimeout(a),n(new b("User rejected request")))},300);function m(f){f.data&&(f.data.type==="PRIVY_OAUTH_RESPONSE"&&f.data.stateCode&&f.data.authorizationCode&&(clearTimeout(a),o(f.data),l()),f.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new b(f.data.error)),l()),f.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=m))}window.addEventListener("message",m)})}var d7="https://cdn.apple-cloudkit.com";async function tm({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,i)=>{function a(){t?.close(),window.removeEventListener("message",l)}function l(s){s.data&&(s.data.type==="PRIVY_OAUTH_RESPONSE"&&s.data.stateCode&&s.data.authorizationCode&&(n(s.data),a()),s.origin===d7&&s.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:s.data.ckSession}),a()),s.data.type==="PRIVY_OAUTH_ERROR"&&(i(s.data.error),a()))}window.addEventListener("message",l)})}var C0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});var tr=require("react/jsx-runtime"),nn;function p7(e){return typeof e=="string"&&e.length===25}function Ie(){if(!nn){let e=X.get(ci);return Promise.resolve(e||null)}return nn.getAccessToken()}var E0,Vf=(e,t,r)=>E0(e,t,r),T0,qf=(e,t)=>T0(e,t),S0,zf=(e,t)=>S0(e,t),_0,$f=()=>_0(),P0,y0=()=>P0(),A0,g0=({message:e})=>A0({message:e}),u7=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(ss,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},x0=({config:e,...t})=>{if(!p7(t.appId))throw new b("Cannot initialize the Privy provider with an invalid Privy app ID");nn||(nn=new da({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,tr.jsx)(Uh,{client:nn,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,tr.jsx)(m7,{...t,client:nn})})},m7=e=>{let t=e.client,[r,o]=(0,ve.useState)(!1),[n,i]=(0,ve.useState)(!1),[a,l]=(0,ve.useState)(!1),[s,c]=(0,ve.useState)(null),[m,f]=(0,ve.useState)([]),[u,w]=(0,ve.useState)(null),v=(0,ve.useRef)(m),[g,E]=(0,ve.useState)(!1),[S,R]=(0,ve.useState)(null),[_,k]=(0,ve.useState)(!1),[I,M]=(0,ve.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:T}),[U,G]=(0,ve.useState)({status:"initial"}),[Y,Z]=(0,ve.useState)(null),[L,F]=(0,ve.useState)(null),O=dt(),Me=rc(),[je,Q]=(0,ve.useState)(!0),[re,ie]=(0,ve.useState)({}),[Fe,De]=(0,ve.useState)(null),[ut,lt]=(0,ve.useState)(null),[Dt,at]=(0,ve.useState)(!1),[ge,Cr]=(0,ve.useState)(!1),vo=(0,ve.useRef)(null),No=(0,ve.useRef)(null),N=(0,ve.useRef)(ry),[_t,Co]=(0,ve.useState)(!1);t.onStoreToken=d=>{d&&B(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),B(N,"accessToken","onAccessTokenRemoved")};let V=(0,ve.useRef)(null),q=(0,ve.useRef)(null),he=d=>{R(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},Mt=d=>{O.embeddedWallets.createOnLogin!=="off"&&Q(!0),he(d)};(0,ve.useEffect)(()=>{let d=vi(s);if(!d||!L)return;let p={address:d.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:On,id:"io.privy.solana.wallet"},getProvider:async()=>new tp(L,d.address)};w(p)},[L,s]),(0,ve.useEffect)(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=ke(s),p=Yl(s);if(d||t.connectors?.removeEmbeddedWalletConnector(),p||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!L){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}d&&t.connectors.addEmbeddedWalletConnector(L,d.address,O.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,O.defaultChain,e.appId)},[L,s]),(0,ve.useEffect)(()=>{L&&ut?.(L)},[L]),(0,ve.useEffect)(()=>{(async()=>{if(!O.customAuth?.enabled)return;Q(!0);let{getCustomAccessToken:p,isLoading:h}=O.customAuth;if(!(!n||h))try{let C=await p();if(!C&&a){await Vi.logout();return}if(!C||a)return;t.startAuthFlow(new zi(C));let{user:A,isNewUser:D}=await t.authenticate();if(!A){await Vi.logout();return}c(A||null),E(D||!1),l(!0),Cr(!0)}catch(C){console.warn(C),a&&await Vi.logout()}})()},[O.customAuth?.enabled,O.customAuth?.getCustomAccessToken,O.customAuth?.isLoading,n,a]),(0,ve.useEffect)(()=>{ge&&L&&s&&Sr(s,O.embeddedWallets.createOnLogin)&&(Cr(!1),sm(s,ji).catch(console.error))},[ge&&L&&s]),(0,ve.useEffect)(()=>{async function d(){let p=os(),h=al();u7();let C=(0,w0.createStore)();t.initializeConnectorManager({walletConnectCloudProjectId:O.walletConnectCloudProjectId,rpcConfig:O.rpcConfig,chains:O.chains,defaultChain:O.defaultChain,store:C,walletList:O.appearance.walletList,shouldEnforceDefaultChainOnConnect:O.shouldEnforceDefaultChainOnConnect,externalWalletConfig:O.externalWallets,appName:O.name??"Privy"});let A;t.connectors?.on("connectorInitialized",()=>{A&&clearTimeout(A);let Ae=t.connectors.walletConnectors.length,ce=t.connectors.walletConnectors.reduce((yt,Be)=>yt+(Be.initialized?1:0),0);ce===Ae?Co(!0):A=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:ce,expected:Ae}),Co(!0)},1500)}),t.connectors?.initialize().then(()=>{pw()});let D=await t.getAuthenticatedUser(),j=!!D;if(O.customAuth?.enabled||(l(!!D),D&&B(N,"login","onComplete",D,!1,!0,null,null),c(D)),p){q.current=j?"link":"login";return}if(h&&!j){q.current="login",Mt("TELEGRAM_AUTH_SCREEN");return}pe.setReadyToTrue(!!D)}!n&&Me&&d()},[t,Fe,n,Me]),(0,ve.useEffect)(()=>{if(!n)return;if(!s){at(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){at(!0);return}let p=!!m.find(h=>h.walletClientType==="privy");at(p)},[n,s,m]);let os=()=>{let d=fs();if(d.inProgress&&d.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if(d.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode});return}let p="privy:";function h(C){return C.startsWith(p)}return d.inProgress&&h(d.provider)&&!d.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode}),window.close()),!d.inProgress||d.headless?!1:(t.startAuthFlow(new Uo(d)),Mt("AWAITING_OAUTH_SCREEN"),!0)},al=()=>{let d=Ff();if(!d||!O.loginMethods.telegram||!O.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Ji;return t.startAuthFlow(p),d.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:d.id,first_name:d.first_name,last_name:d.last_name,auth_date:d.auth_date,username:d.username,photo_url:d.photo_url,hash:d.hash}),d.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:d.query_id,user:d.user,auth_date:d.auth_date,hash:d.hash}),!0},dw=async(d,p,h,C)=>{let A=await t.connectors?.createWalletConnector(d,p)||null;op(A,p,h,C)};async function op(d,p,h,C){if(d)M({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:T});else return M({status:"disconnected",connectedWallet:null,connectError:new we("Unable to connect to wallet."),connector:null,connectRetry:T}),C?.(null,h);d instanceof So&&p&&await d.resetConnection(p),M({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>op(d,p,h,C)});try{let A=await d.connect({showPrompt:!0});if(O.shouldEnforceDefaultChainOnConnect&&!O.chains.find(D=>D.id===Number(A?.chainId.replace("eip155:","")))&&!(A?.connectorType==="wallet_connect_v2"&&A?.walletClientType==="metamask")){M(D=>({...D,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:T}));try{await A?.switchChain(O.defaultChain.id),A&&(A.chainId=Ki(li(O.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${O.defaultChain.id}`)}}return M(D=>({...D,status:"connected",connectedWallet:A,connectError:null,connectRetry:T})),A&&B(N,"connectWallet","onSuccess",A),C?.(A,h)}catch(A){return A instanceof wt?(console.warn(A.cause?A.cause:A.message),B(N,"connectWallet","onError",A.privyErrorCode||"generic_connect_wallet_error")):(console.warn(A),B(N,"connectWallet","onError","unknown_connect_wallet_error")),M(D=>({...D,status:"disconnected",connectedWallet:null,connectError:A})),C?.(null,h)}}let sl=async(d,p)=>{if(d===null)return;let h=new ln(d,t,p);t.startAuthFlow(h)},pw=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),h=d.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!xn()&&Mt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new b("Connector not initialized");he("AWAITING_CONNECTION");let C=new URL(window.location.href);C.searchParams.delete("privy_connector"),C.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",C),dw(p,h,void 0,sl)};(0,ve.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let Pt=d=>{if(!a)throw B(N,"linkAccount","onError","must_be_authenticated",{linkMethod:d}),new b("User must be authenticated before linking an account.")},am=()=>{Pt("siwe"),V.current="siwe",q.current="link",he("LINK_WALLET_SCREEN")},uw=d=>{if(!a||!s)return!1;if(d.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},mw=async d=>{if(!t.connectors)throw new b("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(M(h=>({...h,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:T})),O.captchaEnabled&&!a){let h={callback:C=>sl(d,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};ie({captchaModalData:h}),Mt("CAPTCHA_SCREEN")}else await sl(d),Mt("AWAITING_CONNECTION")},fw=async(d,p)=>{let{signedUrl:h,externalTransactionId:C}=await $2(t,d,p??{},O.appearance.palette,O.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:C}},ll=()=>{f(d=>{let p=t.connectors?.wallets.map(h=>({...h,linked:uw(h),loginOrLink:async()=>{if(!await h.isConnected())throw new b("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new b("Cannot link or login with embedded wallet");mw(h)},fund:async C=>{await pe.fundWallet(h.address,C)},unlink:async()=>{if(!a)throw new b("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new b("Cannot unlink an embedded wallet");let C=await t.unlinkWallet(h.address);c(C)}}))||[];return Zl(d,p)?d:p})};(0,ve.useEffect)(()=>{ll()},[s?.linkedAccounts,a,n]),(0,ve.useEffect)(()=>{if(n){if(!t.connectors)throw new b("Connector not initialized");ll(),t.connectors.on("walletsUpdated",ll)}},[n]);let hw=d=>{if(d&&"suggestedAddress"in d&&d.suggestedAddress){let p=(0,on.getAddress)(d.suggestedAddress);Z(p)}he(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,ve.useEffect)(()=>{if(!m[0])return;let d=m[0],p=v.current.find(C=>C.address===d.address),h;if(d.walletClientType==="privy"?h=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType==="privy"):h=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType!=="privy"),!p&&h){let C=Object.assign({},s);C.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(C)}v.current=m},[m]);let sm=async(d,p)=>{if(ke(d))throw B(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[C,A]=await Promise.all([pe.initializeWalletProxy(p),Ie()]);if(!C&&O.customAuth?.enabled)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!C||!A||O.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((D,j)=>{Q(!0),ie({createWallet:{onSuccess:ce=>{B(N,"createWallet","onSuccess",ce),D(ce)},onFailure:ce=>{B(N,"createWallet","onError","unknown_embedded_wallet_error"),j(ce)},callAuthOnSuccessOnClose:!1}}),he("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await C.create({accessToken:A});let D=await pe.refreshUser(),j=ke(D);if(!j)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return B(N,"createWallet","onSuccess",j),j}},yw=d=>{if(!O.chains.map(p=>p.id).includes(d))throw new we(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},lm=(d,p,h)=>new Promise(async(C,A)=>{let{requesterAppId:D}=p||{};if(!a||!s){B(N,"sendTransaction","onError","must_be_authenticated"),A(new Error("User must be authenticated before signing with a Privy wallet"));return}let j=d.from,Ae=j?s?.linkedAccounts.find(gt=>gt.type==="wallet"&&gt.walletClientType==="privy"&&(0,on.getAddress)(gt.address)===(0,on.getAddress)(j)):ke(s);if(!Ae){B(N,"sendTransaction","onError","embedded_wallet_not_found"),A(new Error("Must have a Privy wallet before signing"));return}Q(!0);let ce=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,yt=d.chainId?Number(d.chainId):ce.chainId;yw(yt);let Be=Object.assign({},d,{chainId:yt}),br=async()=>{let gt=await Ie();if(!gt||!L){B(N,"sendTransaction","onError","embedded_wallet_not_found"),A(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await pe.recoverEmbeddedEthereumWallet()){B(N,"sendTransaction","onError","unknown_connect_wallet_error"),A(new Error("Unable to connect to wallet"));return}let qi=Er(Be.chainId,O.chains,O.rpcConfig,{appId:e.appId}),Do=await(0,rs.populateTransactionRequest)(Ae.address,Be,qi);if(O.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:Cw}=await(0,rs.calculateTotalGasEstimate)(Do,qi),{hasSufficientFunds:ww}=await La(Ae.address,Do,Cw,qi);if(!ww)throw new Kt(new io("Wallet has insufficient funds for this transaction.",rs.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let mm=await Kc(gt,Ae.address,L,Do,qi,D);B(N,"sendTransaction","onSuccess",mm),C(mm)}catch(dl){B(N,"sendTransaction","onError","transaction_failure"),A(dl)}};if(O.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),br();else{let gt={transactionRequest:Be,onSuccess:Do=>{B(N,"sendTransaction","onSuccess",Do),C(Do)},onFailure:Do=>{B(N,"sendTransaction","onError","transaction_failure"),A(Do)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:D},dl={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:Do=>{B(N,"sendTransaction","onError","unknown_connect_wallet_error"),A(Do)}},qi=pm({address:Ae.address,fundWalletConfig:h,chainIdOverride:Be.chainId,comingFromSendTransactionScreen:!0});ie({connectWallet:dl,sendTransaction:gt,funding:qi}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function cm(){return new Promise(async(d,p)=>{let h=await Ie();if(!h||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:h}),d()}catch(C){p(C)}})}let dm=d=>d?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],wr=d=>{let p=s?.linkedAccounts.filter(A=>A.type===d).length??0,{displayName:h,loginMethod:C}=ti(d);if(d==="passkey"&&p>=5||d!=="passkey"&&p>=1)throw B(N,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:C}),new b(`User already has an account of type ${h} linked.`)},gw=()=>{if(!O.loginConfig.telegramAuthConfiguration?.linkEnabled)throw B(N,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:"telegram"}),new b("User can't link an account because Telegram linking is disabled.")},pm=({address:d,fundWalletConfig:p,methodScreen:h,chainIdOverride:C=null,comingFromSendTransactionScreen:A=!1})=>{if(!O.fundingConfig||O.fundingConfig.methods.length===0)return;let D=pd(p)&&p.amount?p.amount:O.fundingConfig.defaultRecommendedAmount,j=pd(p)&&p.chain?p.chain.id:Da(O.fundingConfig.defaultRecommendedCurrency.chain),Ae=pd(p)&&p.chain?p.chain:O.chains.find(ce=>ce.id===j);if(C&&O.chains.find(ce=>ce.id===C)&&(Ae=O.chains.find(ce=>ce.id===C)),!Ae)throw new b("Funding chain is not in PrivyProvider chains list");return{address:d,amount:D,chain:Ae,methodScreen:h,comingFromSendTransactionScreen:A,...z2(p)?{moonpayConfigOverride:p.config}:{}}};async function um({legacySetWalletPasswordFlow:d=!1}){R(null);let p=d?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw B(N,p,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let h=ke(s);if(!h||!L)throw B(N,p,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(vi(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await cm()}catch(A){throw B(N,p,"onError","missing_or_invalid_mfa"),A}return new Promise((A,D)=>{Q(!0);let j={onSuccess:Be=>{B(N,p,"onSuccess","user-passcode",Be),A(Be)},onFailure:Be=>{B(N,p,"onError","user_exited_set_password_flow"),D(Be)},callAuthOnSuccessOnClose:!1},Ae=h.recoveryMethod==="user-passcode",yt={onCompleteNavigateTo:Dc({walletAction:"update",availableRecoveryMethods:O.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:d,isResettingPassword:Ae}),shouldForceMFA:!1,onFailure:Be=>{B(N,p,"onError","unknown_connect_wallet_error"),D(Be)}};ie({setWalletPassword:j,createWallet:j,connectWallet:yt,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Ae}}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function cl({appId:d}){Pt(`privy:${d}`),V.current=`privy:${d}`,q.current="link";let p=window.open(void 0,void 0,Ds({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{appId:d}}),new Promise(async(h,C)=>{let{name:A,logoUrl:D}=await Xc({api:t.api,providerAppId:d,requesterAppId:O.id});ie({crossAppAuth:{appId:d,name:A,logoUrl:D,popup:p,onSuccess:h,onError:C}}),Mt("CROSS_APP_AUTH_SCREEN")})}let Vi={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:hw,importWallet:async({privateKey:d})=>{Pt("siwe");let[p,h]=await Promise.all([pe.initializeWalletProxy(15e3),Ie()]);if(p&&h){await p.import({privateKey:d,accessToken:h});let C=await pe.refreshUser(),A=Yl(C);if(!A)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return B(N,"createWallet","onSuccess",A),A}else throw new b("User is not authenticated")},linkWallet:am,linkCrossAppAccount:cl,linkEmail:()=>{Pt("email"),wr("email"),V.current="email",q.current="link",he("LINK_EMAIL_SCREEN")},linkPhone:()=>{Pt("sms"),wr("phone"),V.current="sms",q.current="link",he("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Pt("google"),wr("google_oauth"),q.current="link",await pe.initLoginWithOAuth("google")},linkTwitter:async()=>{Pt("twitter"),wr("twitter_oauth"),q.current="link",await pe.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Pt("discord"),wr("discord_oauth"),q.current="link",await pe.initLoginWithOAuth("discord")},linkGithub:async()=>{Pt("github"),wr("github_oauth"),q.current="link",await pe.initLoginWithOAuth("github")},linkSpotify:async()=>{Pt("spotify"),wr("spotify_oauth"),q.current="link",await pe.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Pt("instagram"),wr("instagram_oauth"),q.current="link",await pe.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Pt("tiktok"),wr("tiktok_oauth"),q.current="link",await pe.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Pt("linkedin"),wr("linkedin_oauth"),q.current="link",await pe.initLoginWithOAuth("linkedin")},linkApple:async()=>{Pt("apple"),wr("apple_oauth"),q.current="link",await pe.initLoginWithOAuth("apple")},linkPasskey:async()=>{Pt("passkey"),wr("passkey"),await pe.initLinkWithPasskey(),he("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{Pt("telegram"),wr("telegram"),gw(),q.current="link",V.current="telegram",await pe.initLoginWithTelegram(),he("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{Pt("farcaster"),wr("farcaster"),await pe.initLoginWithFarcaster(),q.current="link",V.current="farcaster",he("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Pt("email"),!s?.email)throw new b("User does not have an email linked to their account.");q.current="link",V.current="email",he("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(Pt("sms"),!s?.phone)throw new b("User does not have a phone number linked to their account.");q.current="link",V.current="sms",he("UPDATE_PHONE_SCREEN")},login:async d=>{d&&"target"in d&&d&&(d=void 0);let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let h=await new Promise(C=>{De(A=>C.bind(A))});if(De(null),h){console.warn(p);return}}if(a){console.warn(p);return}q.current="login",ie({login:d}),Mt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{De(()=>d)}),De(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(m[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}Mt("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),R(null),await t.logout(),s&&L)try{await L.clearMfa({userId:s.id})}catch{}c(null),l(!1),B(N,"logout","onSuccess"),q.current=null,V.current=null,o(!1),X.del(ls)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new ct;let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(C=>C.address===d?.address));return!d||!p?new ct:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new rp.Web3Provider(new bo(new ct));let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(C=>C.address===d?.address));return!d||!p?new rp.Web3Provider(new bo(new ct)):new rp.Web3Provider(new bo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Wn(new ct);let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(C=>C.address===d?.address));return!d||!p?new Wn(new ct):new Wn(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkInstagram:async d=>{let p=await t.unlinkOAuth("instagram",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},unlinkTelegram:async d=>{let p=await t.unlinkTelegram(d);return c(p),p},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},unlinkCrossAppAccount:async({subject:d})=>{let p=s?.linkedAccounts.find(C=>C.type==="cross_app"&&C.subject===d)?.providerApp;if(!p)throw new b("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,d);return c(h),h},setActiveWallet:async d=>{let p=m.find(C=>(0,on.getAddress)(C.address)===(0,on.getAddress)(d)),h=s?.linkedAccounts.find(C=>C.type==="wallet"&&(0,on.getAddress)(C.address)===(0,on.getAddress)(d));if(!p||!await p.isConnected())Z(d),am();else if(!p.linked)p.loginOrLink();else{let C=Object.assign({},s);C.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(C)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw B(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return sm(s,15e3)},setWalletRecovery:async()=>um({legacySetWalletPasswordFlow:!1}),setWalletPassword:async()=>um({legacySetWalletPasswordFlow:!0}),signMessage:(d,p,h)=>new Promise(async(C,A)=>{let{requesterAppId:D}=p||{};if(!a||!s){B(N,"signMessage","onError","must_be_authenticated"),A(new Error("User must be authenticated before signing with a Privy wallet"));return}let j=h?s?.linkedAccounts.find(ce=>ce.type==="wallet"&&ce.walletClientType==="privy"&&(0,on.getAddress)(ce.address)===(0,on.getAddress)(h)):ke(s);if(!j){B(N,"signMessage","onError","embedded_wallet_not_found"),A(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){B(N,"signMessage","onError","invalid_message"),A(new Error("Message must be a non-empty string"));return}Q(!0);let Ae=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ce=await Ie();if(!L||!ce)throw new Error("Unable to connect to wallet");if(!await pe.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:j.address,requesterAppId:D}});let{response:Be}=await L.rpc({accessToken:ce,address:j.address,requesterAppId:D,request:{method:"personal_sign",params:[d,j.address]}}),br=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:j.address,requesterAppId:D}}),br};if(O.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ce=await Ae();B(N,"signMessage","onSuccess",ce),C(ce)}catch(ce){B(N,"signMessage","onError","unable_to_sign"),A(ce??new Kt("Unable to sign message"))}}else{let Be={method:"personal_sign",data:d,confirmAndSign:Ae,onSuccess:gt=>{B(N,"signMessage","onSuccess",gt),C(gt)},onFailure:gt=>{B(N,"signMessage","onError","unable_to_sign"),A(gt)},uiOptions:p||{}},br={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:gt=>{B(N,"signMessage","onError","unknown_connect_wallet_error"),A(gt)},address:j.address};ie({signMessage:Be,connectWallet:br}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(h,C)=>{let{requesterAppId:A}=p||{};if(!a||!s){B(N,"signTypedData","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let D=ke(s);if(!D){B(N,"signTypedData","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}Q(!0);let j=is(d),Ae=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ce=await Ie();if(!L||!ce)throw new Error("Unable to connect to wallet");if(!await pe.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:D.address,requesterAppId:A}});let{response:Be}=await L.rpc({accessToken:ce,address:D.address,requesterAppId:A,request:{method:"eth_signTypedData_v4",params:[D.address,j]}}),br=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:D.address,requesterAppId:A}}),br};if(O.embeddedWallets.noPromptOnSignature||(O.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ce=await Ae();B(N,"signTypedData","onSuccess",ce),h(ce)}catch(ce){B(N,"signTypedData","onError","unable_to_sign"),C(ce??new Kt("Unable to sign message"))}}else{let Be={method:"eth_signTypedData_v4",data:j,confirmAndSign:Ae,onSuccess:gt=>{B(N,"signTypedData","onSuccess",gt),h(gt)},onFailure:gt=>{B(N,"signTypedData","onError","unable_to_sign"),C(gt)},uiOptions:p||{}},br={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:gt=>{B(N,"signMessage","onError","unknown_connect_wallet_error"),C(gt)}};ie({signMessage:Be,connectWallet:br}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,h)=>{let A=await(await lm(d,p,h)).wait();return jc(A)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!ke(s)){p(new Error("Must have a Privy wallet before exporting"));return}Q(!0);let C={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p,shouldForceMFA:!0};if(ie(re),!await Ie()||!L){p(new Error("Must have valid access token to enroll in MFA"));return}if(!L){p(new Error("Must have a Privy wallet before exporting"));return}let D={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,onSuccess:d,onFailure:p};ie({keyExport:D,connectWallet:C}),he("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:cm,async init(d){switch(d){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${d}`)}},async submit(d,p){switch(d){case"totp":case"sms":if(typeof p!="string")throw new b("Invalid MFA code");vo.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((D,j)=>{No.current={resolve:D,reject:j}});break;case"passkey":if(typeof p=="string")throw new b("Invalid authenticator response");let C=await(await import("@simplewebauthn/browser")).startAuthentication(p),A=C0(C);vo.current?.resolve({mfaMethod:d,mfaCode:A,relyingParty:window.origin}),await new Promise((D,j)=>{No.current={resolve:D,reject:j}});break;default:throw vo.current?.reject(new b("Unsupported MFA method")),new b(`Unsupported MFA method: ${d}`)}},cancel(){vo.current?.reject(new b("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,h)=>{if(!d){pe.closePrivyModal(),p();return}O.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),ie({mfaEnrollmentFlow:{mfaMethods:O.mfa.methods,onSuccess:p,onFailure:h}}),he("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ie();if(!d||!L)throw new Error("Must have valid access token to enroll in MFA");let p=await L.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async submitEnrollmentWithTotp(d){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:d}){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:d});let h=await t.getAuthenticatedUser();c(h)},async unenroll(d){let p=await Ie();if(!p||!L)throw new Error("Must have valid access token to remove MFA");d==="passkey"?await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await L.unenrollMfa({method:d,accessToken:p});let h=await t.getAuthenticatedUser();c(h)},requestFarcasterSignerFromWarpcast:async()=>{let d=await Ie(),p=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await pe.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let C=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(C.status==="approved"){let A=await t.getAuthenticatedUser();c(A||s||null)}ie({farcasterSigner:C}),he("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let d=await Ie(),p=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await pe.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(A=>Uint8Array.from(A.match(/.{1,2}/g).map(D=>parseInt(D,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async d=>{let p=await Ie(),h=s?.linkedAccounts.find(j=>j.type==="wallet"&&j.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await pe.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let A=await import("@simplewebauthn/browser"),D=await L.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:A.bufferToBase64URLString(d)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(A.base64URLStringToBuffer(D.signature))},isHeadlessOAuthLoading:_,loginWithCode(d){return pe.loginWithCode(d)},initLoginWithEmail(d){return pe.initLoginWithEmail(d)},initLoginWithSms(d){return pe.initLoginWithSms(d)},otpState:U,fundWallet(d,p){return pe.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return pe.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return pe.loginWithHeadlessOAuth(d)},generateSiweMessage({address:d,chainId:p}){return pe.generateSiweMessage({address:d,chainId:p})},linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:C,connectorType:A}){return Pt("siwe"),pe.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:C,connectorType:A})},signMessageWithCrossAppWallet(d,{address:p}){return ed({user:s,client:t,address:p,requesterAppId:O.id,request:{method:"personal_sign",params:[d,p]},reconnect:cl})},signTypedDataWithCrossAppWallet(d,{address:p}){let h=is(d);return ed({user:s,client:t,address:p,requesterAppId:O.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:cl})},sendTransactionWithCrossAppWallet(d,{address:p}){return ed({user:s,client:t,address:p,requesterAppId:O.id,request:{method:"eth_sendTransaction",params:[d]},reconnect:cl})},isModalOpen:r,mfaMethods:O.mfa.methods};E0=Vi.signMessage,T0=Vi.signTypedData,S0=async(...d)=>{let p=await lm(...d);return O.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let pe=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:Y,pendingTransaction:null,walletConnectionStatus:I,connectors:t.connectors?.walletConnectors??[],rpcConfig:O.rpcConfig,chains:O.chains,appId:e.appId,showFiatPrices:O.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>O.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(L)return L;let p=new Promise(A=>{lt(()=>D=>A(D))}),h=new Promise(A=>setTimeout(()=>A(null),d)),C=await Promise.race([p,h]);return lt(null),C},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;if(p&&V.current&&(h=dm(s)),q.current==="login"?d.shouldCallAuthOnSuccess&&p&&V.current?(B(N,"login","onComplete",s,g,!1,V.current,h??null),e.onSuccess?.(s,g)):B(N,"login","onError","exited_auth_flow"):q.current==="link"&&h&&(d.isSuccess&&p&&V.current?B(N,"linkAccount","onSuccess",s,V.current,h):V.current&&B(N,"linkAccount","onError","exited_link_flow",{linkMethod:V.current})),S&&P3.includes(S)&&re.funding){let C=A3[S]??null,A=Er(re.funding.chain.id,O.chains,O.rpcConfig,{appId:e.appId}),D;try{D=(await A.getBalance(re.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}B(N,"fundWallet","onUserExited",{address:re.funding.address,chain:re.funding.chain,fundingMethod:C,balance:D})}Z(null),q.current=null,V.current=null,E(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:d})=>new Promise(async(p,h)=>{let C=async()=>{let A=await t.getAccessToken();if(!A)throw new Error("User must be authenticated to use their embedded wallet.");if(!u)throw new Error("User must have an embedded Solana wallet to sign messages for Solana.");let D=pe.walletProxy??await pe.initializeWalletProxy(15e3);if(!D)throw new Error("Failed to initialize embedded wallet proxy.");let{response:j}=await D.rpcSolana({accessToken:A,publicKey:u.address,request:{method:"signMessage",params:{message:d}}});return j.data.signature};if(O.embeddedWallets.noPromptOnSignature)try{let A=await C();p({signature:A})}catch(A){h(A)}else ie({signMessage:{method:"solana_signMessage",data:d,confirmAndSign:C,onSuccess:Ae=>{p({signature:Ae})},onFailure:Ae=>{h(Ae)},uiOptions:{}}}),Mt("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:he,connectWallet:op,initLoginWithWallet:async(d,p)=>{V.current="siwe",sl(d,p)},loginWithWallet:async()=>{if(!n)throw new an;if(!(t.authFlow instanceof ln))throw new b("Must initialize SIWE flow first.");let d,p;if(a)try{({user:d}=await t.link()),V.current="siwe"}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),V.current="siwe"}catch(h){throw B(N,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||s||null),E(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new as(d);t.startAuthFlow(p);try{V.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw q.current==="login"?B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new an;if(!(t.authFlow instanceof as))throw new b("Must initialize Farcaster flow first.");let d,p;if(a)try{({user:d}=await t.link()),V.current="farcaster"}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),V.current="farcaster"}catch(h){throw B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d||null),E(p||!1),l(!0)},async crossAppAuthFlow({appId:d,popup:p}){let h=`privy:${d}`;V.current=h;let{url:C,stateCode:A,codeVerifier:D}=await Z1({api:t.api,appId:d});if(!C)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:d}}),new b("No authorization URL returned for cross-app auth.");try{let j=await v0({url:C,popup:p,provider:h}),Ae=j.stateCode,ce=j.authorizationCode;if(Ae!==A)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:A??"",returnedStateCode:Ae??""}}),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let yt=await Q1({api:nn.api,appId:d,codeVerifier:D,stateCode:Ae,authorizationCode:ce});yt&&t.storeProviderAccessToken(d,yt);let Be=await pe.refreshUser();if(!Be)throw new b("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{appId:d}}),Be}catch(j){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:j.toString(),provider:h}}),j}},async initLoginWithOAuth(d,p){if(V.current=d,sp()){if(d==="google"&&ga(window.navigator.userAgent)){Mt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Mt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}d==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),X.del(ui);let h=new Uo({provider:d});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let C=await t.authFlow.getAuthorizationUrl();C&&C.url&&(d==="twitter"&&b0.isAndroid&&(C.url=C.url.replace("x.com","twitter.com")),window.location.assign(C.url))},async initLoginWithTelegram(d){if(!n)throw new an;V.current="telegram";let p=new Ji(d);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,C)=>{if(!O.loginConfig.telegramAuthConfiguration)return C(new b("Telegram Auth configuration is not loaded"));if(!window.Telegram)return C(new b("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:O.loginConfig.telegramAuthConfiguration.botId,request_access:!0},A=>A?h(A):C(new b("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Ji))throw new b("Must initialize Telegram flow before calling loginWithTelegram");let d,p;if(a)try{({user:d}=await t.link()),V.current="telegram"}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else try{let h=await t.authenticate();d=h.user,p=h.isNewUser,V.current="telegram"}catch(h){throw q.current==="login"?B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}c(d),E(p||!1),l(!0)},async recoveryOAuthFlow(d,p,h){let C,A;function D(j){if(!j)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new b("Recovery OAuth failed")}switch(d){case"google-drive":{let{url:j,codeVerifier:Ae,stateCode:ce}=await ru({api:nn.api,provider:d});D(j);let yt,Be;try{let br=await tm({url:j,popup:h,provider:d});if(yt=br.stateCode,Be=br.authorizationCode,yt!==ce)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:ce??"",returnedStateCode:yt??""}}),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(br){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:br.toString(),provider:d}}),new b("Recovery OAuth failed")}[C,A]=await Promise.all([Ie(),hg({api:nn.api,provider:d,codeVerifier:Ae,stateCode:yt,authorizationCode:Be})]);break}case"icloud":{let{url:j}=await ru({api:nn.api,provider:d});D(j);let{ckWebAuthToken:Ae}=await tm({url:j,popup:h,provider:d});A=Ae,C=await Ie();break}}if(!L)throw new b("Cannot connect to wallet proxy");if(!C)throw new b("Unable to authorize user");switch(p){case"recover":let j=re.recoverWallet?.privyWallet?.address;if(!j)throw new b("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:j,recoveryMethod:d}}),await L.recover({address:j,accessToken:C,recoveryAccessToken:A,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:j,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:C,recoveryAccessToken:A,recoveryMethod:d});let Ae=await pe.refreshUser(),ce=ke(Ae);if(!ce)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:ce.address}}),B(N,"createWallet","onSuccess",ce);break;case"set-recovery":let yt=ke(s);if(!yt)throw B(N,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{recoveryMethod:d}}),await L.setRecovery({address:yt.address,accessToken:C,recoveryAccessToken:A,recoveryMethod:d});let Be=ke(await pe.refreshUser());if(!Be)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:yt.address,recoveryMethod:d}}),B(N,"setWalletRecovery","onSuccess",d,Be);break;default:throw new b("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof Uo))throw new b("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(di),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:h??""}}),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,A,D;if(a)try{let j=await t.link();C=j.user,D=j.oAuthTokens,V.current=d}catch(j){throw B(N,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account",{linkMethod:d}),j}else try{let j=await t.authenticate();C=j.user,A=j.isNewUser,D=j.oAuthTokens,V.current=d}catch(j){throw q.current==="login"?B(N,"login","onError",j.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account",{linkMethod:d}),j}return c(C),E(A||!1),l(!0),D&&C&&B(N,"oAuthAuthorization","onOAuthTokenGrant",D,{user:C}),D},async initLoginWithPasskey(d){let p=new gi(d);t.startAuthFlow(p),q.current="login";try{V.current="passkey",await p.initAuthenticationFlow()}catch(h){throw B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new an;if(!(t.authFlow instanceof gi))throw new b("Must initialize Passkey flow first.");if(V.current!=="passkey")throw new b("Must init login with Passkey flow first.");let d,p;try{V.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(h){throw B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d),E(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new gi(d);t.startAuthFlow(p),q.current="link",V.current="passkey";try{await p.initLinkFlow()}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new an;if(!(t.authFlow instanceof gi))throw new b("Must initialize Passkey flow first.");if(V.current!=="passkey")throw new b("Must init login with Passkey flow first.");let d;try{V.current="passkey",{user:d}=await t.link()}catch(p){throw B(N,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return c(d||s||null),d},async initLoginWithHeadlessOAuth(d,p){if(sp()){if(d==="google"&&ga(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let h=new Uo({provider:d,headless:!0});p&&h.addCaptchaToken(p);let C=await t.startAuthFlow(h).getAuthorizationUrl();C?.url&&window.location.assign(C.url)},async loginWithHeadlessOAuth(d){k(!0),t.startAuthFlow(new Uo(d));let p=X.get(di),h=d.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:h??""}}),k(!1),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,A;if(a)try{({user:C}=await t.link()),V.current=d.provider}catch(D){throw B(N,"linkAccount","onError",D.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),D}else try{({user:C,isNewUser:A}=await t.authenticate()),V.current=d.provider}catch(D){throw q.current==="login"?B(N,"login","onError",D.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",D.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),D}return c(C),E(A||!1),l(!0),k(!1),C??void 0},initLoginWithEmail:async(d,p)=>{let h=new An(d,p);t.startAuthFlow(h);try{V.current="email",await h.sendCodeEmail()}catch(C){throw q.current==="login"?B(N,"login","onError",C.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),C}},initUpdateEmail:async(d,p,h)=>{let C=new bl(d,p,h);t.startAuthFlow(C),await C.sendCodeEmail()},initUpdatePhone:async(d,p,h)=>{let C=new jl(d,p,h);t.startAuthFlow(C),await C.sendSmsCode()},initLoginWithSms:async(d,p)=>{G({status:"sending-code"});let h=new Rn(d,p);t.startAuthFlow(h);try{V.current="sms",await h.sendSmsCode(),G({status:"awaiting-code-input"})}catch(C){throw G({status:"error",error:C}),q.current==="login"?B(N,"login","onError",C.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),C}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(G({status:"submitting-code"}),!n){let C=new an;throw G({status:"error",error:C}),C}if(t.authFlow instanceof An)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof Rn)t.authFlow.meta.smsCode=d.trim();else{let C=new b("Must initialize a passwordless code flow first");throw G({status:"error",error:C}),C}await Ie();let p,h;if(q.current==="link")try{({user:p}=await t.link())}catch(C){throw G({status:"error",error:C}),B(N,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account",{linkMethod:V.current}),C}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(C){throw G({status:"error",error:C}),B(N,"login","onError",C.privyErrorCode||"unknown_auth_error"),C}c(p||s||null),E(h||!1),l(!0),G({status:"done"})},generateSiweMessage:async({address:d,chainId:p,captchaToken:h})=>{q.current="link",V.current="siwe";let C=await t.generateSiweNonce({address:d,captchaToken:h}),A=p.replace("eip155:","");return Kl({address:d,chainId:A,nonce:C})},linkWithSiwe:async({message:d,signature:p,chainId:h,walletClientType:C,connectorType:A})=>{let D;try{if(q.current!=="link"||V.current!=="siwe")throw new b("Must ensure no other auth flow is in progress other than the SIWE signature flow.");D=await t.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:C,connectorType:A}),D=await pe.refreshUser()??D;let j=dm(D);j&&B(N,"linkAccount","onSuccess",D,"siwe",j)}catch(j){throw B(N,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),q.current=null,V.current=null,j}c(D||s||null),q.current=null,V.current=null},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:L,createAnalyticsEvent:({eventName:d,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:d,payload:p,timestamp:h}),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedEthereumWallet:async()=>new Promise(async(d,p)=>{let h=ke(s)||Yl(s),C=await Ie();if(!C||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await L.connect({accessToken:C,address:h.address}),d(!0)}catch(A){if(Ai(A)&&h.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recover({address:h.address,accessToken:C,recoveryMethod:h.recoveryMethod})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:h.address}}),d(!0);else if(Ai(A)&&h.recoveryMethod!=="privy"){ie({recoverWallet:{privyWallet:h,onFailure:p,onSuccess:()=>d(!0)},recoveryOAuthStatus:{provider:h.recoveryMethod,action:"recover"}});let D=Uc(h.recoveryMethod);he(D)}else p(A)}}),embeddedSolanaWallet:u,createEmbeddedSolanaWallet:async()=>{Q(!0);let d=await Ie(),p=vi(s),h=ke(s);if(!s||!d)throw new b("User must be logged in to create a Solana wallet");if(p)throw new b("User already has an embedded Solana wallet.");if(h)if(h.recoveryMethod==="privy")await pe.recoverEmbeddedEthereumWallet();else throw new b("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let C=await pe.initializeWalletProxy(15e3);if(!C)throw new b("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await C.createSolana({accessToken:d,ethereumAddress:h?.address});let A=await pe.refreshUser(),D=vi(A);if(!D)throw new b("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:D.address}}),D}catch(A){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new b("Failed to create Solana embedded wallet with error ",A)}},recoverEmbeddedSolanaWallet:async()=>new Promise(async(d,p)=>{let h=vi(s),C=await Ie();if(!C||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await L.connectSolana({accessToken:C,publicKey:h.address}),d(!0)}catch(A){Ai(A)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recoverSolana({publicKey:h.address,accessToken:C})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),d(!0)):p(A)}}),getMoonpaySignedUrl:fw,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:d=>{i(!0),Fe?.(d)},updateWallets:()=>ll(),fundWallet:async(d,p)=>{if(!O.fundingConfig||O.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Vd({fundingMethods:O.fundingConfig.methods});ie({funding:pm({address:d,fundWalletConfig:p,methodScreen:h})}),he(h)},requestFarcasterSignerStatus:async d=>{let p=await Ie(),h=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let C=await t.requestFarcasterSignerStatus(d);if(C.status==="approved"){let A=await t.getAuthenticatedUser();c(A||s||null)}return C}}))();_0=pe.recoverEmbeddedEthereumWallet,P0=pe.recoverEmbeddedSolanaWallet,A0=pe.solanaSignMessage;let vw=(0,ve.useMemo)(()=>({wallets:m,ready:Dt&&_t}),[m,Dt,_t]);return(0,tr.jsx)(Ue.Provider,{value:Vi,children:(0,tr.jsx)(Np.Provider,{value:N,children:(0,tr.jsx)(fu.Provider,{value:vw,children:(0,tr.jsx)(Jh,{...O,children:(0,tr.jsxs)(Lp.Provider,{value:pe,children:[(0,tr.jsx)(eg,{children:(0,tr.jsxs)(Hh,{data:re,setModalData:ie,setInitialScreen:R,initialScreen:S,authenticated:a,open:r,children:[e.children,!O.headless&&O.captchaEnabled&&n&&!a&&(0,tr.jsx)(lc,{delayedExecution:!1}),(0,tr.jsx)(a0,{theme:{...O.appearance.palette||{}}}),!O.render.standalone&&(0,tr.jsx)(Xd,{open:r})]})}),je&&Me?(0,tr.jsx)(f0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:vo,mfaSubmitPromise:No,onLoad:F,onLoadFailed:()=>null}):null,O.loginMethods.telegram&&O.loginConfig.telegramAuthConfiguration&&(0,tr.jsx)(xo,{if:!0,children:(0,tr.jsx)(p0,{scriptHost:e.apiUrl||Il,botUsername:O.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};var k0=require("react");function R0(e){let{login:t}=(0,k0.useContext)(Ue);return He("login",e),{login:t}}var I0=require("react");function M0(e){let{logout:t}=(0,I0.useContext)(Ue);return He("logout",e),{logout:t}}var il=require("react");function W0(){let e=We(),t=rc(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=z(),l=(0,il.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new Dr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=(0,il.useCallback)(async()=>{let c=fs();if(a)return console.warn("Cannot login with OAuth when already logged in"),a;if(!c.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!c.popupFlow)try{return await o(c)}catch(m){throw m}finally{yi()}},[o]);return(0,il.useEffect)(()=>{let c=fs();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}var rm=require("react");var O0=()=>{let e=We(),{initLoginWithEmail:t,loginWithCode:r}=z(),o=(0,rm.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=(0,rm.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new Dr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var om=require("react");var L0=()=>{let e=We(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=z(),n=(0,om.useCallback)(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=(0,om.useCallback)(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new Dr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};var nm=require("react");var N0=()=>{let e=We(),{generateSiweMessage:t,linkWithSiwe:r}=z(),o=(0,nm.useCallback)(async({address:i,chainId:a})=>{if(!i||!a)throw new Error("wallet address and chainId required to generate nonce");return t({address:i,chainId:a}).then(l=>l)},[t]),n=(0,nm.useCallback)(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:c})=>{if(e.enabled&&e.status!=="success")throw new Dr(e.error,null,"captcha_failure");return r({message:a,signature:i,chainId:l,walletClientType:s,connectorType:c})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};var D0=require("react");function U0(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkTelegram:w,linkFarcaster:v}=(0,D0.useContext)(Ue);return He("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkFarcaster:v,linkTelegram:w}}var F0=require("react");function B0(e){let{connectWallet:t}=(0,F0.useContext)(Ue);return He("connectWallet",e),{connectWallet:t}}var H0=require("react");function G0(e){let{createWallet:t}=(0,H0.useContext)(Ue);return He("createWallet",e),{createWallet:t}}var V0=e=>{He("fundWallet",e);let{fundWallet:t}=z();return{fundWallet:t}};var q0=()=>{let{embeddedSolanaWallet:e,createEmbeddedSolanaWallet:t}=W();return{createWallet:t,wallets:e?[e]:[]}};var z0=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=z();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};var $0=require("react");function K0(e){let{sendTransaction:t}=(0,$0.useContext)(Ue);return He("sendTransaction",e),{sendTransaction:t}}var j0=require("react");function Y0(e){let{setWalletPassword:t}=(0,j0.useContext)(Ue);return He("setWalletPassword",e),{setWalletPassword:t}}var Z0=require("react");function Q0(e){let{setWalletRecovery:t}=(0,Z0.useContext)(Ue);return He("setWalletRecovery",e),{setWalletRecovery:t}}var J0=require("react");function X0(e){let{signMessage:t}=(0,J0.useContext)(Ue);return He("signMessage",e),{signMessage:t}}var ew=require("react");function tw(e){let{signTypedData:t}=(0,ew.useContext)(Ue);return He("signTypedData",e),{signTypedData:t}}var rw=require("react");var ow=()=>{let{isModalOpen:e}=(0,rw.useContext)(Ue);return{isOpen:e}};var nw=require("react");function iw(e){let{getAccessToken:t}=(0,nw.useContext)(Ue);return He("accessToken",e),{getAccessToken:t}}function aw(e){let{authenticated:t,user:r}=z(),{initLoginWithOAuth:o}=W(),n=ua();return He("oAuthAuthorization",e),{reauthorize:i=>f7(t,r,o,n,i.provider)}}var f7=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new b("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new b(`OAuth account of type ${n} not linked to the account.`);await r(n)};var sw=im;function im(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=z();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function lw(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function cw(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,LoginModal,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,getEmbeddedConnectedWallet,useConnectWallet,useCreateWallet,useCrossAppAccounts,useExperimentalFarcasterSigner,useFarcasterSigner,useFundWallet,useLinkAccount,useLinkWithSiwe,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,useOAuthTokens,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSetWalletRecovery,useSignMessage,useSignTypedData,useSolanaWallets,useToken,useWallets});