@privy-io/react-auth 1.79.0 → 1.79.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/esm/index.js +297 -294
  2. package/dist/index.js +287 -284
  3. package/package.json +1 -1
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Bd=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var $u=(e,t,r)=>(Bd(e,t,"read from private field"),r?r.call(e):t.get(e)),Bs=(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)},Hd=(e,t,r,o)=>(Bd(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var em=(e,t,r)=>(Bd(e,t,"access private method"),r);import{getAddress as xo}from"@ethersproject/address";import{Web3Provider as zu}from"@ethersproject/providers";import{createStore as BP}from"mipd";import{useEffect as ro,useMemo as HP,useRef as Ta,useState as ut}from"react";import{isAndroid as GP}from"react-device-detect";import{ProviderErrors as VP,calculateTotalGasEstimate as qP,populateTransactionRequest as zP}from"@privy-io/js-sdk-core";import{FetchError as Nv}from"ofetch";var it=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}]`:""}`}},xt=class extends it{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},w=class extends it{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Hs=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var de=class extends it{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},ce=e=>{if(e instanceof it)return e;if(!(e instanceof Nv))return at(e);if(!e.response)return new xt("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new xt(t||"ApiError",e.response.status,r||o,e,n)},at=e=>e instanceof it?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var Ro=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Ht=class extends w{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},Gs=class extends w{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Rr=class extends w{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 Vs="/api/v1/sessions",qs="/api/v1/sessions/logout",tm="/api/v1/sessions/fork",zs="/api/v1/sessions/fork/recover",rm="/api/v1/siwe/init",om="/api/v1/siwe/authenticate",nm="/api/v1/siwe/link",im="/api/v1/siwe/unlink",am="/api/v1/farcaster/init",sm="/api/v1/farcaster/authenticate",lm="/api/v1/farcaster/link",cm="/api/v1/farcaster/status",dm="/api/v1/farcaster/unlink",pm="/api/v1/passwordless/init",um="/api/v1/passwordless/authenticate",mm="/api/v1/passwordless/link",fm="/api/v1/passwordless/unlink",hm="/api/v1/passwordless/update",ym="/api/v1/passwordless_sms/init",gm="/api/v1/passwordless_sms/link",vm="/api/v1/passwordless_sms/unlink",Cm="/api/v1/passwordless_sms/authenticate",wm="/api/v1/passwordless_sms/update",Ks="/api/v1/oauth/init",bm="/api/v1/oauth/authenticate",Ys="/api/v1/oauth/link",Em="/api/v1/oauth/unlink",Tm="/api/v1/recovery/oauth/init",Sm="/api/v1/recovery/oauth/init_icloud",Am="/api/v1/recovery/oauth/authenticate",Pm="/api/v1/passkeys/link/init",xm="/api/v1/passkeys/authenticate/init",km="/api/v1/passkeys/link",_m="/api/v1/passkeys/authenticate",Rm="/api/v1/passkeys/unlink",Mm="/api/v1/telegram/authenticate",Im="/api/v1/telegram/link",Wm="/api/v1/telegram/unlink";var Lm="/api/v1/mfa/passwordless_sms/init",Om="/api/v1/mfa/passkeys/init",Nm="/api/v1/users/me/accept_terms",js="/api/v1/analytics_events",Dm="/api/v1/custom_jwt_account/authenticate",Um="/api/v1/guest/authenticate",Fm="/api/v1/plugins/moonpay_on_ramp/sign",Bm="/api/v1/funding/coinbase_on_ramp/init",Hm="/api/v1/funding/coinbase_on_ramp/status";var gi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Dm,{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 qo=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(um,{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 w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(mm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new w("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)}}},Xs=class extends qo{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new w("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(hm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ce(r)}}};import{isMobile as Uv,isIOS as Fv}from"react-device-detect";var Gd=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)}},Qs=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 Sa(){try{let e="privy:__session_storage__test",t="blobby",r=new Qs;return r.put(e,t),r.del(e),!0}catch{return!1}}function Dv(){return typeof window<"u"&&window.localStorage?new Qs:new Gd}var X=Dv();import{StaticJsonRpcProvider as Aa}from"@ethersproject/providers";function Gm(){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 Zs=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 Vd=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Zs(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!Vd(r))return!1}return!0},zo=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Js=()=>{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 Vm=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},$s=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,}))$/),qm=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},et=(e,t=3,r=4,o="ethereum")=>{if(!e)return"";let n=o==="ethereum"?2:0,i=3;if(t+r+n+i>=e.length)return e;let a=e.slice(0,n+t),l=e.slice(e.length-r,e.length);return`${a}...${l}`},qd=e=>new Promise(t=>setTimeout(t,e));function zm(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 Pa=(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 qd(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},el=(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 Km=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),_n=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Ym(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();console.debug("Detected injected providers:",s.map(f=>f.info));let c=[];for(let f of s)t.includes("coinbase_wallet")&&f.info.rdns==="com.coinbase.wallet"||c.push({type:f.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:f});for(let f of Gm()){let m=Zs(f);if(!s.some(u=>u.info.name===m)){if(Vd(f,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:f});continue}if(m==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:f});continue}if(m==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:f});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:f})}}a(c)}})}function vi(e){return`eip155:${String(Number(e))}`}var jm=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new de(`Unsupported chainId ${e}`,4901);return Ko(i,r,o)},Ko=(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 de(`No RPC url found for ${o}`);return i},Xm=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new de(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Mr=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new de(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new Aa(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new Aa(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new Aa({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new Aa(i.rpcUrls.public.http[0]):a=new Aa(i.rpcUrls.default?.http[0]),!a)throw new de(`No RPC url found for ${e}`);return a},xa=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}}};function Qm(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)}var tl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(rl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var rl={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 Zm(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function Jm(e,t){let r=Zm(t);if(r.deepLink)return nf(r.deepLink,e);if(r.universalLink)return zd(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function $m(e,t){let r=Zm(t);if(r.universalLink)return zd(r.universalLink,e)}var ef="WALLETCONNECT_DEEPLINK_CHOICE";function tf(){try{localStorage.removeItem(ef)}catch{}}function rf({href:e,name:t}){try{localStorage.setItem(ef,JSON.stringify({href:e,name:t}))}catch{}}function of(e){return e.startsWith("http://")||e.startsWith("https://")}function nf(e,t){if(of(e))return zd(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 zd(e,t){if(!of(e))return nf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function ol(e,t){window.open(e,t,"noreferrer noopener")}var je=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 ka=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new je(this._startChannelOnce.bind(this)),this.pollForReady=new je(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("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 w("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 w("Auth flow has no API instance");try{return await this.api.post(lm,{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 w("Auth flow has no API instance");let t=await this.api.post(am,{token:this.captchaToken});Uv&&!Fv&&t.connect_uri&&ol(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new w("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");let t=await this.api.get(cm,{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}};import{base64url as vf}from"jose";var af="1.79.0";var sf="34357d3c125c2bcf2ce2bc3309d98715",nl="https://auth.privy.io",lf=2e4,Me=1400,cf=2500,df=4e3,Kd=af;var Rn="privy:token",Yd="privy-token",il="privy:refresh_token",pf="privy-refresh-token",jd="privy:id_token",Xd="privy-id-token",al="privy-session",_a="privy:session_transfer_token",Hv="privy:wallet",Ra="privy:caid",sl=e=>`privy:guest:${e}`,Ma=e=>`privy:cross-app:${e}`,Mn="privy:state_code",In="privy:code_verifier",Wn="privy:headless_oauth",ll=e=>`${Hv}:${e}`,Qd="privy:connectors",Zd="privy:connections";var Ln=12e4,Mo=1,Jd="0x1",Ci=3e4,uf="https://api.moonpay.com/v1",mf="https://api.moonpay.com/v1",ff="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",hf="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var yf="deprecated";async function gf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Ia(e){return crypto.getRandomValues(new Uint8Array(e))}var wi=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=sl(t);if(Sa()){if(X.get(r))return X.get(r);{let o=vf.encode(Ia(32));return X.put(r,o),o}}return vf.encode(Ia(32))}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Um,{guest_credential:this.meta.guestCredential});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("Linking is not supported for the guest flow")}};import{base64url as Cf}from"jose";var Gv="S256",Vv="S256";function On(){return Cf.encode(Ia(36))}function bi(){return On()}async function Ei(e,t=Gv){if(t==Vv){let r=await gf(e);return Cf.encode(r)}else return e}function wf(){let e=X.get(In);if(!e)throw new w("Authentication error.");return e}function cl(){return!!X.get(Wn)}var io=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:cl();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 w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=wf();try{let r=await this.api.post(bm,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(In),this.meta.headless&&X.del(Wn),{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 w(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=X.get(In);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(Ys,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(In),r}catch(r){throw ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initializing OAuth authentication.");let t=On();X.put(In,t);let r=bi();X.put(Mn,r);let o=await Ei(t);this.meta.headless&&X.put(Wn,!0);try{return await this.api.post(Ks,{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 $d(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as bf,jsxs as qv}from"react/jsx-runtime";var dl=({style:e,...t})=>qv("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:[bf("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"}),bf("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"})]});import{jsx as Wa,jsxs as zv}from"react/jsx-runtime";var pl=({style:e,...t})=>zv("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:[Wa("g",{clipPath:"url(#clip0)",children:Wa("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"})}),Wa("defs",{children:Wa("clipPath",{id:"clip0",children:Wa("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as Ef}from"react/jsx-runtime";var ul=({style:e,...t})=>Ef("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:Ef("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"})});import Kv from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Yv}from"react/jsx-runtime";var Tf=({style:e})=>Yv(Kv,{style:{color:"var(--privy-color-error)",...e}});import{jsx as ml,jsxs as jv}from"react/jsx-runtime";var fl=({style:e,...t})=>jv("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:[ml("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"}),ml("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"}),ml("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"}),ml("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"})]});import{jsx as Ir,jsxs as hl}from"react/jsx-runtime";function yl(e){return hl("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:[hl("defs",{children:[hl("linearGradient",{id:"b",children:[Ir("stop",{offset:"0",stopColor:"#3771c8"}),Ir("stop",{stopColor:"#3771c8",offset:".128"}),Ir("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),hl("linearGradient",{id:"a",children:[Ir("stop",{offset:"0",stopColor:"#fd5"}),Ir("stop",{offset:".1",stopColor:"#fd5"}),Ir("stop",{offset:".5",stopColor:"#ff543e"}),Ir("stop",{offset:"1",stopColor:"#c837ab"})]}),Ir("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"}),Ir("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"})]}),Ir("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)"}),Ir("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)"}),Ir("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"})]})}import{jsx as gl}from"react/jsx-runtime";function vl({style:e,...t}){return gl("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:gl("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:gl("g",{transform:"scale(5.12,5.12)",children:gl("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"})})})})}import{jsx as Sf,jsxs as Xv}from"react/jsx-runtime";function Cl(e){return Xv("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Sf("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"}),Sf("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"})]})}import{jsx as ep,jsxs as Qv}from"react/jsx-runtime";function wl(e){return Qv("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:[ep("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"}),ep("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"}),ep("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"})]})}import{jsx as Af}from"react/jsx-runtime";var bl=({style:e,...t})=>Af("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:Af("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 Pf={google:{name:"Google",component:fl},discord:{name:"Discord",component:pl},github:{name:"Github",component:ul},linkedin:{name:"LinkedIn",component:vl},twitter:{name:"Twitter",component:bl},spotify:{name:"Spotify",component:Cl},instagram:{name:"Instagram",component:yl},tiktok:{name:"Tiktok",component:wl},apple:{name:"Apple",component:dl}},La=e=>e in Pf?Pf[e]:{name:"Unknown",component:Tf};function xf(e,t){let r={detail:"",retryable:!1},o=$d(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=La(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=La(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 Oa(){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:cl(),popupFlow:window.opener!==null&&n}}function Nn(){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(Mn),window.history.replaceState({},"",e)}var Dn=class{constructor(t){this.initAuthenticateOnce=new je(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new je(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new w("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 w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("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 w("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 w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("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(km,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(xm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Pm,{})}_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 El=({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
+ var Hd=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var tm=(e,t,r)=>(Hd(e,t,"read from private field"),r?r.call(e):t.get(e)),Bs=(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)},Gd=(e,t,r,o)=>(Hd(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var rm=(e,t,r)=>(Hd(e,t,"access private method"),r);import{getAddress as xo}from"@ethersproject/address";import{Web3Provider as Yu}from"@ethersproject/providers";import{createStore as GP}from"mipd";import{useEffect as ro,useMemo as VP,useRef as Ta,useState as ut}from"react";import{isAndroid as qP}from"react-device-detect";import{ProviderErrors as zP,calculateTotalGasEstimate as KP,populateTransactionRequest as YP}from"@privy-io/js-sdk-core";import{FetchError as Dv}from"ofetch";var it=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}]`:""}`}},xt=class extends it{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},w=class extends it{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Hs=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var ue=class extends it{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},ce=e=>{if(e instanceof it)return e;if(!(e instanceof Dv))return at(e);if(!e.response)return new xt("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new xt(t||"ApiError",e.response.status,r||o,e,n)},at=e=>e instanceof it?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var Ro=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Ht=class extends w{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},Gs=class extends w{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Rr=class extends w{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 Vs="/api/v1/sessions",qs="/api/v1/sessions/logout",om="/api/v1/sessions/fork",zs="/api/v1/sessions/fork/recover",nm="/api/v1/siwe/init",im="/api/v1/siwe/authenticate",am="/api/v1/siwe/link",sm="/api/v1/siwe/unlink",lm="/api/v1/farcaster/init",cm="/api/v1/farcaster/authenticate",dm="/api/v1/farcaster/link",pm="/api/v1/farcaster/status",um="/api/v1/farcaster/unlink",mm="/api/v1/passwordless/init",fm="/api/v1/passwordless/authenticate",hm="/api/v1/passwordless/link",ym="/api/v1/passwordless/unlink",gm="/api/v1/passwordless/update",vm="/api/v1/passwordless_sms/init",Cm="/api/v1/passwordless_sms/link",wm="/api/v1/passwordless_sms/unlink",bm="/api/v1/passwordless_sms/authenticate",Em="/api/v1/passwordless_sms/update",Ks="/api/v1/oauth/init",Tm="/api/v1/oauth/authenticate",Ys="/api/v1/oauth/link",Sm="/api/v1/oauth/unlink",Am="/api/v1/recovery/oauth/init",Pm="/api/v1/recovery/oauth/init_icloud",xm="/api/v1/recovery/oauth/authenticate",km="/api/v1/passkeys/link/init",_m="/api/v1/passkeys/authenticate/init",Rm="/api/v1/passkeys/link",Mm="/api/v1/passkeys/authenticate",Im="/api/v1/passkeys/unlink",Wm="/api/v1/telegram/authenticate",Lm="/api/v1/telegram/link",Om="/api/v1/telegram/unlink";var Nm="/api/v1/mfa/passwordless_sms/init",Dm="/api/v1/mfa/passkeys/init",Um="/api/v1/users/me/accept_terms",js="/api/v1/analytics_events",Fm="/api/v1/custom_jwt_account/authenticate",Bm="/api/v1/guest/authenticate",Hm="/api/v1/plugins/moonpay_on_ramp/sign",Gm="/api/v1/funding/coinbase_on_ramp/init",Vm="/api/v1/funding/coinbase_on_ramp/status";var gi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Fm,{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 qo=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(fm,{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 w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(hm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{return await this.api.post(mm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ce(o)}}},Xs=class extends qo{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new w("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(gm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ce(r)}}};import{isMobile as Fv,isIOS as Bv}from"react-device-detect";var Vd=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)}},Qs=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 Sa(){try{let e="privy:__session_storage__test",t="blobby",r=new Qs;return r.put(e,t),r.del(e),!0}catch{return!1}}function Uv(){return typeof window<"u"&&window.localStorage?new Qs:new Vd}var X=Uv();import{StaticJsonRpcProvider as Aa}from"@ethersproject/providers";function qm(){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 Zs=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 qd=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Zs(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!qd(r))return!1}return!0},zo=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Js=()=>{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 zm=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},$s=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,}))$/),Km=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},et=(e,t=3,r=4,o="ethereum")=>{if(!e)return"";let n=o==="ethereum"?2:0,i=3;if(t+r+n+i>=e.length)return e;let a=e.slice(0,n+t),l=e.slice(e.length-r,e.length);return`${a}...${l}`},zd=e=>new Promise(t=>setTimeout(t,e));function Ym(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 Pa=(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 zd(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},el=(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 jm=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),_n=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Xm(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();console.debug("Detected injected providers:",s.map(f=>f.info));let c=[];for(let f of s)t.includes("coinbase_wallet")&&f.info.rdns==="com.coinbase.wallet"||c.push({type:f.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:f});for(let f of qm()){let m=Zs(f);if(!s.some(u=>u.info.name===m)){if(qd(f,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:f});continue}if(m==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:f});continue}if(m==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:f});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:f})}}a(c)}})}function vi(e){return`eip155:${String(Number(e))}`}var Qm=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new ue(`Unsupported chainId ${e}`,4901);return Ko(i,r,o)},Ko=(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 ue(`No RPC url found for ${o}`);return i},Zm=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new ue(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Mr=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new ue(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new Aa(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new Aa(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new Aa({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new Aa(i.rpcUrls.public.http[0]):a=new Aa(i.rpcUrls.default?.http[0]),!a)throw new ue(`No RPC url found for ${e}`);return a},xa=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}}};function Jm(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)}var tl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(rl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var rl={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 $m(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function ef(e,t){let r=$m(t);if(r.deepLink)return sf(r.deepLink,e);if(r.universalLink)return Kd(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function tf(e,t){let r=$m(t);if(r.universalLink)return Kd(r.universalLink,e)}var rf="WALLETCONNECT_DEEPLINK_CHOICE";function of(){try{localStorage.removeItem(rf)}catch{}}function nf({href:e,name:t}){try{localStorage.setItem(rf,JSON.stringify({href:e,name:t}))}catch{}}function af(e){return e.startsWith("http://")||e.startsWith("https://")}function sf(e,t){if(af(e))return Kd(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 Kd(e,t){if(!af(e))return sf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function ol(e,t){window.open(e,t,"noreferrer noopener")}var Ye=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 ka=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Ye(this._startChannelOnce.bind(this)),this.pollForReady=new Ye(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");try{let t=await this.api.post(cm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new w("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 w("Auth flow has no API instance");try{return await this.api.post(dm,{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 w("Auth flow has no API instance");let t=await this.api.post(lm,{token:this.captchaToken});Fv&&!Bv&&t.connect_uri&&ol(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new w("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("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}};import{base64url as wf}from"jose";var lf="1.79.1";var cf="34357d3c125c2bcf2ce2bc3309d98715",nl="https://auth.privy.io",df=2e4,Me=1400,pf=2500,uf=4e3,Yd=lf;var Rn="privy:token",jd="privy-token",il="privy:refresh_token",mf="privy-refresh-token",Xd="privy:id_token",Qd="privy-id-token",al="privy-session",_a="privy:session_transfer_token",Gv="privy:wallet",Ra="privy:caid",sl=e=>`privy:guest:${e}`,Ma=e=>`privy:cross-app:${e}`,Mn="privy:state_code",In="privy:code_verifier",Wn="privy:headless_oauth",ll=e=>`${Gv}:${e}`,Zd="privy:connectors",Jd="privy:connections";var Ln=12e4,Mo=1,$d="0x1",Ci=3e4,ff="https://api.moonpay.com/v1",hf="https://api.moonpay.com/v1",yf="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",gf="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var vf="deprecated";async function Cf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Ia(e){return crypto.getRandomValues(new Uint8Array(e))}var wi=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=sl(t);if(Sa()){if(X.get(r))return X.get(r);{let o=wf.encode(Ia(32));return X.put(r,o),o}}return wf.encode(Ia(32))}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Bm,{guest_credential:this.meta.guestCredential});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("Linking is not supported for the guest flow")}};import{base64url as bf}from"jose";var Vv="S256",qv="S256";function On(){return bf.encode(Ia(36))}function bi(){return On()}async function Ei(e,t=Vv){if(t==qv){let r=await Cf(e);return bf.encode(r)}else return e}function Ef(){let e=X.get(In);if(!e)throw new w("Authentication error.");return e}function cl(){return!!X.get(Wn)}var io=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:cl();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 w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=Ef();try{let r=await this.api.post(Tm,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(In),this.meta.headless&&X.del(Wn),{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 w(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=X.get(In);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(Ys,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(In),r}catch(r){throw ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initializing OAuth authentication.");let t=On();X.put(In,t);let r=bi();X.put(Mn,r);let o=await Ei(t);this.meta.headless&&X.put(Wn,!0);try{return await this.api.post(Ks,{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 ep(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as Tf,jsxs as zv}from"react/jsx-runtime";var dl=({style:e,...t})=>zv("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:[Tf("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"}),Tf("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"})]});import{jsx as Wa,jsxs as Kv}from"react/jsx-runtime";var pl=({style:e,...t})=>Kv("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:[Wa("g",{clipPath:"url(#clip0)",children:Wa("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"})}),Wa("defs",{children:Wa("clipPath",{id:"clip0",children:Wa("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as Sf}from"react/jsx-runtime";var ul=({style:e,...t})=>Sf("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:Sf("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"})});import Yv from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as jv}from"react/jsx-runtime";var Af=({style:e})=>jv(Yv,{style:{color:"var(--privy-color-error)",...e}});import{jsx as ml,jsxs as Xv}from"react/jsx-runtime";var fl=({style:e,...t})=>Xv("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:[ml("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"}),ml("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"}),ml("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"}),ml("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"})]});import{jsx as Ir,jsxs as hl}from"react/jsx-runtime";function yl(e){return hl("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:[hl("defs",{children:[hl("linearGradient",{id:"b",children:[Ir("stop",{offset:"0",stopColor:"#3771c8"}),Ir("stop",{stopColor:"#3771c8",offset:".128"}),Ir("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),hl("linearGradient",{id:"a",children:[Ir("stop",{offset:"0",stopColor:"#fd5"}),Ir("stop",{offset:".1",stopColor:"#fd5"}),Ir("stop",{offset:".5",stopColor:"#ff543e"}),Ir("stop",{offset:"1",stopColor:"#c837ab"})]}),Ir("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"}),Ir("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"})]}),Ir("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)"}),Ir("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)"}),Ir("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"})]})}import{jsx as gl}from"react/jsx-runtime";function vl({style:e,...t}){return gl("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:gl("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:gl("g",{transform:"scale(5.12,5.12)",children:gl("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"})})})})}import{jsx as Pf,jsxs as Qv}from"react/jsx-runtime";function Cl(e){return Qv("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Pf("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"}),Pf("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"})]})}import{jsx as tp,jsxs as Zv}from"react/jsx-runtime";function wl(e){return Zv("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:[tp("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"}),tp("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"}),tp("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"})]})}import{jsx as xf}from"react/jsx-runtime";var bl=({style:e,...t})=>xf("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:xf("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 kf={google:{name:"Google",component:fl},discord:{name:"Discord",component:pl},github:{name:"Github",component:ul},linkedin:{name:"LinkedIn",component:vl},twitter:{name:"Twitter",component:bl},spotify:{name:"Spotify",component:Cl},instagram:{name:"Instagram",component:yl},tiktok:{name:"Tiktok",component:wl},apple:{name:"Apple",component:dl}},La=e=>e in kf?kf[e]:{name:"Unknown",component:Af};function _f(e,t){let r={detail:"",retryable:!1},o=ep(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=La(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=La(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 Oa(){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:cl(),popupFlow:window.opener!==null&&n}}function Nn(){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(Mn),window.history.replaceState({},"",e)}var Dn=class{constructor(t){this.initAuthenticateOnce=new Ye(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Ye(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new w("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 w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("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(Mm,{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 w("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 w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("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(Rm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(_m,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(km,{})}_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 El=({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 Io=class{constructor(t,r,o){this.getNonceOnce=new je(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 w("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 w("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 w("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new w("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 w("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new w("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=El({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var Yo=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Cm,{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 w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(gm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(ym,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ce(o)}}},Tl=class extends Yo{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new w("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(wm,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw ce(r)}}};var Ti=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Mm,{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 w("Auth flow has no API instance");try{return await this.api.post(Im,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw ce(t)}}};function tp(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 _f(){let e;if(e=Zv(),e)return kf(),{...e,flowType:"login-url"};if(e=Jv(),e)return kf(),{...e,flowType:"web-app"}}function Zv(){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 Jv(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash"),a=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0;if(!(!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i,chat_instance:a,chat_type:l}}function kf(){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"),e.hash="",window.history.replaceState({},"",e)}import{v4 as jC}from"uuid";function te(e){return e?new Date(e*1e3):null}function $v(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let f={subject:r.subject,username:r.username,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(f);break;case"twitter_oauth":let m={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(m);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(u);break;case"github_oauth":let C={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(C);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let b={subject:r.subject,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(b);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)});break;case"farcaster":let E={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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(E);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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.first_verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function $t(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var ve=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,Un=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Sl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,eC=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Gt=(e,t)=>ve(e)||Un(e)?!1:t==="all-users"||t==="users-without-wallets"&&!eC(e)?.length;function er(e){if(!e)return null;let t=$v(e.linked_accounts),r=$t(t,"wallet"),o=$t(t,"email"),n=$t(t,"phone"),i=$t(t,"google_oauth"),a=$t(t,"twitter_oauth"),l=$t(t,"discord_oauth"),s=$t(t,"github_oauth"),c=$t(t,"spotify_oauth"),f=$t(t,"instagram_oauth"),m=$t(t,"tiktok_oauth"),u=$t(t,"linkedin_oauth"),C=$t(t,"apple_oauth"),v=$t(t,"farcaster"),g=$t(t,"telegram"),b=e.mfa_methods.map(({type:R,verified_at:S})=>({type:R,verifiedAt:te(S)}));return{id:e.id,createdAt:te(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:f&&{subject:f.subject,username:f.username},tiktok:m&&{subject:m.subject,username:m.username,name:m.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:C&&{subject:C.subject,email:C.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:b.map(R=>R.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest}}import{getAddress as wh}from"@ethersproject/address";import{isHexString as HC}from"@ethersproject/bytes";import GC from"eventemitter3";import lC from"@coinbase/wallet-sdk";import{jsx as Rf,jsxs as tC}from"react/jsx-runtime";var Wo=({style:e,...t})=>tC("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:[Rf("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Rf("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"})]});import{getAddress as lo}from"@ethersproject/address";import{Web3Provider as Nf}from"@ethersproject/providers";import{default as aC}from"eventemitter3";import iC from"eventemitter3";var rC=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],Mf=e=>rC.includes(e);import{ErrorCode as oC}from"@ethersproject/logger";import{ProviderErrors as Fn}from"@privy-io/js-sdk-core";var Si=class extends de{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ai=class extends de{constructor(){super("User rejected connection");this.type="wallet_error"}},Vr=e=>{if(e instanceof de)return e;if(e?.code&&e?.reason){let t=new Tt(e);return e.code===oC.ACTION_REJECTED&&(t.details=Fn.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Tt(e):new de("Unknown connector error",e)},Wr=class extends it{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Tt=class extends Wr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Fn).find(i=>i.eipCode===o.code);this.details=n||Fn.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Fn.E32002_CONNECTION_ALREADY_PENDING:this.details=Fn.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Fn.E32002_WALLET_LOCKED))}},nC={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},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1}},ao={...nC,...Fn};var Qe=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 Si,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||Ln,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 de(`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 Vr(r)})}},jo=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Na=class extends iC{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=Mr(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Pi(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new jo(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Ce()||!this.address)throw new jo("Disconnected",4900);return(await Lf(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new jo(`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 jo(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Mr(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 If(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 Wf(xa(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:_n(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 _n(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(Mf(r.method)){let o=await Ce();if(await Of(),!o||!this.address)throw new jo("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 jo("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Ce();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}}},so=class extends Qe{constructor(r){super(r,r.rpcTimeoutDuration)}},Xo=class extends Qe{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 sC=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},tr=class extends aC{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=vi(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=Pi(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>lo(l.address)===lo(r));return{address:lo(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new de("Wallet is not currently connected.");let s=this.wallets.find(C=>lo(C.address)===lo(r))?.chainId;if(!s)throw new de("Unable to determine current chainId.");let c,f;if(typeof l=="number"?(c=`0x${l.toString(16)}`,f=l):(c=l,f=Number(l)),s===vi(c))return;let m=this.chains.find(C=>C.id===f);if(!m)throw new de(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await u()}catch(C){if(sC(C,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:m.name,nativeCurrency:m.nativeCurrency,rpcUrls:[m.rpcUrls.default?.http[0]??""],blockExplorerUrls:[m.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&C.message?.includes("wallet_switchEthereumChain")?new de(`Rainbow does not support the chainId ${o}`):C}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new de("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new de("Wallet is not currently connected.");return new Nf(new so(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new de("Wallet is not currently connected.");return new Xo(this.proxyProvider)},sign:async l=>{if(!await a())throw new de("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 Pa(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,c),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=lo(n),a=[],l;if(this.walletClientType==="privy"){let c=X.get(ll(i));this.chains.find(f=>f.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 Pa(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,c),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 ${Jd}`,c),l=Jd}let s=vi(l);if(!a.find(c=>lo(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(lo(n),s,c,this.connectorType==="embedded_imported"))}Al(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=>lo(n)===lo(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 Nf(new so(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 cC=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Df=(e,t)=>e.makeWeb3Provider({options:t}),Pl,xl=class extends tr{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 Qe(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"),!Pl){let s=[o.id].concat(r.map(f=>f.id)),c=this.connectionOptions!=="eoaOnly"?s.filter(f=>!cC.includes(f)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),Pl=new lC({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Df(Pl,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:Wo,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 de("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Vr(r)}}updateConnectionPreference(r){this.connectionOptions=r,this.walletClientType=r==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(Df(Pl,this.connectionOptions))}};import{jsx as Uf}from"react/jsx-runtime";var Qo=({...e})=>Uf("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:Uf("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 Da=class extends tr{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:[_n(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Qo,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Ff}from"react/jsx-runtime";var xi=({style:e,...t})=>Ff("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Ff("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"})});import{jsx as fr,jsxs as dC}from"react/jsx-runtime";var ki=({style:e,...t})=>dC("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:[fr("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),fr("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"})]});import{jsx as Bf,jsxs as pC}from"react/jsx-runtime";var co=({style:e,...t})=>pC("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:[Bf("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Bf("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 Ri=class extends tr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Qe(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 de("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Vr(r)}}},_i,Mi=class extends tr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Bs(this,_i,void 0);this.proxyProvider=new Qe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Hd(this,_i,{name:"MetaMask",icon:ki,id:"io.metamask"}):a==="phantom"&&Hd(this,_i,{name:"Phantom",icon:co,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 $u(this,_i)??{name:"Browser Extension",icon:xi,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 de("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Vr(r)}}};_i=new WeakMap;import{getAddress as VR}from"@ethersproject/address";import{Web3Provider as zR}from"@ethersproject/providers";import{isMobile as uC}from"react-device-detect";var kl=class extends Ri{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{uC||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 de("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Vr(t)}}};var _l=class extends tr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Qe(void 0,Ln);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 Rl=class extends _l{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:co,id:"phantom"}}};import{EthereumProvider as DC,OPTIONAL_EVENTS as UC,OPTIONAL_METHODS as FC}from"@walletconnect/ethereum-provider";import{isMobile as BC}from"react-device-detect";import{createContext as _C,useContext as RC,useEffect as ip,useRef as MC,useState as IC}from"react";import{jsx as mC}from"react/jsx-runtime";function Hf({src:e,...t}){return mC("img",{src:e,...t,style:{display:"none"}})}import{useContext as hh,useEffect as fh,useMemo as AC,useState as PC}from"react";import{createContext as xC}from"react";var Vt={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:sf,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var Gf=({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 fC=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet","safe"]),Vf=e=>fC.has(e),qf=(e,t,r)=>r.indexOf(e)===t,zf=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Vf).filter(qf):e?e.filter(Vf).filter(qf):Vt.appearance.walletList;var Ml={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 Kf={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 Il={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 Yf={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 Wl={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 jf={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 Xf={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 Ll={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 Qf={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 Zf={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 Jf={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 $f={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 eh={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 Ol={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 th={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 rh={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 Ii={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 Nl={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 oh={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 Dl={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 nh={id:80002,name:"Polygon Amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};var ih={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: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 Ul={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 sh={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 lh={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 Bn=[Ml,Kf,ah,Ii,Nl,oh,Dl,nh,Ll,Qf,Zf,Jf,Wl,jf,Xf,rh,Ol,th,Il,Yf,Ul,lh,sh,eh,ih,$f],ch=new Set(Bn.map(e=>e.id));import Hn from"tinycolor2";var dh="#FFFFFF",hC="#040217",yC=dh,gC="#1E1E1D";function vC(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 qr(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return Hn({...e.toHsl(),l:r})}var CC="#51BA81",wC="#FFB74D",bC="#EC6351",EC=dh,TC=hC;function ph({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=yC;break;case"dark":r=gC;break;default:r=e;break}let o=Hn(r),n=Hn(t),i=Hn(CC),a=Hn(wC),l=Hn(bC),s=vC(o.getLuminance()),c=qr(o,s==="light"?-.04:.11),f=qr(o,s==="light"?-.88:.87),m=qr(o,s==="light"?-.7:.75),u=qr(o,s==="light"?-.43:.45).desaturate(s==="light"?60:20),C=qr(o,s==="light"?-.08:.25).desaturate(s==="light"?60:20),v=qr(n,.15),g=qr(n,-.06),b=qr(l,.3),E=qr(a,.3),R=Hn(n.getLuminance()>.5?TC:EC),S=qr(i,-.16),A=qr(i,.4);return{colorScheme:s,background:o.toHslString(),background2:c.toHslString(),foreground:f.toHslString(),foreground2:m.toHslString(),foreground3:u.toHslString(),foreground4:C.toHslString(),accent:n.toHslString(),accentLight:v.toHslString(),accentDark:g.toHslString(),foregroundAccent:R.toHslString(),success:i.toHslString(),successDark:S.toHslString(),successLight:A.toHslString(),error:l.toHslString(),errorLight:b.toHslString(),warn:a.toHslString(),warnLight:E.toHslString()}}function rp(e,t,r){let o=r?console.warn:()=>{},n,i,a,l,s,c,f,m,u,C,v,g,b,E,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"),f=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),C=t.loginMethods.includes("instagram"),m=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),v=t.loginMethods.includes("linkedin"),b=t.loginMethods.includes("apple"),E=t.loginMethods.includes("farcaster"),R=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,l=e.walletAuth,s=e.googleOAuth,c=e.twitterOAuth,f=e.discordOAuth,g=e.githubOAuth,u=e.spotifyOAuth,C=e.instagramOAuth,m=e.tiktokOAuth,v=e.linkedinOAuth,b=e.appleOAuth,E=e.farcasterAuth,R=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let S=[n,i].filter(Boolean),A=[s,c,f,g,u,C,m,v,b,E,R].filter(Boolean),k=[l].filter(Boolean);if(S.length+A.length+k.length===0)throw new Error("You must enable at least one login method");let I=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;I&&k.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):!I&&A.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"),I=!0);let F=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=zf({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=Gf({input:t?.loginMethodsAndOrder}),j=t?.intl?.defaultCountry??"US",{chains:L,defaultChain:U}=SC({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),W=!!t?.defaultChain,be=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,Re,re=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?be?Re=t?.embeddedWallets?.noPromptOnSignature??!0:Re=t?.embeddedWallets?.noPromptOnSignature??re:Re=re,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&Re!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:ae,...oe}=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??Vt.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:ph({backgroundTheme:t?.appearance?.theme??Vt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Vt.appearance.accentColor}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:G},loginMethods:{wallet:l,email:n,sms:i,passkey:a,google:s,twitter:c,discord:f,github:g,spotify:u,instagram:C,tiktok:m,linkedin:v,apple:b,farcaster:E,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??Vt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Vt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Vt.rpcConfig.rpcTimeouts},chains:L,defaultChain:U,intl:{defaultCountry:j},shouldEnforceDefaultChainOnConnect:W,captchaEnabled:e.captchaEnabled??Vt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??Vt.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:F}},embeddedWallets:{...e.embeddedWalletConfig,...typeof ae=="boolean"?{requireUserOwnedRecoveryOnCreate:ae}:{},...be?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...oe,noPromptOnSignature:Re},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:be?{enabled:!0,...t.customAuth}:void 0,loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??Vt._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??Vt.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??Vt.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??Vt.fundingMethodConfig.moonpay.useSandbox}}}}function uh(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 SC({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:Bn.find(f=>f.id===s.id)??s)}else n=Bn.concat(e??[]);let i=t?n[0]:Ii,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 mh=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)};import{jsx as kC}from"react/jsx-runtime";var yh={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:""},op=rp(yh,void 0,!1),np=xC({appConfig:op,isServerConfigLoaded:!1}),gh=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=PC(null),a=AC(()=>rp(n??yh,o,!!n),[n,o]);return fh(()=>{if(!n)return;let l=uh(o,t),s=mh(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]),fh(()=>{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)}})()},[]),kC(np.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},De=()=>{let{appConfig:e}=hh(np);return e},Fl=()=>{let{isServerConfigLoaded:e}=hh(np);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{jsx as LC,jsxs as OC}from"react/jsx-runtime";var vh=_C({ready:!1,app:op,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),WC=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Ch=e=>{let t=De(),r=e.authenticated,[o,n]=IC(e.initialScreen);ip(()=>{!r&&!WC.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=MC(null);ip(()=>{e.open||(i.current=null)},[e.open]),ip(()=>{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 OC(vh.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&LC(Hf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},x=()=>RC(vh);import{jsx as Wi,jsxs as NC}from"react/jsx-runtime";var Ua=({style:e,...t})=>{let{app:r}=x();return NC("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:[Wi("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Wi("g",{clipPath:"url(#clip0_1765_9946)",children:Wi("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"})}),Wi("defs",{children:Wi("clipPath",{id:"clip0_1765_9946",children:Wi("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var zr=class extends tr{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 Qe(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=rl[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=tl(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:ki,id:"io.metamask"}:{name:Km(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Ua,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=rl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,tf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Ai)};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 de("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=tl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Pi(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(Vr(a));return}o(new de("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=jm(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 DC.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:UC,optionalMethods:FC,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(),BC&&this.walletEntry){let{redirect:l,href:s}=Jm(a,this.walletEntry);rf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let c=$m(a,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),ol(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=tl(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 sp=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>HC(o)).map(o=>wh(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Pi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Ln:Ln,Fa=class extends GC{constructor(r,o,n,i,a,l,s,c,f,m,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 Qe: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=f,this.privyAppName=m,this.privyAppLogo=u,this.storedConnections=ap()}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(Qd)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(Qd));let r=Ym(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"),!zo()&&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 Na(r,o,this.rpcConfig,this.chains,i,n.id),s=new Da(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 Na(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,c=new Da(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=ap(),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=ap(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof zr&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new kl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Mi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Mi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Mi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Ri(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new xl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Rl(this.defaultChain):new zr(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(Zd,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=wh(r),this.emit("walletsUpdated")}};function Al(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 VC=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",ap=()=>{let e=X.get(Zd);return e&&Array.isArray(e)&&e.map(o=>VC(o)).every(Boolean)?e:[]};import{ofetch as qC}from"ofetch";var zC=[Vs,zs,qs,js],Bl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Kd,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=qC.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=zC.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 Hs}})}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 bh=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});import Zo from"js-cookie";function Eh(e){return e instanceof qo?"email":e instanceof Yo?"sms":e instanceof Io?"siwe":e instanceof wi?"guest":e instanceof gi?"custom_auth":e instanceof io?e.meta.provider:null}import{isSafari as KC}from"react-device-detect";function Hl(){return!(KC&&window.location.origin.startsWith("http://localhost"))}import*as Th from"jose";var Lr=class{static parse(t){try{return new Lr(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Th.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 YC=30,Gl=class{constructor(){this.authenticateOnce=new je(async t=>this._authenticate(t)),this.linkOnce=new je(async t=>this._link(t)),this.refreshOnce=new je(this._refresh.bind(this)),this.destroyOnce=new je(this._destroy.bind(this)),this.forkSessionOnce=new je(this._forkSession.bind(this))}get token(){try{let t=X.get(Rn);return typeof t=="string"?new Lr(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(il);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(_a);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(Ma(t));if(typeof r=="string"){let o=new Lr(r);return o.isExpired()?(X.del(Ma(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=Zo.get(al);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!==yf}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Lr.parse(this.token);return t!==null&&!t.isExpired(YC)}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(Ma(t),r):X.del(Ma(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=Eh(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:er(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),at(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:er(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),at(r)}}async _refresh(){if(!this.api)throw new w("Session has no API instance");if(!this.client)throw new w("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(Vs,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(zs,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),er(n.user)}catch(n){if(n instanceof xt&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw at(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(qs,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new w("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(tm,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw at(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(Rn);if(X.put(Rn,t),!this.client?.useServerCookies){let o=Lr.parse(t)?.expiration;Zo.set(Yd,t,{sameSite:"Strict",secure:Hl(),expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(Rn),Zo.remove(Yd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put(il,t),this.client?.useServerCookies||Zo.set(al,"t",{sameSite:"Strict",secure:Hl(),expires:30})):(X.del(il),Zo.remove(pf),Zo.remove(al))}storeIdentityToken(t){if(this.client?.useServerCookies)return;X.put(jd,t);let r=Lr.parse(t)?.expiration;Zo.set(Xd,t,{sameSite:"Strict",secure:Hl(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){X.del(jd),Zo.remove(Xd)}clearForkedToken(){X.del(_a)}};var lp,Vl,Sh,Ba=class{constructor(t){Bs(this,Vl);this.apiUrl=t.apiUrl||nl,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||lf,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=em(this,Vl,Sh).call(this),lp||(lp=new Gl),this.session=lp,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 Fa(this.appId,t,r,o,n,i,a,l,s,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Bl({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 w("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new w("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(Lm,{action:"verify"})}catch(t){throw ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Om,{});return bh(t.options)}catch(t){throw ce(t)}}async acceptTerms(){try{let t=await this.api.post(Nm,{});return er(t)}catch(t){throw at(t)}}async unlinkEmail(t){try{let r=await this.api.post(fm,{address:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkPhone(t){try{let r=await this.api.post(vm,{phoneNumber:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkWallet(t){try{let r=await this.api.post(im,{address:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Em,{provider:t,subject:r});return await this.getAuthenticatedUser()??er(o)}catch(o){throw at(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(dm,{fid:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Wm,{telegram_user_id:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Rm,{credential_id:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(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(js,{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(Fm,t)}catch(r){throw at(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(Bm,t)}catch(r){throw at(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${Hm}?partnerUserId=${t}`)}catch(r){throw at(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Lr.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 at(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(rm,{address:t,token:r})).nonce}catch(o){throw at(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(om,{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(nm,{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 er(a)}catch(a){throw at(a)}}};Vl=new WeakSet,Sh=function(){if(typeof window>"u")return null;try{let r=X.get(Ra);if(typeof r=="string"&&r.length>0)return r}catch{}let t=jC();try{return X.put(Ra,t),t}catch{return t}};import{Turnstile as ew}from"@marsidev/react-turnstile";import{useEffect as tw,useMemo as rw}from"react";import{useMemo as XC,useRef as QC,useContext as ZC,useState as cp,createContext as JC}from"react";import{jsx as $C}from"react/jsx-runtime";var Ah=JC({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}),hr=class extends it{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Ph=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=QC(null),[i,a]=cp(),[l,s]=cp(),[c,f]=cp(!1),m=XC(()=>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 $C(Ah.Provider,{value:{...m,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:f,remove(){o&&(n.current?.remove(),f(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),f(!1),s(void 0),a(void 0))},execute(){o&&(f(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await zm(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new hr("Captcha failed",null,"captcha_timeout")}}},children:e})},Te=()=>ZC(Ah);import{jsx as xh}from"react/jsx-runtime";var dp=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Te(),[,s]=rw(()=>r?.split("t:")||[],[r]);if(tw(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return xh("div",{className:"hidden h-0 w-0",children:xh(ew,{...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")}}})})};import{useCallback as bP,useEffect as $0,useRef as EP,useState as TP}from"react";import rv from"styled-components";import{createContext as ow,useContext as nw}from"react";var pp=ow({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,loginWithGuestAccountFlow: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,exportSolanaWallet:T,solanaSignMessage:T,connectCoinbaseSmartWallet:T}),M=()=>nw(pp);import{createContext as iw,useContext as aw}from"react";var we=iw({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,createGuestAccount: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=()=>aw(we);import{useEffect as sw,useState as lw}from"react";var kh=e=>{let[t,r]=lw("auto");return sw(()=>{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};import{createContext as cw,useContext as dw,useEffect as pw}from"react";var _h={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:[]}},up=cw(void 0),Rh=()=>dw(up);function xe(e,t){if(!t)return;let o=Rh().current[e];return pw(()=>{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 Li(){let e=Rh();return(t,r,...o)=>B(e,t,r,...o)}function mp(e){xe("configureMfa",e)}import Ww from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Dh from"styled-components";import Gn,{css as Mh}from"styled-components";import hp from"styled-components";import{Fragment as mw,jsx as fp,jsxs as fw}from"react/jsx-runtime";var lt=({success:e,fail:t})=>fw(mw,{children:[fp(ct,{className:e?"success":t?"fail":""}),fp(Ha,{className:e?"success":t?"fail":""})]}),ct=hp.span`
12
+ - https://privy.io`};var Io=class{constructor(t,r,o){this.getNonceOnce=new Ye(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 w("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 w("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 w("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new w("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 w("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new w("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=El({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var Yo=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(bm,{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 w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Cm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(vm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ce(o)}}},Tl=class extends Yo{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new w("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Em,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw ce(r)}}};var Ti=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Wm,{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 w("Auth flow has no API instance");try{return await this.api.post(Lm,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw ce(t)}}};function rp(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 Mf(){let e;if(e=Jv(),e)return Rf(),{...e,flowType:"login-url"};if(e=$v(),e)return Rf(),{...e,flowType:"web-app"}}function Jv(){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 $v(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash"),a=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0;if(!(!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i,chat_instance:a,chat_type:l}}function Rf(){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"),e.hash="",window.history.replaceState({},"",e)}import{v4 as XC}from"uuid";function te(e){return e?new Date(e*1e3):null}function eC(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let f={subject:r.subject,username:r.username,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(f);break;case"twitter_oauth":let m={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(m);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(u);break;case"github_oauth":let C={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(C);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let b={subject:r.subject,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(b);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)});break;case"farcaster":let E={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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(E);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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.first_verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function $t(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var ve=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,Un=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Sl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,tC=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Gt=(e,t)=>ve(e)||Un(e)?!1:t==="all-users"||t==="users-without-wallets"&&!tC(e)?.length;function er(e){if(!e)return null;let t=eC(e.linked_accounts),r=$t(t,"wallet"),o=$t(t,"email"),n=$t(t,"phone"),i=$t(t,"google_oauth"),a=$t(t,"twitter_oauth"),l=$t(t,"discord_oauth"),s=$t(t,"github_oauth"),c=$t(t,"spotify_oauth"),f=$t(t,"instagram_oauth"),m=$t(t,"tiktok_oauth"),u=$t(t,"linkedin_oauth"),C=$t(t,"apple_oauth"),v=$t(t,"farcaster"),g=$t(t,"telegram"),b=e.mfa_methods.map(({type:R,verified_at:S})=>({type:R,verifiedAt:te(S)}));return{id:e.id,createdAt:te(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:f&&{subject:f.subject,username:f.username},tiktok:m&&{subject:m.subject,username:m.username,name:m.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:C&&{subject:C.subject,email:C.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:b.map(R=>R.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest}}import{getAddress as Eh}from"@ethersproject/address";import{isHexString as GC}from"@ethersproject/bytes";import VC from"eventemitter3";import cC from"@coinbase/wallet-sdk";import{jsx as If,jsxs as rC}from"react/jsx-runtime";var Wo=({style:e,...t})=>rC("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:[If("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),If("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"})]});import{getAddress as lo}from"@ethersproject/address";import{Web3Provider as Uf}from"@ethersproject/providers";import{default as sC}from"eventemitter3";import aC from"eventemitter3";var oC=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],Wf=e=>oC.includes(e);import{ErrorCode as nC}from"@ethersproject/logger";import{ProviderErrors as Fn}from"@privy-io/js-sdk-core";var Si=class extends ue{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ai=class extends ue{constructor(){super("User rejected connection");this.type="wallet_error"}},Vr=e=>{if(e instanceof ue)return e;if(e?.code&&e?.reason){let t=new Tt(e);return e.code===nC.ACTION_REJECTED&&(t.details=Fn.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Tt(e):new ue("Unknown connector error",e)},Wr=class extends it{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Tt=class extends Wr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Fn).find(i=>i.eipCode===o.code);this.details=n||Fn.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Fn.E32002_CONNECTION_ALREADY_PENDING:this.details=Fn.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Fn.E32002_WALLET_LOCKED))}},iC={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},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1}},ao={...iC,...Fn};var Xe=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 Si,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||Ln,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 ue(`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 Vr(r)})}},jo=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Na=class extends aC{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=Mr(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Pi(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new jo(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Ce()||!this.address)throw new jo("Disconnected",4900);return(await Nf(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new jo(`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 jo(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Mr(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 Lf(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 Of(xa(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:_n(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 _n(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(Wf(r.method)){let o=await Ce();if(await Df(),!o||!this.address)throw new jo("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 jo("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Ce();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}}},so=class extends Xe{constructor(r){super(r,r.rpcTimeoutDuration)}},Xo=class extends Xe{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 lC=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},tr=class extends sC{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=vi(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=Pi(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>lo(l.address)===lo(r));return{address:lo(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new ue("Wallet is not currently connected.");let s=this.wallets.find(C=>lo(C.address)===lo(r))?.chainId;if(!s)throw new ue("Unable to determine current chainId.");let c,f;if(typeof l=="number"?(c=`0x${l.toString(16)}`,f=l):(c=l,f=Number(l)),s===vi(c))return;let m=this.chains.find(C=>C.id===f);if(!m)throw new ue(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await u()}catch(C){if(lC(C,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:m.name,nativeCurrency:m.nativeCurrency,rpcUrls:[m.rpcUrls.default?.http[0]??""],blockExplorerUrls:[m.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&C.message?.includes("wallet_switchEthereumChain")?new ue(`Rainbow does not support the chainId ${o}`):C}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new ue("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new ue("Wallet is not currently connected.");return new Uf(new so(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new ue("Wallet is not currently connected.");return new Xo(this.proxyProvider)},sign:async l=>{if(!await a())throw new ue("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 Pa(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,c),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=lo(n),a=[],l;if(this.walletClientType==="privy"){let c=X.get(ll(i));this.chains.find(f=>f.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 Pa(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,c),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 ${$d}`,c),l=$d}let s=vi(l);if(!a.find(c=>lo(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(lo(n),s,c,this.connectorType==="embedded_imported"))}Al(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=>lo(n)===lo(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 Uf(new so(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 dC=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Ff=(e,t)=>e.makeWeb3Provider({options:t}),Pl,xl=class extends tr{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 Xe(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"),!Pl){let s=[o.id].concat(r.map(f=>f.id)),c=this.connectionOptions!=="eoaOnly"?s.filter(f=>!dC.includes(f)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),Pl=new cC({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Ff(Pl,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:Wo,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 ue("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Vr(r)}}updateConnectionPreference(r){this.connectionOptions=r,this.walletClientType=r==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(Ff(Pl,this.connectionOptions))}};import{jsx as Bf}from"react/jsx-runtime";var Qo=({...e})=>Bf("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:Bf("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 Da=class extends tr{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:[_n(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Qo,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Hf}from"react/jsx-runtime";var xi=({style:e,...t})=>Hf("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Hf("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"})});import{jsx as fr,jsxs as pC}from"react/jsx-runtime";var ki=({style:e,...t})=>pC("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:[fr("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),fr("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"}),fr("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"})]});import{jsx as Gf,jsxs as uC}from"react/jsx-runtime";var co=({style:e,...t})=>uC("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:[Gf("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Gf("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 Ri=class extends tr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Xe(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 ue("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Vr(r)}}},_i,Mi=class extends tr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Bs(this,_i,void 0);this.proxyProvider=new Xe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Gd(this,_i,{name:"MetaMask",icon:ki,id:"io.metamask"}):a==="phantom"&&Gd(this,_i,{name:"Phantom",icon:co,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 tm(this,_i)??{name:"Browser Extension",icon:xi,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 ue("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Vr(r)}}};_i=new WeakMap;import{getAddress as qR}from"@ethersproject/address";import{Web3Provider as KR}from"@ethersproject/providers";import{isMobile as mC}from"react-device-detect";var kl=class extends Ri{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{mC||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 ue("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Vr(t)}}};var _l=class extends tr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Xe(void 0,Ln);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 Rl=class extends _l{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:co,id:"phantom"}}};import{EthereumProvider as UC,OPTIONAL_EVENTS as FC,OPTIONAL_METHODS as BC}from"@walletconnect/ethereum-provider";import{isMobile as HC}from"react-device-detect";import{createContext as RC,useContext as MC,useEffect as ap,useRef as IC,useState as WC}from"react";import{jsx as fC}from"react/jsx-runtime";function Vf({src:e,...t}){return fC("img",{src:e,...t,style:{display:"none"}})}import{useContext as gh,useEffect as yh,useMemo as PC,useState as xC}from"react";import{createContext as kC}from"react";var Vt={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 qf=({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 hC=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet","safe"]),zf=e=>hC.has(e),Kf=(e,t,r)=>r.indexOf(e)===t,Yf=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(zf).filter(Kf):e?e.filter(zf).filter(Kf):Vt.appearance.walletList;var Ml={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 jf={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 Il={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 Xf={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 Wl={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 Qf={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 Zf={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 Ll={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 Jf={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 $f={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 eh={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 th={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 rh={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 Ol={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 oh={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 nh={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 Ii={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 Nl={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 ih={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 Dl={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 ah={id:80002,name:"Polygon Amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};var sh={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 lh={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 Ul={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 ch={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 dh={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 Bn=[Ml,jf,lh,Ii,Nl,ih,Dl,ah,Ll,Jf,$f,eh,Wl,Qf,Zf,nh,Ol,oh,Il,Xf,Ul,dh,ch,rh,sh,th],ph=new Set(Bn.map(e=>e.id));import Hn from"tinycolor2";var uh="#FFFFFF",yC="#040217",gC=uh,vC="#1E1E1D";function CC(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 qr(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return Hn({...e.toHsl(),l:r})}var wC="#51BA81",bC="#FFB74D",EC="#EC6351",TC=uh,SC=yC;function mh({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=gC;break;case"dark":r=vC;break;default:r=e;break}let o=Hn(r),n=Hn(t),i=Hn(wC),a=Hn(bC),l=Hn(EC),s=CC(o.getLuminance()),c=qr(o,s==="light"?-.04:.11),f=qr(o,s==="light"?-.88:.87),m=qr(o,s==="light"?-.7:.75),u=qr(o,s==="light"?-.43:.45).desaturate(s==="light"?60:20),C=qr(o,s==="light"?-.08:.25).desaturate(s==="light"?60:20),v=qr(n,.15),g=qr(n,-.06),b=qr(l,.3),E=qr(a,.3),R=Hn(n.getLuminance()>.5?SC:TC),S=qr(i,-.16),A=qr(i,.4);return{colorScheme:s,background:o.toHslString(),background2:c.toHslString(),foreground:f.toHslString(),foreground2:m.toHslString(),foreground3:u.toHslString(),foreground4:C.toHslString(),accent:n.toHslString(),accentLight:v.toHslString(),accentDark:g.toHslString(),foregroundAccent:R.toHslString(),success:i.toHslString(),successDark:S.toHslString(),successLight:A.toHslString(),error:l.toHslString(),errorLight:b.toHslString(),warn:a.toHslString(),warnLight:E.toHslString()}}function op(e,t,r){let o=r?console.warn:()=>{},n,i,a,l,s,c,f,m,u,C,v,g,b,E,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"),f=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),C=t.loginMethods.includes("instagram"),m=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),v=t.loginMethods.includes("linkedin"),b=t.loginMethods.includes("apple"),E=t.loginMethods.includes("farcaster"),R=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,l=e.walletAuth,s=e.googleOAuth,c=e.twitterOAuth,f=e.discordOAuth,g=e.githubOAuth,u=e.spotifyOAuth,C=e.instagramOAuth,m=e.tiktokOAuth,v=e.linkedinOAuth,b=e.appleOAuth,E=e.farcasterAuth,R=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let S=[n,i].filter(Boolean),A=[s,c,f,g,u,C,m,v,b,E,R].filter(Boolean),k=[l].filter(Boolean);if(S.length+A.length+k.length===0)throw new Error("You must enable at least one login method");let I=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;I&&k.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):!I&&A.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"),I=!0);let F=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=Yf({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=qf({input:t?.loginMethodsAndOrder}),j=t?.intl?.defaultCountry??"US",{chains:L,defaultChain:U}=AC({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),W=!!t?.defaultChain,be=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,Re,re=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?be?Re=t?.embeddedWallets?.noPromptOnSignature??!0:Re=t?.embeddedWallets?.noPromptOnSignature??re:Re=re,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&Re!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:oe,...ne}=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??Vt.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:mh({backgroundTheme:t?.appearance?.theme??Vt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Vt.appearance.accentColor}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:G},loginMethods:{wallet:l,email:n,sms:i,passkey:a,google:s,twitter:c,discord:f,github:g,spotify:u,instagram:C,tiktok:m,linkedin:v,apple:b,farcaster:E,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??Vt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Vt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Vt.rpcConfig.rpcTimeouts},chains:L,defaultChain:U,intl:{defaultCountry:j},shouldEnforceDefaultChainOnConnect:W,captchaEnabled:e.captchaEnabled??Vt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??Vt.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:F}},embeddedWallets:{...e.embeddedWalletConfig,...typeof oe=="boolean"?{requireUserOwnedRecoveryOnCreate:oe}:{},...be?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...ne,noPromptOnSignature:Re},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:be?{enabled:!0,...t.customAuth}:void 0,loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??Vt._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??Vt.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??Vt.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??Vt.fundingMethodConfig.moonpay.useSandbox}}}}function fh(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 AC({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:Bn.find(f=>f.id===s.id)??s)}else n=Bn.concat(e??[]);let i=t?n[0]:Ii,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 hh=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)};import{jsx as _C}from"react/jsx-runtime";var vh={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:""},np=op(vh,void 0,!1),ip=kC({appConfig:np,isServerConfigLoaded:!1}),Ch=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=xC(null),a=PC(()=>op(n??vh,o,!!n),[n,o]);return yh(()=>{if(!n)return;let l=fh(o,t),s=hh(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]),yh(()=>{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)}})()},[]),_C(ip.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},De=()=>{let{appConfig:e}=gh(ip);return e},Fl=()=>{let{isServerConfigLoaded:e}=gh(ip);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{jsx as OC,jsxs as NC}from"react/jsx-runtime";var wh=RC({ready:!1,app:np,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),LC=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],bh=e=>{let t=De(),r=e.authenticated,[o,n]=WC(e.initialScreen);ap(()=>{!r&&!LC.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=IC(null);ap(()=>{e.open||(i.current=null)},[e.open]),ap(()=>{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 NC(wh.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&OC(Vf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},x=()=>MC(wh);import{jsx as Wi,jsxs as DC}from"react/jsx-runtime";var Ua=({style:e,...t})=>{let{app:r}=x();return DC("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:[Wi("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Wi("g",{clipPath:"url(#clip0_1765_9946)",children:Wi("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"})}),Wi("defs",{children:Wi("clipPath",{id:"clip0_1765_9946",children:Wi("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var zr=class extends tr{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 Xe(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=rl[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=tl(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:ki,id:"io.metamask"}:{name:jm(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Ua,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=rl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,of(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Ai)};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 ue("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=tl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Pi(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(Vr(a));return}o(new ue("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=Qm(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 UC.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:FC,optionalMethods:BC,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(),HC&&this.walletEntry){let{redirect:l,href:s}=ef(a,this.walletEntry);nf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let c=tf(a,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),ol(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=tl(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 lp=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>GC(o)).map(o=>Eh(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Pi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Ln:Ln,Fa=class extends VC{constructor(r,o,n,i,a,l,s,c,f,m,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 Xe: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=f,this.privyAppName=m,this.privyAppLogo=u,this.storedConnections=sp()}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(Zd)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(Zd));let r=Xm(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"),!zo()&&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 Na(r,o,this.rpcConfig,this.chains,i,n.id),s=new Da(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 Na(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,c=new Da(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=sp(),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=sp(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof zr&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new kl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Mi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Mi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Mi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Ri(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new xl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Rl(this.defaultChain):new zr(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(Jd,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=Eh(r),this.emit("walletsUpdated")}};function Al(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 qC=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",sp=()=>{let e=X.get(Jd);return e&&Array.isArray(e)&&e.map(o=>qC(o)).every(Boolean)?e:[]};import{ofetch as zC}from"ofetch";var KC=[Vs,zs,qs,js],Bl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Yd,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=zC.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=KC.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 Hs}})}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 Th=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});import Zo from"js-cookie";function Sh(e){return e instanceof qo?"email":e instanceof Yo?"sms":e instanceof Io?"siwe":e instanceof wi?"guest":e instanceof gi?"custom_auth":e instanceof io?e.meta.provider:null}import{isSafari as YC}from"react-device-detect";function Hl(){return!(YC&&window.location.origin.startsWith("http://localhost"))}import*as Ah from"jose";var Lr=class{static parse(t){try{return new Lr(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Ah.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 jC=30,Gl=class{constructor(){this.authenticateOnce=new Ye(async t=>this._authenticate(t)),this.linkOnce=new Ye(async t=>this._link(t)),this.refreshOnce=new Ye(this._refresh.bind(this)),this.destroyOnce=new Ye(this._destroy.bind(this)),this.forkSessionOnce=new Ye(this._forkSession.bind(this))}get token(){try{let t=X.get(Rn);return typeof t=="string"?new Lr(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(il);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(_a);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(Ma(t));if(typeof r=="string"){let o=new Lr(r);return o.isExpired()?(X.del(Ma(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=Zo.get(al);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!==vf}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Lr.parse(this.token);return t!==null&&!t.isExpired(jC)}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(Ma(t),r):X.del(Ma(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=Sh(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:er(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),at(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:er(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),at(r)}}async _refresh(){if(!this.api)throw new w("Session has no API instance");if(!this.client)throw new w("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(Vs,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(zs,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),er(n.user)}catch(n){if(n instanceof xt&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw at(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(qs,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new w("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(om,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw at(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(Rn);if(X.put(Rn,t),!this.client?.useServerCookies){let o=Lr.parse(t)?.expiration;Zo.set(jd,t,{sameSite:"Strict",secure:Hl(),expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(Rn),Zo.remove(jd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put(il,t),this.client?.useServerCookies||Zo.set(al,"t",{sameSite:"Strict",secure:Hl(),expires:30})):(X.del(il),Zo.remove(mf),Zo.remove(al))}storeIdentityToken(t){if(this.client?.useServerCookies)return;X.put(Xd,t);let r=Lr.parse(t)?.expiration;Zo.set(Qd,t,{sameSite:"Strict",secure:Hl(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){X.del(Xd),Zo.remove(Qd)}clearForkedToken(){X.del(_a)}};var cp,Vl,Ph,Ba=class{constructor(t){Bs(this,Vl);this.apiUrl=t.apiUrl||nl,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||df,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=rm(this,Vl,Ph).call(this),cp||(cp=new Gl),this.session=cp,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 Fa(this.appId,t,r,o,n,i,a,l,s,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Bl({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 w("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new w("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(Nm,{action:"verify"})}catch(t){throw ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Dm,{});return Th(t.options)}catch(t){throw ce(t)}}async acceptTerms(){try{let t=await this.api.post(Um,{});return er(t)}catch(t){throw at(t)}}async unlinkEmail(t){try{let r=await this.api.post(ym,{address:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkPhone(t){try{let r=await this.api.post(wm,{phoneNumber:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkWallet(t){try{let r=await this.api.post(sm,{address:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Sm,{provider:t,subject:r});return await this.getAuthenticatedUser()??er(o)}catch(o){throw at(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(um,{fid:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Om,{telegram_user_id:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Im,{credential_id:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw at(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(js,{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(Hm,t)}catch(r){throw at(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(Gm,t)}catch(r){throw at(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${Vm}?partnerUserId=${t}`)}catch(r){throw at(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Lr.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 at(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(nm,{address:t,token:r})).nonce}catch(o){throw at(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(im,{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(am,{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 er(a)}catch(a){throw at(a)}}};Vl=new WeakSet,Ph=function(){if(typeof window>"u")return null;try{let r=X.get(Ra);if(typeof r=="string"&&r.length>0)return r}catch{}let t=XC();try{return X.put(Ra,t),t}catch{return t}};import{Turnstile as tw}from"@marsidev/react-turnstile";import{useEffect as rw,useMemo as ow}from"react";import{useMemo as QC,useRef as ZC,useContext as JC,useState as dp,createContext as $C}from"react";import{jsx as ew}from"react/jsx-runtime";var xh=$C({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}),hr=class extends it{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},kh=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=ZC(null),[i,a]=dp(),[l,s]=dp(),[c,f]=dp(!1),m=QC(()=>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 ew(xh.Provider,{value:{...m,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:f,remove(){o&&(n.current?.remove(),f(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),f(!1),s(void 0),a(void 0))},execute(){o&&(f(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await Ym(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new hr("Captcha failed",null,"captcha_timeout")}}},children:e})},Te=()=>JC(xh);import{jsx as _h}from"react/jsx-runtime";var pp=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Te(),[,s]=ow(()=>r?.split("t:")||[],[r]);if(rw(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return _h("div",{className:"hidden h-0 w-0",children:_h(tw,{...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")}}})})};import{useCallback as TP,useEffect as ev,useRef as SP,useState as AP}from"react";import ov from"styled-components";import{createContext as nw,useContext as iw}from"react";var up=nw({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,loginWithGuestAccountFlow: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,exportSolanaWallet:T,solanaSignMessage:T,connectCoinbaseSmartWallet:T}),M=()=>iw(up);import{createContext as aw,useContext as sw}from"react";var we=aw({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,createGuestAccount: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:[]}),K=()=>sw(we);import{useEffect as lw,useState as cw}from"react";var Rh=e=>{let[t,r]=cw("auto");return lw(()=>{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};import{createContext as dw,useContext as pw,useEffect as uw}from"react";var Mh={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:[]}},mp=dw(void 0),Ih=()=>pw(mp);function xe(e,t){if(!t)return;let o=Ih().current[e];return uw(()=>{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 Li(){let e=Ih();return(t,r,...o)=>B(e,t,r,...o)}function fp(e){xe("configureMfa",e)}import Lw from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Fh from"styled-components";import Gn,{css as Wh}from"styled-components";import yp from"styled-components";import{Fragment as fw,jsx as hp,jsxs as hw}from"react/jsx-runtime";var lt=({success:e,fail:t})=>hw(fw,{children:[hp(ct,{className:e?"success":t?"fail":""}),hp(Ha,{className:e?"success":t?"fail":""})]}),ct=yp.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
- `,Ha=hp(ct)`
45
+ `,Ha=yp(ct)`
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
- `,po=e=>fp(uw,{color:e.color||"var(--privy-color-foreground-3)"}),uw=hp(ct)`
51
+ `,po=e=>hp(mw,{color:e.color||"var(--privy-color-foreground-3)"}),mw=yp(ct)`
52
52
  && {
53
53
  height: 1rem;
54
54
  width: 1rem;
@@ -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})=>rr(Ih,{disabled:t||r,...n,children:t?zl("span",{children:[rr(po,{}),o?rr("span",{children:o}):null]}):e}),Lo=({children:e,loading:t,disabled:r,...o})=>rr(hw,{disabled:r,...o,children:t?rr(po,{color:"var(--privy-color-foreground-accent)"}):e}),hw=Gn(Vn)`
83
+ `,H=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(Lh,{disabled:t||r,...n,children:t?zl("span",{children:[rr(po,{}),o?rr("span",{children:o}):null]}):e}),Lo=({children:e,loading:t,disabled:r,...o})=>rr(yw,{disabled:r,...o,children:t?rr(po,{color:"var(--privy-color-foreground-accent)"}):e}),yw=Gn(Vn)`
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
- `,ql=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(Ih,{as:"a",disabled:t||r,...n,children:t?zl("span",{children:[rr(po,{}),o?rr("span",{children:o}):null]}):e}),Ih=Gn(Vn)`
109
+ `,ql=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(Lh,{as:"a",disabled:t||r,...n,children:t?zl("span",{children:[rr(po,{}),o?rr("span",{children:o}):null]}):e}),Lh=Gn(Vn)`
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?Mh`
135
+ ${e=>e.disabled?Wh`
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
- `,Kr=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(yw,{disabled:t||r,...n,children:t?zl("span",{children:[rr(po,{}),o?rr("span",{children:o}):null]}):e}),yw=Gn(Vn)`
154
+ `,Kr=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(gw,{disabled:t||r,...n,children:t?zl("span",{children:[rr(po,{}),o?rr("span",{children:o}):null]}):e}),gw=Gn(Vn)`
155
155
  && {
156
156
  border-width: 1px;
157
157
  border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
@@ -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&&Mh`
196
+ ${e=>e.invisible&&Wh`
197
197
  pointer-events: none;
198
198
  `}
199
199
 
@@ -211,10 +211,10 @@ Resources:
211
211
  cursor: not-allowed;
212
212
  }
213
213
  }
214
- `,PL=Gn.div`
214
+ `,xL=Gn.div`
215
215
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
216
216
  height: 44px;
217
- `,Oi=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>zl(gw,{isSubmitting:o,onClick:t,disabled:r,...n,children:[rr("span",{children:e}),rr("span",{children:rr(po,{})})]}),gw=Gn.button`
217
+ `,Oi=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>zl(vw,{isSubmitting:o,onClick:t,disabled:r,...n,children:[rr("span",{children:e}),rr("span",{children:rr(po,{})})]}),vw=Gn.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
- `;import vw from"styled-components";var Wh=vw.span`
259
+ `;import Cw from"styled-components";var Oh=Cw.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
- `;import Cw from"@heroicons/react/24/outline/ArrowLeftIcon";import ww from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import bw from"@heroicons/react/24/outline/XMarkIcon";import Ni from"styled-components";import{jsx as or,jsxs as Lh}from"react/jsx-runtime";var Ew=({backFn:e})=>or("div",{children:or(yp,{onClick:e,children:or(Cw,{height:"16px",width:"16px",strokeWidth:2})})}),Tw=({infoFn:e})=>or("div",{children:or(Aw,{"aria-label":"info",onClick:e,children:or(ww,{height:"22px",width:"22px",strokeWidth:2})})}),Sw=e=>or("div",{children:or(yp,{"aria-label":"close modal",onClick:e.onClose,children:or(bw,{height:"16px",width:"16px",strokeWidth:2})})});var _=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=M(),a=De();return Lh(Pw,{children:[Lh(xw,{children:[e&&or(Ew,{backFn:e}),t&&or(Tw,{infoFn:t})]}),o&&or(_w,{id:"privy-dialog-title",children:o}),or(kw,{children:!a.render.standalone&&n&&or(Sw,{onClose:r||(()=>i())})})]})},yp=Ni.button`
271
+ `;import ww from"@heroicons/react/24/outline/ArrowLeftIcon";import bw from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Ew from"@heroicons/react/24/outline/XMarkIcon";import Ni from"styled-components";import{jsx as or,jsxs as Nh}from"react/jsx-runtime";var Tw=({backFn:e})=>or("div",{children:or(gp,{onClick:e,children:or(ww,{height:"16px",width:"16px",strokeWidth:2})})}),Sw=({infoFn:e})=>or("div",{children:or(Pw,{"aria-label":"info",onClick:e,children:or(bw,{height:"22px",width:"22px",strokeWidth:2})})}),Aw=e=>or("div",{children:or(gp,{"aria-label":"close modal",onClick:e.onClose,children:or(Ew,{height:"16px",width:"16px",strokeWidth:2})})});var _=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=M(),a=De();return Nh(xw,{children:[Nh(kw,{children:[e&&or(Tw,{backFn:e}),t&&or(Sw,{infoFn:t})]}),o&&or(Rw,{id:"privy-dialog-title",children:o}),or(_w,{children:!a.render.standalone&&n&&or(Aw,{onClose:r||(()=>i())})})]})},gp=Ni.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
- `,Aw=Ni(yp)`
290
+ `,Pw=Ni(gp)`
291
291
  && {
292
292
  background-color: transparent;
293
293
  }
294
- `,Pw=Ni.div`
294
+ `,xw=Ni.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
- `,xw=Ni.div`
306
+ `,kw=Ni.div`
307
307
  flex: 1;
308
308
  align-items: center;
309
309
  display: flex;
310
310
  gap: 8px;
311
- `,kw=Ni.div`
311
+ `,_w=Ni.div`
312
312
  flex: 1;
313
313
  display: flex;
314
314
  justify-content: flex-end;
315
- `,_w=Ni.div`
315
+ `,Rw=Ni.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
- `;import Rw from"styled-components";var Mw=Rw.div`
322
+ `;import Mw from"styled-components";var Iw=Mw.div`
323
323
  display: flex;
324
324
  flex-direction: column;
325
325
  justify-content: center;
@@ -342,7 +342,7 @@ Resources:
342
342
  left: -19px;
343
343
  top: -19px;
344
344
  }
345
- `,tt=Mw;import $o,{css as Iw}from"styled-components";var yr=$o.div`
345
+ `,tt=Iw;import $o,{css as Ww}from"styled-components";var yr=$o.div`
346
346
  text-align: left;
347
347
  flex-grow: 1;
348
348
  `,Kl=$o.div`
@@ -365,13 +365,13 @@ Resources:
365
365
  &::-webkit-scrollbar {
366
366
  display: none;
367
367
  }
368
- `,Oh=$o(nr)`
368
+ `,Dh=$o(nr)`
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
- `,Nh=Iw`
374
+ `,Uh=Ww`
375
375
  && {
376
376
  width: 100%;
377
377
  font-size: 16px;
@@ -413,9 +413,9 @@ Resources:
413
413
  font-size: 14px;
414
414
  margin-bottom: 24px;
415
415
  `,Se=$o.button`
416
- ${Nh}
417
- `,gp=$o.a`
418
- ${Nh}
416
+ ${Uh}
417
+ `,vp=$o.a`
418
+ ${Uh}
419
419
  `,Yr=$o.div`
420
420
  width: 100%;
421
421
  height: 100%;
@@ -423,7 +423,7 @@ Resources:
423
423
  display: flex;
424
424
  flex-direction: column;
425
425
  ${e=>e.if?"display: none;":""}
426
- `;import{Fragment as Nw,jsx as qn,jsxs as Ga}from"react/jsx-runtime";var Uh=()=>{let{navigate:e,app:t}=x();return Ga(Nw,{children:[qn(_,{}),Ga(Lw,{children:[qn(tt,{children:Ga("div",{children:[qn(Wh,{color:"var(--privy-color-warn-light)"}),qn(Ww,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),Ga(Ow,{children:[qn("h3",{children:"Account not found"}),Ga("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),qn(yr,{}),qn(H,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},Lw=Dh.div`
426
+ `;import{Fragment as Dw,jsx as qn,jsxs as Ga}from"react/jsx-runtime";var Bh=()=>{let{navigate:e,app:t}=x();return Ga(Dw,{children:[qn(_,{}),Ga(Ow,{children:[qn(tt,{children:Ga("div",{children:[qn(Oh,{color:"var(--privy-color-warn-light)"}),qn(Lw,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),Ga(Nw,{children:[qn("h3",{children:"Account not found"}),Ga("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),qn(yr,{}),qn(H,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},Ow=Fh.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
- `,Ow=Dh.div`
435
+ `,Nw=Fh.div`
436
436
  display: flex;
437
437
  flex-direction: column;
438
438
  gap: 8px;
439
- `;import Gh from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Dw from"@heroicons/react/24/solid/DocumentCheckIcon";import Uw from"styled-components";import Fh from"styled-components";import{jsx as Di,jsxs as Bh}from"react/jsx-runtime";var vp=Fh.div`
439
+ `;import qh from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Uw from"@heroicons/react/24/solid/DocumentCheckIcon";import Fw from"styled-components";import Hh from"styled-components";import{jsx as Di,jsxs as Gh}from"react/jsx-runtime";var Cp=Hh.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 Ui(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return Di(vp,{});if(!r&&!t)return Di(vp,{});let n=!!(t&&r);return Bh(vp,{children:["By logging in I agree to the"," ",r&&Di("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&Di("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var q=()=>Bh(Z,{children:[Di(Qo,{}),Di("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),Z=Fh.div`
448
+ `;function Ui(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return Di(Cp,{});if(!r&&!t)return Di(Cp,{});let n=!!(t&&r);return Gh(Cp,{children:["By logging in I agree to the"," ",r&&Di("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&Di("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var q=()=>Gh(Z,{children:[Di(Qo,{}),Di("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),Z=Hh.div`
449
449
  display: flex;
450
450
  align-items: center;
451
451
  justify-content: center;
@@ -480,7 +480,7 @@ Resources:
480
480
  @media (max-width: 440px) {
481
481
  padding: 10px 10px 20px;
482
482
  }
483
- `,pe=gt.div`
483
+ `,de=gt.div`
484
484
  font-size: 18px;
485
485
  line-height: 30px;
486
486
  text-align: center;
@@ -590,7 +590,7 @@ Resources:
590
590
  width: 100%;
591
591
  display: flex;
592
592
  justify-content: space-between;
593
- `,Hh=gt.p`
593
+ `,Vh=gt.p`
594
594
  text-align: left;
595
595
  width: 100%;
596
596
  color: var(--privy-color-foreground-3) !important;
@@ -624,7 +624,7 @@ Resources:
624
624
  &:hover {
625
625
  text-decoration: underline;
626
626
  }
627
- `,Ze=gt.div`
627
+ `,Qe=gt.div`
628
628
  display: flex;
629
629
  align-items: center;
630
630
  justify-content: center;
@@ -641,10 +641,10 @@ Resources:
641
641
  }
642
642
  `,$l=gt.div`
643
643
  color: var(--privy-color-error);
644
- `;import{Fragment as Hw,jsx as uo,jsxs as qa}from"react/jsx-runtime";var Vh=()=>{let{user:e,logout:t}=z(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=x(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=M(),c=m=>{m?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let f=async m=>{m.preventDefault(),await a(),e&&Gt(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 uo(Fw,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:f,onDecline:c})},Fw=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>qa(Hw,{children:[uo(_,{closeable:!1}),uo(Dw,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),uo(pe,{style:{marginTop:24},children:"One last step"}),uo(me,{children:"By signing up, you agree to our terms and privacy policy."}),qa(nr,{style:{marginTop:24},children:[e&&qa(gp,{target:"_blank",href:e,children:["View Terms ",uo(Gh,{style:{marginLeft:"auto"}})]}),t&&qa(gp,{target:"_blank",href:t,children:["View Privacy Policy ",uo(Gh,{style:{marginLeft:"auto"}})]})]}),qa(Bw,{style:{marginTop:24},children:[uo(Kr,{onClick:o,children:"No thanks"}),uo(H,{onClick:r,children:"Accept"})]}),uo(q,{})]}),Bw=Uw.div`
644
+ `;import{Fragment as Gw,jsx as uo,jsxs as qa}from"react/jsx-runtime";var zh=()=>{let{user:e,logout:t}=K(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=x(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=M(),c=m=>{m?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let f=async m=>{m.preventDefault(),await a(),e&&Gt(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 uo(Bw,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:f,onDecline:c})},Bw=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>qa(Gw,{children:[uo(_,{closeable:!1}),uo(Uw,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),uo(de,{style:{marginTop:24},children:"One last step"}),uo(me,{children:"By signing up, you agree to our terms and privacy policy."}),qa(nr,{style:{marginTop:24},children:[e&&qa(vp,{target:"_blank",href:e,children:["View Terms ",uo(qh,{style:{marginLeft:"auto"}})]}),t&&qa(vp,{target:"_blank",href:t,children:["View Privacy Policy ",uo(qh,{style:{marginLeft:"auto"}})]})]}),qa(Hw,{style:{marginTop:24},children:[uo(Kr,{onClick:o,children:"No thanks"}),uo(H,{onClick:r,children:"Accept"})]}),uo(q,{})]}),Hw=Fw.div`
645
645
  display: flex;
646
646
  gap: 10px;
647
- `;import zh from"styled-components";import Gw from"styled-components";var ec=Gw.span`
647
+ `;import Yh from"styled-components";import Vw from"styled-components";var ec=Vw.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
- `;import{jsx as qh}from"react/jsx-runtime";var tc=({style:e,...t})=>qh("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:qh("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"})});import{Fragment as Cp,jsx as mo,jsxs as rc}from"react/jsx-runtime";var Kh=()=>{let{navigate:e,app:t}=x(),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 rc(Cp,{children:[mo(_,{}),rc(Vw,{children:[mo(tt,{children:rc("div",{children:[mo(ec,{}),mo(tc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),rc(qw,{children:[typeof r=="string"?mo("h3",{children:r}):mo(Cp,{children:r}),typeof o=="string"?mo("p",{children:o}):mo(Cp,{children:o})]}),t?.allowlistConfig.errorCtaLink?mo(H,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):mo(H,{onClick:()=>{e("LANDING")},children:n})]})]})},Vw=zh.div`
662
+ `;import{jsx as Kh}from"react/jsx-runtime";var tc=({style:e,...t})=>Kh("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:Kh("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"})});import{Fragment as wp,jsx as mo,jsxs as rc}from"react/jsx-runtime";var jh=()=>{let{navigate:e,app:t}=x(),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 rc(wp,{children:[mo(_,{}),rc(qw,{children:[mo(tt,{children:rc("div",{children:[mo(ec,{}),mo(tc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),rc(zw,{children:[typeof r=="string"?mo("h3",{children:r}):mo(wp,{children:r}),typeof o=="string"?mo("p",{children:o}):mo(wp,{children:o})]}),t?.allowlistConfig.errorCtaLink?mo(H,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):mo(H,{onClick:()=>{e("LANDING")},children:n})]})]})},qw=Yh.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
- `,qw=zh.div`
670
+ `,zw=Yh.div`
671
671
  display: flex;
672
672
  flex-direction: column;
673
673
  gap: 8px;
674
- `;import Yw from"@heroicons/react/20/solid/CheckIcon";import jw from"@heroicons/react/24/outline/EnvelopeIcon";import Xw from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as bp,useState as Ka}from"react";import{isMobile as Qw}from"react-device-detect";import jn from"styled-components";import sr from"styled-components";var lr=sr.div`
674
+ `;import jw from"@heroicons/react/20/solid/CheckIcon";import Xw from"@heroicons/react/24/outline/EnvelopeIcon";import Qw from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as Ep,useState as Ka}from"react";import{isMobile as Zw}from"react-device-detect";import jn from"styled-components";import sr from"styled-components";var lr=sr.div`
675
675
  display: flex;
676
676
  flex-direction: column;
677
677
  align-items: flex-start;
@@ -686,7 +686,7 @@ Resources:
686
686
  justify-content: center;
687
687
  flex-grow: 1;
688
688
  width: 100%;
689
- `,Yh=sr.div`
689
+ `,Xh=sr.div`
690
690
  display: flex;
691
691
  flex-direction: column;
692
692
  align-items: center;
@@ -699,16 +699,16 @@ Resources:
699
699
  display: flex;
700
700
  flex-direction: column;
701
701
  width: 100%;
702
- `,Xe=sr.div`
702
+ `,je=sr.div`
703
703
  display: flex;
704
704
  flex-direction: column;
705
705
  gap: 8px;
706
- `,WO=sr.div`
706
+ `,LO=sr.div`
707
707
  display: flex;
708
708
  flex-direction: column;
709
709
  justify-content: space-between;
710
710
  height: 100%;
711
- `,jh=sr.div`
711
+ `,Qh=sr.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
- `,ie=sr.div`
734
+ `,ae=sr.div`
735
735
  height: 16px;
736
736
  `,se=sr.div`
737
737
  height: 12px;
738
- `,Xh=sr.div`
738
+ `,Zh=sr.div`
739
739
  position: relative;
740
740
  `,Bi=sr.div`
741
741
  height: ${e=>e.height??"12"}px;
742
- `,Qh=sr.div`
742
+ `,Jh=sr.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
- `;import wp from"styled-components";import{Fragment as Kw,jsx as za,jsxs as Jh}from"react/jsx-runtime";var Yn=({title:e,description:t,children:r,...o})=>za(Zh,{...o,children:Jh(Kw,{children:[za("h3",{children:e}),typeof t=="string"?za("p",{children:t}):t,r]})}),fo=wp(Yn)`
750
+ `;import bp from"styled-components";import{Fragment as Yw,jsx as za,jsxs as ey}from"react/jsx-runtime";var Yn=({title:e,description:t,children:r,...o})=>za($h,{...o,children:ey(Yw,{children:[za("h3",{children:e}),typeof t=="string"?za("p",{children:t}):t,r]})}),fo=bp(Yn)`
751
751
  margin-bottom: 24px;
752
- `,fe=({title:e,description:t,icon:r,children:o,...n})=>Jh(zw,{...n,children:[r||null,za("h3",{children:e}),t&&typeof t=="string"?za("p",{children:t}):t,o]}),Zh=wp.div`
752
+ `,fe=({title:e,description:t,icon:r,children:o,...n})=>ey(Kw,{...n,children:[r||null,za("h3",{children:e}),t&&typeof t=="string"?za("p",{children:t}):t,o]}),$h=bp.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
- `,zw=wp(Zh)`
772
+ `,Kw=bp($h)`
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
- `;import{Fragment as i4,jsx as qt,jsxs as Oo}from"react/jsx-runtime";var Ep=6,$h=new Array(Ep).fill(""),Zw=1400,Jw=30;var ty=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=x(),{closePrivyModal:a,resendEmailCode:l,resendSmsCode:s,getAuthMeta:c,loginWithCode:f,updateWallets:m,createAnalyticsEvent:u}=M(),{authenticated:C,logout:v,user:g}=z(),[b,E]=Ka($h),[R,S]=Ka(!1),[A,k]=Ka(null),[I,F]=Ka(null),[G,Y]=Ka(0);i.current=()=>null;let j=c()?.email?0:1,L=Me,U=L-500;bp(()=>{if(G){let ae=setTimeout(()=>{Y(G-1)},1e3);return()=>clearTimeout(ae)}},[G]),bp(()=>{if(C&&R&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let oe=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},U);return()=>clearTimeout(oe)}if(Gt(g,e?.embeddedWallets?.createOnLogin)){let oe=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:Ae=>{console.error(Ae),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Ae,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},U);return()=>clearTimeout(oe)}else{m();let oe=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),L);return()=>clearTimeout(oe)}}},[C,R,g]),bp(()=>{if(A&&I===0){let ae=setTimeout(()=>{E($h),k(null),document.querySelector("input[name=code-0]")?.focus()},Zw);return()=>clearTimeout(ae)}},[A]);let W=ae=>{ae.preventDefault();let oe=ae.currentTarget.value.replace(" ","");if(oe==="")return;if(isNaN(Number(oe))){k("Code should be numeric"),F(1);return}k(null),F(null);let Ae=Number(ae.currentTarget.name?.charAt(5)),Pe=[...oe||[""]].slice(0,Ep-Ae),ze=[...b.slice(0,Ae),...Pe,...b.slice(Ae+Pe.length)];E(ze);let Ke=Pe.length,mt=Math.min(Math.max(Ae+Ke,0),Ep-1);isNaN(Number(ae.currentTarget.value))||document.querySelector(`input[name=code-${mt}]`)?.focus(),ze.every(Je=>Je&&!isNaN(+Je))&&(document.querySelector(`input[name=code-${mt}]`)?.blur(),f(ze.join("")).then(()=>S(!0)).catch(le=>{if(le instanceof xt&&le.privyErrorCode==="invalid_credentials")k("Invalid or expired verification code");else if(le instanceof xt&&le.privyErrorCode==="cannot_link_more_of_type")k(le.message);else if(le instanceof xt&&le.privyErrorCode==="max_accounts_reached"){console.error(new Rr(le).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(le instanceof xt&&le.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(le instanceof xt&&le.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:le,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else k("Issue verifying code");F(0)}))},be=ae=>{I===1&&(k(null),F(null));let oe=[...b.slice(0,ae),"",...b.slice(ae+1)];E(oe),ae>0&&document.querySelector(`input[name=code-${ae-1}]`)?.focus()},Re=j==0?qt(jw,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):qt(Xw,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),re=j==0?Oo("p",{children:["Please check ",qt(ey,{children:c()?.email})," for an email from privy.io and enter your code below."]}):Oo("p",{children:["Please check ",qt(ey,{children:c()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return Oo(i4,{children:[qt(_,{backFn:()=>o()},"header"),Oo($w,{children:[qt(fe,{title:"Enter confirmation code",description:re,icon:Re}),Oo(Yh,{children:[Oo(e4,{children:[qt(t4,{fail:!!A,success:R,children:qt("span",{children:A||(R?"Success!":"")})}),qt("div",{children:b.map((ae,oe)=>qt("input",{name:`code-${oe}`,type:"text",value:b[oe],onChange:W,onKeyUp:Ae=>{Ae.key==="Backspace"&&be(oe)},inputMode:"numeric",autoFocus:oe===0,pattern:"[0-9]",className:`${R?"success":""} ${A?"fail":""}`,autoComplete:Qw?"one-time-code":"off"},oe))})]}),Oo(r4,{children:[Oo("span",{children:["Didn't get ",j==0?"an email":"a message","?"]}),G?Oo(n4,{children:[qt(Yw,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),qt("span",{children:"Code sent"})]}):qt(o4,{children:qt("button",{onClick:async()=>{Y(Jw),j==0?await l():await s()},children:"Resend code"})})]})]})]}),qt(q,{})]})},$w=jn.div`
780
+ `;import{Fragment as a4,jsx as qt,jsxs as Oo}from"react/jsx-runtime";var Tp=6,ty=new Array(Tp).fill(""),Jw=1400,$w=30;var oy=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=x(),{closePrivyModal:a,resendEmailCode:l,resendSmsCode:s,getAuthMeta:c,loginWithCode:f,updateWallets:m,createAnalyticsEvent:u}=M(),{authenticated:C,logout:v,user:g}=K(),[b,E]=Ka(ty),[R,S]=Ka(!1),[A,k]=Ka(null),[I,F]=Ka(null),[G,Y]=Ka(0);i.current=()=>null;let j=c()?.email?0:1,L=Me,U=L-500;Ep(()=>{if(G){let oe=setTimeout(()=>{Y(G-1)},1e3);return()=>clearTimeout(oe)}},[G]),Ep(()=>{if(C&&R&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let ne=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},U);return()=>clearTimeout(ne)}if(Gt(g,e?.embeddedWallets?.createOnLogin)){let ne=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:Ae=>{console.error(Ae),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Ae,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},U);return()=>clearTimeout(ne)}else{m();let ne=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),L);return()=>clearTimeout(ne)}}},[C,R,g]),Ep(()=>{if(A&&I===0){let oe=setTimeout(()=>{E(ty),k(null),document.querySelector("input[name=code-0]")?.focus()},Jw);return()=>clearTimeout(oe)}},[A]);let W=oe=>{oe.preventDefault();let ne=oe.currentTarget.value.replace(" ","");if(ne==="")return;if(isNaN(Number(ne))){k("Code should be numeric"),F(1);return}k(null),F(null);let Ae=Number(oe.currentTarget.name?.charAt(5)),Pe=[...ne||[""]].slice(0,Tp-Ae),ze=[...b.slice(0,Ae),...Pe,...b.slice(Ae+Pe.length)];E(ze);let Ke=Pe.length,mt=Math.min(Math.max(Ae+Ke,0),Tp-1);isNaN(Number(oe.currentTarget.value))||document.querySelector(`input[name=code-${mt}]`)?.focus(),ze.every(Ze=>Ze&&!isNaN(+Ze))&&(document.querySelector(`input[name=code-${mt}]`)?.blur(),f(ze.join("")).then(()=>S(!0)).catch(le=>{if(le instanceof xt&&le.privyErrorCode==="invalid_credentials")k("Invalid or expired verification code");else if(le instanceof xt&&le.privyErrorCode==="cannot_link_more_of_type")k(le.message);else if(le instanceof xt&&le.privyErrorCode==="max_accounts_reached"){console.error(new Rr(le).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(le instanceof xt&&le.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(le instanceof xt&&le.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:le,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else k("Issue verifying code");F(0)}))},be=oe=>{I===1&&(k(null),F(null));let ne=[...b.slice(0,oe),"",...b.slice(oe+1)];E(ne),oe>0&&document.querySelector(`input[name=code-${oe-1}]`)?.focus()},Re=j==0?qt(Xw,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):qt(Qw,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),re=j==0?Oo("p",{children:["Please check ",qt(ry,{children:c()?.email})," for an email from privy.io and enter your code below."]}):Oo("p",{children:["Please check ",qt(ry,{children:c()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return Oo(a4,{children:[qt(_,{backFn:()=>o()},"header"),Oo(e4,{children:[qt(fe,{title:"Enter confirmation code",description:re,icon:Re}),Oo(Xh,{children:[Oo(t4,{children:[qt(r4,{fail:!!A,success:R,children:qt("span",{children:A||(R?"Success!":"")})}),qt("div",{children:b.map((oe,ne)=>qt("input",{name:`code-${ne}`,type:"text",value:b[ne],onChange:W,onKeyUp:Ae=>{Ae.key==="Backspace"&&be(ne)},inputMode:"numeric",autoFocus:ne===0,pattern:"[0-9]",className:`${R?"success":""} ${A?"fail":""}`,autoComplete:Zw?"one-time-code":"off"},ne))})]}),Oo(o4,{children:[Oo("span",{children:["Didn't get ",j==0?"an email":"a message","?"]}),G?Oo(i4,{children:[qt(jw,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),qt("span",{children:"Code sent"})]}):qt(n4,{children:qt("button",{onClick:async()=>{Y($w),j==0?await l():await s()},children:"Resend code"})})]})]})]}),qt(q,{})]})},e4=jn.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=jn.div`
788
+ `,t4=jn.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=jn.div`
845
+ `,r4=jn.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
- `,r4=jn.div`
853
+ `,o4=jn.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
- `,o4=jn.div`
864
+ `,n4=jn.div`
865
865
  color: var(--privy-color-accent);
866
866
  padding: 2px 0;
867
867
  > button {
868
868
  text-decoration: underline;
869
869
  }
870
- `,n4=jn.div`
870
+ `,i4=jn.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
- `,ey=jn.span`
879
+ `,ry=jn.span`
880
880
  font-weight: 500;
881
881
  word-break: break-all;
882
- `;import d4 from"@heroicons/react/24/solid/CheckCircleIcon";import p4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Tp,useRef as u4,useState as Gi}from"react";import m4 from"styled-components";import a4 from"styled-components";import{Fragment as c4,jsx as Hi,jsxs as l4}from"react/jsx-runtime";var ry=({icon:e})=>{let t=e;return Hi(c4,{children:Hi(s4,{children:l4("div",{children:[Hi(lt,{}),typeof t=="string"?Hi("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?Hi(t,{style:{width:"38px",height:"38px"}}):Hi("span",{})]})})})},s4=a4.div`
882
+ `;import p4 from"@heroicons/react/24/solid/CheckCircleIcon";import u4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Sp,useRef as m4,useState as Gi}from"react";import f4 from"styled-components";import s4 from"styled-components";import{Fragment as d4,jsx as Hi,jsxs as c4}from"react/jsx-runtime";var ny=({icon:e})=>{let t=e;return Hi(d4,{children:Hi(l4,{children:c4("div",{children:[Hi(lt,{}),typeof t=="string"?Hi("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?Hi(t,{style:{width:"38px",height:"38px"}}):Hi("span",{})]})})})},l4=s4.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
- `;import{Fragment as h4,jsx as jr,jsxs as Sp}from"react/jsx-runtime";var ny=500,oy=ny*2,iy=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=x(),{status:a,token:l,waitForResult:s,reset:c,execute:f}=Te(),m=u4([]),u=U=>{m.current=[U,...m.current]},[C,v]=Gi(!0);Tp(()=>{let U=setTimeout(v,oy,!1);return u(U),()=>{m.current.forEach(W=>clearTimeout(W)),m.current=[]}},[]);let[g,b]=Gi(""),[E,R]=Gi("Checking that you are a human..."),[S,A]=Gi(jr(H,{onClick:()=>{},disabled:!0,children:"Continue"})),[k,I]=Gi(!1),[F,G]=Gi(3),Y=r?.captchaModalData,j=async U=>{try{await Y?.callback(U),Y?.onSuccessNavigateTo&&n(Y?.onSuccessNavigateTo,!1)}catch(W){if(W instanceof hr)return;{let be={error:W,previousScreen:e||"LANDING"};i({errorModalData:be}),n(Y?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};Tp(()=>{if(a==="success"){let U=setTimeout(async()=>{let W=await s();!W||Y?.userIntentRequired||j(W)},oy);u(U)}else if(a==="ready"){let U=setTimeout(()=>{a==="ready"&&f()},ny);u(U)}},[a]),Tp(()=>{if(!C)switch(a){case"success":b("Success!"),R("CAPTCHA passed successfully."),A(jr(H,{onClick:()=>{I(!0),j(l)},disabled:!Y?.userIntentRequired,loading:k,children:Y?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":b(""),R("Checking that you are a human..."),A(jr(H,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":b("Something went wrong"),F<=0?(R("If you use an adblocker or VPN, try disabling and re-attempting."),A(null)):(R("You did not pass CAPTCHA. Please try again."),A(jr(H,{onClick:L,children:"Retry"})));break;case"ready":default:break}},[a,C,k]);let L=async()=>{if(F<=0)return;G(W=>W-1),c(),f();let U=await s();!U||Y?.userIntentRequired||j(U)};return Sp(h4,{children:[jr(_,{backFn:!e||t===e?void 0:o}),Sp(f4,{children:[a==="success"?jr(d4,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?jr(p4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):jr(ry,{}),Sp(Xe,{children:[g?jr("h3",{children:g}):null,jr("p",{children:E})]}),S]}),jr(Z,{})]})},f4=m4.div`
905
+ `;import{Fragment as y4,jsx as jr,jsxs as Ap}from"react/jsx-runtime";var ay=500,iy=ay*2,sy=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=x(),{status:a,token:l,waitForResult:s,reset:c,execute:f}=Te(),m=m4([]),u=U=>{m.current=[U,...m.current]},[C,v]=Gi(!0);Sp(()=>{let U=setTimeout(v,iy,!1);return u(U),()=>{m.current.forEach(W=>clearTimeout(W)),m.current=[]}},[]);let[g,b]=Gi(""),[E,R]=Gi("Checking that you are a human..."),[S,A]=Gi(jr(H,{onClick:()=>{},disabled:!0,children:"Continue"})),[k,I]=Gi(!1),[F,G]=Gi(3),Y=r?.captchaModalData,j=async U=>{try{await Y?.callback(U),Y?.onSuccessNavigateTo&&n(Y?.onSuccessNavigateTo,!1)}catch(W){if(W instanceof hr)return;{let be={error:W,previousScreen:e||"LANDING"};i({errorModalData:be}),n(Y?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};Sp(()=>{if(a==="success"){let U=setTimeout(async()=>{let W=await s();!W||Y?.userIntentRequired||j(W)},iy);u(U)}else if(a==="ready"){let U=setTimeout(()=>{a==="ready"&&f()},ay);u(U)}},[a]),Sp(()=>{if(!C)switch(a){case"success":b("Success!"),R("CAPTCHA passed successfully."),A(jr(H,{onClick:()=>{I(!0),j(l)},disabled:!Y?.userIntentRequired,loading:k,children:Y?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":b(""),R("Checking that you are a human..."),A(jr(H,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":b("Something went wrong"),F<=0?(R("If you use an adblocker or VPN, try disabling and re-attempting."),A(null)):(R("You did not pass CAPTCHA. Please try again."),A(jr(H,{onClick:L,children:"Retry"})));break;case"ready":default:break}},[a,C,k]);let L=async()=>{if(F<=0)return;G(W=>W-1),c(),f();let U=await s();!U||Y?.userIntentRequired||j(U)};return Ap(y4,{children:[jr(_,{backFn:!e||t===e?void 0:o}),Ap(h4,{children:[a==="success"?jr(p4,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?jr(u4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):jr(ny,{}),Ap(je,{children:[g?jr("h3",{children:g}):null,jr("p",{children:E})]}),S]}),jr(Z,{})]})},h4=f4.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
- `;import{isMobile as by}from"react-device-detect";import Ey from"styled-components";import y4 from"@heroicons/react/24/outline/WalletIcon";import{jsx as Ap}from"react/jsx-runtime";var oc=({icon:e,name:t})=>typeof e=="string"?Ap("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?Ap(y4,{}):e?Ap(e,{}):null;import C4,{css as sy,keyframes as w4}from"styled-components";import{keyframes as g4,css as ay}from"styled-components";var v4=g4`
912
+ `;import{isMobile as Ty}from"react-device-detect";import Sy from"styled-components";import g4 from"@heroicons/react/24/outline/WalletIcon";import{jsx as Pp}from"react/jsx-runtime";var oc=({icon:e,name:t})=>typeof e=="string"?Pp("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?Pp(g4,{}):e?Pp(e,{}):null;import w4,{css as cy,keyframes as b4}from"styled-components";import{keyframes as v4,css as ly}from"styled-components";var C4=v4`
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
- `,nc=ay`
923
- ${e=>e.$isLoading?ay`
922
+ `,nc=ly`
923
+ ${e=>e.$isLoading?ly`
924
924
  width: 35%;
925
- animation: ${v4} 2s linear infinite;
925
+ animation: ${C4} 2s linear infinite;
926
926
  border-radius: var(--privy-border-radius-sm);
927
927
  `:""}
928
- `;import{jsx as E4}from"react/jsx-runtime";var Rt=({children:e,color:t,isLoading:r,isPulsing:o,className:n})=>E4(b4,{$color:t,$isLoading:r,$isPulsing:o,className:n,children:e}),b4=C4.span`
928
+ `;import{jsx as T4}from"react/jsx-runtime";var Rt=({children:e,color:t,isLoading:r,isPulsing:o,className:n})=>T4(E4,{$color:t,$isLoading:r,$isPulsing:o,className:n,children:e}),E4=w4.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=w4`
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=b4`
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 sy`
943
+ `;return cy`
944
944
  color: ${t};
945
945
  background-color: ${r};
946
- ${e.$isPulsing&&sy`
946
+ ${e.$isPulsing&&cy`
947
947
  animation: ${o} 3s linear infinite;
948
948
  `};
949
949
  `}}
950
950
 
951
951
  ${nc}
952
- `;import{jsx as Xr,jsxs as ly}from"react/jsx-runtime";var cy=({...e})=>ly("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[Xr("defs",{children:ly("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:[Xr("stop",{offset:"0",stopColor:"#f1562b"}),Xr("stop",{offset:"0.3",stopColor:"#f1542b"}),Xr("stop",{offset:"0.41",stopColor:"#f04d2a"}),Xr("stop",{offset:"0.49",stopColor:"#ef4229"}),Xr("stop",{offset:"0.5",stopColor:"#ef4029"}),Xr("stop",{offset:"0.56",stopColor:"#e83e28"}),Xr("stop",{offset:"0.67",stopColor:"#e13c26"}),Xr("stop",{offset:"1",stopColor:"#df3c26"})]})}),Xr("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"}),Xr("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"})]});import{jsx as Qr,jsxs as Ya}from"react/jsx-runtime";var dy=({style:e,...t})=>Ya("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:[Qr("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"}),Qr("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:Qr("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"})}),Ya("g",{mask:"url(#mask0_16909_31415)",children:[Qr("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"}),Qr("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"}),Qr("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"}}),Qr("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"}})]}),Ya("defs",{children:[Ya("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[Qr("stop",{stopColor:"#002D72"}),Qr("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),Ya("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[Qr("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),Qr("stop",{offset:"1",stopColor:"#002D72"})]})]})]});import{jsx as vr,jsxs as Vi}from"react/jsx-runtime";var py=e=>Vi("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[vr("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),vr("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)"}),vr("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)"}),vr("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)"}),vr("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)"}),Vi("defs",{children:[Vi("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"white"}),vr("stop",{offset:"1",stopColor:"white"})]}),Vi("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"#8697FF"}),vr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),Vi("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"#8697FF"}),vr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),Vi("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"white"}),vr("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});import{jsx as ue,jsxs as Cr}from"react/jsx-runtime";var uy=({style:e,...t})=>Cr("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:[ue("g",{clipPath:"url(#clip0_5_32)",children:Cr("g",{clipPath:"url(#clip1_5_32)",children:[ue("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:ue("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"})}),ue("g",{mask:"url(#mask0_5_32)",children:ue("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),ue("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)"}),ue("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),ue("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),ue("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),ue("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),ue("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),ue("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)"}),ue("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),ue("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),Cr("defs",{children:[Cr("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[ue("stop",{stopColor:"#174299"}),ue("stop",{offset:"1",stopColor:"#001E59"})]}),Cr("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[ue("stop",{offset:"0.770277",stopColor:"#FF4000"}),ue("stop",{offset:"1",stopColor:"#8754C9"})]}),Cr("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[ue("stop",{stopColor:"#FF4000"}),ue("stop",{offset:"1",stopColor:"#8754C9"})]}),Cr("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[ue("stop",{stopColor:"#8754C9"}),ue("stop",{offset:"1",stopColor:"#FF4000"})]}),Cr("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[ue("stop",{offset:"0.723929",stopColor:"#FFF700"}),ue("stop",{offset:"1",stopColor:"#FF9901"})]}),Cr("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[ue("stop",{stopColor:"#FFF700"}),ue("stop",{offset:"1",stopColor:"#FF9901"})]}),Cr("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[ue("stop",{stopColor:"#FFF700"}),ue("stop",{offset:"1",stopColor:"#FF9901"})]}),Cr("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[ue("stop",{offset:"0.59513",stopColor:"#00AAFF"}),ue("stop",{offset:"1",stopColor:"#01DA40"})]}),Cr("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[ue("stop",{stopColor:"#00AAFF"}),ue("stop",{offset:"1",stopColor:"#01DA40"})]}),Cr("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:[ue("stop",{stopColor:"#00AAFF"}),ue("stop",{offset:"1",stopColor:"#01DA40"})]}),ue("clipPath",{id:"clip0_5_32",children:ue("rect",{width:"120",height:"120",fill:"white"})}),ue("clipPath",{id:"clip1_5_32",children:ue("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as ic,jsxs as T4}from"react/jsx-runtime";var my=({style:e,...t})=>T4("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:[ic("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),ic("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),ic("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),ic("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]});import{jsx as ho,jsxs as fy}from"react/jsx-runtime";var hy=({style:e,...t})=>fy("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:[ho("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),fy("g",{children:[ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"})]})]});import{jsx as ja,jsxs as yy}from"react/jsx-runtime";var gy=({style:e,...t})=>yy("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:[yy("g",{clipPath:"url(#clip0_1704_1423)",children:[ja("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"}),ja("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"})]}),ja("defs",{children:ja("clipPath",{id:"clip0_1704_1423",children:ja("rect",{width:"176",height:"176",fill:"white"})})})]});var Nr={coinbase_wallet:{logo:Wo,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Wo,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:ki,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:co,displayName:"Phantom"},rainbow:{logo:uy,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Ua,displayName:"WalletConnect"},zerion:{logo:gy,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:cy,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:dy,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:hy,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:py,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:my}},tn=(e,t,r)=>{if(Nr[e]?.displayName)return e==="coinbase_wallet"?Nr[r].displayName:Nr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},ac=(e,t,r)=>{if(Nr[e]?.logo)return e==="coinbase_wallet"?Nr[r].logo:Nr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Ua};function qi(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}import{useContext as S4,useEffect as A4,useState as P4}from"react";import{createContext as x4}from"react";import{jsx as k4}from"react/jsx-runtime";var Cy=x4({}),wy=({children:e})=>{let t=De(),[r,o]=P4({});return xe("login",{onComplete:(n,i,a,l,s)=>{!s||s.type==="passkey"||s.type==="cross_app"||s.type==="wallet"&&s.walletClientType==="privy"||(X.put(vy(t.id),s.type),s.type==="wallet"?(X.put(Pp(t.id),s.walletClientType),o({accountType:s.type,walletClientType:s.walletClientType})):(X.del(Pp(t.id)),o({accountType:s.type})))}}),A4(()=>{if(!t.id)return;let n=X.get(vy(t.id)),i=X.get(Pp(t.id));n&&o(n==="wallet"?{accountType:n,walletClientType:i}:{accountType:n})},[t.id]),k4(Cy.Provider,{value:r,children:e})},vy=e=>`privy:${e}:recent-login-method`,Pp=e=>`privy:${e}:recent-login-wallet-client`,Mt=()=>S4(Cy);import{jsx as sc,jsxs as M4}from"react/jsx-runtime";var Xn=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=x(),{connectWallet:a}=M(),l=Mt(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches,f;return n.connectorType==="phantom"?f=()=>{zo()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(by?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&by&&!c&&!Js()?f=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:f=()=>{qi(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},M4(_4,{onClick:f,children:[sc(oc,{icon:ac(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),sc("span",{children:tn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?sc(R4,{color:"gray",children:"Recent"}):sc("span",{id:"connect-text",children:"Connect"})]})},_4=Ey(Se)`
952
+ `;import{jsx as Xr,jsxs as dy}from"react/jsx-runtime";var py=({...e})=>dy("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[Xr("defs",{children:dy("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:[Xr("stop",{offset:"0",stopColor:"#f1562b"}),Xr("stop",{offset:"0.3",stopColor:"#f1542b"}),Xr("stop",{offset:"0.41",stopColor:"#f04d2a"}),Xr("stop",{offset:"0.49",stopColor:"#ef4229"}),Xr("stop",{offset:"0.5",stopColor:"#ef4029"}),Xr("stop",{offset:"0.56",stopColor:"#e83e28"}),Xr("stop",{offset:"0.67",stopColor:"#e13c26"}),Xr("stop",{offset:"1",stopColor:"#df3c26"})]})}),Xr("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"}),Xr("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"})]});import{jsx as Qr,jsxs as Ya}from"react/jsx-runtime";var uy=({style:e,...t})=>Ya("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:[Qr("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"}),Qr("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:Qr("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"})}),Ya("g",{mask:"url(#mask0_16909_31415)",children:[Qr("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"}),Qr("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"}),Qr("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"}}),Qr("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"}})]}),Ya("defs",{children:[Ya("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[Qr("stop",{stopColor:"#002D72"}),Qr("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),Ya("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[Qr("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),Qr("stop",{offset:"1",stopColor:"#002D72"})]})]})]});import{jsx as vr,jsxs as Vi}from"react/jsx-runtime";var my=e=>Vi("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[vr("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),vr("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)"}),vr("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)"}),vr("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)"}),vr("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)"}),Vi("defs",{children:[Vi("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"white"}),vr("stop",{offset:"1",stopColor:"white"})]}),Vi("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"#8697FF"}),vr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),Vi("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"#8697FF"}),vr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),Vi("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"white"}),vr("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});import{jsx as pe,jsxs as Cr}from"react/jsx-runtime";var fy=({style:e,...t})=>Cr("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:[pe("g",{clipPath:"url(#clip0_5_32)",children:Cr("g",{clipPath:"url(#clip1_5_32)",children:[pe("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:pe("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"})}),pe("g",{mask:"url(#mask0_5_32)",children:pe("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),pe("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)"}),pe("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),pe("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),pe("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),pe("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),pe("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),pe("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)"}),pe("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),pe("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),Cr("defs",{children:[Cr("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[pe("stop",{stopColor:"#174299"}),pe("stop",{offset:"1",stopColor:"#001E59"})]}),Cr("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[pe("stop",{offset:"0.770277",stopColor:"#FF4000"}),pe("stop",{offset:"1",stopColor:"#8754C9"})]}),Cr("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[pe("stop",{stopColor:"#FF4000"}),pe("stop",{offset:"1",stopColor:"#8754C9"})]}),Cr("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[pe("stop",{stopColor:"#8754C9"}),pe("stop",{offset:"1",stopColor:"#FF4000"})]}),Cr("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[pe("stop",{offset:"0.723929",stopColor:"#FFF700"}),pe("stop",{offset:"1",stopColor:"#FF9901"})]}),Cr("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[pe("stop",{stopColor:"#FFF700"}),pe("stop",{offset:"1",stopColor:"#FF9901"})]}),Cr("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[pe("stop",{stopColor:"#FFF700"}),pe("stop",{offset:"1",stopColor:"#FF9901"})]}),Cr("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[pe("stop",{offset:"0.59513",stopColor:"#00AAFF"}),pe("stop",{offset:"1",stopColor:"#01DA40"})]}),Cr("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[pe("stop",{stopColor:"#00AAFF"}),pe("stop",{offset:"1",stopColor:"#01DA40"})]}),Cr("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:[pe("stop",{stopColor:"#00AAFF"}),pe("stop",{offset:"1",stopColor:"#01DA40"})]}),pe("clipPath",{id:"clip0_5_32",children:pe("rect",{width:"120",height:"120",fill:"white"})}),pe("clipPath",{id:"clip1_5_32",children:pe("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as ic,jsxs as S4}from"react/jsx-runtime";var hy=({style:e,...t})=>S4("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:[ic("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),ic("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),ic("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),ic("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]});import{jsx as ho,jsxs as yy}from"react/jsx-runtime";var gy=({style:e,...t})=>yy("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:[ho("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),yy("g",{children:[ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"}),ho("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"})]})]});import{jsx as ja,jsxs as vy}from"react/jsx-runtime";var Cy=({style:e,...t})=>vy("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:[vy("g",{clipPath:"url(#clip0_1704_1423)",children:[ja("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"}),ja("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"})]}),ja("defs",{children:ja("clipPath",{id:"clip0_1704_1423",children:ja("rect",{width:"176",height:"176",fill:"white"})})})]});var Nr={coinbase_wallet:{logo:Wo,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Wo,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:ki,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:co,displayName:"Phantom"},rainbow:{logo:fy,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Ua,displayName:"WalletConnect"},zerion:{logo:Cy,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:py,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:uy,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:gy,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:my,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:hy}},tn=(e,t,r)=>{if(Nr[e]?.displayName)return e==="coinbase_wallet"?Nr[r].displayName:Nr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},ac=(e,t,r)=>{if(Nr[e]?.logo)return e==="coinbase_wallet"?Nr[r].logo:Nr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Ua};function qi(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}import{useContext as A4,useEffect as P4,useState as x4}from"react";import{createContext as k4}from"react";import{jsx as _4}from"react/jsx-runtime";var by=k4({}),Ey=({children:e})=>{let t=De(),[r,o]=x4({});return xe("login",{onComplete:(n,i,a,l,s)=>{!s||s.type==="passkey"||s.type==="cross_app"||s.type==="wallet"&&s.walletClientType==="privy"||(X.put(wy(t.id),s.type),s.type==="wallet"?(X.put(xp(t.id),s.walletClientType),o({accountType:s.type,walletClientType:s.walletClientType})):(X.del(xp(t.id)),o({accountType:s.type})))}}),P4(()=>{if(!t.id)return;let n=X.get(wy(t.id)),i=X.get(xp(t.id));n&&o(n==="wallet"?{accountType:n,walletClientType:i}:{accountType:n})},[t.id]),_4(by.Provider,{value:r,children:e})},wy=e=>`privy:${e}:recent-login-method`,xp=e=>`privy:${e}:recent-login-wallet-client`,Mt=()=>A4(by);import{jsx as sc,jsxs as I4}from"react/jsx-runtime";var Xn=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=x(),{connectWallet:a}=M(),l=Mt(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches,f;return n.connectorType==="phantom"?f=()=>{zo()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(Ty?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Ty&&!c&&!Js()?f=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:f=()=>{qi(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},I4(R4,{onClick:f,children:[sc(oc,{icon:ac(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),sc("span",{children:tn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?sc(M4,{color:"gray",children:"Recent"}):sc("span",{id:"connect-text",children:"Connect"})]})},R4=Sy(Se)`
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
- `,R4=Ey(Rt)`
974
+ `,M4=Sy(Rt)`
975
975
  margin-left: auto;
976
- `;import{Fragment as N4,jsx as zi,jsxs as D4}from"react/jsx-runtime";var I4=["coinbase_wallet"],W4=["metamask","okx_wallet","rainbow","uniswap","uniswap_extension","zerion","rabby_wallet","cryptocom"],L4=["safe"],O4=["phantom"],Ki=({connectOnly:e})=>{let{connectors:t}=M(),{app:r}=x(),o=rn(r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return D4(N4,{children:[...o]})},rn=(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 f=t.filter(({connectorType:m,walletClientType:u})=>u==="uniswap_wallet_extension"||u==="uniswap_extension"?!o.includes("uniswap"):u==="crypto.com_wallet_extension"?!o.includes("cryptocom"):m==="injected"&&!o.includes(u));for(let m of f){let{walletClientType:u,walletBranding:C}=m;(u==="unknown"?a:i).push(zi(Xn,{connectOnly:r,provider:u,logo:C.icon,displayName:C.name,connector:m},`${c}-${u}`))}}else if(O4.includes(c)){let f=t.find(m=>m.connectorType==="injected"&&m.walletClientType===c||m.connectorType===c);f&&i.push(zi(Xn,{connectOnly:r,provider:c,connector:f},c))}else if(W4.includes(c)){let f=t.find(m=>c==="uniswap"?m.walletClientType==="uniswap_wallet_extension"||m.walletClientType==="uniswap_extension":c==="cryptocom"?m.walletClientType==="crypto.com_wallet_extension":m.connectorType==="injected"&&m.walletClientType===c);n&&!f&&(f=s),f&&i.push(zi(Xn,{connectOnly:r,provider:c,connector:f,logo:f.connectorType==="injected"?f.walletBranding.icon:void 0,displayName:f.connectorType==="injected"?f.walletBranding.name:void 0},c))}else if(I4.includes(c)){let f=t.find(({connectorType:m})=>m===c);f&&i.push(zi(Xn,{connectOnly:r,provider:c,connector:f},c))}else L4.includes(c)?s&&l.push(zi(Xn,{connectOnly:r,provider:c,connector:s},c)):c==="wallet_connect"&&s&&l.push(zi(Xn,{connectOnly:r,provider:c,connector:s},c));return[...a,...i,...l]};import{Fragment as U4,jsx as Xa,jsxs as F4}from"react/jsx-runtime";var Ty=()=>{let{app:e}=x(),{linkingOrConnectingHint:t}=M(),r=t?`Connect the wallet with address ${et(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return F4(U4,{children:[Xa(_,{},"header"),Xa(fo,{title:"Connect your wallet",description:r}),Xa(nr,{children:Xa(Ki,{connectOnly:!0})}),Xa(q,{})]})};import{Fragment as B4,jsx as Yi,jsxs as H4}from"react/jsx-runtime";var Sy=()=>{let{app:e}=x(),{linkingOrConnectingHint:t}=M(),r=t?`Connect the wallet with address ${et(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return H4(B4,{children:[Yi(_,{},"header"),Yi(Yn,{title:"Connect your wallet",description:r}),Yi(nr,{children:Yi(Ki,{connectOnly:!0})}),e&&Yi(Ui,{app:e,alwaysShowImplicitConsent:!0}),Yi(q,{})]})};import{useEffect as Ry,useState as My}from"react";import{isMobile as X4}from"react-device-detect";import Q4 from"styled-components";import{useEffect as xp,useState as on}from"react";import{isMobile as lc}from"react-device-detect";import ky from"styled-components";import{useEffect as Ay,useRef as G4}from"react";var V4=(e,t)=>{let r=G4(()=>{});Ay(()=>{r.current=e}),Ay(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Py=V4;import{useState as q4,useEffect as z4,useCallback as K4}from"react";function xy(){let[e,t]=q4(!1),r=K4(()=>{document.hidden&&t(!0)},[]);return z4(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as _p,jsx as vt,jsxs as ji}from"react/jsx-runtime";var kp=2,Rp=e=>e?.privyErrorCode==="linked_to_another_user"?ao.ERROR_USER_EXISTS:e instanceof Tt&&!e.details.default?e.details:e instanceof Si?ao.ERROR_TIMED_OUT:e instanceof Ai?ao.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode==="cannot_link_more_of_type"?ao.ERROR_USER_LIMIT_REACHED:ao.ERROR_WALLET_CONNECTION,_y=()=>{let[e,t]=on(!1),[r,o]=on(!1),[n,i]=on(void 0),{authenticated:a,logout:l}=z(),{app:s,navigate:c,navigateBack:f,lastScreen:m,currentScreen:u,setModalData:C}=x(),{getAuthFlow:v,walletConnectionStatus:g,closePrivyModal:b,initLoginWithWallet:E,loginWithWallet:R,updateWallets:S,createAnalyticsEvent:A}=M(),{walletConnectors:k}=z(),[I,F]=on(0),{user:G}=z(),[Y]=on(G?.linkedAccounts.length||0),[j,L]=on(""),[U,W]=on(""),[be,Re]=on(!1),{hasTabbedAway:re}=xy(),{enabled:ae,token:oe}=Te(),Ae=lc&&g?.connector?.connectorType==="wallet_connect_v2"||lc&&g?.connector?.connectorType==="coinbase_wallet"||lc&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",Pe=g?.status==="connected",ze=g?.status==="switching_to_supported_chain";xp(()=>{let V=v(),J=V instanceof Io?V:void 0;if(Pe&&!J&&(ae&&!oe&&!a?(C({captchaModalData:{callback:Be=>E(g.connectedWallet,Be).then(()=>{Re(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):E(g.connectedWallet,oe).then(()=>{Re(!0)})),J&&Ae&&Pe&&!J.preparedMessage){J.buildSiweMessage();return}!J||Ae||!Pe||r||(async()=>{o(!0),i(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await qd(2500),await mt()}catch(Be){console.warn("Auto-prompted signature failed",Be)}finally{o(!1)}})()},[I,Pe,be]),xp(()=>{if(G&&e){let J=Me-500;if(s?.legal.requireUsersAcceptTerms&&!G.hasAcceptedTerms){let _o=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},J);return()=>clearTimeout(_o)}if(Gt(G,s?.embeddedWallets?.createOnLogin)){let _o=setTimeout(()=>{C({createWallet:{onSuccess:()=>{},onFailure:oo=>{console.error(oo),A({eventName:"embedded_wallet_creation_failure_logout",payload:{error:oo,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},J);return()=>clearTimeout(_o)}S();let Be=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Me);return()=>clearTimeout(Be)}},[G,e]);let Ke=V=>{if(V?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(V?.privyErrorCode==="max_accounts_reached"){console.error(new Rr(V).toString()),c("USER_LIMIT_REACHED_SCREEN");return}else if(V?.privyErrorCode==="user_does_not_exist"){c("ACCOUNT_NOT_FOUND_SCREEN");return}i(Rp(V))};async function mt(){try{await R(),t(!0)}catch(V){Ke(V)}finally{o(!1)}}xp(()=>{g?.connectError&&Ke(g?.connectError)},[g]),Py(()=>{let V=Je==="wallet_connect_v2"&&g?.connector instanceof zr?g.connector.redirectUri:void 0;V&&L(V);let J=Je==="wallet_connect_v2"&&g?.connector instanceof zr?g.connector.fallbackUniversalRedirectUri:void 0;J&&W(J)},g?.connector instanceof zr&&!j?500:null);let Je=g?.connector?.connectorType||"injected",le=g?.connector?.walletClientType||"unknown",Zt=Nr[le]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",mr=Nr[le]?.logo||g?.connector?.walletBranding.icon||(V=>vt(xi,{...V})),_r=Zt==="Browser Extension"?Zt.toLowerCase():Zt,O;e?O=`Successfully connected with ${_r}`:n?O=n.message:ze?O="Switching networks":Pe?O=r&&Ae?"Signing":"Sign to verify":O=`Waiting for ${_r}`;let We="Don\u2019t see your wallet? Check your other browser windows.";if(e){let V=G?.linkedAccounts.length||0;Y===V?We="Wallet was already linked.":We="You\u2019re good to go!"}else I>=kp&&n?We="Unable to connect wallet":n?We=n.detail:ze?We="Switch your wallet to the requested network.":Pe&&Ae?We="Sign the message in your wallet to verify it belongs to you.":le==="metamask"&&lc?We="Click continue to open and connect MetaMask.":le==="metamask"?We="For the best experience, connect only one wallet at a time.":Je==="wallet_connect"?We="Open your mobile wallet app to continue":Je==="coinbase_wallet"&&(Js()||(sp(G)?We="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":We="Open the Coinbase app on your phone to continue."));let ft=k?.walletConnectors?.find(V=>V.walletClientType==="coinbase_wallet"),D=le==="coinbase_wallet"&&(sp(G)||n===ao.ERROR_USER_EXISTS);return ji(_p,{children:[vt(_,{backFn:!m||u===m?void 0:f}),ji(Y4,{children:[vt(Mp,{walletLogo:mr,success:e,fail:!!n}),ji(Xe,{children:[vt("h3",{children:O}),vt("p",{children:We}),!Pe&&j&&!re?ji("p",{children:["Still here?"," ",vt("a",{href:j,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),U&&ji(_p,{children:[" ","or"," ",vt("a",{href:U,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),D?vt(H,{onClick:()=>ft&&ft?.disconnect(),disabled:e,children:"Use a different wallet"}):n==ao.ERROR_USER_EXISTS&&u!==m?vt(H,{onClick:f,children:"Use a different wallet"}):Pe&&!e&&Ae?vt(H,{onClick:()=>{o(!0),mt()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&I<kp?vt(H,{onClick:()=>{F(I+1),i(void 0),Pe?(o(!0),mt()):g?.connectRetry()},disabled:!e&&(!n?.retryable||I>=kp),children:"Retry"}):!e&&!n?vt(H,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),vt(Z,{})]})},Y4=ky.div`
976
+ `;import{Fragment as D4,jsx as zi,jsxs as U4}from"react/jsx-runtime";var W4=["coinbase_wallet"],L4=["metamask","okx_wallet","rainbow","uniswap","uniswap_extension","zerion","rabby_wallet","cryptocom"],O4=["safe"],N4=["phantom"],Ki=({connectOnly:e})=>{let{connectors:t}=M(),{app:r}=x(),o=rn(r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return U4(D4,{children:[...o]})},rn=(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 f=t.filter(({connectorType:m,walletClientType:u})=>u==="uniswap_wallet_extension"||u==="uniswap_extension"?!o.includes("uniswap"):u==="crypto.com_wallet_extension"?!o.includes("cryptocom"):m==="injected"&&!o.includes(u));for(let m of f){let{walletClientType:u,walletBranding:C}=m;(u==="unknown"?a:i).push(zi(Xn,{connectOnly:r,provider:u,logo:C.icon,displayName:C.name,connector:m},`${c}-${u}`))}}else if(N4.includes(c)){let f=t.find(m=>m.connectorType==="injected"&&m.walletClientType===c||m.connectorType===c);f&&i.push(zi(Xn,{connectOnly:r,provider:c,connector:f},c))}else if(L4.includes(c)){let f=t.find(m=>c==="uniswap"?m.walletClientType==="uniswap_wallet_extension"||m.walletClientType==="uniswap_extension":c==="cryptocom"?m.walletClientType==="crypto.com_wallet_extension":m.connectorType==="injected"&&m.walletClientType===c);n&&!f&&(f=s),f&&i.push(zi(Xn,{connectOnly:r,provider:c,connector:f,logo:f.connectorType==="injected"?f.walletBranding.icon:void 0,displayName:f.connectorType==="injected"?f.walletBranding.name:void 0},c))}else if(W4.includes(c)){let f=t.find(({connectorType:m})=>m===c);f&&i.push(zi(Xn,{connectOnly:r,provider:c,connector:f},c))}else O4.includes(c)?s&&l.push(zi(Xn,{connectOnly:r,provider:c,connector:s},c)):c==="wallet_connect"&&s&&l.push(zi(Xn,{connectOnly:r,provider:c,connector:s},c));return[...a,...i,...l]};import{Fragment as F4,jsx as Xa,jsxs as B4}from"react/jsx-runtime";var Ay=()=>{let{app:e}=x(),{linkingOrConnectingHint:t}=M(),r=t?`Connect the wallet with address ${et(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return B4(F4,{children:[Xa(_,{},"header"),Xa(fo,{title:"Connect your wallet",description:r}),Xa(nr,{children:Xa(Ki,{connectOnly:!0})}),Xa(q,{})]})};import{Fragment as H4,jsx as Yi,jsxs as G4}from"react/jsx-runtime";var Py=()=>{let{app:e}=x(),{linkingOrConnectingHint:t}=M(),r=t?`Connect the wallet with address ${et(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return G4(H4,{children:[Yi(_,{},"header"),Yi(Yn,{title:"Connect your wallet",description:r}),Yi(nr,{children:Yi(Ki,{connectOnly:!0})}),e&&Yi(Ui,{app:e,alwaysShowImplicitConsent:!0}),Yi(q,{})]})};import{useEffect as Iy,useState as Wy}from"react";import{isMobile as Q4}from"react-device-detect";import Z4 from"styled-components";import{useEffect as kp,useState as on}from"react";import{isMobile as lc}from"react-device-detect";import Ry from"styled-components";import{useEffect as xy,useRef as V4}from"react";var q4=(e,t)=>{let r=V4(()=>{});xy(()=>{r.current=e}),xy(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},ky=q4;import{useState as z4,useEffect as K4,useCallback as Y4}from"react";function _y(){let[e,t]=z4(!1),r=Y4(()=>{document.hidden&&t(!0)},[]);return K4(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as Rp,jsx as vt,jsxs as ji}from"react/jsx-runtime";var _p=2,Mp=e=>e?.privyErrorCode==="linked_to_another_user"?ao.ERROR_USER_EXISTS:e instanceof Tt&&!e.details.default?e.details:e instanceof Si?ao.ERROR_TIMED_OUT:e instanceof Ai?ao.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode==="cannot_link_more_of_type"?ao.ERROR_USER_LIMIT_REACHED:ao.ERROR_WALLET_CONNECTION,My=()=>{let[e,t]=on(!1),[r,o]=on(!1),[n,i]=on(void 0),{authenticated:a,logout:l}=K(),{app:s,navigate:c,navigateBack:f,lastScreen:m,currentScreen:u,setModalData:C}=x(),{getAuthFlow:v,walletConnectionStatus:g,closePrivyModal:b,initLoginWithWallet:E,loginWithWallet:R,updateWallets:S,createAnalyticsEvent:A}=M(),{walletConnectors:k}=K(),[I,F]=on(0),{user:G}=K(),[Y]=on(G?.linkedAccounts.length||0),[j,L]=on(""),[U,W]=on(""),[be,Re]=on(!1),{hasTabbedAway:re}=_y(),{enabled:oe,token:ne}=Te(),Ae=lc&&g?.connector?.connectorType==="wallet_connect_v2"||lc&&g?.connector?.connectorType==="coinbase_wallet"||lc&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",Pe=g?.status==="connected",ze=g?.status==="switching_to_supported_chain";kp(()=>{let V=v(),J=V instanceof Io?V:void 0;if(Pe&&!J&&(oe&&!ne&&!a?(C({captchaModalData:{callback:Be=>E(g.connectedWallet,Be).then(()=>{Re(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):E(g.connectedWallet,ne).then(()=>{Re(!0)})),J&&Ae&&Pe&&!J.preparedMessage){J.buildSiweMessage();return}!J||Ae||!Pe||r||(async()=>{o(!0),i(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await zd(2500),await mt()}catch(Be){console.warn("Auto-prompted signature failed",Be)}finally{o(!1)}})()},[I,Pe,be]),kp(()=>{if(G&&e){let J=Me-500;if(s?.legal.requireUsersAcceptTerms&&!G.hasAcceptedTerms){let _o=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},J);return()=>clearTimeout(_o)}if(Gt(G,s?.embeddedWallets?.createOnLogin)){let _o=setTimeout(()=>{C({createWallet:{onSuccess:()=>{},onFailure:oo=>{console.error(oo),A({eventName:"embedded_wallet_creation_failure_logout",payload:{error:oo,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},J);return()=>clearTimeout(_o)}S();let Be=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Me);return()=>clearTimeout(Be)}},[G,e]);let Ke=V=>{if(V?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(V?.privyErrorCode==="max_accounts_reached"){console.error(new Rr(V).toString()),c("USER_LIMIT_REACHED_SCREEN");return}else if(V?.privyErrorCode==="user_does_not_exist"){c("ACCOUNT_NOT_FOUND_SCREEN");return}i(Mp(V))};async function mt(){try{await R(),t(!0)}catch(V){Ke(V)}finally{o(!1)}}kp(()=>{g?.connectError&&Ke(g?.connectError)},[g]),ky(()=>{let V=Ze==="wallet_connect_v2"&&g?.connector instanceof zr?g.connector.redirectUri:void 0;V&&L(V);let J=Ze==="wallet_connect_v2"&&g?.connector instanceof zr?g.connector.fallbackUniversalRedirectUri:void 0;J&&W(J)},g?.connector instanceof zr&&!j?500:null);let Ze=g?.connector?.connectorType||"injected",le=g?.connector?.walletClientType||"unknown",Zt=Nr[le]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",mr=Nr[le]?.logo||g?.connector?.walletBranding.icon||(V=>vt(xi,{...V})),_r=Zt==="Browser Extension"?Zt.toLowerCase():Zt,O;e?O=`Successfully connected with ${_r}`:n?O=n.message:ze?O="Switching networks":Pe?O=r&&Ae?"Signing":"Sign to verify":O=`Waiting for ${_r}`;let We="Don\u2019t see your wallet? Check your other browser windows.";if(e){let V=G?.linkedAccounts.length||0;Y===V?We="Wallet was already linked.":We="You\u2019re good to go!"}else I>=_p&&n?We="Unable to connect wallet":n?We=n.detail:ze?We="Switch your wallet to the requested network.":Pe&&Ae?We="Sign the message in your wallet to verify it belongs to you.":le==="metamask"&&lc?We="Click continue to open and connect MetaMask.":le==="metamask"?We="For the best experience, connect only one wallet at a time.":Ze==="wallet_connect"?We="Open your mobile wallet app to continue":Ze==="coinbase_wallet"&&(Js()||(lp(G)?We="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":We="Open the Coinbase app on your phone to continue."));let ft=k?.walletConnectors?.find(V=>V.walletClientType==="coinbase_wallet"),D=le==="coinbase_wallet"&&(lp(G)||n===ao.ERROR_USER_EXISTS);return ji(Rp,{children:[vt(_,{backFn:!m||u===m?void 0:f}),ji(j4,{children:[vt(Ip,{walletLogo:mr,success:e,fail:!!n}),ji(je,{children:[vt("h3",{children:O}),vt("p",{children:We}),!Pe&&j&&!re?ji("p",{children:["Still here?"," ",vt("a",{href:j,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),U&&ji(Rp,{children:[" ","or"," ",vt("a",{href:U,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),D?vt(H,{onClick:()=>ft&&ft?.disconnect(),disabled:e,children:"Use a different wallet"}):n==ao.ERROR_USER_EXISTS&&u!==m?vt(H,{onClick:f,children:"Use a different wallet"}):Pe&&!e&&Ae?vt(H,{onClick:()=>{o(!0),mt()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&I<_p?vt(H,{onClick:()=>{F(I+1),i(void 0),Pe?(o(!0),mt()):g?.connectRetry()},disabled:!e&&(!n?.retryable||I>=_p),children:"Retry"}):!e&&!n?vt(H,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),vt(Z,{})]})},j4=Ry.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
- `,j4=ky.div`
983
+ `,X4=Ry.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
- `,Mp=e=>{let t=e.walletLogo;return vt(_p,{children:vt(j4,{children:ji("div",{children:[vt(lt,{success:e.success,fail:e.fail}),typeof t=="string"?vt("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):vt(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as J4,jsx as No,jsxs as Ip}from"react/jsx-runtime";var cc=2,Iy=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=x(),{walletConnectionStatus:i,closePrivyModal:a}=M(),[l,s]=My(void 0),[c,f]=My(0),m=i?.status==="connected",u=i?.status==="switching_to_supported_chain";Ry(()=>{if(m){let k;if(n?.externalConnectWallet?.onCompleteNavigateTo){let I=n.externalConnectWallet.onCompleteNavigateTo;k=setTimeout(()=>{t(I)},Me)}else k=setTimeout(a,Me);return()=>clearTimeout(k)}},[m]);let C=k=>{s(Rp(k))};Ry(()=>{i?.connectError&&C(i?.connectError)},[i]);let v=i?.connector?.connectorType||"injected",g=i?.connector?.walletClientType||"unknown",b=Nr[g]?.displayName||i?.connector?.walletBranding.name||"Browser Extension",E=Nr[g]?.logo||i?.connector?.walletBranding.icon||(k=>No(xi,{...k})),R=b==="Browser Extension"?b.toLowerCase():b,S;m?S=`Successfully connected with ${R}`:l?S=l.message:u?S="Switching networks":S=`Waiting for ${R}`;let A="Don\u2019t see your wallet? Check your other browser windows.";return m?A="You\u2019re good to go!":c>=cc&&l?A="Unable to connect wallet":l?A=l.detail:u?A="Switch your wallet to the requested network.":g==="metamask"&&X4?A="Click to continue to open and connect MetaMask.":g==="metamask"?A="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?A="Open your mobile wallet app to continue":v==="coinbase_wallet"&&(A="Open the Coinbase app on your phone to continue."),Ip(J4,{children:[No(_,{backFn:o===r?void 0:e}),Ip(Z4,{children:[No(Mp,{walletLogo:E,success:m,fail:!!l}),Ip(Xe,{children:[No("h3",{children:S}),No("p",{children:A})]}),l==ao.ERROR_USER_EXISTS?No(H,{onClick:e,children:"Use a different wallet"}):!m&&l?.retryable&&c<cc?No(H,{onClick:()=>{f(c+1),s(void 0),i?.connectRetry()},disabled:!m&&(!l?.retryable||c>=cc),children:"Retry"}):!m&&l&&c>=cc?No(H,{onClick:e,children:"Use a different wallet"}):null]}),No(Z,{})]})},Z4=Q4.div`
1006
+ `,Ip=e=>{let t=e.walletLogo;return vt(Rp,{children:vt(X4,{children:ji("div",{children:[vt(lt,{success:e.success,fail:e.fail}),typeof t=="string"?vt("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):vt(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as $4,jsx as No,jsxs as Wp}from"react/jsx-runtime";var cc=2,Ly=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=x(),{walletConnectionStatus:i,closePrivyModal:a}=M(),[l,s]=Wy(void 0),[c,f]=Wy(0),m=i?.status==="connected",u=i?.status==="switching_to_supported_chain";Iy(()=>{if(m){let k;if(n?.externalConnectWallet?.onCompleteNavigateTo){let I=n.externalConnectWallet.onCompleteNavigateTo;k=setTimeout(()=>{t(I)},Me)}else k=setTimeout(a,Me);return()=>clearTimeout(k)}},[m]);let C=k=>{s(Mp(k))};Iy(()=>{i?.connectError&&C(i?.connectError)},[i]);let v=i?.connector?.connectorType||"injected",g=i?.connector?.walletClientType||"unknown",b=Nr[g]?.displayName||i?.connector?.walletBranding.name||"Browser Extension",E=Nr[g]?.logo||i?.connector?.walletBranding.icon||(k=>No(xi,{...k})),R=b==="Browser Extension"?b.toLowerCase():b,S;m?S=`Successfully connected with ${R}`:l?S=l.message:u?S="Switching networks":S=`Waiting for ${R}`;let A="Don\u2019t see your wallet? Check your other browser windows.";return m?A="You\u2019re good to go!":c>=cc&&l?A="Unable to connect wallet":l?A=l.detail:u?A="Switch your wallet to the requested network.":g==="metamask"&&Q4?A="Click to continue to open and connect MetaMask.":g==="metamask"?A="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?A="Open your mobile wallet app to continue":v==="coinbase_wallet"&&(A="Open the Coinbase app on your phone to continue."),Wp($4,{children:[No(_,{backFn:o===r?void 0:e}),Wp(J4,{children:[No(Ip,{walletLogo:E,success:m,fail:!!l}),Wp(je,{children:[No("h3",{children:S}),No("p",{children:A})]}),l==ao.ERROR_USER_EXISTS?No(H,{onClick:e,children:"Use a different wallet"}):!m&&l?.retryable&&c<cc?No(H,{onClick:()=>{f(c+1),s(void 0),i?.connectRetry()},disabled:!m&&(!l?.retryable||c>=cc),children:"Retry"}):!m&&l&&c>=cc?No(H,{onClick:e,children:"Use a different wallet"}):null]}),No(Z,{})]})},J4=Z4.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
- `;import{useEffect as Oy,useMemo as $4,useState as e5}from"react";import t5 from"styled-components";import{jsx as Wy}from"react/jsx-runtime";var Ly=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?Wy("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):Wy("span",{})};import{Fragment as o5,jsx as Do,jsxs as dc}from"react/jsx-runtime";var Ny=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=x(),{crossAppAuthFlow:r,updateWallets:o,closePrivyModal:n}=M(),[i,a]=e5({}),l={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},s=Me,c=new w(`There was an issue connecting your ${l.name} account. Please try again.`),f=new je(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 w?a({error:g}):g instanceof xt?(e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),a({error:c})):a({error:c})}}),m=()=>{i.data&&(o(),e?.crossAppAuth?.onSuccess(i.data),n({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(i.error??new w("User canceled flow")),n({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=m,Oy(()=>{l.id.length&&f.execute(l.id)},[l.id]),Oy(()=>{if(!i.data)return;let v=setTimeout(m,s);return()=>clearTimeout(v)},[i.data]);let{title:u,subtitle:C}=$4(()=>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 dc(o5,{children:[Do(_,{onClose:m}),Do(ie,{}),dc(r5,{children:[Do(tt,{children:dc("div",{children:[Do(lt,{success:!!i.data,fail:!!i.error}),Do(Ly,{name:l.name,logoUrl:l.logoUrl})]})}),dc(Xe,{children:[Do("h3",{children:u}),Do("p",{children:C})]})]}),Do(se,{}),Do(Z,{})]})},r5=t5.div`
1013
+ `;import{useEffect as Dy,useMemo as e5,useState as t5}from"react";import r5 from"styled-components";import{jsx as Oy}from"react/jsx-runtime";var Ny=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?Oy("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):Oy("span",{})};import{Fragment as n5,jsx as Do,jsxs as dc}from"react/jsx-runtime";var Uy=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=x(),{crossAppAuthFlow:r,updateWallets:o,closePrivyModal:n}=M(),[i,a]=t5({}),l={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},s=Me,c=new w(`There was an issue connecting your ${l.name} account. Please try again.`),f=new Ye(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 w?a({error:g}):g instanceof xt?(e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),a({error:c})):a({error:c})}}),m=()=>{i.data&&(o(),e?.crossAppAuth?.onSuccess(i.data),n({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(i.error??new w("User canceled flow")),n({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=m,Dy(()=>{l.id.length&&f.execute(l.id)},[l.id]),Dy(()=>{if(!i.data)return;let v=setTimeout(m,s);return()=>clearTimeout(v)},[i.data]);let{title:u,subtitle:C}=e5(()=>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 dc(n5,{children:[Do(_,{onClose:m}),Do(ae,{}),dc(o5,{children:[Do(tt,{children:dc("div",{children:[Do(lt,{success:!!i.data,fail:!!i.error}),Do(Ny,{name:l.name,logoUrl:l.logoUrl})]})}),dc(je,{children:[Do("h3",{children:u}),Do("p",{children:C})]})]}),Do(se,{}),Do(Z,{})]})},o5=r5.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
- `;import d5 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as p5,useMemo as u5,useState as m5}from"react";import f5 from"styled-components";import pc from"styled-components";import{jsx as Wp,jsxs as l5}from"react/jsx-runtime";var uc=()=>Wp(n5,{children:l5(i5,{children:[Wp(a5,{}),Wp(s5,{})]})}),n5=pc.div`
1021
+ `;import p5 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as u5,useMemo as m5,useState as f5}from"react";import h5 from"styled-components";import pc from"styled-components";import{jsx as Lp,jsxs as c5}from"react/jsx-runtime";var uc=()=>Lp(i5,{children:c5(a5,{children:[Lp(s5,{}),Lp(l5,{})]})}),i5=pc.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
- `,i5=pc.div`
1033
+ `,a5=pc.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
- `,a5=pc.div`
1040
+ `,s5=pc.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
- `,s5=pc.div`
1053
+ `,l5=pc.div`
1054
1054
  position: absolute;
1055
1055
  top: 0;
1056
1056
  right: 0;
@@ -1074,26 +1074,26 @@ Resources:
1074
1074
  transform: rotate(360deg);
1075
1075
  }
1076
1076
  }
1077
- `;var Dy=["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 Oe=class extends Error{constructor(r,o){super(o);this.type=r}};function Xi(e){let t=e.type;return typeof t=="string"&&Dy.includes(t)}function c5(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function Qn(e){return Xi(e)&&e.type==="wallet_not_on_device"}function Uy(e){return Xi(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Zn(e){return!!(Xi(e)&&e.type==="mfa_timeout")}function Jn(e){return!!(Xi(e)&&e.type==="missing_or_invalid_mfa")}function Lp(e){return!!(Xi(e)&&e.type==="mfa_verification_max_attempts_reached")}function mc(e){return!!(Xi(e)&&e.message.includes("code 429"))}function fc(e){return!!(c5(e)&&e.message==="MFA canceled")}function Op({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function Qi({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:o,showAutomaticRecovery:n}){return n?"EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN":r||t.length===1?Op({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function hc(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 Np({api:e,provider:t}){let r=On(),o=bi(),n=await Ei(r);try{return t==="icloud"?{url:(await e.post(Sm,{client_type:"web"})).url}:{url:(await e.post(Tm,{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 Fy({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during OAuth flow");try{return(await e.post(Am,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=ce(i);throw a.privyErrorCode?new w(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}import{Fragment as Hy,jsx as Zi,jsxs as Dp}from"react/jsx-runtime";var By=1,Gy=()=>{let{authenticated:e,user:t,getAccessToken:r}=z(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=M(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=x(),f=u5(()=>Date.now(),[]),[m,u]=m5(!1),{onCompleteNavigateTo:C,onFailure:v,shouldForceMFA:g,address:b}=l?.connectWallet,E=S=>{m||(u(!0),v(typeof S=="string"?new Error(S):S))};p5(()=>{let S=b?t?.linkedAccounts.find(I=>I.type==="wallet"&&I.walletClientType==="privy"&&I.address===b):ve(t),A;return!e||!S?E("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let I=await r();if(!I)return E("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:I,address:S.address}),g&&await i.verifyMfa({accessToken:I});let F=(Date.now()-f)/1e3;C==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&F<By?A=setTimeout(()=>{a(C,!1)},(By-F)*1e3):a(C,!1)}catch(F){if(Qn(F)&&S.recoveryMethod==="privy"){let G=await r();if(!G)return E("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||E(new Error("Unable to recover wallet")),C?a(C):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:S.address}}),a(C)}catch{E("An error has occurred, please try again.")}}else if(Qn(F)&&S.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:S,onCompleteNavigateTo:C,onFailure:v},recoveryOAuthStatus:{provider:S.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let G=hc(S.recoveryMethod);a(G)}else E(F)}})(),()=>clearTimeout(A)):void 0},[e,t,i]);let R=()=>{E("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=R,Dp(Hy,{children:[Zi(_,{onClose:R}),m?Dp(Hy,{children:[Dp(gr,{children:[Zi(d5,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Zi(fe,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),Zi(H,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):Zi(uc,{}),Zi(h5,{})]})},h5=f5.div`
1077
+ `;var Fy=["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 Oe=class extends Error{constructor(r,o){super(o);this.type=r}};function Xi(e){let t=e.type;return typeof t=="string"&&Fy.includes(t)}function d5(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function Qn(e){return Xi(e)&&e.type==="wallet_not_on_device"}function By(e){return Xi(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Zn(e){return!!(Xi(e)&&e.type==="mfa_timeout")}function Jn(e){return!!(Xi(e)&&e.type==="missing_or_invalid_mfa")}function Op(e){return!!(Xi(e)&&e.type==="mfa_verification_max_attempts_reached")}function mc(e){return!!(Xi(e)&&e.message.includes("code 429"))}function fc(e){return!!(d5(e)&&e.message==="MFA canceled")}function Np({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function Qi({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:o,showAutomaticRecovery:n}){return n?"EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN":r||t.length===1?Np({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function hc(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 Dp({api:e,provider:t}){let r=On(),o=bi(),n=await Ei(r);try{return t==="icloud"?{url:(await e.post(Pm,{client_type:"web"})).url}:{url:(await e.post(Am,{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 Hy({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during OAuth flow");try{return(await e.post(xm,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=ce(i);throw a.privyErrorCode?new w(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}import{Fragment as Vy,jsx as Zi,jsxs as Up}from"react/jsx-runtime";var Gy=1,qy=()=>{let{authenticated:e,user:t,getAccessToken:r}=K(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=M(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=x(),f=m5(()=>Date.now(),[]),[m,u]=f5(!1),{onCompleteNavigateTo:C,onFailure:v,shouldForceMFA:g,address:b}=l?.connectWallet,E=S=>{m||(u(!0),v(typeof S=="string"?new Error(S):S))};u5(()=>{let S=b?t?.linkedAccounts.find(I=>I.type==="wallet"&&I.walletClientType==="privy"&&I.address===b):ve(t),A;return!e||!S?E("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let I=await r();if(!I)return E("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:I,address:S.address}),g&&await i.verifyMfa({accessToken:I});let F=(Date.now()-f)/1e3;C==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&F<Gy?A=setTimeout(()=>{a(C,!1)},(Gy-F)*1e3):a(C,!1)}catch(F){if(Qn(F)&&S.recoveryMethod==="privy"){let G=await r();if(!G)return E("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||E(new Error("Unable to recover wallet")),C?a(C):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:S.address}}),a(C)}catch{E("An error has occurred, please try again.")}}else if(Qn(F)&&S.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:S,onCompleteNavigateTo:C,onFailure:v},recoveryOAuthStatus:{provider:S.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let G=hc(S.recoveryMethod);a(G)}else E(F)}})(),()=>clearTimeout(A)):void 0},[e,t,i]);let R=()=>{E("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=R,Up(Vy,{children:[Zi(_,{onClose:R}),m?Up(Vy,{children:[Up(gr,{children:[Zi(p5,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Zi(fe,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),Zi(H,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):Zi(uc,{}),Zi(y5,{})]})},y5=h5.div`
1078
1078
  height: 44px;
1079
- `;import y5 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as g5}from"react";import{Fragment as v5,jsx as Ji,jsxs as Vy}from"react/jsx-runtime";var qy=()=>{let{user:e}=z(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=M(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=x(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,f=()=>{let m=ve(e);m?(o(),l(m)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return g5(()=>{let m=setTimeout(f,cf);return()=>clearTimeout(m)},[]),a.current=f,Vy(v5,{children:[Ji(_,{onClose:f}),Ji(ie,{}),Vy(gr,{children:[Ji(y5,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),Ji(fe,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),Ji(se,{}),Ji(q,{})]})};import b5 from"@heroicons/react/20/solid/CheckIcon";import E5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import T5 from"@heroicons/react/24/outline/Square2StackIcon";import{useEffect as Ky,useRef as S5,useState as gc}from"react";import an from"styled-components";import C5 from"styled-components";var yc=C5.div`
1079
+ `;import g5 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as v5}from"react";import{Fragment as C5,jsx as Ji,jsxs as zy}from"react/jsx-runtime";var Ky=()=>{let{user:e}=K(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=M(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=x(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,f=()=>{let m=ve(e);m?(o(),l(m)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return v5(()=>{let m=setTimeout(f,pf);return()=>clearTimeout(m)},[]),a.current=f,zy(C5,{children:[Ji(_,{onClose:f}),Ji(ae,{}),zy(gr,{children:[Ji(g5,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),Ji(fe,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),Ji(se,{}),Ji(q,{})]})};import E5 from"@heroicons/react/20/solid/CheckIcon";import T5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import S5 from"@heroicons/react/24/outline/Square2StackIcon";import{useEffect as jy,useRef as A5,useState as gc}from"react";import an from"styled-components";import w5 from"styled-components";var yc=w5.div`
1080
1080
  display: flex;
1081
1081
  flex-direction: column;
1082
- `;import w5 from"styled-components";var Ct=w5.span`
1082
+ `;import b5 from"styled-components";var Ct=b5.span`
1083
1083
  color: var(--privy-color-foreground-3);
1084
1084
  font-size: 0.875rem;
1085
1085
  font-weight: 400;
1086
1086
  line-height: 1.375rem; /* 157.143% */
1087
- `;import{Fragment as L5,jsx as ht,jsxs as nn}from"react/jsx-runtime";var Yy=()=>{let[e,t]=gc(null),{authenticated:r,user:o,getAccessToken:n}=z(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=M(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=x(),{onFailure:f,onSuccess:m,origin:u,appId:C,appClientId:v,wallet:g}=s.keyExport,b=R=>{i({shouldCallAuthOnSuccess:!1}),f(typeof R=="string"?new Error(R):R)},E=()=>{i({shouldCallAuthOnSuccess:!1}),m(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:g.address}})};return Ky(()=>{if(!r||!g)return b("User must be authenticated before exporting their wallet");n().then(t,b)},[r,o]),c.current=E,nn(L5,{children:[ht(_,{onClose:E}),nn(x5,{children:[ht(fe,{title:"Transfer wallet",description:nn(k5,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",ht("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]})}),nn(_5,{children:[ht(E5,{color:"var(--privy-color-warn)"}),ht("p",{children:"Never share your private key or seed phrase with anyone."})]}),ht(R5,{children:ht(I5,{children:nn(yc,{children:[ht(Ct,{children:"Your wallet"}),nn(M5,{children:[et(g.address,4,4,g.chainType),ht(A5,{address:g.address??""})]})]})})}),ht("div",{style:{width:"100%"},children:e&&ht(P5,{origin:u,appId:C,appClientId:v,accessToken:e,clientAnalyticsId:l,wallet:g,dimensions:{height:"44px"}})})]}),ht(q,{})]})};function A5(e){let[t,r]=gc(!1);return t?nn("div",{className:"gap-1.75 flex items-center",children:[ht(b5,{color:"var(--privy-color-success)"}),ht("span",{children:"Copied Address"})]}):ht(T5,{color:"var(--privy-color-foreground-3)",onClick:async()=>{await navigator.clipboard.writeText(e.address),r(!0),setTimeout(()=>r(!1),2500)}})}function P5(e){let[t,r]=gc(e.dimensions.width),[o,n]=gc(void 0),i=S5(null);Ky(()=>{if(i.current&&t===void 0){let{width:s}=i.current.getBoundingClientRect();r(s)}let l=getComputedStyle(document.documentElement);n({background:l.getPropertyValue("--privy-color-background"),background2:l.getPropertyValue("--privy-color-background-2"),foreground3:l.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:l.getPropertyValue("--privy-color-foreground-accent"),accent:l.getPropertyValue("--privy-color-accent"),accentDark:l.getPropertyValue("--privy-color-accent-dark"),success:l.getPropertyValue("--privy-color-success")})},[]);let a=e.wallet.chainType==="ethereum"&&!e.wallet.imported;return ht("div",{ref:i,children:t&&nn(W5,{children:[ht("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:el(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.wallet.address,width:`${t}px`,caid:e.clientAnalyticsId,phrase_export:a,...o},{token:e.accessToken})}),ht(zy,{children:"Loading..."}),a&&ht(zy,{children:"Loading..."})]})})}var x5=an.div`
1087
+ `;import{Fragment as O5,jsx as ht,jsxs as nn}from"react/jsx-runtime";var Xy=()=>{let[e,t]=gc(null),{authenticated:r,user:o,getAccessToken:n}=K(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=M(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=x(),{onFailure:f,onSuccess:m,origin:u,appId:C,appClientId:v,wallet:g}=s.keyExport,b=R=>{i({shouldCallAuthOnSuccess:!1}),f(typeof R=="string"?new Error(R):R)},E=()=>{i({shouldCallAuthOnSuccess:!1}),m(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:g.address}})};return jy(()=>{if(!r||!g)return b("User must be authenticated before exporting their wallet");n().then(t,b)},[r,o]),c.current=E,nn(O5,{children:[ht(_,{onClose:E}),nn(k5,{children:[ht(fe,{title:"Transfer wallet",description:nn(_5,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",ht("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]})}),nn(R5,{children:[ht(T5,{color:"var(--privy-color-warn)"}),ht("p",{children:"Never share your private key or seed phrase with anyone."})]}),ht(M5,{children:ht(W5,{children:nn(yc,{children:[ht(Ct,{children:"Your wallet"}),nn(I5,{children:[et(g.address,4,4,g.chainType),ht(P5,{address:g.address??""})]})]})})}),ht("div",{style:{width:"100%"},children:e&&ht(x5,{origin:u,appId:C,appClientId:v,accessToken:e,clientAnalyticsId:l,wallet:g,dimensions:{height:"44px"}})})]}),ht(q,{})]})};function P5(e){let[t,r]=gc(!1);return t?nn("div",{className:"gap-1.75 flex items-center",children:[ht(E5,{color:"var(--privy-color-success)"}),ht("span",{children:"Copied Address"})]}):ht(S5,{color:"var(--privy-color-foreground-3)",onClick:async()=>{await navigator.clipboard.writeText(e.address),r(!0),setTimeout(()=>r(!1),2500)}})}function x5(e){let[t,r]=gc(e.dimensions.width),[o,n]=gc(void 0),i=A5(null);jy(()=>{if(i.current&&t===void 0){let{width:s}=i.current.getBoundingClientRect();r(s)}let l=getComputedStyle(document.documentElement);n({background:l.getPropertyValue("--privy-color-background"),background2:l.getPropertyValue("--privy-color-background-2"),foreground3:l.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:l.getPropertyValue("--privy-color-foreground-accent"),accent:l.getPropertyValue("--privy-color-accent"),accentDark:l.getPropertyValue("--privy-color-accent-dark"),success:l.getPropertyValue("--privy-color-success")})},[]);let a=e.wallet.chainType==="ethereum"&&!e.wallet.imported;return ht("div",{ref:i,children:t&&nn(L5,{children:[ht("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:el(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.wallet.address,width:`${t}px`,caid:e.clientAnalyticsId,phrase_export:a,...o},{token:e.accessToken})}),ht(Yy,{children:"Loading..."}),a&&ht(Yy,{children:"Loading..."})]})})}var k5=an.div`
1088
1088
  display: flex;
1089
1089
  flex-direction: column;
1090
1090
  text-align: left;
1091
- `,k5=an.span`
1091
+ `,_5=an.span`
1092
1092
  && a {
1093
1093
  color: var(--privy-color-accent);
1094
1094
  text-decoration: underline;
1095
1095
  }
1096
- `,_5=an.div`
1096
+ `,R5=an.div`
1097
1097
  background: var(--privy-color-warn-light);
1098
1098
  display: flex;
1099
1099
  align-items: start;
@@ -1104,13 +1104,13 @@ Resources:
1104
1104
  width: 1.25rem;
1105
1105
  height: 1.25rem;
1106
1106
  }
1107
- `,R5=an.div`
1107
+ `,M5=an.div`
1108
1108
  && > div {
1109
1109
  border-radius: var(--privy-border-radius-md);
1110
1110
  border-width: 1px;
1111
1111
  border-color: var(--privy-color-foreground-4);
1112
1112
  }
1113
- `,M5=an.div`
1113
+ `,I5=an.div`
1114
1114
  display: flex;
1115
1115
  align-items: center;
1116
1116
  gap: 0.625rem;
@@ -1119,19 +1119,19 @@ Resources:
1119
1119
  height: 0.875rem;
1120
1120
  cursor: pointer;
1121
1121
  }
1122
- `,I5=an.div`
1122
+ `,W5=an.div`
1123
1123
  display: flex;
1124
1124
  margin-top: 1.5rem;
1125
1125
  margin-bottom: 1rem;
1126
1126
  padding: 0.75rem 1rem;
1127
- `,W5=an.div`
1127
+ `,L5=an.div`
1128
1128
  overflow: visible;
1129
1129
  position: relative;
1130
1130
  overflow: none;
1131
1131
  height: 44px;
1132
1132
  display: flex;
1133
1133
  gap: 12px;
1134
- `,zy=an.div`
1134
+ `,Yy=an.div`
1135
1135
  display: flex;
1136
1136
  align-items: center;
1137
1137
  justify-content: center;
@@ -1142,9 +1142,9 @@ Resources:
1142
1142
  border-radius: var(--privy-border-radius-md);
1143
1143
  background-color: var(--privy-color-background-2);
1144
1144
  color: var(--privy-color-foreground-3);
1145
- `;import D5 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as U5,useState as jy}from"react";import F5 from"styled-components";import{useCallback as O5,useRef as N5}from"react";function vc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=M(),o=N5(!1);return{createWallet:O5(async i=>{let a=await Ce();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(Ci);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,c=new Promise((C,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 m=await e();if(!m)throw new Error("Failed to refresh user.");let u=ve(m);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}},[])}}import{Fragment as H5,jsx as $i,jsxs as Xy}from"react/jsx-runtime";var Qy=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=x(),[i,a]=jy(""),{embeddedWallets:l}=De(),{authenticated:s}=z(),{closePrivyModal:c}=M(),{onSuccess:f,onFailure:m,callAuthOnSuccessOnClose:u}=o.createWallet,C=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:v}=vc(),[g,b]=jy(null),E=new je(async()=>{try{let S=await v();if(!S)return;b(S),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(S){a(S.message)}});U5(()=>{if(!s){r("LANDING"),m(new Error("User must be authenticated before creating a Privy wallet"));return}if(C){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let S=Qi({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(S)}E.execute()},[C,s]);let R=()=>{g?(f(g),c({shouldCallAuthOnSuccess:u})):(m(new Ht("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?Xy(H5,{children:[$i(_,{closeable:!1}),Xy(gr,{children:[$i(D5,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),$i(fe,{title:"Something went wrong",description:i})]}),$i(H,{onClick:R,children:"Close"}),$i(B5,{})]}):$i(uc,{})},B5=F5.div`
1145
+ `;import U5 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as F5,useState as Qy}from"react";import B5 from"styled-components";import{useCallback as N5,useRef as D5}from"react";function vc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=M(),o=D5(!1);return{createWallet:N5(async i=>{let a=await Ce();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(Ci);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,c=new Promise((C,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 m=await e();if(!m)throw new Error("Failed to refresh user.");let u=ve(m);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}},[])}}import{Fragment as G5,jsx as $i,jsxs as Zy}from"react/jsx-runtime";var Jy=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=x(),[i,a]=Qy(""),{embeddedWallets:l}=De(),{authenticated:s}=K(),{closePrivyModal:c}=M(),{onSuccess:f,onFailure:m,callAuthOnSuccessOnClose:u}=o.createWallet,C=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:v}=vc(),[g,b]=Qy(null),E=new Ye(async()=>{try{let S=await v();if(!S)return;b(S),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(S){a(S.message)}});F5(()=>{if(!s){r("LANDING"),m(new Error("User must be authenticated before creating a Privy wallet"));return}if(C){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let S=Qi({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(S)}E.execute()},[C,s]);let R=()=>{g?(f(g),c({shouldCallAuthOnSuccess:u})):(m(new Ht("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?Zy(G5,{children:[$i(_,{closeable:!1}),Zy(gr,{children:[$i(U5,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),$i(fe,{title:"Something went wrong",description:i})]}),$i(H,{onClick:R,children:"Close"}),$i(H5,{})]}):$i(uc,{})},H5=B5.div`
1146
1146
  height: 44px;
1147
- `;import{useEffect as L6,useState as Tc}from"react";import{useCallback as qp,useEffect as W6}from"react";import K5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as Y5,useState as Bp}from"react";import G5 from"@heroicons/react/24/outline/ArrowPathIcon";import V5 from"@heroicons/react/24/outline/EyeIcon";import q5 from"@heroicons/react/24/outline/EyeSlashIcon";import It,{css as Up}from"styled-components";var z5=Up`
1147
+ `;import{useEffect as O6,useState as Tc}from"react";import{useCallback as zp,useEffect as L6}from"react";import Y5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as j5,useState as Hp}from"react";import V5 from"@heroicons/react/24/outline/ArrowPathIcon";import q5 from"@heroicons/react/24/outline/EyeIcon";import z5 from"@heroicons/react/24/outline/EyeSlashIcon";import It,{css as Fp}from"styled-components";var K5=Fp`
1148
1148
  font-size: 14px;
1149
1149
  font-style: normal;
1150
1150
  font-weight: 400;
@@ -1153,7 +1153,7 @@ Resources:
1153
1153
  text-align: left;
1154
1154
  transition: color 0.1s ease-in;
1155
1155
  `,Cc=It.span`
1156
- ${z5}
1156
+ ${K5}
1157
1157
  transition: color 0.1s ease-in;
1158
1158
  color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1159
1159
  text-transform: ${({error:e})=>e?"":"capitalize"};
@@ -1167,12 +1167,12 @@ Resources:
1167
1167
  justify-content: center;
1168
1168
  flex-grow: 1;
1169
1169
  `,ln=It(H)`
1170
- ${e=>e.hideAnimations&&Up`
1170
+ ${e=>e.hideAnimations&&Fp`
1171
1171
  && {
1172
1172
  transition: none;
1173
1173
  }
1174
1174
  `}
1175
- `,Zy=Up`
1175
+ `,$y=Fp`
1176
1176
  && {
1177
1177
  width: 100%;
1178
1178
  border-width: 1px;
@@ -1188,7 +1188,7 @@ Resources:
1188
1188
  line-height: 22px; /* 137.5% */
1189
1189
  }
1190
1190
  `,ea=It.input`
1191
- ${Zy}
1191
+ ${$y}
1192
1192
 
1193
1193
  &::placeholder {
1194
1194
  color: var(--privy-color-foreground-3);
@@ -1199,8 +1199,8 @@ Resources:
1199
1199
  overflow: hidden;
1200
1200
  text-overflow: ellipsis;
1201
1201
  white-space: nowrap;
1202
- `,Jy=It.div`
1203
- ${Zy}
1202
+ `,eg=It.div`
1203
+ ${$y}
1204
1204
  `,cn=It.div`
1205
1205
  position: relative;
1206
1206
  width: 100%;
@@ -1254,13 +1254,13 @@ Resources:
1254
1254
  > :first-child {
1255
1255
  min-width: 24px;
1256
1256
  }
1257
- `,UB=It.div`
1257
+ `,FB=It.div`
1258
1258
  height: var(--privy-height-modal-full);
1259
1259
 
1260
1260
  @media (max-width: 440px) {
1261
1261
  height: var(--privy-height-modal-compact);
1262
1262
  }
1263
- `,Fp=It(Vn)`
1263
+ `,Bp=It(Vn)`
1264
1264
  display: flex;
1265
1265
  flex: 1;
1266
1266
  gap: 4px;
@@ -1280,7 +1280,7 @@ Resources:
1280
1280
  flex-direction: row;
1281
1281
  justify-content: space-around;
1282
1282
  align-items: center;
1283
- `,$y=It(G5)`
1283
+ `,tg=It(V5)`
1284
1284
  height: 1.25rem;
1285
1285
  width: 1.25rem;
1286
1286
  stroke: var(--privy-color-accent);
@@ -1289,7 +1289,7 @@ Resources:
1289
1289
  :active {
1290
1290
  stroke: var(--privy-color-accent-light);
1291
1291
  }
1292
- `,ra=It(q5)`
1292
+ `,ra=It(z5)`
1293
1293
  height: 1.25rem;
1294
1294
  width: 1.25rem;
1295
1295
  stroke: var(--privy-color-accent);
@@ -1298,7 +1298,7 @@ Resources:
1298
1298
  :active {
1299
1299
  stroke: var(--privy-color-accent-light);
1300
1300
  }
1301
- `,oa=It(V5)`
1301
+ `,oa=It(q5)`
1302
1302
  height: 1.25rem;
1303
1303
  width: 1.25rem;
1304
1304
  stroke: var(--privy-color-accent);
@@ -1307,7 +1307,7 @@ Resources:
1307
1307
  :active {
1308
1308
  stroke: var(--privy-color-accent-light);
1309
1309
  }
1310
- `,eg=It.progress`
1310
+ `,rg=It.progress`
1311
1311
  height: 4px;
1312
1312
  width: 100%;
1313
1313
  margin: 8px 0;
@@ -1323,7 +1323,7 @@ Resources:
1323
1323
  transition: all 0.1s ease-out;
1324
1324
  background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1325
1325
  }
1326
- `;import{Fragment as j5,jsx as wr,jsxs as wc}from"react/jsx-runtime";var tg=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=Bp(!0),[l,s]=Bp(!1),[c,f]=Bp(""),m=r===c;return Y5(()=>{c&&!l&&s(!0)},[c]),wc(j5,{children:[wr(_,{closeable:!1,backFn:n}),wr(ie,{}),wc(sn,{children:[wc(dn,{children:[wr(K5,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),wr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),wr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),wc(cn,{children:[wr(ea,{value:c,onChange:u=>f(u.target.value),onKeyUp:u=>{u.key==="Enter"&&o()},onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),wr(ta,{style:{right:"0.75rem"},children:i?wr(ra,{onClick:()=>a(!1)}):wr(oa,{onClick:()=>a(!0)})})]}),wr(Cc,{"aria-hidden":!l||m,error:!0,children:"Passwords do not match"})]}),wr(ln,{onClick:o,loading:t,disabled:!m,hideAnimations:e,children:"Continue"}),wr(se,{}),wr(q,{})]})};import J5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as $5}from"react";import e6 from"styled-components";import $a from"styled-components";import{jsx as Ja,jsxs as Z5}from"react/jsx-runtime";var rg=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>Ja("label",{children:Z5(X5,{className:e,children:[Ja(ng,{checked:t,...o}),Ja(Q5,{color:r,checked:t,children:Ja(og,{viewBox:"0 0 24 24",children:Ja("polyline",{points:"20 6 9 17 4 12"})})})]})});var QB=$a.label`
1326
+ `;import{Fragment as X5,jsx as wr,jsxs as wc}from"react/jsx-runtime";var og=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=Hp(!0),[l,s]=Hp(!1),[c,f]=Hp(""),m=r===c;return j5(()=>{c&&!l&&s(!0)},[c]),wc(X5,{children:[wr(_,{closeable:!1,backFn:n}),wr(ae,{}),wc(sn,{children:[wc(dn,{children:[wr(Y5,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),wr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),wr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),wc(cn,{children:[wr(ea,{value:c,onChange:u=>f(u.target.value),onKeyUp:u=>{u.key==="Enter"&&o()},onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),wr(ta,{style:{right:"0.75rem"},children:i?wr(ra,{onClick:()=>a(!1)}):wr(oa,{onClick:()=>a(!0)})})]}),wr(Cc,{"aria-hidden":!l||m,error:!0,children:"Passwords do not match"})]}),wr(ln,{onClick:o,loading:t,disabled:!m,hideAnimations:e,children:"Continue"}),wr(se,{}),wr(q,{})]})};import $5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as e6}from"react";import t6 from"styled-components";import $a from"styled-components";import{jsx as Ja,jsxs as J5}from"react/jsx-runtime";var ng=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>Ja("label",{children:J5(Q5,{className:e,children:[Ja(ag,{checked:t,...o}),Ja(Z5,{color:r,checked:t,children:Ja(ig,{viewBox:"0 0 24 24",children:Ja("polyline",{points:"20 6 9 17 4 12"})})})]})});var ZB=$a.label`
1327
1327
  && {
1328
1328
  cursor: pointer;
1329
1329
  display: flex;
@@ -1335,14 +1335,14 @@ Resources:
1335
1335
  border: 1px solid var(--privy-color-foreground-4);
1336
1336
  width: 100%;
1337
1337
  }
1338
- `,X5=$a.div`
1338
+ `,Q5=$a.div`
1339
1339
  display: inline-block;
1340
1340
  vertical-align: middle;
1341
- `,og=$a.svg`
1341
+ `,ig=$a.svg`
1342
1342
  fill: none;
1343
1343
  stroke: white;
1344
1344
  stroke-width: 3px;
1345
- `,ng=$a.input.attrs({type:"checkbox"})`
1345
+ `,ag=$a.input.attrs({type:"checkbox"})`
1346
1346
  border: 0;
1347
1347
  clip: rect(0 0 0 0);
1348
1348
  clippath: inset(50%);
@@ -1353,7 +1353,7 @@ Resources:
1353
1353
  position: absolute;
1354
1354
  white-space: nowrap;
1355
1355
  width: 1px;
1356
- `,Q5=$a.div`
1356
+ `,Z5=$a.div`
1357
1357
  display: inline-block;
1358
1358
  width: 18px;
1359
1359
  height: 18px;
@@ -1368,28 +1368,28 @@ Resources:
1368
1368
  border-width: 1px;
1369
1369
  }
1370
1370
 
1371
- ${ng}:focus + & {
1371
+ ${ag}:focus + & {
1372
1372
  box-shadow: 0 0 0 1px ${e=>e.color};
1373
1373
  }
1374
1374
 
1375
- ${og} {
1375
+ ${ig} {
1376
1376
  visibility: ${e=>e.checked?"visible":"hidden"};
1377
1377
  }
1378
- `;import{Fragment as ig,jsx as Dr,jsxs as es}from"react/jsx-runtime";var ag=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=$5(!1);return es(ig,{children:[Dr(_,{closeable:!1,backFn:o}),Dr(ie,{}),es(sn,{children:[es(dn,{children:[Dr(J5,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),Dr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),Dr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),Dr(Qa,{children:es(Za,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[Dr(rg,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),Dr(ig,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),es(t6,{children:[n.initiatedBy==="user"&&Dr(Kr,{onClick:n.onCancel,disabled:t,children:"Cancel"}),Dr(ln,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),Dr(se,{}),Dr(q,{})]})},t6=e6.div`
1378
+ `;import{Fragment as sg,jsx as Dr,jsxs as es}from"react/jsx-runtime";var lg=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=e6(!1);return es(sg,{children:[Dr(_,{closeable:!1,backFn:o}),Dr(ae,{}),es(sn,{children:[es(dn,{children:[Dr($5,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),Dr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),Dr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),Dr(Qa,{children:es(Za,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[Dr(ng,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),Dr(sg,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),es(r6,{children:[n.initiatedBy==="user"&&Dr(Kr,{onClick:n.onCancel,disabled:t,children:"Cancel"}),Dr(ln,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),Dr(se,{}),Dr(q,{})]})},r6=t6.div`
1379
1379
  display: flex;
1380
1380
  gap: 10px;
1381
- `;import g6 from"@heroicons/react/24/outline/KeyIcon";import mg from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as fg,useMemo as Hp,useEffect as v6}from"react";import hg from"styled-components";import r6 from"fast-password-entropy";import*as sg from"secure-password-utilities";import{DEFAULT_WORDLIST as o6}from"secure-password-utilities/wordlists";var n6=95,i6=8,a6=3,s6=.3,l6=/[a-z]/,c6=/[A-Z]/,d6=/[0-9]/,p6="a-zA-Z0-9",lg="!@#$%^&*()\\-_+.",cg=`${p6}${lg}`,u6=new RegExp(`[${lg}]`),m6=new RegExp(`[${cg}]`),dg=new RegExp(`^[${cg}]{6,}$`),pg=(e="")=>{let t=e.split("").filter(r=>!m6.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},bc=()=>sg.generatePassphrase(4,o6);function f6(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function h6(e){if(e.length<i6)return 0;let t=0;l6.test(e)&&(t+=1),c6.test(e)&&(t+=1),d6.test(e)&&(t+=1),u6.test(e)&&(t+=1);let r=t/a6;return Math.max(0,Math.min(1,r))}function y6(e=""){let t=h6(e),r=r6(e)/n6;return(t*s6+r)/2}function ug(e=""){let t=y6(e);return{value:t,label:f6(t)}}import{Fragment as b6,jsx as Wt,jsxs as yo}from"react/jsx-runtime";var yg=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:c})=>{let[f,m]=fg(!1),[u,C]=fg(!1);v6(()=>{r&&!u&&C(!0)},[r]);let v=Hp(()=>u?(r?.length||0)<6?"Password must be at least 6 characters":dg.test(r||"")?null:`Invalid characters used ( ${pg(r).join(" ")} )`:null,[r,u]),g=Hp(()=>v?{value:0,label:"Weak"}:ug(r),[r,v]),b=Hp(()=>!!(!r?.length||v),[v,r]);return yo(b6,{children:[Wt(_,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),Wt(ie,{}),yo(sn,{children:[yo(dn,{children:[Wt(g6,{height:48,width:48,stroke:"var(--privy-color-accent)"}),yo("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),Wt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),yo(cn,{children:[Wt(ea,{value:r,onChange:E=>s(E.target.value),onKeyUp:E=>{E.key==="Enter"&&i()},placeholder:"enter or generate a strong password",type:f?"password":"text",style:{paddingRight:"3.8rem"}}),yo(ta,{style:{width:"3.5rem"},children:[f?Wt(ra,{onClick:()=>m(!1)}):Wt(oa,{onClick:()=>m(!0)}),Wt($y,{onClick:c})]})]}),Wt(eg,{value:g.value===0?.01:g.value,label:g.label}),Wt(Cc,{error:!!v,children:v||`Password Strength: ${u?g.label:"--"}`}),yo(w6,{children:[Wt(C6,{children:yo(Qa,{children:[yo(Za,{children:[Wt(mg,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),yo(Za,{children:[Wt(mg,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),Wt(ln,{onClick:i,loading:t,disabled:b,hideAnimations:e,children:"Continue"})]})]}),Wt(se,{}),Wt(q,{})]})},C6=hg(Qa)`
1381
+ `;import v6 from"@heroicons/react/24/outline/KeyIcon";import hg from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as yg,useMemo as Gp,useEffect as C6}from"react";import gg from"styled-components";import o6 from"fast-password-entropy";import*as cg from"secure-password-utilities";import{DEFAULT_WORDLIST as n6}from"secure-password-utilities/wordlists";var i6=95,a6=8,s6=3,l6=.3,c6=/[a-z]/,d6=/[A-Z]/,p6=/[0-9]/,u6="a-zA-Z0-9",dg="!@#$%^&*()\\-_+.",pg=`${u6}${dg}`,m6=new RegExp(`[${dg}]`),f6=new RegExp(`[${pg}]`),ug=new RegExp(`^[${pg}]{6,}$`),mg=(e="")=>{let t=e.split("").filter(r=>!f6.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},bc=()=>cg.generatePassphrase(4,n6);function h6(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function y6(e){if(e.length<a6)return 0;let t=0;c6.test(e)&&(t+=1),d6.test(e)&&(t+=1),p6.test(e)&&(t+=1),m6.test(e)&&(t+=1);let r=t/s6;return Math.max(0,Math.min(1,r))}function g6(e=""){let t=y6(e),r=o6(e)/i6;return(t*l6+r)/2}function fg(e=""){let t=g6(e);return{value:t,label:h6(t)}}import{Fragment as E6,jsx as Wt,jsxs as yo}from"react/jsx-runtime";var vg=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:c})=>{let[f,m]=yg(!1),[u,C]=yg(!1);C6(()=>{r&&!u&&C(!0)},[r]);let v=Gp(()=>u?(r?.length||0)<6?"Password must be at least 6 characters":ug.test(r||"")?null:`Invalid characters used ( ${mg(r).join(" ")} )`:null,[r,u]),g=Gp(()=>v?{value:0,label:"Weak"}:fg(r),[r,v]),b=Gp(()=>!!(!r?.length||v),[v,r]);return yo(E6,{children:[Wt(_,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),Wt(ae,{}),yo(sn,{children:[yo(dn,{children:[Wt(v6,{height:48,width:48,stroke:"var(--privy-color-accent)"}),yo("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),Wt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),yo(cn,{children:[Wt(ea,{value:r,onChange:E=>s(E.target.value),onKeyUp:E=>{E.key==="Enter"&&i()},placeholder:"enter or generate a strong password",type:f?"password":"text",style:{paddingRight:"3.8rem"}}),yo(ta,{style:{width:"3.5rem"},children:[f?Wt(ra,{onClick:()=>m(!1)}):Wt(oa,{onClick:()=>m(!0)}),Wt(tg,{onClick:c})]})]}),Wt(rg,{value:g.value===0?.01:g.value,label:g.label}),Wt(Cc,{error:!!v,children:v||`Password Strength: ${u?g.label:"--"}`}),yo(b6,{children:[Wt(w6,{children:yo(Qa,{children:[yo(Za,{children:[Wt(hg,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),yo(Za,{children:[Wt(hg,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),Wt(ln,{onClick:i,loading:t,disabled:b,hideAnimations:e,children:"Continue"})]})]}),Wt(se,{}),Wt(q,{})]})},w6=gg(Qa)`
1382
1382
  flex: 1;
1383
1383
  padding-top: 1rem;
1384
- `,w6=hg.div`
1384
+ `,b6=gg.div`
1385
1385
  display: flex;
1386
1386
  flex-direction: column;
1387
1387
  height: 100%;
1388
- `;import E6 from"@heroicons/react/24/outline/ArrowDownTrayIcon";import T6 from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import S6 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import A6 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as P6,useCallback as gg}from"react";import{Fragment as Gp,jsx as cr,jsxs as $n}from"react/jsx-runtime";var vg=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=P6(!1),s=gg(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=gg(()=>{let f=document.createElement("a"),m=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),u=new Blob([x6(r,o)],{type:"text/plain"}),C=URL.createObjectURL(u);f.href=C,f.target="_blank",f.download=`${m}-privy-wallet-recovery.txt`,document.body.appendChild(f),f.click(),setTimeout(()=>{f.remove(),URL.revokeObjectURL(C)},5e3)},[o]);return $n(Gp,{children:[cr(_,{backFn:i,closeable:!1}),cr(ie,{}),$n(sn,{children:[$n(dn,{children:[cr(A6,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),cr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),cr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),cr(cn,{centered:!0,children:cr(Jy,{children:o})}),$n("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[cr(Fp,{onClick:s,children:a?$n(Gp,{children:[cr(T6,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):$n(Gp,{children:[cr(S6,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),$n(Fp,{onClick:c,children:[cr(E6,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),cr(ln,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),cr(se,{}),cr(q,{})]})},x6=(e,t)=>`Your wallet recovery password for ${e} is
1388
+ `;import T6 from"@heroicons/react/24/outline/ArrowDownTrayIcon";import S6 from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import A6 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import P6 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as x6,useCallback as Cg}from"react";import{Fragment as Vp,jsx as cr,jsxs as $n}from"react/jsx-runtime";var wg=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=x6(!1),s=Cg(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=Cg(()=>{let f=document.createElement("a"),m=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),u=new Blob([k6(r,o)],{type:"text/plain"}),C=URL.createObjectURL(u);f.href=C,f.target="_blank",f.download=`${m}-privy-wallet-recovery.txt`,document.body.appendChild(f),f.click(),setTimeout(()=>{f.remove(),URL.revokeObjectURL(C)},5e3)},[o]);return $n(Vp,{children:[cr(_,{backFn:i,closeable:!1}),cr(ae,{}),$n(sn,{children:[$n(dn,{children:[cr(P6,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),cr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),cr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),cr(cn,{centered:!0,children:cr(eg,{children:o})}),$n("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[cr(Bp,{onClick:s,children:a?$n(Vp,{children:[cr(S6,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):$n(Vp,{children:[cr(A6,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),$n(Bp,{onClick:c,children:[cr(T6,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),cr(ln,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),cr(se,{}),cr(q,{})]})},k6=(e,t)=>`Your wallet recovery password for ${e} is
1389
1389
 
1390
1390
  ${t}
1391
1391
 
1392
- You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import k6 from"@heroicons/react/24/solid/CheckCircleIcon";import _6 from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as R6,jsx as Uo,jsxs as Vp}from"react/jsx-runtime";var Cg=({error:e,onClose:t})=>Vp(R6,{children:[Uo(_,{closeable:!1}),Uo(ie,{}),e?Vp(gr,{children:[Uo(_6,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Uo(fe,{title:"Something went wrong",description:e})]}):Vp(gr,{children:[Uo(k6,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),Uo(fe,{title:"Success"})]}),Uo(H,{onClick:t,children:"Close"}),Uo(se,{}),Uo(q,{})]});import{useReducer as M6}from"react";var I6=(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}},wg=()=>{let[e,t]=M6(I6,"creating");return{send:t,state:e}};import{jsx as ts}from"react/jsx-runtime";var Ec=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=x(),{send:n,state:i}=wg(),a=qp(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);W6(()=>{let c;return i==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),Me)),()=>{c&&clearTimeout(c)}},[i,t.config.initiatedBy,t.onClose]);let l=qp(()=>{n("back")},[n]),s=qp(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?ts(yg,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?ts(vg,{...t,onSubmit:a,onBack:l}):i==="confirming"?ts(tg,{...t,onSubmit:a,onBack:l}):i==="finalizing"?ts(ag,{...t,onSubmit:a,onBack:l}):i==="done"?ts(Cg,{...t,onSubmit:a}):null};import{jsx as O6}from"react/jsx-runtime";var bg=()=>{let[e,t]=Tc(null),[r,o]=Tc(!1),[n,i]=Tc(null),[a,l]=Tc(""),{authenticated:s,getAccessToken:c,user:f}=z(),{walletProxy:m,refreshUser:u,closePrivyModal:C,createAnalyticsEvent:v}=M(),{app:g,navigate:b,data:E,onUserCloseViaDialogOrKeybindRef:R}=x(),{onSuccess:S,onFailure:A}=E.createWallet,k=ve(f),I=e?.recoveryMethod==="user-passcode",F=k?.recoveryMethod==="user-passcode";L6(()=>{s||(b("LANDING"),A(new Gs("User must be authenticated before setting a password on a Privy wallet")))},[s]);let G=()=>{if(n){A(n),C({shouldCallAuthOnSuccess:!1});return}if(!I){A(new Ht("Exited before password was added to wallet")),C({shouldCallAuthOnSuccess:!1});return}S(e),C({shouldCallAuthOnSuccess:!1})};R.current=G;let Y=async()=>{let L=await c();if(L&&k?.address&&a&&m)try{if(v({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:F}}),!(await m.setRecovery({accessToken:L,address:k.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new Ht("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:F,reason:"error setting password"}});return}let W=await u(),be=ve(W);if(!be){i(new Ht("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:F,reason:"wallet disconnected"}});return}t(be),v({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:F}})}catch(U){console.warn(U),i(U instanceof Error?U:new Error("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:k.address,reason:U}})}},j=async()=>{I?(S(e),C({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await Y(),o(!1))};return O6(Ec,{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:F,onPasswordGenerate:()=>l(bc()),onPasswordChange:l,onSubmit:j,onClose:G})};import N6 from"@heroicons/react/24/outline/UserCircleIcon";import D6 from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as U6,jsx as Fo,jsxs as Sc}from"react/jsx-runtime";var Eg=()=>{let{closePrivyModal:e}=M(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new Ht("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,Sc(U6,{children:[Fo(_,{onClose:l}),Fo(ie,{}),Sc(gr,{children:[Sc(Xh,{children:[Fo(N6,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),Fo(Qh,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:Fo(D6,{width:"12px",height:"12px",fill:"white"})})]}),Sc(fe,{title:"Secure Your Account",children:["Please set a password to secure your account.",Fo("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),Fo(H,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),Fo(se,{}),Fo(q,{})]})};import F6 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import B6 from"@heroicons/react/24/outline/PhoneIcon";import Tg from"styled-components";import{Fragment as q6,jsx as Ur,jsxs as Ac}from"react/jsx-runtime";var H6=(e,t)=>{let r=Ur(F6,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof w)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:r};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(e instanceof Oe&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:Ur(B6,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof it)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:r};case"allowlist_rejected":return{title:t.errorTitle||"You don't have access to this app",detail:t.errorDetail||"Have you been invited?",ctaText:t.errorCtaText||"Try another account",icon:Ur(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:Ur("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:Ur("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else return e instanceof xt&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}},Sg=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=x(),i=r?.errorModalData?.previousScreen||(o===n?void 0:o);return Ur(ei,{error:r?.errorModalData?.error||new Error,backFn:()=>i?e(i,!1):t(),onClick:()=>e(i||"LANDING",!1)})},ei=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Te(),{app:n}=x(),i=H6(e,n.allowlistConfig),a=()=>{if(e instanceof it&&(e.privyErrorCode==="invalid_captcha"&&o(),e.privyErrorCode==="allowlist_rejected"&&n.allowlistConfig.errorCtaLink)){window.location.href=n.allowlistConfig.errorCtaLink;return}r?.()};return Ac(q6,{children:[Ur(_,{backFn:t}),Ac(G6,{children:[Ur(tt,{children:Ac("div",{children:[Ur(ec,{color:"var(--privy-color-error)"}),i.icon]})}),Ac(V6,{children:[Ur("h3",{children:i.title}),Ur("p",{children:i.detail})]}),Ur(H,{color:"var(--privy-color-error)",onClick:a,children:i.ctaText})]})]})},G6=Tg.div`
1392
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import _6 from"@heroicons/react/24/solid/CheckCircleIcon";import R6 from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as M6,jsx as Uo,jsxs as qp}from"react/jsx-runtime";var bg=({error:e,onClose:t})=>qp(M6,{children:[Uo(_,{closeable:!1}),Uo(ae,{}),e?qp(gr,{children:[Uo(R6,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Uo(fe,{title:"Something went wrong",description:e})]}):qp(gr,{children:[Uo(_6,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),Uo(fe,{title:"Success"})]}),Uo(H,{onClick:t,children:"Close"}),Uo(se,{}),Uo(q,{})]});import{useReducer as I6}from"react";var W6=(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}},Eg=()=>{let[e,t]=I6(W6,"creating");return{send:t,state:e}};import{jsx as ts}from"react/jsx-runtime";var Ec=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=x(),{send:n,state:i}=Eg(),a=zp(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);L6(()=>{let c;return i==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),Me)),()=>{c&&clearTimeout(c)}},[i,t.config.initiatedBy,t.onClose]);let l=zp(()=>{n("back")},[n]),s=zp(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?ts(vg,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?ts(wg,{...t,onSubmit:a,onBack:l}):i==="confirming"?ts(og,{...t,onSubmit:a,onBack:l}):i==="finalizing"?ts(lg,{...t,onSubmit:a,onBack:l}):i==="done"?ts(bg,{...t,onSubmit:a}):null};import{jsx as N6}from"react/jsx-runtime";var Tg=()=>{let[e,t]=Tc(null),[r,o]=Tc(!1),[n,i]=Tc(null),[a,l]=Tc(""),{authenticated:s,getAccessToken:c,user:f}=K(),{walletProxy:m,refreshUser:u,closePrivyModal:C,createAnalyticsEvent:v}=M(),{app:g,navigate:b,data:E,onUserCloseViaDialogOrKeybindRef:R}=x(),{onSuccess:S,onFailure:A}=E.createWallet,k=ve(f),I=e?.recoveryMethod==="user-passcode",F=k?.recoveryMethod==="user-passcode";O6(()=>{s||(b("LANDING"),A(new Gs("User must be authenticated before setting a password on a Privy wallet")))},[s]);let G=()=>{if(n){A(n),C({shouldCallAuthOnSuccess:!1});return}if(!I){A(new Ht("Exited before password was added to wallet")),C({shouldCallAuthOnSuccess:!1});return}S(e),C({shouldCallAuthOnSuccess:!1})};R.current=G;let Y=async()=>{let L=await c();if(L&&k?.address&&a&&m)try{if(v({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:F}}),!(await m.setRecovery({accessToken:L,address:k.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new Ht("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:F,reason:"error setting password"}});return}let W=await u(),be=ve(W);if(!be){i(new Ht("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:F,reason:"wallet disconnected"}});return}t(be),v({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:F}})}catch(U){console.warn(U),i(U instanceof Error?U:new Error("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:k.address,reason:U}})}},j=async()=>{I?(S(e),C({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await Y(),o(!1))};return N6(Ec,{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:F,onPasswordGenerate:()=>l(bc()),onPasswordChange:l,onSubmit:j,onClose:G})};import D6 from"@heroicons/react/24/outline/UserCircleIcon";import U6 from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as F6,jsx as Fo,jsxs as Sc}from"react/jsx-runtime";var Sg=()=>{let{closePrivyModal:e}=M(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new Ht("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,Sc(F6,{children:[Fo(_,{onClose:l}),Fo(ae,{}),Sc(gr,{children:[Sc(Zh,{children:[Fo(D6,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),Fo(Jh,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:Fo(U6,{width:"12px",height:"12px",fill:"white"})})]}),Sc(fe,{title:"Secure Your Account",children:["Please set a password to secure your account.",Fo("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),Fo(H,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),Fo(se,{}),Fo(q,{})]})};import B6 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import H6 from"@heroicons/react/24/outline/PhoneIcon";import Ag from"styled-components";import{Fragment as z6,jsx as Ur,jsxs as Ac}from"react/jsx-runtime";var G6=(e,t)=>{let r=Ur(B6,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof w)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:r};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(e instanceof Oe&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:Ur(H6,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof it)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:r};case"allowlist_rejected":return{title:t.errorTitle||"You don't have access to this app",detail:t.errorDetail||"Have you been invited?",ctaText:t.errorCtaText||"Try another account",icon:Ur(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:Ur("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:Ur("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else return e instanceof xt&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}},Pg=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=x(),i=r?.errorModalData?.previousScreen||(o===n?void 0:o);return Ur(ei,{error:r?.errorModalData?.error||new Error,backFn:()=>i?e(i,!1):t(),onClick:()=>e(i||"LANDING",!1)})},ei=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Te(),{app:n}=x(),i=G6(e,n.allowlistConfig),a=()=>{if(e instanceof it&&(e.privyErrorCode==="invalid_captcha"&&o(),e.privyErrorCode==="allowlist_rejected"&&n.allowlistConfig.errorCtaLink)){window.location.href=n.allowlistConfig.errorCtaLink;return}r?.()};return Ac(z6,{children:[Ur(_,{backFn:t}),Ac(V6,{children:[Ur(tt,{children:Ac("div",{children:[Ur(ec,{color:"var(--privy-color-error)"}),i.icon]})}),Ac(q6,{children:[Ur("h3",{children:i.title}),Ur("p",{children:i.detail})]}),Ur(H,{color:"var(--privy-color-error)",onClick:a,children:i.ctaText})]})]})},V6=Ag.div`
1393
1393
  display: flex;
1394
1394
  flex-direction: column;
1395
1395
  align-items: center;
@@ -1397,11 +1397,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1397
1397
  gap: 24px;
1398
1398
  width: 100%;
1399
1399
  padding-bottom: 16px;
1400
- `,V6=Tg.div`
1400
+ `,q6=Ag.div`
1401
1401
  display: flex;
1402
1402
  flex-direction: column;
1403
1403
  gap: 8px;
1404
- `;import{useEffect as Mg,useRef as db,useState as Yp}from"react";import{isIOS as pb,isMobile as Ig}from"react-device-detect";import Og from"styled-components";import{useState as z6}from"react";import K6 from"styled-components";import{jsx as Ag}from"react/jsx-runtime";var na=({style:e,color:t,...r})=>Ag("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:Ag("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as zp}from"react/jsx-runtime";var Pg=({color:e,...t})=>zp("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:zp("g",{children:zp("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"})})});import{jsx as xg,jsxs as j6}from"react/jsx-runtime";var pn=e=>{let[t,r]=z6(!1);return j6(Y6,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?xg(na,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):xg(Pg,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},Y6=K6.button`
1404
+ `;import{useEffect as Wg,useRef as pb,useState as jp}from"react";import{isIOS as ub,isMobile as Lg}from"react-device-detect";import Dg from"styled-components";import{useState as K6}from"react";import Y6 from"styled-components";import{jsx as xg}from"react/jsx-runtime";var na=({style:e,color:t,...r})=>xg("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:xg("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as Kp}from"react/jsx-runtime";var kg=({color:e,...t})=>Kp("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:Kp("g",{children:Kp("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"})})});import{jsx as _g,jsxs as X6}from"react/jsx-runtime";var pn=e=>{let[t,r]=K6(!1);return X6(j6,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?_g(na,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):_g(kg,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},j6=Y6.button`
1405
1405
  display: flex;
1406
1406
  align-items: center;
1407
1407
  gap: 6px;
@@ -1439,7 +1439,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1439
1439
  width: 14px;
1440
1440
  height: 14px;
1441
1441
  }
1442
- `;import{useState as X6}from"react";import Q6 from"styled-components";import{jsx as J6}from"react/jsx-runtime";var Pc=e=>{let[t,r]=X6(!1);return J6(Z6,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},Z6=Q6.a`
1442
+ `;import{useState as Q6}from"react";import Z6 from"styled-components";import{jsx as $6}from"react/jsx-runtime";var Pc=e=>{let[t,r]=Q6(!1);return $6(J6,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},J6=Z6.a`
1443
1443
  display: flex;
1444
1444
  align-items: center;
1445
1445
  gap: 6px;
@@ -1477,7 +1477,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1477
1477
  width: 14px;
1478
1478
  height: 14px;
1479
1479
  }
1480
- `;import $6 from"qrcode";import eb from"react";import tb from"styled-components";import{jsx as kg}from"react/jsx-runtime";var _g=()=>kg("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:kg("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as rs,jsx as zt,jsxs as Rg}from"react/jsx-runtime";var br=7,Kp=(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},rb=(e,t)=>{let r=$6.create(e,{errorCorrectionLevel:t}).modules,o=qm(Array.from(r.data),r.size);return o=Kp(o,0,0,br,br),o=Kp(o,o.length-br,0,br,br),o=Kp(o,0,o.length-br,br,br),o},ob=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>zt(rs,{children:[0,1,2].map(i=>zt("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}`))}),nb=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-br)*e,0],[0,(t-br)*e]];return zt(rs,{children:n.map(([i,a])=>zt(ob,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},ib=({matrix:e,cellSize:t,color:r})=>zt(rs,{children:e.map((i,a)=>i.map((l,s)=>l?zt("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}`):zt(eb.Fragment,{},`circle-${a}-${s}`)))}),ab=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return zt(rs,{});let i=t*(o||.14),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,f=s-s*c*2,m=r,u=a*e;return Rg(rs,{children:[zt("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),zt(m,{x:u+s*c,y:u+s*c,height:f,width:f})]})},sb=e=>{let t=e.outputSize,r=rb(e.url,e.errorCorrectionLevel),o=t/r.length,n=Qm(o*2,{min:t*.025,max:t*.036});return Rg("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${n}px`},children:[zt(ib,{matrix:r,cellSize:o,color:e.fgColor}),zt(nb,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),zt(ab,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},lb=tb.div`
1480
+ `;import eb from"qrcode";import tb from"react";import rb from"styled-components";import{jsx as Rg}from"react/jsx-runtime";var Mg=()=>Rg("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:Rg("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as rs,jsx as zt,jsxs as Ig}from"react/jsx-runtime";var br=7,Yp=(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},ob=(e,t)=>{let r=eb.create(e,{errorCorrectionLevel:t}).modules,o=Km(Array.from(r.data),r.size);return o=Yp(o,0,0,br,br),o=Yp(o,o.length-br,0,br,br),o=Yp(o,0,o.length-br,br,br),o},nb=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>zt(rs,{children:[0,1,2].map(i=>zt("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}`))}),ib=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-br)*e,0],[0,(t-br)*e]];return zt(rs,{children:n.map(([i,a])=>zt(nb,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},ab=({matrix:e,cellSize:t,color:r})=>zt(rs,{children:e.map((i,a)=>i.map((l,s)=>l?zt("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}`):zt(tb.Fragment,{},`circle-${a}-${s}`)))}),sb=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return zt(rs,{});let i=t*(o||.14),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,f=s-s*c*2,m=r,u=a*e;return Ig(rs,{children:[zt("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),zt(m,{x:u+s*c,y:u+s*c,height:f,width:f})]})},lb=e=>{let t=e.outputSize,r=ob(e.url,e.errorCorrectionLevel),o=t/r.length,n=Jm(o*2,{min:t*.025,max:t*.036});return Ig("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${n}px`},children:[zt(ab,{matrix:r,cellSize:o,color:e.fgColor}),zt(ib,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),zt(sb,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},cb=rb.div`
1481
1481
  display: flex;
1482
1482
  justify-content: center;
1483
1483
  align-items: center;
@@ -1491,7 +1491,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1491
1491
  border-color: ${e=>e.borderColor};
1492
1492
  border-radius: var(--privy-border-radius-md);
1493
1493
  }
1494
- `,un=e=>{let{appearance:t}=De(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return zt(lb,{size:n,bgColor:r,fgColor:o,borderColor:i,children:zt(sb,{url:e.url,logo:{element:e.squareLogoElement??_g},outputSize:n,bgColor:r,fgColor:o,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})};import{jsx as xc,jsxs as cb}from"react/jsx-runtime";var go=({style:e,...t})=>cb("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:[xc("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),xc("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"}),xc("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"}),xc("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"})]});import{Fragment as kc,jsx as _e,jsxs as vo}from"react/jsx-runtime";var Wg="#8a63d2",Ng=1e3,ub=Ng*2,mb=Ng*120,Dg=()=>{let{authenticated:e,logout:t,ready:r,user:o}=z(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=x(),{getAuthFlow:c,loginWithFarcaster:f,closePrivyModal:m,createAnalyticsEvent:u}=M(),[C,v]=Yp(void 0),[g,b]=Yp(!1),[E,R]=Yp(!1),S=db([]),A=Me,k=c(),I=k?.meta.connectUri;return Mg(()=>{let F=Date.now(),G=setInterval(async()=>{let Y=await k.pollForReady.execute(),j=Date.now()-F;if(Y){clearInterval(G),b(!0);try{await f(),R(!0)}catch(L){let U={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 Rr(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"?U.detail="This account has already been linked to another user.":L?.privyErrorCode==="invalid_credentials"?(U.retryable=!0,U.detail="Something went wrong. Try again."):L?.privyErrorCode==="too_many_requests"&&(U.detail="Too many requests. Please wait before trying again.");v(U)}}else j>mb&&(clearInterval(G),v({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},ub);return()=>{clearInterval(G),S.current.forEach(Y=>clearTimeout(Y))}},[]),Mg(()=>{if(r&&e&&E&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},A);return()=>clearTimeout(G)}E&&(Gt(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")},A)):S.current.push(setTimeout(()=>m({shouldCallAuthOnSuccess:!0,isSuccess:!0}),A)))}},[E,r,e,o]),Ig||g?vo(kc,{children:[_e(_,{backFn:n?a:void 0,onClose:m},"header"),_e(ie,{}),pb?_e(kc,{children:vo(fb,{children:[_e(tt,{children:vo("div",{children:[_e(lt,{success:E,fail:!!C}),_e(go,{style:{width:"38px",height:"38px"}})]})}),vo(Xe,{children:[_e(pe,{children:C?C.message:"Sign in with Farcaster"}),_e(me,{children:C?C.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),I&&_e(H,{onClick:F=>{F.preventDefault(),window.location.href=I},children:"Open Warpcast app"})]})}):_e(kc,{children:vo(Lg,{children:[_e(tt,{children:vo("div",{children:[_e(lt,{success:E,fail:!!C}),_e(go,{style:{width:"38px",height:"38px"}})]})}),vo(Xe,{children:[_e(pe,{children:C?C.message:"Signing in with Farcaster"}),_e(me,{children:C?C.detail:"This should only take a moment"}),_e(St,{children:I&&Ig&&_e(Pc,{text:"Take me to Warpcast",url:I,color:Wg})})]})]})}),_e(Z,{})]}):vo(kc,{children:[_e(_,{backFn:n?a:void 0,onClose:m},"header"),_e(ie,{}),_e(Lg,{children:vo("div",{children:[_e(pe,{children:"Sign in with Farcaster"}),_e(me,{children:"Scan with your phone's camera to continue."}),_e(Fi,{children:I?_e(un,{url:I,size:275,squareLogoElement:go}):_e(ct,{})}),vo(St,{children:[_e(me,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),I&&_e(pn,{text:I,itemName:"link",color:Wg})]})]})}),_e(Z,{})]})},Lg=Og.div`
1494
+ `,un=e=>{let{appearance:t}=De(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return zt(cb,{size:n,bgColor:r,fgColor:o,borderColor:i,children:zt(lb,{url:e.url,logo:{element:e.squareLogoElement??Mg},outputSize:n,bgColor:r,fgColor:o,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})};import{jsx as xc,jsxs as db}from"react/jsx-runtime";var go=({style:e,...t})=>db("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:[xc("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),xc("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"}),xc("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"}),xc("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"})]});import{Fragment as kc,jsx as _e,jsxs as vo}from"react/jsx-runtime";var Og="#8a63d2",Ug=1e3,mb=Ug*2,fb=Ug*120,Fg=()=>{let{authenticated:e,logout:t,ready:r,user:o}=K(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=x(),{getAuthFlow:c,loginWithFarcaster:f,closePrivyModal:m,createAnalyticsEvent:u}=M(),[C,v]=jp(void 0),[g,b]=jp(!1),[E,R]=jp(!1),S=pb([]),A=Me,k=c(),I=k?.meta.connectUri;return Wg(()=>{let F=Date.now(),G=setInterval(async()=>{let Y=await k.pollForReady.execute(),j=Date.now()-F;if(Y){clearInterval(G),b(!0);try{await f(),R(!0)}catch(L){let U={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 Rr(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"?U.detail="This account has already been linked to another user.":L?.privyErrorCode==="invalid_credentials"?(U.retryable=!0,U.detail="Something went wrong. Try again."):L?.privyErrorCode==="too_many_requests"&&(U.detail="Too many requests. Please wait before trying again.");v(U)}}else j>fb&&(clearInterval(G),v({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},mb);return()=>{clearInterval(G),S.current.forEach(Y=>clearTimeout(Y))}},[]),Wg(()=>{if(r&&e&&E&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},A);return()=>clearTimeout(G)}E&&(Gt(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")},A)):S.current.push(setTimeout(()=>m({shouldCallAuthOnSuccess:!0,isSuccess:!0}),A)))}},[E,r,e,o]),Lg||g?vo(kc,{children:[_e(_,{backFn:n?a:void 0,onClose:m},"header"),_e(ae,{}),ub?_e(kc,{children:vo(hb,{children:[_e(tt,{children:vo("div",{children:[_e(lt,{success:E,fail:!!C}),_e(go,{style:{width:"38px",height:"38px"}})]})}),vo(je,{children:[_e(de,{children:C?C.message:"Sign in with Farcaster"}),_e(me,{children:C?C.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),I&&_e(H,{onClick:F=>{F.preventDefault(),window.location.href=I},children:"Open Warpcast app"})]})}):_e(kc,{children:vo(Ng,{children:[_e(tt,{children:vo("div",{children:[_e(lt,{success:E,fail:!!C}),_e(go,{style:{width:"38px",height:"38px"}})]})}),vo(je,{children:[_e(de,{children:C?C.message:"Signing in with Farcaster"}),_e(me,{children:C?C.detail:"This should only take a moment"}),_e(St,{children:I&&Lg&&_e(Pc,{text:"Take me to Warpcast",url:I,color:Og})})]})]})}),_e(Z,{})]}):vo(kc,{children:[_e(_,{backFn:n?a:void 0,onClose:m},"header"),_e(ae,{}),_e(Ng,{children:vo("div",{children:[_e(de,{children:"Sign in with Farcaster"}),_e(me,{children:"Scan with your phone's camera to continue."}),_e(Fi,{children:I?_e(un,{url:I,size:275,squareLogoElement:go}):_e(ct,{})}),vo(St,{children:[_e(me,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),I&&_e(pn,{text:I,itemName:"link",color:Og})]})]})}),_e(Z,{})]})},Ng=Dg.div`
1495
1495
  display: flex;
1496
1496
  flex-direction: column;
1497
1497
  align-items: center;
@@ -1499,14 +1499,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1499
1499
  margin-left: 27px;
1500
1500
  margin-right: 27px;
1501
1501
  gap: 24px;
1502
- `,fb=Og.div`
1502
+ `,hb=Dg.div`
1503
1503
  display: flex;
1504
1504
  flex-direction: column;
1505
1505
  align-items: center;
1506
1506
  justify-content: center;
1507
1507
  gap: 24px;
1508
1508
  width: 100%;
1509
- `;import{useEffect as hb,useRef as yb,useState as jp}from"react";import{isIOS as gb,isMobile as Ug}from"react-device-detect";import Hg from"styled-components";import{Fragment as _c,jsx as Ie,jsxs as Zr}from"react/jsx-runtime";var Fg="#8a63d2",Gg=1e3,vb=Gg*2,Cb=Gg*300,Vg=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=x(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=M(),[a,l]=jp(void 0),[s,c]=jp(!1),[f,m]=jp(!1),u=yb([]),C=Me,v=r?.farcasterSigner;hb(()=>{let b=Date.now(),E=setInterval(async()=>{if(!v?.public_key){clearInterval(E),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}v.status==="approved"&&(clearInterval(E),c(!1),m(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),C)));let R=await n(v?.public_key),S=Date.now()-b;R.status==="approved"?(clearInterval(E),c(!1),m(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),C))):S>Cb?(clearInterval(E),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):R.status==="revoked"&&(clearInterval(E),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},vb);return()=>{clearInterval(E),u.current.forEach(R=>clearTimeout(R))}},[]);let g=v?.status==="pending_approval"?v.signer_approval_url:void 0;return Ug||s?Zr(_c,{children:[Ie(_,{backFn:e?t:void 0,onClose:i},"header"),Ie(ie,{}),gb?Ie(_c,{children:Zr(wb,{children:[Ie(tt,{children:Zr("div",{children:[Ie(lt,{success:f,fail:!!a}),Ie(go,{style:{width:"38px",height:"38px"}})]})}),Zr(Xe,{children:[Ie(pe,{children:a?a.message:"Add a signer to Farcaster"}),Ie(me,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&Ie(H,{onClick:b=>{b.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):Ie(_c,{children:Zr(Bg,{children:[Ie(tt,{children:Zr("div",{children:[Ie(lt,{success:f,fail:!!a}),Ie(go,{style:{width:"38px",height:"38px"}})]})}),Zr(Xe,{children:[Ie(pe,{children:a?a.message:"Requesting signer from Farcaster"}),Ie(me,{children:a?a.detail:"This should only take a moment"}),Ie(St,{children:g&&Ug&&Ie(Pc,{text:"Take me to Warpcast",url:g,color:Fg})})]})]})}),Ie(Z,{})]}):Zr(_c,{children:[Ie(_,{backFn:e?t:void 0,onClose:i},"header"),Ie(ie,{}),Ie(Bg,{children:Zr("div",{children:[Ie(pe,{children:"Add a signer to Farcaster"}),Zr(me,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),Ie(Fi,{children:v?.status==="pending_approval"?Ie(un,{url:v.signer_approval_url,size:275,squareLogoElement:go}):Ie(ct,{})}),Zr(St,{children:[Ie(me,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),v?.status==="pending_approval"&&Ie(pn,{text:v.signer_approval_url,itemName:"link",color:Fg})]})]})}),Ie(Z,{})]})},Bg=Hg.div`
1509
+ `;import{useEffect as yb,useRef as gb,useState as Xp}from"react";import{isIOS as vb,isMobile as Bg}from"react-device-detect";import Vg from"styled-components";import{Fragment as _c,jsx as Ie,jsxs as Zr}from"react/jsx-runtime";var Hg="#8a63d2",qg=1e3,Cb=qg*2,wb=qg*300,zg=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=x(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=M(),[a,l]=Xp(void 0),[s,c]=Xp(!1),[f,m]=Xp(!1),u=gb([]),C=Me,v=r?.farcasterSigner;yb(()=>{let b=Date.now(),E=setInterval(async()=>{if(!v?.public_key){clearInterval(E),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}v.status==="approved"&&(clearInterval(E),c(!1),m(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),C)));let R=await n(v?.public_key),S=Date.now()-b;R.status==="approved"?(clearInterval(E),c(!1),m(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),C))):S>wb?(clearInterval(E),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):R.status==="revoked"&&(clearInterval(E),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},Cb);return()=>{clearInterval(E),u.current.forEach(R=>clearTimeout(R))}},[]);let g=v?.status==="pending_approval"?v.signer_approval_url:void 0;return Bg||s?Zr(_c,{children:[Ie(_,{backFn:e?t:void 0,onClose:i},"header"),Ie(ae,{}),vb?Ie(_c,{children:Zr(bb,{children:[Ie(tt,{children:Zr("div",{children:[Ie(lt,{success:f,fail:!!a}),Ie(go,{style:{width:"38px",height:"38px"}})]})}),Zr(je,{children:[Ie(de,{children:a?a.message:"Add a signer to Farcaster"}),Ie(me,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&Ie(H,{onClick:b=>{b.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):Ie(_c,{children:Zr(Gg,{children:[Ie(tt,{children:Zr("div",{children:[Ie(lt,{success:f,fail:!!a}),Ie(go,{style:{width:"38px",height:"38px"}})]})}),Zr(je,{children:[Ie(de,{children:a?a.message:"Requesting signer from Farcaster"}),Ie(me,{children:a?a.detail:"This should only take a moment"}),Ie(St,{children:g&&Bg&&Ie(Pc,{text:"Take me to Warpcast",url:g,color:Hg})})]})]})}),Ie(Z,{})]}):Zr(_c,{children:[Ie(_,{backFn:e?t:void 0,onClose:i},"header"),Ie(ae,{}),Ie(Gg,{children:Zr("div",{children:[Ie(de,{children:"Add a signer to Farcaster"}),Zr(me,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),Ie(Fi,{children:v?.status==="pending_approval"?Ie(un,{url:v.signer_approval_url,size:275,squareLogoElement:go}):Ie(ct,{})}),Zr(St,{children:[Ie(me,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),v?.status==="pending_approval"&&Ie(pn,{text:v.signer_approval_url,itemName:"link",color:Hg})]})]})}),Ie(Z,{})]})},Gg=Vg.div`
1510
1510
  display: flex;
1511
1511
  flex-direction: column;
1512
1512
  align-items: center;
@@ -1514,14 +1514,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1514
1514
  margin-left: 27px;
1515
1515
  margin-right: 27px;
1516
1516
  gap: 24px;
1517
- `,wb=Hg.div`
1517
+ `,bb=Vg.div`
1518
1518
  display: flex;
1519
1519
  flex-direction: column;
1520
1520
  align-items: center;
1521
1521
  justify-content: center;
1522
1522
  gap: 24px;
1523
1523
  width: 100%;
1524
- `;import x7 from"@heroicons/react/24/outline/CheckCircleIcon";import{useEffect as ua,useState as Er}from"react";import{createPublicClient as O1,createWalletClient as k7,custom as _7,formatEther as R7,http as N1,parseEther as M7,publicActions as I7}from"viem";import{jsx as bb}from"react/jsx-runtime";function Lt({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=x(),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,bb(_,{title:e,backFn:i})}import Rc from"styled-components";import{jsx as Xp,jsxs as Pb}from"react/jsx-runtime";var Mc=()=>Xp(Eb,{children:Pb(Tb,{children:[Xp(Sb,{}),Xp(Ab,{})]})}),Eb=Rc.div`
1524
+ `;import _7 from"@heroicons/react/24/outline/CheckCircleIcon";import{useEffect as ua,useState as Er}from"react";import{createPublicClient as D1,createWalletClient as R7,custom as M7,formatEther as I7,http as U1,parseEther as W7,publicActions as L7}from"viem";import{jsx as Eb}from"react/jsx-runtime";function Lt({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=x(),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,Eb(_,{title:e,backFn:i})}import Rc from"styled-components";import{jsx as Qp,jsxs as xb}from"react/jsx-runtime";var Mc=()=>Qp(Tb,{children:xb(Sb,{children:[Qp(Ab,{}),Qp(Pb,{})]})}),Tb=Rc.div`
1525
1525
  display: flex;
1526
1526
  justify-content: center;
1527
1527
  align-items: center;
@@ -1530,14 +1530,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1530
1530
  @media all and (display-mode: standalone) {
1531
1531
  margin-bottom: 30px;
1532
1532
  }
1533
- `,Tb=Rc.div`
1533
+ `,Sb=Rc.div`
1534
1534
  position: relative;
1535
1535
  height: 96px;
1536
1536
  width: 96px;
1537
1537
 
1538
1538
  opacity: 1;
1539
1539
  animation: fadein 200ms ease;
1540
- `,Sb=Rc.div`
1540
+ `,Ab=Rc.div`
1541
1541
  position: absolute;
1542
1542
  top: 0;
1543
1543
  right: 0;
@@ -1550,7 +1550,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1550
1550
  border: 4px solid #f1f2f9;
1551
1551
  border-radius: 50%;
1552
1552
  }
1553
- `,Ab=Rc.div`
1553
+ `,Pb=Rc.div`
1554
1554
  position: absolute;
1555
1555
  top: 0;
1556
1556
  right: 0;
@@ -1574,16 +1574,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
1574
1574
  transform: rotate(360deg);
1575
1575
  }
1576
1576
  }
1577
- `;import{useState as Qp,useEffect as xb}from"react";var Co=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=M(),[n,i]=Qp(!0),[a,l]=Qp(void 0),[s,c]=Qp(void 0);return xb(()=>{let f=e.chainId||Mo,m=o.find(C=>C.id===Number(f));if(!m)throw new de(`Unsupported chain: ${f}`);(async()=>{if(!t){i(!1);return}try{i(!0);let C=await r(m);C?c(C):l(new Error(`Unable to fetch token price on chain id ${m.id}`))}catch(C){l(C)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};import{createContext as kb,useContext as _b}from"react";var Zp=kb(null);function Jr(){let e=_b(Zp);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}import{BigNumber as Rb}from"@ethersproject/bignumber";import{formatEther as qg}from"@ethersproject/units";import{QuantityToBigNumber as Mb}from"@privy-io/js-sdk-core";var Ib=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),zg=e=>Ib.format(e),ia=(e,t)=>{let r=zg(t*parseFloat(e));return r!=="$0.00"?r:"<$0.01"},wo=(e,t)=>{let r=zg(t*parseFloat(qg(e)));return r==="$0.00"?"<$0.01":r},At=(e,t,r=6,o=!1)=>{let i=parseFloat(qg(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},os=e=>e.map(Mb).reduce((t,r)=>t.add(r),Rb.from(0)).toHexString(),Kg=(e,t)=>{let{chains:r}=M(),o=`https://etherscan.io/address/${t}`,n=`${Xm(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n};var Yg="0x0000000000000000000000000000000000000000",jg=e=>({tradeType:"EXACT_OUTPUT",originCurrency:Yg,destinationCurrency:Yg,...e}),Wb="https://api.testnets.relay.link/execute/swap",Lb="https://api.relay.link/execute/swap",Xg=async({input:e,isTestnet:t})=>{let r=await fetch(t?Wb:Lb,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await r.json();if(!r.ok)throw console.error("Relay error:",o),new Error(o.message??"Error fetching quote from relay");return o},Qg=e=>{let t=e.steps[0]?.items?.[0];if(t)return{from:t.data.from,to:t.data.to,value:Number(t.data.value),chainId:Number(t.data.chainId),data:t.data.data}};import{createPublicClient as Ob,http as Nb}from"viem";var Zg=({chains:e,appId:t,address:r,rpcConfig:o})=>Promise.all(e.map(async n=>({balance:await Ob({chain:n,transport:Nb(Ko(n,o,t))}).getBalance({address:r}).catch(()=>0n),chain:n})));import{formatEther as E7}from"viem";import Jg from"styled-components";var Ic=Jg.span`
1577
+ `;function kb(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Ic(e){let t=e.filter(r=>!ph.has(r.id));return Bn.concat(t)}import{useState as Zp,useEffect as _b}from"react";var Co=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=M(),[n,i]=Zp(!0),[a,l]=Zp(void 0),[s,c]=Zp(void 0);return _b(()=>{let f=e.chainId||Mo,u=Ic(o).find(v=>v.id===Number(f));(async()=>{if(!t){i(!1);return}if(!u){i(!1),l(new Error(`Unable to fetch token price on chain id ${f}`));return}try{i(!0);let v=await r(u);v?c(v):l(new Error(`Unable to fetch token price on chain id ${u.id}`))}catch(v){l(v)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};import{createContext as Rb,useContext as Mb}from"react";var Jp=Rb(null);function Jr(){let e=Mb(Jp);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}import{BigNumber as Ib}from"@ethersproject/bignumber";import{formatEther as Kg}from"@ethersproject/units";import{QuantityToBigNumber as Wb}from"@privy-io/js-sdk-core";var Lb=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),Yg=e=>Lb.format(e),ia=(e,t)=>{let r=Yg(t*parseFloat(e));return r!=="$0.00"?r:"<$0.01"},wo=(e,t)=>{let r=Yg(t*parseFloat(Kg(e)));return r==="$0.00"?"<$0.01":r},At=(e,t,r=6,o=!1)=>{let i=parseFloat(Kg(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},os=e=>e.map(Wb).reduce((t,r)=>t.add(r),Ib.from(0)).toHexString(),jg=(e,t)=>{let{chains:r}=M(),o=`https://etherscan.io/address/${t}`,n=`${Zm(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n};var Xg="0x0000000000000000000000000000000000000000",Qg=e=>({tradeType:"EXACT_OUTPUT",originCurrency:Xg,destinationCurrency:Xg,...e}),Ob="https://api.testnets.relay.link/execute/swap",Nb="https://api.relay.link/execute/swap",Zg=async({input:e,isTestnet:t})=>{let r=await fetch(t?Ob:Nb,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await r.json();if(!r.ok)throw console.error("Relay error:",o),new Error(o.message??"Error fetching quote from relay");return o},Jg=e=>{let t=e.steps[0]?.items?.[0];if(t)return{from:t.data.from,to:t.data.to,value:Number(t.data.value),chainId:Number(t.data.chainId),data:t.data.data}};import{createPublicClient as Db,http as Ub}from"viem";var $g=({chains:e,appId:t,address:r,rpcConfig:o})=>Promise.all(e.map(async n=>({balance:await Db({chain:n,transport:Ub(Ko(n,o,t))}).getBalance({address:r}).catch(()=>0n),chain:n})));import{formatEther as S7}from"viem";import e1 from"styled-components";var Wc=e1.span`
1578
1578
  display: flex;
1579
1579
  flex-direction: column;
1580
1580
  gap: 0.35rem;
1581
1581
  width: 100%;
1582
- `,Ot=Jg.span`
1582
+ `,Ot=e1.span`
1583
1583
  display: flex;
1584
1584
  width: 100%;
1585
1585
  justify-content: space-between;
1586
- `;import Db from"styled-components";var bo=Db.span`
1586
+ gap: 0.5rem;
1587
+ `;import Fb from"styled-components";var bo=Fb.span`
1587
1588
  margin-top: 4px;
1588
1589
  color: var(--privy-color-foreground);
1589
1590
  text-align: center;
@@ -1591,21 +1592,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
1591
1592
  font-size: 0.875rem;
1592
1593
  font-weight: 400;
1593
1594
  line-height: 1.375rem; /* 157.143% */
1594
- `;import Ub from"styled-components";var Bo=Ub.span`
1595
+ `;import Bb from"styled-components";var Bo=Bb.span`
1595
1596
  color: var(--privy-color-foreground);
1596
1597
  font-size: 1.125rem;
1597
1598
  font-weight: 600;
1598
1599
  line-height: 1.875rem; /* 166.667% */
1599
1600
  text-align: center;
1600
- `;import y1 from"styled-components";import Fb from"styled-components";var Kt=Fb.span`
1601
+ `;import v1 from"styled-components";import Hb from"styled-components";var Kt=Hb.span`
1601
1602
  color: var(--privy-color-foreground);
1602
1603
  font-size: 0.875rem;
1603
1604
  font-weight: 500;
1604
1605
  line-height: 1.375rem; /* 157.143% */
1606
+ word-break: break-all;
1607
+ text-align: right;
1605
1608
 
1606
1609
  ${nc}
1607
- `;import zb from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Yt,jsxs as Wc}from"react/jsx-runtime";var $g=e=>Yt("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...e,children:Yt("g",{id:"Layer_x0020_1",children:Wc("g",{id:"_2405588477232",children:[Yt("rect",{fill:"none",width:"2500",height:"2500"}),Yt("g",{children:Wc("g",{children:[Yt("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),Yt("g",{children:Wc("g",{children:[Yt("g",{children:Yt("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),Yt("g",{children:Yt("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),Yt("g",{children:Yt("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),Yt("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),Wc("g",{children:[Yt("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),Yt("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})});import{jsx as e1,jsxs as Bb}from"react/jsx-runtime";var t1=e=>Bb("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[e1("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),e1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]});import{jsx as r1,jsxs as Hb}from"react/jsx-runtime";var o1=e=>Hb("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[r1("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),r1("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"})]});import{jsx as n1}from"react/jsx-runtime";var i1=e=>n1("svg",{version:"1.1",id:"Symbol",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",x:"0px",y:"0px",viewBox:"0 0 384 383",enableBackground:"new 0 0 384 383;",...e,children:n1("path",{d:`M383.5,0H0.5v383h383V249.3h-63.6C298,298.1,248.7,332,192.3,332c-77.8,0-140.8-63.6-140.8-140.8
1608
- C51.4,114,114.5,51,192.3,51C249.8,51,299.1,86,321,135.9h62.5V0z`})});import{jsx as aa,jsxs as a1}from"react/jsx-runtime";var s1=e=>a1("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[aa("rect",{width:"199.4",height:"207.623",fill:"#121212"}),a1("g",{"clip-path":"url(#clip0_2303_643)",children:[aa("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),aa("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),aa("defs",{children:aa("clipPath",{id:"clip0_2303_643",children:aa("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});import{jsx as ns,jsxs as Gb}from"react/jsx-runtime";var l1=e=>Gb("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 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[ns("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),ns("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),ns("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),ns("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),ns("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});import{jsx as Jp,jsxs as Vb}from"react/jsx-runtime";var c1=e=>Vb("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Jp("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),Jp("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),Jp("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]});import{jsx as d1,jsxs as qb}from"react/jsx-runtime";var p1=e=>qb("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[d1("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),d1("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]});import{jsx as Lc,jsxs as u1}from"react/jsx-runtime";var m1=e=>u1("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Lc("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),u1("defs",{children:[Lc("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:Lc("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),Lc("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]});import{jsx as f1}from"react/jsx-runtime";var Kb={[Ml.id]:$g,[Il.id]:t1,[Wl.id]:o1,[Ll.id]:i1,[Ol.id]:s1,[Ii.id]:l1,[Nl.id]:c1,[Dl.id]:p1,[Ul.id]:m1},sa=({chainId:e,...t})=>{let r=Kb[e];return r?f1(r,{...t}):f1(zb,{...t})};import Yb,{css as jb}from"styled-components";var $p=jb`
1610
+ `;import Yb from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Yt,jsxs as Lc}from"react/jsx-runtime";var t1=e=>Yt("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...e,children:Yt("g",{id:"Layer_x0020_1",children:Lc("g",{id:"_2405588477232",children:[Yt("rect",{fill:"none",width:"2500",height:"2500"}),Yt("g",{children:Lc("g",{children:[Yt("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),Yt("g",{children:Lc("g",{children:[Yt("g",{children:Yt("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),Yt("g",{children:Yt("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),Yt("g",{children:Yt("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),Yt("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),Lc("g",{children:[Yt("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),Yt("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})});import{jsx as r1,jsxs as Gb}from"react/jsx-runtime";var o1=e=>Gb("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[r1("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),r1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]});import{jsx as n1,jsxs as Vb}from"react/jsx-runtime";var i1=e=>Vb("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[n1("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),n1("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"})]});import{jsx as a1}from"react/jsx-runtime";var s1=e=>a1("svg",{version:"1.1",id:"Symbol",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",x:"0px",y:"0px",viewBox:"0 0 384 383",enableBackground:"new 0 0 384 383;",...e,children:a1("path",{d:`M383.5,0H0.5v383h383V249.3h-63.6C298,298.1,248.7,332,192.3,332c-77.8,0-140.8-63.6-140.8-140.8
1611
+ C51.4,114,114.5,51,192.3,51C249.8,51,299.1,86,321,135.9h62.5V0z`})});import{jsx as aa,jsxs as l1}from"react/jsx-runtime";var c1=e=>l1("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[aa("rect",{width:"199.4",height:"207.623",fill:"#121212"}),l1("g",{"clip-path":"url(#clip0_2303_643)",children:[aa("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),aa("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),aa("defs",{children:aa("clipPath",{id:"clip0_2303_643",children:aa("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});import{jsx as ns,jsxs as qb}from"react/jsx-runtime";var d1=e=>qb("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 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[ns("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),ns("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),ns("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),ns("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),ns("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});import{jsx as $p,jsxs as zb}from"react/jsx-runtime";var p1=e=>zb("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[$p("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),$p("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),$p("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]});import{jsx as u1,jsxs as Kb}from"react/jsx-runtime";var m1=e=>Kb("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u1("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),u1("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]});import{jsx as Oc,jsxs as f1}from"react/jsx-runtime";var h1=e=>f1("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Oc("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),f1("defs",{children:[Oc("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:Oc("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),Oc("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]});import{jsx as y1}from"react/jsx-runtime";var jb={[Ml.id]:t1,[Il.id]:o1,[Wl.id]:i1,[Ll.id]:s1,[Ol.id]:c1,[Ii.id]:d1,[Nl.id]:p1,[Dl.id]:m1,[Ul.id]:h1},sa=({chainId:e,...t})=>{let r=jb[e];return r?y1(r,{...t}):y1(Yb,{...t})};import Xb,{css as Qb}from"styled-components";var eu=Qb`
1609
1612
  && {
1610
1613
  border-width: 1px;
1611
1614
  padding: 0.5rem 1rem;
@@ -1620,21 +1623,21 @@ You will need this password to access your ${e} wallet on a new device. Please k
1620
1623
  align-items: center;
1621
1624
 
1622
1625
  ${e=>e.$state==="error"?"border-color: var(--privy-color-error);":""}
1623
- `,Oc=Yb.div`
1624
- ${$p}
1625
- `;import{Fragment as Zb,jsx as is,jsxs as h1}from"react/jsx-runtime";var g1=({balance:e,className:t,chain:r})=>is(Oc,{className:t,$state:void 0,children:is(Nc,{balance:e,chain:r})}),Nc=({balance:e,chain:t})=>h1(Zb,{children:[h1(Xb,{children:[is(Qb,{chainId:t.id}),is(Kt,{children:t.name})]}),is(Rt,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),Xb=y1.div`
1626
+ `,Nc=Xb.div`
1627
+ ${eu}
1628
+ `;import{Fragment as $b,jsx as is,jsxs as g1}from"react/jsx-runtime";var C1=({balance:e,className:t,chain:r})=>is(Nc,{className:t,$state:void 0,children:is(Dc,{balance:e,chain:r})}),Dc=({balance:e,chain:t})=>g1($b,{children:[g1(Zb,{children:[is(Jb,{chainId:t.id}),is(Kt,{children:t.name})]}),is(Rt,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),Zb=v1.div`
1626
1629
  display: flex;
1627
1630
  align-items: center;
1628
- `,Qb=y1(sa)`
1631
+ `,Jb=v1(sa)`
1629
1632
  height: 1.25rem;
1630
1633
  width: 1.25rem;
1631
1634
  display: inline-block;
1632
1635
  margin-right: 0.5rem;
1633
1636
  border-radius: 4px;
1634
- `;import{Menu as Dc}from"@headlessui/react";import{ChevronDownIcon as Jb}from"@heroicons/react/24/outline";import ss from"styled-components";import{jsx as as,jsxs as v1}from"react/jsx-runtime";var C1=({options:e,onSelect:t,selected:r,className:o})=>v1(Dc,{as:$b,children:[v1(Dc.Button,{as:r7,children:[as(Nc,{balance:r.balance,chain:r.chain}),as(eu,{height:16})]}),as(Dc.Items,{as:e7,className:o,anchor:"bottom",children:e.map((n,i)=>as(Dc.Item,{as:t7,onClick:()=>t(i),children:as(Nc,{balance:n.balance,chain:n.chain})},i))})]}),$b=ss.div`
1637
+ `;import{Menu as Uc}from"@headlessui/react";import{ChevronDownIcon as e7}from"@heroicons/react/24/outline";import ss from"styled-components";import{jsx as as,jsxs as w1}from"react/jsx-runtime";var b1=({options:e,onSelect:t,selected:r,className:o})=>w1(Uc,{as:t7,children:[w1(Uc.Button,{as:n7,children:[as(Dc,{balance:r.balance,chain:r.chain}),as(tu,{height:16})]}),as(Uc.Items,{as:r7,className:o,anchor:"bottom",children:e.map((n,i)=>as(Uc.Item,{as:o7,onClick:()=>t(i),children:as(Dc,{balance:n.balance,chain:n.chain})},i))})]}),t7=ss.div`
1635
1638
  width: 100%;
1636
1639
  position: relative;
1637
- `,e7=ss.div`
1640
+ `,r7=ss.div`
1638
1641
  width: 100%;
1639
1642
  margin-top: 0.5rem;
1640
1643
  position: absolute;
@@ -1648,7 +1651,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1648
1651
  }
1649
1652
 
1650
1653
  z-index: 1;
1651
- `,t7=ss.button`
1654
+ `,o7=ss.button`
1652
1655
  width: 100%;
1653
1656
  display: flex;
1654
1657
  justify-content: space-between;
@@ -1664,27 +1667,27 @@ You will need this password to access your ${e} wallet on a new device. Please k
1664
1667
  :hover {
1665
1668
  background: var(--privy-color-background-2);
1666
1669
  }
1667
- `,eu=ss(Jb)`
1670
+ `,tu=ss(e7)`
1668
1671
  height: 1rem;
1669
1672
  margin-left: 0.5rem;
1670
- `,r7=ss.button`
1671
- ${$p}
1673
+ `,n7=ss.button`
1674
+ ${eu}
1672
1675
 
1673
1676
  /* Push the chip all the way to the right */
1674
1677
  span {
1675
1678
  margin-left: auto;
1676
1679
  }
1677
1680
 
1678
- ${eu} {
1681
+ ${tu} {
1679
1682
  transition: rotate 100ms ease-in;
1680
1683
  }
1681
1684
 
1682
1685
  &[aria-expanded='true'] {
1683
- ${eu} {
1686
+ ${tu} {
1684
1687
  rotate: -180deg;
1685
1688
  }
1686
1689
  }
1687
- `;import Br,{keyframes as w7}from"styled-components";import o7 from"@heroicons/react/24/outline/ClockIcon";import n7 from"@heroicons/react/24/outline/TrashIcon";import i7 from"@heroicons/react/24/solid/CheckBadgeIcon";import a7 from"@heroicons/react/24/solid/CheckCircleIcon";import s7 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as l7,useState as ls}from"react";import Fr,{css as S1}from"styled-components";import{jsx as w1}from"react/jsx-runtime";var ti=({style:e,...t})=>w1("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:w1("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"})});import{jsx as Ge,jsxs as b1}from"react/jsx-runtime";var ri=({style:e,...t})=>b1("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:[b1("g",{clipPath:"url(#clip0_113_33841)",children:[Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"})]}),Ge("defs",{children:Ge("clipPath",{id:"clip0_113_33841",children:Ge("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as tu,jsx as ye,jsxs as dr}from"react/jsx-runtime";var E1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=ls([]),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(f=>f.concat([c])),await r(c),i(f=>f.filter(m=>m!==c))};return dr("div",{children:[ye(f7,{children:"Your passkeys"}),dr(P1,{children:[e.slice(0,a).map(c=>dr(g7,{children:[dr("div",{children:[ye(h7,{children:l(c)}),dr(y7,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),ye(C7,{disabled:n.includes(c.credentialId),onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?ye(po,{}):ye(n7,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&ye(ru,{onClick:o,children:"View all"})]})]})},c7=()=>dr(P1,{children:[dr(ar,{children:[ye(ir,{children:ye(i7,{})}),"Log in with Touch ID, Face ID, or a security key."]}),dr(ar,{children:[ye(ir,{children:ye(s7,{})}),"More secure than a password."]}),dr(ar,{children:[ye(ir,{children:ye(o7,{})}),"Takes seconds to set up and use."]})]}),A1=()=>{let{user:e,unlinkPasskey:t}=z(),{linkWithPasskey:r,closePrivyModal:o}=M(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[i,a]=ls(!1),[l,s]=ls(""),[c,f]=ls(!1),[m,u]=ls(!1);l7(()=>{n.length===0&&u(!1)},[n.length]);let C=()=>{a(!0),r().then(()=>f(!0)).catch(g=>{if(g instanceof it){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(()=>f(!0)).catch(b=>{if(b instanceof it&&b.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?dr(tu,{children:[ye(_,{onClose:()=>o()},"header"),ye(Le,{children:ye(Ze,{status:"success",children:ye(a7,{})})}),ye(T1,{children:"Passkey added"}),ye(u7,{children:"From now on, you can use your passkey to log in."}),ye(_t,{children:ye(H,{onClick:()=>o(),children:"Done"})}),ye(Z,{})]}):m?dr(tu,{children:[ye(_,{backFn:()=>u(!1),onClose:()=>o()},"header"),ye(E1,{passkeys:n,expanded:m,onUnlink:v,onExpand:()=>u(!0)}),ye(Z,{})]}):dr(tu,{children:[ye(_,{onClose:()=>o()},"header"),ye(Le,{children:dr(Uc,{children:[ye(ti,{}),ye(ri,{})]})}),ye(T1,{children:"Secure your account with a passkey"}),ye(m7,{}),n.length===0?ye(c7,{}):ye(E1,{passkeys:n,expanded:m,onUnlink:v,onExpand:()=>u(!0)}),dr(_t,{style:{marginTop:"12px"},children:[l&&ye(d7,{fail:!0,children:l}),ye(H,{onClick:C,loading:i,children:"Add new passkey"})]}),ye(Z,{})]})},Uc=Fr.div`
1690
+ `;import Br,{keyframes as E7}from"styled-components";import i7 from"@heroicons/react/24/outline/ClockIcon";import a7 from"@heroicons/react/24/outline/TrashIcon";import s7 from"@heroicons/react/24/solid/CheckBadgeIcon";import l7 from"@heroicons/react/24/solid/CheckCircleIcon";import c7 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as d7,useState as ls}from"react";import Fr,{css as P1}from"styled-components";import{jsx as E1}from"react/jsx-runtime";var ti=({style:e,...t})=>E1("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:E1("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"})});import{jsx as Ge,jsxs as T1}from"react/jsx-runtime";var ri=({style:e,...t})=>T1("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:[T1("g",{clipPath:"url(#clip0_113_33841)",children:[Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"})]}),Ge("defs",{children:Ge("clipPath",{id:"clip0_113_33841",children:Ge("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as ru,jsx as ye,jsxs as dr}from"react/jsx-runtime";var S1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=ls([]),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(f=>f.concat([c])),await r(c),i(f=>f.filter(m=>m!==c))};return dr("div",{children:[ye(y7,{children:"Your passkeys"}),dr(k1,{children:[e.slice(0,a).map(c=>dr(C7,{children:[dr("div",{children:[ye(g7,{children:l(c)}),dr(v7,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),ye(b7,{disabled:n.includes(c.credentialId),onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?ye(po,{}):ye(a7,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&ye(ou,{onClick:o,children:"View all"})]})]})},p7=()=>dr(k1,{children:[dr(ar,{children:[ye(ir,{children:ye(s7,{})}),"Log in with Touch ID, Face ID, or a security key."]}),dr(ar,{children:[ye(ir,{children:ye(c7,{})}),"More secure than a password."]}),dr(ar,{children:[ye(ir,{children:ye(i7,{})}),"Takes seconds to set up and use."]})]}),x1=()=>{let{user:e,unlinkPasskey:t}=K(),{linkWithPasskey:r,closePrivyModal:o}=M(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[i,a]=ls(!1),[l,s]=ls(""),[c,f]=ls(!1),[m,u]=ls(!1);d7(()=>{n.length===0&&u(!1)},[n.length]);let C=()=>{a(!0),r().then(()=>f(!0)).catch(g=>{if(g instanceof it){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(()=>f(!0)).catch(b=>{if(b instanceof it&&b.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?dr(ru,{children:[ye(_,{onClose:()=>o()},"header"),ye(Le,{children:ye(Qe,{status:"success",children:ye(l7,{})})}),ye(A1,{children:"Passkey added"}),ye(f7,{children:"From now on, you can use your passkey to log in."}),ye(_t,{children:ye(H,{onClick:()=>o(),children:"Done"})}),ye(Z,{})]}):m?dr(ru,{children:[ye(_,{backFn:()=>u(!1),onClose:()=>o()},"header"),ye(S1,{passkeys:n,expanded:m,onUnlink:v,onExpand:()=>u(!0)}),ye(Z,{})]}):dr(ru,{children:[ye(_,{onClose:()=>o()},"header"),ye(Le,{children:dr(Fc,{children:[ye(ti,{}),ye(ri,{})]})}),ye(A1,{children:"Secure your account with a passkey"}),ye(h7,{}),n.length===0?ye(p7,{}):ye(S1,{passkeys:n,expanded:m,onUnlink:v,onExpand:()=>u(!0)}),dr(_t,{style:{marginTop:"12px"},children:[l&&ye(u7,{fail:!0,children:l}),ye(H,{onClick:C,loading:i,children:"Add new passkey"})]}),ye(Z,{})]})},Fc=Fr.div`
1688
1691
  display: flex;
1689
1692
  align-items: center;
1690
1693
  justify-content: center;
@@ -1700,7 +1703,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1700
1703
  stroke: var(--privy-color-accent) !important;
1701
1704
  fill: var(--privy-color-accent) !important;
1702
1705
  }
1703
- `,d7=Fr.div`
1706
+ `,u7=Fr.div`
1704
1707
  line-height: 20px;
1705
1708
  height: 20px;
1706
1709
  font-size: 13px;
@@ -1708,7 +1711,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1708
1711
  display: flex;
1709
1712
  justify-content: flex-beginngin;
1710
1713
  width: 100%;
1711
- `,p7=S1`
1714
+ `,m7=P1`
1712
1715
  && {
1713
1716
  width: 100%;
1714
1717
  font-size: 0.875rem;
@@ -1733,9 +1736,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1733
1736
  box-shadow: none;
1734
1737
  }
1735
1738
  }
1736
- `,ru=Fr.button`
1737
- ${p7}
1738
- `,P1=Fr.div`
1739
+ `,ou=Fr.button`
1740
+ ${m7}
1741
+ `,k1=Fr.div`
1739
1742
  display: flex;
1740
1743
  flex-direction: column;
1741
1744
  align-items: stretch;
@@ -1743,18 +1746,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1743
1746
  padding: 0.5rem 0rem 0rem;
1744
1747
  flex-grow: 1;
1745
1748
  width: 100%;
1746
- `,T1=Fr.div`
1749
+ `,A1=Fr.div`
1747
1750
  font-size: 18px;
1748
1751
  line-height: 18px;
1749
1752
  text-align: center;
1750
1753
  font-weight: 600;
1751
- `,u7=Fr.div`
1754
+ `,f7=Fr.div`
1752
1755
  font-size: 0.875rem;
1753
1756
  text-align: center;
1754
1757
  margin-top: 10px;
1755
- `,m7=Fr.div`
1758
+ `,h7=Fr.div`
1756
1759
  height: 32px;
1757
- `,f7=Fr.div`
1760
+ `,y7=Fr.div`
1758
1761
  line-height: 20px;
1759
1762
  height: 20px;
1760
1763
  font-size: 1em;
@@ -1762,18 +1765,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1762
1765
  display: flex;
1763
1766
  justify-content: flex-beginning;
1764
1767
  width: 100%;
1765
- `,h7=Fr.div`
1768
+ `,g7=Fr.div`
1766
1769
  font-size: 1em;
1767
1770
  line-height: 1.3em;
1768
1771
  font-weight: 500;
1769
1772
  color: var(--privy-color-foreground-2);
1770
1773
  padding: 0.2em 0;
1771
- `,y7=Fr.div`
1774
+ `,v7=Fr.div`
1772
1775
  font-size: 0.875rem;
1773
1776
  line-height: 1rem;
1774
1777
  color: #64668b;
1775
1778
  padding: 0.2em 0;
1776
- `,g7=Fr.div`
1779
+ `,C7=Fr.div`
1777
1780
  display: flex;
1778
1781
  align-items: center;
1779
1782
  justify-content: space-between;
@@ -1786,7 +1789,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1786
1789
  border: 1px solid #e2e3f0 !important;
1787
1790
  width: 100%;
1788
1791
  height: 5em;
1789
- `,v7=S1`
1792
+ `,w7=P1`
1790
1793
  :focus,
1791
1794
  :hover,
1792
1795
  :active {
@@ -1803,15 +1806,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
1803
1806
  svg:hover {
1804
1807
  color: var(--privy-color-foreground-3);
1805
1808
  }
1806
- `,C7=Fr.button`
1807
- ${v7}
1808
- `;var x1=Br.div`
1809
+ `,b7=Fr.button`
1810
+ ${w7}
1811
+ `;var _1=Br.div`
1809
1812
  display: flex;
1810
1813
  flex-direction: column;
1811
1814
  gap: 12px;
1812
1815
  padding-top: 24px;
1813
1816
  padding-bottom: 24px;
1814
- `,Fc=Br.div`
1817
+ `,Bc=Br.div`
1815
1818
  width: 24px;
1816
1819
  height: 24px;
1817
1820
  display: flex;
@@ -1831,9 +1834,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1831
1834
  display: flex;
1832
1835
  align-items: baseline;
1833
1836
  gap: 4px;
1834
- `,Bc=Br.div`
1837
+ `,Hc=Br.div`
1835
1838
  font-size: 42px !important;
1836
- `,k1=Br.input`
1839
+ `,R1=Br.input`
1837
1840
  font-size: 42px !important;
1838
1841
  text-align: right;
1839
1842
  background-color: var(--privy-color-background);
@@ -1848,7 +1851,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1848
1851
  border: none !important;
1849
1852
  box-shadow: none !important;
1850
1853
  }
1851
- `,_1=Br.div`
1854
+ `,M1=Br.div`
1852
1855
  cursor: pointer;
1853
1856
  padding-left: 4px;
1854
1857
  `,da=Br.div`
@@ -1858,7 +1861,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1858
1861
  color: var(--privy-color-foreground-3);
1859
1862
  // we need this container to maintain a static height if there's no content
1860
1863
  height: 20px;
1861
- `,R1=Br.div`
1864
+ `,I1=Br.div`
1862
1865
  display: flex;
1863
1866
  flex-direction: row;
1864
1867
  line-height: 22px;
@@ -1868,31 +1871,31 @@ You will need this password to access your ${e} wallet on a new device. Please k
1868
1871
  margin-right: 6px;
1869
1872
  margin: auto;
1870
1873
  }
1871
- `,M1=Br(ru)`
1874
+ `,W1=Br(ou)`
1872
1875
  margin-top: 16px;
1873
- `,b7=w7`
1876
+ `,T7=E7`
1874
1877
  from {
1875
1878
  opacity: 0;
1876
1879
  }
1877
1880
  to {
1878
1881
  opacity: 1;
1879
1882
  }
1880
- `,I1=Br(Jo)`
1883
+ `,L1=Br(Jo)`
1881
1884
  border-radius: var(--privy-border-radius-md) !important;
1882
- animation: ${b7} 0.3s ease-in-out;
1883
- `;import{Fragment as T7,jsx as pr,jsxs as cs}from"react/jsx-runtime";var W1=({displayName:e,configuredFundingChain:t,balance:r,fundingAmountInWei:o,fundingAmountInUsd:n,options:i,selectedOption:a,isPreparing:l,isSubmitting:s,onSubmit:c,onSelect:f})=>cs(T7,{children:[pr(Lt,{}),pr(ie,{}),pr(Bo,{children:"Transfer from another network"}),cs(bo,{children:["You need more funds on the ",t.name," network. Bridge from another blockchain network."]}),cs(la,{style:{marginTop:"2rem"},children:[cs(ca,{children:[pr(Bc,{children:E7(o)}),pr(da,{children:t.nativeCurrency.symbol})]}),n&&pr(pa,{children:n})]}),pr(Ot,{style:{marginTop:"1.5rem"},children:pr(Ct,{children:"From"})}),pr(C1,{selected:{chain:a.chain,balance:At(a.balance,a.chain.nativeCurrency.symbol,3,!0)},options:i.map(({chain:m,balance:u})=>({chain:m,balance:At(u,m.nativeCurrency.symbol,3,!0)})),onSelect:f}),pr(Ot,{children:pr(Ct,{style:{marginTop:"1.5rem"},children:"To"})}),pr(g1,{chain:t,balance:At(r,t.nativeCurrency.symbol,3,!0)}),cs(Lo,{style:{marginTop:"1rem"},loading:s||l,disabled:l||s,onClick:c,children:["Confirm with ",e]}),pr(se,{}),pr(q,{})]});import S7 from"styled-components";import{Fragment as P7,jsx as Nt,jsxs as oi}from"react/jsx-runtime";var L1=({wallet:e,displayName:t,addressToFund:r,chain:o,isBridging:n,totalPriceInNativeCurrency:i,totalPriceInUsd:a,gasPriceInNativeCurrency:l,gasPriceInUsd:s})=>oi(P7,{children:[Nt(Lt,{}),Nt(Mc,{}),Nt(St,{style:{marginTop:"16px"},children:Nt(oc,{icon:ac(e.walletClientType,e.connectorType,e.walletClientType),name:e.walletClientType})}),Nt(fe,{style:{marginTop:"8px",marginBottom:"12px"},title:`${n?"Bridging":"Confirming"} with ${t}`}),!n&&oi(Ic,{children:[oi(Ot,{children:[Nt(Ct,{children:"Total"}),Nt(Kt,{children:a||i})]}),oi(Ot,{children:[Nt(Ct,{children:"To"}),Nt(Kt,{children:et(r)})]}),oi(Ot,{children:[Nt(Ct,{children:"Network"}),Nt(Kt,{children:oi(A7,{children:[Nt(sa,{chainId:o.id,height:16,width:16})," ",o.name]})})]}),l&&oi(Ot,{children:[Nt(Ct,{children:"Estimated fee"}),Nt(Kt,{children:s||l})]})]}),Nt(Bi,{height:24}),Nt(q,{})]}),A7=S7.div`
1885
+ animation: ${T7} 0.3s ease-in-out;
1886
+ `;import{Fragment as A7,jsx as pr,jsxs as cs}from"react/jsx-runtime";var O1=({displayName:e,configuredFundingChain:t,balance:r,fundingAmountInWei:o,fundingAmountInUsd:n,options:i,selectedOption:a,isPreparing:l,isSubmitting:s,onSubmit:c,onSelect:f})=>cs(A7,{children:[pr(Lt,{}),pr(ae,{}),pr(Bo,{children:"Transfer from another network"}),cs(bo,{children:["You need more funds on the ",t.name," network. Bridge from another blockchain network."]}),cs(la,{style:{marginTop:"2rem"},children:[cs(ca,{children:[pr(Hc,{children:S7(o)}),pr(da,{children:t.nativeCurrency.symbol})]}),n&&pr(pa,{children:n})]}),pr(Ot,{style:{marginTop:"1.5rem"},children:pr(Ct,{children:"From"})}),pr(b1,{selected:{chain:a.chain,balance:At(a.balance,a.chain.nativeCurrency.symbol,3,!0)},options:i.map(({chain:m,balance:u})=>({chain:m,balance:At(u,m.nativeCurrency.symbol,3,!0)})),onSelect:f}),pr(Ot,{children:pr(Ct,{style:{marginTop:"1.5rem"},children:"To"})}),pr(C1,{chain:t,balance:At(r,t.nativeCurrency.symbol,3,!0)}),cs(Lo,{style:{marginTop:"1rem"},loading:s||l,disabled:l||s,onClick:c,children:["Confirm with ",e]}),pr(se,{}),pr(q,{})]});import P7 from"styled-components";import{Fragment as k7,jsx as Nt,jsxs as oi}from"react/jsx-runtime";var N1=({wallet:e,displayName:t,addressToFund:r,chain:o,isBridging:n,totalPriceInNativeCurrency:i,totalPriceInUsd:a,gasPriceInNativeCurrency:l,gasPriceInUsd:s})=>oi(k7,{children:[Nt(Lt,{}),Nt(Mc,{}),Nt(St,{style:{marginTop:"16px"},children:Nt(oc,{icon:ac(e.walletClientType,e.connectorType,e.walletClientType),name:e.walletClientType})}),Nt(fe,{style:{marginTop:"8px",marginBottom:"12px"},title:`${n?"Bridging":"Confirming"} with ${t}`}),!n&&oi(Wc,{children:[oi(Ot,{children:[Nt(Ct,{children:"Total"}),Nt(Kt,{children:a||i})]}),oi(Ot,{children:[Nt(Ct,{children:"To"}),Nt(Kt,{children:et(r)})]}),oi(Ot,{children:[Nt(Ct,{children:"Network"}),Nt(Kt,{children:oi(x7,{children:[Nt(sa,{chainId:o.id,height:16,width:16})," ",o.name]})})]}),l&&oi(Ot,{children:[Nt(Ct,{children:"Estimated fee"}),Nt(Kt,{children:s||l})]})]}),Nt(Bi,{height:24}),Nt(q,{})]}),x7=P7.div`
1884
1887
  display: flex;
1885
1888
  flex-direction: row;
1886
1889
  align-items: center;
1887
1890
  gap: 4px;
1888
- `;import{Fragment as D1,jsx as Hr,jsxs as ou}from"react/jsx-runtime";var U1=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r}=M(),{navigate:o,setModalData:n,app:i,data:a}=x(),{wallets:l}=Jr(),s=M7(a.funding.amount),c=a.funding.address,f=a.funding.chain,m=l[0],[u,C]=Er(null);ua(()=>{(async()=>{if(!m)return;let D=await m.getEthereumProvider(),V=k7({account:m.address,transport:_7(D)}).extend(I7);C(V)})().catch(console.error)},[m]);let[v,g]=Er(0n);ua(()=>{O1({chain:f,transport:N1(Ko(f,e,t))}).getBalance({address:c}).then(g).catch(console.error)},[]);let{tokenPrice:b}=Co({chainId:f.id}),[E,R]=Er({to:c,chain:f,value:s,data:void 0}),[S,A]=Er(!1),[k,I]=Er(0n),[F,G]=Er(!1),[Y,j]=Er(null),[L,U]=Er([]),[W,be]=Er(0),[Re,re]=Er(!1),[ae,oe]=Er(!1),[Ae,Pe]=Er(!1),[ze,Ke]=Er(!1);ua(()=>{(async()=>{if(!u||!m||Re||Ae)return;re(!0);let D;try{D=await O1({chain:E.chain,transport:N1(Ko(E.chain,e,t))}).prepareTransactionRequest({account:m.address,to:E.to,chain:E.chain,data:E.data,value:BigInt(E.value??0)})}catch(J){console.error(J)}if(!D){re(!1),G(!0);return}re(!1),Pe(!0),A(!0),I(D.gas);try{await u.switchChain({id:E.chain.id})}catch{await u.addChain({chain:E.chain}),await u.switchChain({id:E.chain.id})}let V;try{V=await u.sendTransaction(D)}catch(J){console.error(J);let Be=J;Be.name==="TransactionExecutionError"&&L.length<1&&j(new w(Be.shortMessage,void 0,"transaction_failure"))}V&&(await u.waitForTransactionReceipt({hash:V}),Pe(!1),Ke(!0))})().catch(console.error)},[u,E]),ua(()=>{(async()=>{if(!F||!u||!m)return;let D=i.chains.filter(Ye=>!ch.has(Ye.id)),V=Bn.concat(D).filter(Ye=>Ye.id!==a.funding.chain.id&&!!Ye.testnet==!!a.funding.chain.testnet),J=(await Zg({chains:V,address:m.address,appId:t,rpcConfig:e})).filter(Ye=>Ye.balance>s);if(J.length<1){j(new w(`Wallet ${et(m.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}J.sort((Ye,fi)=>Number(fi.balance-Ye.balance));let Be=(await Promise.allSettled(J.map(async Ye=>({quote:await Xg({isTestnet:!!a.funding?.chain.testnet,input:jg({amount:s.toString(),user:m.address,recipient:c,destinationChainId:f.id,originChainId:Ye.chain.id})}),...Ye})))).filter(Ye=>Ye.status==="fulfilled").map(Ye=>Ye.value);if(Be.length<1){j(new w(`Wallet ${et(m.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let _o=Be.map(Ye=>({bridgeTx:Qg(Ye.quote),balance:Ye.balance,chain:Ye.chain})).filter(Ye=>!!Ye.bridgeTx);if(_o.length>1){U(_o);return}let oo=_o[0];if(!oo){j(new w(`Wallet ${et(m.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}oe(!0),R({data:oo.bridgeTx.data,to:oo.bridgeTx.to,value:oo.bridgeTx.value,chain:oo.chain})})().catch(console.error)},[F]),ua(()=>{if(!Y)return;let ft={error:Y,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};n({funding:a?.funding,sendTransaction:a?.sendTransaction,errorModalData:ft}),o("ERROR_SCREEN",!1)},[Y]);let mt=m?tn(m.walletClientType,m.connectorType,m.walletClientType)||"wallet":null,Je=b?ia(a?.funding?.amount??"0",b):void 0,le=os([k,s]),Zt=le&&b?wo(le,b):void 0,mr=le?At(le,"ETH"):void 0,_r=k&&b?wo(k,b):void 0,O=k?At(k,"ETH"):void 0;if(ua(()=>{if(!ze)return;let ft=setTimeout(r,df);return()=>clearTimeout(ft)},[ze]),ze)return ou(D1,{children:[Hr(Lt,{}),Hr(ie,{}),ou(gr,{children:[Hr(x7,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),Hr(fe,{title:"Success!",description:`You\u2019ve successfully added ${R7(s)} ETH to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),Hr(se,{}),Hr(q,{})]});let We=L[W];return L.length>1&&We?Hr(W1,{displayName:mt,configuredFundingChain:f,balance:v,fundingAmountInWei:s,fundingAmountInUsd:Je,options:L,selectedOption:We,isPreparing:Re,isSubmitting:Ae,onSubmit:()=>{R({to:We.bridgeTx.to,data:We.bridgeTx.data,value:We.bridgeTx.value,chain:We.chain})},onSelect:be}):S&&k&&m&&a?.funding?Hr(L1,{wallet:m,displayName:mt,addressToFund:c,isBridging:ae,totalPriceInUsd:Zt,totalPriceInNativeCurrency:mr,gasPriceInUsd:_r,gasPriceInNativeCurrency:O,chain:a.funding.chain}):ou(D1,{children:[Hr(Lt,{}),Hr(Mc,{}),Hr("div",{style:{marginTop:"1rem"}}),Hr(q,{})]})};import L7 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import O7 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as N7,useMemo as D7,useState as z1}from"react";import K1 from"styled-components";async function Hc({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 w("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 F1({api:e,appId:t}){let r=On(),o=bi(),n=await Ei(r);try{let{url:i}=await e.post(Ks,{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 B1({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during cross-app auth flow");try{return(await e.post(Ys,{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 w(a.message||"Invalid code during cross-app auth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during cross-app auth flow"?new w("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new w("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var Gc=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(C=>C.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 w("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await Hc({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 w("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 w("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 w("Failed to initialize signature request");let f=new URL(`${s.apiUrl}/oauth/transact`);return f.searchParams.set("token",l||""),f.searchParams.set("request",W7(o)),c.location=f.href,new Promise((u,C)=>{let g=setTimeout(()=>{R(),C(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),b=setInterval(()=>{c.closed&&(R(),C(new w("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),E=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(),C(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",E);let R=()=>{c.close(),clearInterval(b),clearTimeout(g),window.removeEventListener("message",E)}})},W7=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 ma="sdk_fiat_on_ramp_completed_with_status";var H1={1:"ethereum",8453:"base",10:"optimism",137:"polygon",42161:"arbitrum"},G1=e=>!!H1[e];function V1(e){let t=H1[e];if(!t)throw new w(`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}};import{Fragment as X1,jsx as Tr,jsxs as ps}from"react/jsx-runtime";var U7=240,Y1=1500,F7=Math.floor(U7*1e3/Y1),j1=()=>{let{data:e,setModalData:t,navigate:r}=x(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=M(),l=e?.funding,[s,c]=z1(!1),[f,m]=z1(!1);return N7(()=>{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=V1(l.chain.id),b=await i({addresses:[{address:l.address,blockchains:[g]}]}),{url:E}=q1({input:b,amount:l.amount,blockchain:g});if(!v)throw new Error("Unable to initiate Coinbase Onramp flow.");v.location=E.toString();let R=0,S=!1;for(;R<F7;){R++;let{status:A}=await a({partnerUserId:b.partner_user_id});if(A==="success"){S=!0;break}if(A==="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(k=>setTimeout(k,Y1))}if(!S)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:ma,payload:{status:"success",provider:"coinbase-onramp"}}),m(!0)}catch(v){console.error(v),n({eventName:ma,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)}},C=setTimeout(()=>void u(),500);return()=>clearTimeout(C)},[]),ps(X1,{children:[Tr(_,{title:"Fund account"},"header"),Tr(H7,{isSucccess:f,onClickCta:o}),Tr(q,{})]})},B7=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:""},H7=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=D7(()=>B7(e),[e]);return ps(X1,{children:[ps(K7,{children:[Tr(q7,{isSucccess:e}),ps(Xe,{children:[Tr("h3",{children:r}),Tr(z7,{children:o})]})]}),n&&Tr(H,{onClick:t,children:n})]})},G7=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",V7=e=>e?O7:()=>Tr(L7,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),q7=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return ps("div",{style:{position:"relative"},children:[Tr(ct,{color:o,style:{position:"absolute"}}),Tr(Ha,{color:o}),Tr(Wo,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=V7(e),r=G7(e);return Tr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Tr(t,{width:"4rem",height:"4rem",color:r})})},z7=K1.p`
1891
+ `;import{Fragment as F1,jsx as Hr,jsxs as nu}from"react/jsx-runtime";var B1=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r}=M(),{navigate:o,setModalData:n,app:i,data:a}=x(),{wallets:l}=Jr(),s=W7(a.funding.amount),c=a.funding.address,f=a.funding.chain,m=l[0],[u,C]=Er(null);ua(()=>{(async()=>{if(!m)return;let D=await m.getEthereumProvider(),V=R7({account:m.address,transport:M7(D)}).extend(L7);C(V)})().catch(console.error)},[m]);let[v,g]=Er(0n);ua(()=>{D1({chain:f,transport:U1(Ko(f,e,t))}).getBalance({address:c}).then(g).catch(console.error)},[]);let{tokenPrice:b}=Co({chainId:f.id}),[E,R]=Er({to:c,chain:f,value:s,data:void 0}),[S,A]=Er(!1),[k,I]=Er(0n),[F,G]=Er(!1),[Y,j]=Er(null),[L,U]=Er([]),[W,be]=Er(0),[Re,re]=Er(!1),[oe,ne]=Er(!1),[Ae,Pe]=Er(!1),[ze,Ke]=Er(!1);ua(()=>{(async()=>{if(!u||!m||Re||Ae)return;re(!0);let D;try{D=await D1({chain:E.chain,transport:U1(Ko(E.chain,e,t))}).prepareTransactionRequest({account:m.address,to:E.to,chain:E.chain,data:E.data,value:BigInt(E.value??0)})}catch(J){console.error(J)}if(!D){re(!1),G(!0);return}re(!1),Pe(!0),A(!0),I(D.gas);try{await u.switchChain({id:E.chain.id})}catch{await u.addChain({chain:E.chain}),await u.switchChain({id:E.chain.id})}let V;try{V=await u.sendTransaction(D)}catch(J){console.error(J);let Be=J;Be.name==="TransactionExecutionError"&&L.length<1&&j(new w(Be.shortMessage,void 0,"transaction_failure"))}V&&(await u.waitForTransactionReceipt({hash:V}),Pe(!1),Ke(!0))})().catch(console.error)},[u,E]),ua(()=>{(async()=>{if(!F||!u||!m)return;let V=Ic(i.chains).filter(Je=>Je.id!==a.funding.chain.id&&!!Je.testnet==!!a.funding.chain.testnet),J=(await $g({chains:V,address:m.address,appId:t,rpcConfig:e})).filter(Je=>Je.balance>s);if(J.length<1){j(new w(`Wallet ${et(m.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}J.sort((Je,fi)=>Number(fi.balance-Je.balance));let Be=(await Promise.allSettled(J.map(async Je=>({quote:await Zg({isTestnet:!!a.funding?.chain.testnet,input:Qg({amount:s.toString(),user:m.address,recipient:c,destinationChainId:f.id,originChainId:Je.chain.id})}),...Je})))).filter(Je=>Je.status==="fulfilled").map(Je=>Je.value);if(Be.length<1){j(new w(`Wallet ${et(m.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let _o=Be.map(Je=>({bridgeTx:Jg(Je.quote),balance:Je.balance,chain:Je.chain})).filter(Je=>!!Je.bridgeTx);if(_o.length>1){U(_o);return}let oo=_o[0];if(!oo){j(new w(`Wallet ${et(m.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}ne(!0),R({data:oo.bridgeTx.data,to:oo.bridgeTx.to,value:oo.bridgeTx.value,chain:oo.chain})})().catch(console.error)},[F]),ua(()=>{if(!Y)return;let ft={error:Y,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};n({funding:a?.funding,sendTransaction:a?.sendTransaction,errorModalData:ft}),o("ERROR_SCREEN",!1)},[Y]);let mt=m?tn(m.walletClientType,m.connectorType,m.walletClientType)||"wallet":null,Ze=b?ia(a?.funding?.amount??"0",b):void 0,le=os([k,s]),Zt=le&&b?wo(le,b):void 0,mr=le?At(le,"ETH"):void 0,_r=k&&b?wo(k,b):void 0,O=k?At(k,"ETH"):void 0;if(ua(()=>{if(!ze)return;let ft=setTimeout(r,uf);return()=>clearTimeout(ft)},[ze]),ze)return nu(F1,{children:[Hr(Lt,{}),Hr(ae,{}),nu(gr,{children:[Hr(_7,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),Hr(fe,{title:"Success!",description:`You\u2019ve successfully added ${I7(s)} ETH to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),Hr(se,{}),Hr(q,{})]});let We=L[W];return L.length>1&&We?Hr(O1,{displayName:mt,configuredFundingChain:f,balance:v,fundingAmountInWei:s,fundingAmountInUsd:Ze,options:L,selectedOption:We,isPreparing:Re,isSubmitting:Ae,onSubmit:()=>{R({to:We.bridgeTx.to,data:We.bridgeTx.data,value:We.bridgeTx.value,chain:We.chain})},onSelect:be}):S&&k&&m&&a?.funding?Hr(N1,{wallet:m,displayName:mt,addressToFund:c,isBridging:oe,totalPriceInUsd:Zt,totalPriceInNativeCurrency:mr,gasPriceInUsd:_r,gasPriceInNativeCurrency:O,chain:a.funding.chain}):nu(F1,{children:[Hr(Lt,{}),Hr(Mc,{}),Hr("div",{style:{marginTop:"1rem"}}),Hr(q,{})]})};import N7 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import D7 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as U7,useMemo as F7,useState as Y1}from"react";import j1 from"styled-components";async function Gc({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 w("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 H1({api:e,appId:t}){let r=On(),o=bi(),n=await Ei(r);try{let{url:i}=await e.post(Ks,{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 G1({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during cross-app auth flow");try{return(await e.post(Ys,{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 w(a.message||"Invalid code during cross-app auth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during cross-app auth flow"?new w("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new w("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var Vc=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(C=>C.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 w("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await Gc({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 w("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 w("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 w("Failed to initialize signature request");let f=new URL(`${s.apiUrl}/oauth/transact`);return f.searchParams.set("token",l||""),f.searchParams.set("request",O7(o)),c.location=f.href,new Promise((u,C)=>{let g=setTimeout(()=>{R(),C(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),b=setInterval(()=>{c.closed&&(R(),C(new w("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),E=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(),C(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",E);let R=()=>{c.close(),clearInterval(b),clearTimeout(g),window.removeEventListener("message",E)}})},O7=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 ma="sdk_fiat_on_ramp_completed_with_status";var V1={1:"ethereum",8453:"base",10:"optimism",137:"polygon",42161:"arbitrum"},q1=e=>!!V1[e];function z1(e){let t=V1[e];if(!t)throw new w(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}var K1=({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}};import{Fragment as Z1,jsx as Tr,jsxs as ps}from"react/jsx-runtime";var B7=240,X1=1500,H7=Math.floor(B7*1e3/X1),Q1=()=>{let{data:e,setModalData:t,navigate:r}=x(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=M(),l=e?.funding,[s,c]=Y1(!1),[f,m]=Y1(!1);return U7(()=>{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=z1(l.chain.id),b=await i({addresses:[{address:l.address,blockchains:[g]}]}),{url:E}=K1({input:b,amount:l.amount,blockchain:g});if(!v)throw new Error("Unable to initiate Coinbase Onramp flow.");v.location=E.toString();let R=0,S=!1;for(;R<H7;){R++;let{status:A}=await a({partnerUserId:b.partner_user_id});if(A==="success"){S=!0;break}if(A==="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(k=>setTimeout(k,X1))}if(!S)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:ma,payload:{status:"success",provider:"coinbase-onramp"}}),m(!0)}catch(v){console.error(v),n({eventName:ma,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)}},C=setTimeout(()=>void u(),500);return()=>clearTimeout(C)},[]),ps(Z1,{children:[Tr(_,{title:"Fund account"},"header"),Tr(V7,{isSucccess:f,onClickCta:o}),Tr(q,{})]})},G7=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:""},V7=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=F7(()=>G7(e),[e]);return ps(Z1,{children:[ps(j7,{children:[Tr(K7,{isSucccess:e}),ps(je,{children:[Tr("h3",{children:r}),Tr(Y7,{children:o})]})]}),n&&Tr(H,{onClick:t,children:n})]})},q7=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",z7=e=>e?D7:()=>Tr(N7,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),K7=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return ps("div",{style:{position:"relative"},children:[Tr(ct,{color:o,style:{position:"absolute"}}),Tr(Ha,{color:o}),Tr(Wo,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=z7(e),r=q7(e);return Tr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Tr(t,{width:"4rem",height:"4rem",color:r})})},Y7=j1.p`
1889
1892
  font-size: 1rem;
1890
1893
  color: var(--privy-color-foreground-3);
1891
1894
  margin-bottom: 1rem;
1892
1895
  display: flex;
1893
1896
  flex-direction: column;
1894
1897
  gap: 1rem;
1895
- `,K7=K1.div`
1898
+ `,j7=j1.div`
1896
1899
  display: flex;
1897
1900
  flex-direction: column;
1898
1901
  align-items: center;
@@ -1900,7 +1903,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1900
1903
  margin-left: 1.75rem;
1901
1904
  margin-right: 1.75rem;
1902
1905
  padding: 2rem 0;
1903
- `;import{getAddress as Z1}from"@ethersproject/address";import $7 from"@heroicons/react/24/outline/PencilIcon";import eE from"@heroicons/react/24/outline/WalletIcon";import{useEffect as tE,useRef as rE,useState as oE}from"react";import{ExclamationTriangleIcon as Y7}from"@heroicons/react/24/outline";import j7 from"styled-components";import{jsx as Q7,jsxs as Z7}from"react/jsx-runtime";var Q1=({children:e})=>Z7(X7,{children:[Q7(Y7,{width:"3rem",color:"var(--privy-color-error)"}),e]}),X7=j7.div`
1906
+ `;import{getAddress as $1}from"@ethersproject/address";import tE from"@heroicons/react/24/outline/PencilIcon";import rE from"@heroicons/react/24/outline/WalletIcon";import{useEffect as oE,useRef as nE,useState as iE}from"react";import{ExclamationTriangleIcon as X7}from"@heroicons/react/24/outline";import Q7 from"styled-components";import{jsx as J7,jsxs as $7}from"react/jsx-runtime";var J1=({children:e})=>$7(Z7,{children:[J7(X7,{width:"3rem",color:"var(--privy-color-error)"}),e]}),Z7=Q7.div`
1904
1907
  display: flex;
1905
1908
  gap: 0.5rem;
1906
1909
  background-color: var(--privy-color-error-light);
@@ -1919,19 +1922,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
1919
1922
  border: 1px solid var(--privy-color-error);
1920
1923
  border-radius: var(--privy-border-radius-sm);
1921
1924
  }
1922
- `;import{jsx as nu,jsxs as J7}from"react/jsx-runtime";var fa=({size:e=61,...t})=>nu("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:J7("g",{id:"moonpay_symbol_wht 2",children:[nu("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),nu("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"})]})});import{Fragment as nE,jsx as Dt,jsxs as mn}from"react/jsx-runtime";var J1=()=>{let{wallets:e}=Jr(),{app:t,navigate:r,data:o,setModalData:n}=x(),i=o?.funding,a=rE(null),[l,s]=oE(!1);tE(()=>{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:f}=Co({chainId:i.chain.id}),m=f?ia(i.amount,f):void 0,u=e.find(b=>Z1(b.address)===Z1(i.address)),C=u&&u.walletClientType!=="privy"?tn(u.walletClientType,u.connectorType,u.walletClientType):t.name,v=parseFloat(i.amount),g=!isNaN(v)&&v>0;return mn(nE,{children:[Dt(Lt,{}),mn("h3",{children:["Add funds to your"," ",C?.toLowerCase().endsWith("wallet")?C:C+" wallet"]}),Dt(en,{style:{marginTop:"32px"},children:mn(la,{children:[mn(ca,{onClick:()=>a.current?.focus(),children:[Dt(k1,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:b=>{let E=b.target.value;/^[0-9.]*$/.test(E)&&E.split(".").length-1<=1&&n({...o,funding:{...i,amount:E}})}}),Dt(da,{children:i.chain.nativeCurrency.symbol}),!l&&Dt(_1,{children:Dt($7,{width:12,height:12})})]}),Dt(pa,{children:m&&g?m:""})]})}),mn(x1,{children:[i.errorMessage&&Dt(Q1,{children:i.errorMessage}),c.sort().map(b=>{switch(b){case"moonpay":return mn(Se,{disabled:!g,onClick:()=>{r("MOONPAY_PROMPT_SCREEN")},children:[Dt(Fc,{children:Dt(fa,{style:{width:24}})}),"Moonpay"]},b);case"coinbase-onramp":return G1(Number(i.chain.id))?mn(Se,{disabled:!g,onClick:()=>{r("COINBASE_ONRAMP_STATUS_SCREEN")},children:[Dt(Fc,{children:Dt(Wo,{style:{width:24}})}),"Coinbase Onramp"]},b):null;case"external":return mn(Se,{disabled:!g,onClick:()=>{r("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[Dt(Fc,{children:Dt(eE,{style:{width:24}})}),"Transfer from wallet"]},b)}}),Dt(M1,{disabled:!g,onClick:()=>r("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),Dt(q,{})]})};import{formatUnits as uE}from"@ethersproject/units";import mE from"@heroicons/react/24/outline/DocumentDuplicateIcon";import fE from"@heroicons/react/24/outline/InformationCircleIcon";import hE from"@heroicons/react/24/outline/QrCodeIcon";import{useEffect as yE,useMemo as gE,useState as au}from"react";import ha from"styled-components";import iE from"styled-components";var us=iE.span`
1925
+ `;import{jsx as iu,jsxs as eE}from"react/jsx-runtime";var fa=({size:e=61,...t})=>iu("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:eE("g",{id:"moonpay_symbol_wht 2",children:[iu("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),iu("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"})]})});import{Fragment as aE,jsx as Dt,jsxs as mn}from"react/jsx-runtime";var e2=()=>{let{wallets:e}=Jr(),{app:t,navigate:r,data:o,setModalData:n}=x(),i=o?.funding,a=nE(null),[l,s]=iE(!1);oE(()=>{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:f}=Co({chainId:i.chain.id}),m=f?ia(i.amount,f):void 0,u=e.find(b=>$1(b.address)===$1(i.address)),C=u&&u.walletClientType!=="privy"?tn(u.walletClientType,u.connectorType,u.walletClientType):t.name,v=parseFloat(i.amount),g=!isNaN(v)&&v>0;return mn(aE,{children:[Dt(Lt,{}),mn("h3",{children:["Add funds to your"," ",C?.toLowerCase().endsWith("wallet")?C:C+" wallet"]}),Dt(en,{style:{marginTop:"32px"},children:mn(la,{children:[mn(ca,{onClick:()=>a.current?.focus(),children:[Dt(R1,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:b=>{let E=b.target.value;/^[0-9.]*$/.test(E)&&E.split(".").length-1<=1&&n({...o,funding:{...i,amount:E}})}}),Dt(da,{children:i.chain.nativeCurrency.symbol}),!l&&Dt(M1,{children:Dt(tE,{width:12,height:12})})]}),Dt(pa,{children:m&&g?m:""})]})}),mn(_1,{children:[i.errorMessage&&Dt(J1,{children:i.errorMessage}),c.sort().map(b=>{switch(b){case"moonpay":return mn(Se,{disabled:!g,onClick:()=>{r("MOONPAY_PROMPT_SCREEN")},children:[Dt(Bc,{children:Dt(fa,{style:{width:24}})}),"Moonpay"]},b);case"coinbase-onramp":return q1(Number(i.chain.id))?mn(Se,{disabled:!g,onClick:()=>{r("COINBASE_ONRAMP_STATUS_SCREEN")},children:[Dt(Bc,{children:Dt(Wo,{style:{width:24}})}),"Coinbase Onramp"]},b):null;case"external":return mn(Se,{disabled:!g,onClick:()=>{r("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[Dt(Bc,{children:Dt(rE,{style:{width:24}})}),"Transfer from wallet"]},b)}}),Dt(W1,{disabled:!g,onClick:()=>r("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),Dt(q,{})]})};import{formatUnits as fE}from"@ethersproject/units";import hE from"@heroicons/react/24/outline/DocumentDuplicateIcon";import yE from"@heroicons/react/24/outline/InformationCircleIcon";import gE from"@heroicons/react/24/outline/QrCodeIcon";import{useEffect as vE,useMemo as CE,useState as su}from"react";import ha from"styled-components";import sE from"styled-components";var us=sE.span`
1923
1926
  text-align: left;
1924
1927
  font-size: 0.75rem;
1925
1928
  font-weight: 500;
1926
1929
  line-height: 1.125rem; /* 150% */
1927
1930
 
1928
1931
  color: var(--privy-color-error);
1929
- `;import aE from"styled-components";var $1=aE.span`
1932
+ `;import lE from"styled-components";var t2=lE.span`
1930
1933
  color: var(--privy-color-foreground-3);
1931
1934
  font-size: 0.75rem;
1932
1935
  font-weight: 500;
1933
1936
  line-height: 1.125rem; /* 150% */
1934
- `;import sE from"@heroicons/react/24/outline/Square2StackIcon";import lE from"styled-components";import{jsx as e2,jsxs as dE}from"react/jsx-runtime";var ms=({address:e,showCopyIcon:t,url:r,className:o})=>r?e2("a",{title:e,className:o,href:`${r}/address/${e}`,target:"_blank",children:et(e)}):dE("button",{title:e,className:o,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[et(e),t&&e2(cE,{})]}),cE=lE(sE)`
1937
+ `;import cE from"@heroicons/react/24/outline/Square2StackIcon";import dE from"styled-components";import{jsx as r2,jsxs as uE}from"react/jsx-runtime";var ms=({address:e,showCopyIcon:t,url:r,className:o})=>r?r2("a",{title:e,className:o,href:`${r}/address/${e}`,target:"_blank",children:et(e)}):uE("button",{title:e,className:o,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[et(e),t&&r2(pE,{})]}),pE=dE(cE)`
1935
1938
  && {
1936
1939
  display: inline;
1937
1940
  }
@@ -1940,11 +1943,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1940
1943
  width: 0.875rem;
1941
1944
  margin-left: 0.125rem;
1942
1945
  color: var(--privy-color-foreground-3);
1943
- `;import{Fragment as pE,jsx as Vc,jsxs as iu}from"react/jsx-runtime";var qc=({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",iu(pE,{children:[iu(Oc,{className:n,$state:e?"error":void 0,children:[iu(yc,{children:[Vc($1,{children:i||"Pay with"}),Vc(ms,{address:r,showCopyIcon:!!e})]}),Vc(Rt,{isLoading:o,isPulsing:a,color:s,children:t})]}),e&&Vc(us,{style:{marginTop:"0.25rem"},children:e})]})};import{Fragment as zc,jsx as Ve,jsxs as Ut}from"react/jsx-runtime";var vE=2e3,t2=()=>{let{wallets:e}=Jr(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=x(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:c}=M(),[f,m]=au("default"),[u,C]=au(void 0),v=r?.funding,{tokenPrice:g}=Co({chainId:v.chain.id}),b=g?ia(v.amount,g):void 0,E=e.find(k=>et(k.address)===et(v.address)),R=E&&E.walletClientType!=="privy"?tn(E.walletClientType,E.connectorType,E.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"),Ve(zc,{});yE(()=>{let k=Mr(v.chain.id,a,l,{appId:s});function I(){k.getBalance(v.address).then(G=>C(parseFloat(uE(G,"ether")))).catch(()=>C(void 0))}let F=setInterval(I,vE);return I(),()=>clearInterval(F)},[]);let S=gE(()=>u!==void 0?u>=parseFloat(v.amount):!1,[u,v.amount]),A=Ut(zc,{children:[Ve(qc,{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&&Ve(I1,{onClick:()=>c(),children:"Close"})]});return f==="qr-code"?Ut(zc,{children:[Ve(_,{backFn:()=>m("default")}),Ut(en,{style:{gap:"24px",marginBottom:"24px"},children:[Ut("div",{children:[Ve(pe,{children:"Scan QR code"}),Ut(me,{children:["Scan this code using your mobile wallet to send funds to your ",R," ","wallet."]})]}),Ve(un,{url:v.address,size:200,squareLogoElement:CE}),A]}),Ve(q,{})]}):Ut(zc,{children:[Ve(Lt,{}),Ve(fe,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),Ut(en,{style:{gap:"16px"},children:[Ut(EE,{children:[Ve(fE,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),Ut(TE,{children:["Make sure to send on ",v.chain.name,"."]})]}),Ut(SE,{children:[Ve(Bi,{height:16}),Ut(la,{children:[Ut(ca,{children:[Ve(Bc,{children:v.amount}),Ve(da,{children:v.chain.nativeCurrency.symbol})]}),Ve(pa,{children:b?`${b} USD`:"..."}),Ut(R1,{children:[Ve(sa,{chainId:v.chain.id,height:16,width:16})," ",v.chain.name]})]}),Ve(Bi,{height:8}),Ut(bE,{children:[Ve(wE,{text:v.address}),Ve(o2,{onClick:()=>m("qr-code"),children:Ut(r2,{children:[Ve(hE,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),A]}),Ve(Bi,{height:16}),Ve(q,{})]})},CE=({...e})=>Ve(Qo,{color:"black",...e}),wE=e=>{let[t,r]=au(!1);return Ve(o2,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:Ut(r2,{children:[t?Ve(na,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):Ve(mE,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},bE=ha.div`
1946
+ `;import{Fragment as mE,jsx as qc,jsxs as au}from"react/jsx-runtime";var zc=({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",au(mE,{children:[au(Nc,{className:n,$state:e?"error":void 0,children:[au(yc,{children:[qc(t2,{children:i||"Pay with"}),qc(ms,{address:r,showCopyIcon:!!e})]}),qc(Rt,{isLoading:o,isPulsing:a,color:s,children:t})]}),e&&qc(us,{style:{marginTop:"0.25rem"},children:e})]})};import{Fragment as Kc,jsx as Ve,jsxs as Ut}from"react/jsx-runtime";var wE=2e3,o2=()=>{let{wallets:e}=Jr(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=x(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:c}=M(),[f,m]=su("default"),[u,C]=su(void 0),v=r?.funding,{tokenPrice:g}=Co({chainId:v.chain.id}),b=g?ia(v.amount,g):void 0,E=e.find(k=>et(k.address)===et(v.address)),R=E&&E.walletClientType!=="privy"?tn(E.walletClientType,E.connectorType,E.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"),Ve(Kc,{});vE(()=>{let k=Mr(v.chain.id,a,l,{appId:s});function I(){k.getBalance(v.address).then(G=>C(parseFloat(fE(G,"ether")))).catch(()=>C(void 0))}let F=setInterval(I,wE);return I(),()=>clearInterval(F)},[]);let S=CE(()=>u!==void 0?u>=parseFloat(v.amount):!1,[u,v.amount]),A=Ut(Kc,{children:[Ve(zc,{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&&Ve(L1,{onClick:()=>c(),children:"Close"})]});return f==="qr-code"?Ut(Kc,{children:[Ve(_,{backFn:()=>m("default")}),Ut(en,{style:{gap:"24px",marginBottom:"24px"},children:[Ut("div",{children:[Ve(de,{children:"Scan QR code"}),Ut(me,{children:["Scan this code using your mobile wallet to send funds to your ",R," ","wallet."]})]}),Ve(un,{url:v.address,size:200,squareLogoElement:bE}),A]}),Ve(q,{})]}):Ut(Kc,{children:[Ve(Lt,{}),Ve(fe,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),Ut(en,{style:{gap:"16px"},children:[Ut(SE,{children:[Ve(yE,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),Ut(AE,{children:["Make sure to send on ",v.chain.name,"."]})]}),Ut(PE,{children:[Ve(Bi,{height:16}),Ut(la,{children:[Ut(ca,{children:[Ve(Hc,{children:v.amount}),Ve(da,{children:v.chain.nativeCurrency.symbol})]}),Ve(pa,{children:b?`${b} USD`:"..."}),Ut(I1,{children:[Ve(sa,{chainId:v.chain.id,height:16,width:16})," ",v.chain.name]})]}),Ve(Bi,{height:8}),Ut(TE,{children:[Ve(EE,{text:v.address}),Ve(i2,{onClick:()=>m("qr-code"),children:Ut(n2,{children:[Ve(gE,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),A]}),Ve(Bi,{height:16}),Ve(q,{})]})},bE=({...e})=>Ve(Qo,{color:"black",...e}),EE=e=>{let[t,r]=su(!1);return Ve(i2,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:Ut(n2,{children:[t?Ve(na,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):Ve(hE,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},TE=ha.div`
1944
1947
  display: flex;
1945
1948
  flex-direction: row;
1946
1949
  gap: 8px;
1947
- `,EE=ha.div`
1950
+ `,SE=ha.div`
1948
1951
  display: flex;
1949
1952
  flex-direction: row;
1950
1953
  padding: 8px;
@@ -1953,11 +1956,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1953
1956
  svg {
1954
1957
  margin-right: 12px;
1955
1958
  }
1956
- `,TE=ha.div`
1959
+ `,AE=ha.div`
1957
1960
  line-height: 20px;
1958
1961
  font-size: 18px
1959
1962
  text-align: center;
1960
- `,SE=ha.div`
1963
+ `,PE=ha.div`
1961
1964
  display: flex;
1962
1965
  flex-direction: column;
1963
1966
  background-color: var(--privy-color-background-2);
@@ -1967,11 +1970,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1967
1970
  }
1968
1971
  padding: 16px;
1969
1972
  gap: 8px;
1970
- `,r2=ha.span`
1973
+ `,n2=ha.span`
1971
1974
  display: flex;
1972
1975
  align-items: center;
1973
1976
  margin: auto;
1974
- `,o2=ha.button`
1977
+ `,i2=ha.button`
1975
1978
  display: flex;
1976
1979
  align-items: center;
1977
1980
  width: 100%;
@@ -2008,7 +2011,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2008
2011
  width: 18px;
2009
2012
  height: 18px;
2010
2013
  }
2011
- `;import{useEffect as VE,useState as qE}from"react";import AE from"@heroicons/react/24/outline/ClockIcon";import PE from"@heroicons/react/24/outline/EyeSlashIcon";import xE from"@heroicons/react/24/outline/LinkIcon";import Eo from"styled-components";import{Fragment as n2,jsx as jt,jsxs as ni}from"react/jsx-runtime";var su=({title:e,desc:t,icon:r})=>ni(WE,{children:[jt(OE,{children:r}),ni(LE,{children:[jt(ME,{children:e}),jt(IE,{children:t})]})]}),i2=({app:e,signedUrl:t,onContinue:r})=>ni(n2,{children:[ni(_E,{children:[jt(fa,{size:"3.75rem"}),ni(RE,{children:[e?.name," uses ",jt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),ni(NE,{children:[jt(su,{icon:jt(xE,{width:"1rem"}),title:"Purchase assets to fund your account",desc:ni(n2,{children:["Connect a payment method (",jt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),jt(su,{icon:jt(AE,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),jt(su,{icon:jt(PE,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),jt(DE,{className:"mobile-only"})]}),jt(kE,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),jt(ql,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),kE=Eo.span`
2014
+ `;import{useEffect as zE,useState as KE}from"react";import xE from"@heroicons/react/24/outline/ClockIcon";import kE from"@heroicons/react/24/outline/EyeSlashIcon";import _E from"@heroicons/react/24/outline/LinkIcon";import Eo from"styled-components";import{Fragment as a2,jsx as jt,jsxs as ni}from"react/jsx-runtime";var lu=({title:e,desc:t,icon:r})=>ni(OE,{children:[jt(DE,{children:r}),ni(NE,{children:[jt(WE,{children:e}),jt(LE,{children:t})]})]}),s2=({app:e,signedUrl:t,onContinue:r})=>ni(a2,{children:[ni(ME,{children:[jt(fa,{size:"3.75rem"}),ni(IE,{children:[e?.name," uses ",jt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),ni(UE,{children:[jt(lu,{icon:jt(_E,{width:"1rem"}),title:"Purchase assets to fund your account",desc:ni(a2,{children:["Connect a payment method (",jt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),jt(lu,{icon:jt(xE,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),jt(lu,{icon:jt(kE,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),jt(FE,{className:"mobile-only"})]}),jt(RE,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),jt(ql,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),RE=Eo.span`
2012
2015
  display: inline-block;
2013
2016
  color: var(--privy-color-foreground-3);
2014
2017
  text-align: center;
@@ -2017,13 +2020,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2017
2020
  font-weight: 400;
2018
2021
  line-height: 140%; /* 0.875rem */
2019
2022
  margin-bottom: 0.25rem;
2020
- `,_E=Eo.div`
2023
+ `,ME=Eo.div`
2021
2024
  display: flex;
2022
2025
  flex-direction: column;
2023
2026
  align-items: center;
2024
2027
  justify-content: center;
2025
2028
  padding: 1.5rem 0;
2026
- `,RE=Eo.span`
2029
+ `,IE=Eo.span`
2027
2030
  color: var(--privy-color-foreground);
2028
2031
  text-align: center;
2029
2032
  font-size: 1.125rem;
@@ -2032,46 +2035,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
2032
2035
  margin: 1.5rem 0;
2033
2036
  text-align: center;
2034
2037
  max-width: 19.5rem;
2035
- `,ME=Eo.span`
2038
+ `,WE=Eo.span`
2036
2039
  color: var(--privy-color-foreground);
2037
2040
  font-size: 0.875rem;
2038
2041
  font-weight: 500;
2039
2042
  line-height: 1.225rem;
2040
2043
  width: 100%;
2041
- `,IE=Eo.span`
2044
+ `,LE=Eo.span`
2042
2045
  color: var(--privy-color-foreground-2);
2043
2046
  font-size: 0.875rem;
2044
2047
  font-weight: 400;
2045
2048
  line-height: 1.225rem;
2046
- `,WE=Eo.div`
2049
+ `,OE=Eo.div`
2047
2050
  display: flex;
2048
2051
  align-items: flex-start;
2049
2052
  gap: 0.5rem;
2050
2053
  align-self: stretch;
2051
- `,LE=Eo.div`
2054
+ `,NE=Eo.div`
2052
2055
  display: flex;
2053
2056
  flex-direction: column;
2054
2057
  gap: 0.25rem;
2055
2058
  align-items: flex-start;
2056
2059
  text-align: left;
2057
2060
  flex: 1 0 0;
2058
- `,OE=Eo.div`
2061
+ `,DE=Eo.div`
2059
2062
  padding-top: 2px;
2060
- `,NE=Eo.div`
2063
+ `,UE=Eo.div`
2061
2064
  display: flex;
2062
2065
  flex-direction: column;
2063
2066
  gap: 1.25rem;
2064
2067
  margin: 0 0.5rem;
2065
- `,DE=Eo.div`
2068
+ `,FE=Eo.div`
2066
2069
  margin: 30px 0;
2067
- `;import{ofetch as UE}from"ofetch";import{useEffect as FE,useRef as BE,useState as HE}from"react";var Kc="moonpay";function a2(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 s2(e){return parseFloat(e)}function l2(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function Yc(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function c2(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 GE(e,t){let r=t?mf:uf,o=t?hf:ff;return UE(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function d2(e,t=!1){let[r,o]=HE(null),{createAnalyticsEvent:n}=M(),{data:i,navigate:a,setModalData:l}=x(),s=i?.funding,c=BE(0);return FE(()=>{let f=setInterval(async()=>{if(e)try{let[m]=await GE(e,t),u=m.status==="waitingAuthorization"&&m.paymentMethod==="credit_debit_card"?"pending":m.status;if(["failed","completed","awaitingAuthorization"].includes(u)&&(n({eventName:ma,payload:{status:u,provider:Kc,paymentMethod:m.paymentMethod,cardPaymentType:m.cardPaymentType,currency:m.currency?.code,baseCurrencyAmount:m.baseCurrencyAmount,quoteCurrencyAmount:m.quoteCurrencyAmount,feeAmount:m.feeAmount,extraFeeAmount:m.extraFeeAmount,networkFeeAmount:m.networkFeeAmount}}),clearInterval(f)),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(m){m.response?.status!==404&&(c.current+=1),c.current>=3&&(n({eventName:ma,payload:{status:"serviceFailure",provider:Kc}}),clearInterval(f),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(f)},[e,c]),r}import{Fragment as zE,jsx as lu,jsxs as KE}from"react/jsx-runtime";var p2=()=>{let{app:e,data:t,navigate:r,setModalData:o}=x(),{createAnalyticsEvent:n,getMoonpaySignedUrl:i}=M(),[a,l]=qE(null),s=t?.funding;return VE(()=>{if(a||!s)return;async function c(){if(!e.fundingConfig)return;let{signedUrl:f,externalTransactionId:m}=await i(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??a2(`eip155:${s.chain.id}`),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??s2(s.amount)});l(f),o({moonpayStatus:{externalTransactionId:m},funding:t?.funding})}c()},[a,s]),KE(zE,{children:[lu(Lt,{}),lu(i2,{app:e,signedUrl:a,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:Kc}}),r("MOONPAY_STATUS_SCREEN")}}),lu(q,{})]})};import YE from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import jE from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as XE}from"react";import u2 from"styled-components";import{Fragment as f2,jsx as Sr,jsxs as fs}from"react/jsx-runtime";var m2=()=>{let{app:e,data:t}=x(),{closePrivyModal:r}=M(),{externalTransactionId:o}=t?.moonpayStatus,n=d2(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return fs(f2,{children:[Sr(_,{title:"Fund account"},"header"),Sr(ZE,{status:n,onClickCta:r}),Sr(q,{})]})},QE=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:""}}},ZE=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=XE(()=>QE(e),[e]);return fs(f2,{children:[fs(r8,{children:[Sr(e8,{status:e}),fs(Xe,{children:[Sr("h3",{children:r}),Sr(t8,{children:o})]})]}),n&&Sr(H,{onClick:t,children:n})]})},JE=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)",$E=e=>{switch(e){case"completed":return jE;case"waitingAuthorization":return()=>Sr(YE,{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}},e8=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return fs("div",{style:{position:"relative"},children:[Sr(ct,{color:o,style:{position:"absolute"}}),Sr(Ha,{color:o}),Sr(fa,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=$E(e),r=JE(e);return Sr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Sr(t,{width:"4rem",height:"4rem",color:r})})},t8=u2.p`
2070
+ `;import{ofetch as BE}from"ofetch";import{useEffect as HE,useRef as GE,useState as VE}from"react";var Yc="moonpay";function l2(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 c2(e){return parseFloat(e)}function d2(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function jc(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function p2(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 qE(e,t){let r=t?hf:ff,o=t?gf:yf;return BE(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function u2(e,t=!1){let[r,o]=VE(null),{createAnalyticsEvent:n}=M(),{data:i,navigate:a,setModalData:l}=x(),s=i?.funding,c=GE(0);return HE(()=>{let f=setInterval(async()=>{if(e)try{let[m]=await qE(e,t),u=m.status==="waitingAuthorization"&&m.paymentMethod==="credit_debit_card"?"pending":m.status;if(["failed","completed","awaitingAuthorization"].includes(u)&&(n({eventName:ma,payload:{status:u,provider:Yc,paymentMethod:m.paymentMethod,cardPaymentType:m.cardPaymentType,currency:m.currency?.code,baseCurrencyAmount:m.baseCurrencyAmount,quoteCurrencyAmount:m.quoteCurrencyAmount,feeAmount:m.feeAmount,extraFeeAmount:m.extraFeeAmount,networkFeeAmount:m.networkFeeAmount}}),clearInterval(f)),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(m){m.response?.status!==404&&(c.current+=1),c.current>=3&&(n({eventName:ma,payload:{status:"serviceFailure",provider:Yc}}),clearInterval(f),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(f)},[e,c]),r}import{Fragment as YE,jsx as cu,jsxs as jE}from"react/jsx-runtime";var m2=()=>{let{app:e,data:t,navigate:r,setModalData:o}=x(),{createAnalyticsEvent:n,getMoonpaySignedUrl:i}=M(),[a,l]=KE(null),s=t?.funding;return zE(()=>{if(a||!s)return;async function c(){if(!e.fundingConfig)return;let{signedUrl:f,externalTransactionId:m}=await i(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??l2(`eip155:${s.chain.id}`),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??c2(s.amount)});l(f),o({moonpayStatus:{externalTransactionId:m},funding:t?.funding})}c()},[a,s]),jE(YE,{children:[cu(Lt,{}),cu(s2,{app:e,signedUrl:a,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:Yc}}),r("MOONPAY_STATUS_SCREEN")}}),cu(q,{})]})};import XE from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import QE from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as ZE}from"react";import f2 from"styled-components";import{Fragment as y2,jsx as Sr,jsxs as fs}from"react/jsx-runtime";var h2=()=>{let{app:e,data:t}=x(),{closePrivyModal:r}=M(),{externalTransactionId:o}=t?.moonpayStatus,n=u2(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return fs(y2,{children:[Sr(_,{title:"Fund account"},"header"),Sr($E,{status:n,onClickCta:r}),Sr(q,{})]})},JE=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:""}}},$E=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=ZE(()=>JE(e),[e]);return fs(y2,{children:[fs(n8,{children:[Sr(r8,{status:e}),fs(je,{children:[Sr("h3",{children:r}),Sr(o8,{children:o})]})]}),n&&Sr(H,{onClick:t,children:n})]})},e8=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)",t8=e=>{switch(e){case"completed":return QE;case"waitingAuthorization":return()=>Sr(XE,{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}},r8=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return fs("div",{style:{position:"relative"},children:[Sr(ct,{color:o,style:{position:"absolute"}}),Sr(Ha,{color:o}),Sr(fa,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=t8(e),r=e8(e);return Sr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Sr(t,{width:"4rem",height:"4rem",color:r})})},o8=f2.p`
2068
2071
  font-size: 1rem;
2069
2072
  color: var(--privy-color-foreground-3);
2070
2073
  margin-bottom: 1rem;
2071
2074
  display: flex;
2072
2075
  flex-direction: column;
2073
2076
  gap: 1rem;
2074
- `,r8=u2.div`
2077
+ `,n8=f2.div`
2075
2078
  display: flex;
2076
2079
  flex-direction: column;
2077
2080
  align-items: center;
@@ -2079,7 +2082,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2079
2082
  margin-left: 1.75rem;
2080
2083
  margin-right: 1.75rem;
2081
2084
  padding: 2rem 0;
2082
- `;import{useEffect as d8,useState as p8}from"react";import o8,{css as n8}from"styled-components";import{jsx as a8}from"react/jsx-runtime";var jc=()=>{let{enabled:e,token:t}=Te(),{navigate:r,setModalData:o}=x(),{initLoginWithPasskey:n}=M();return a8(cu,{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"})},i8=n8`
2085
+ `;import{useEffect as u8,useState as m8}from"react";import i8,{css as a8}from"styled-components";import{jsx as l8}from"react/jsx-runtime";var Xc=()=>{let{enabled:e,token:t}=Te(),{navigate:r,setModalData:o}=x(),{initLoginWithPasskey:n}=M();return l8(du,{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"})},s8=a8`
2083
2086
  && {
2084
2087
  width: 100%;
2085
2088
  font-size: 0.875rem;
@@ -2104,9 +2107,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
2104
2107
  box-shadow: none;
2105
2108
  }
2106
2109
  }
2107
- `,cu=o8.button`
2108
- ${i8}
2109
- `;import s8 from"@heroicons/react/24/outline/ChevronRightIcon";import l8 from"@heroicons/react/24/outline/WalletIcon";import{jsx as du,jsxs as c8}from"react/jsx-runtime";var Xc=({onClick:e,text:t})=>c8(Se,{onClick:e,children:[du(l8,{}),du(yr,{children:t}),du(s8,{})]});import{Fragment as h2,jsx as fn,jsxs as Qc}from"react/jsx-runtime";var y2=()=>{let{connectors:e}=M(),{app:t,setModalData:r,data:o,navigate:n}=x(),[i,a]=p8("default"),l=rn(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=fn(Xc,{text:"More wallets",onClick:()=>a("overflow")});return d8(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),i==="overflow"?Qc(h2,{children:[fn(_,{backFn:()=>a("default")},"header"),Qc(nr,{children:[fn(bo,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),fn(q,{})]}):Qc(h2,{children:[fn(Lt,{}),fn(fe,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),Qc(nr,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,fn(cu,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),fn(q,{})]})};import u8 from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import m8 from"styled-components";import{Fragment as h8,jsx as hn,jsxs as y8}from"react/jsx-runtime";var g2=()=>{let{closePrivyModal:e}=M();return y8(h8,{children:[hn(_,{},"header"),hn(f8,{children:hn(u8,{style:{width:32,height:32}})}),hn(fo,{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"}}),hn(lr,{children:hn(H,{onClick:()=>e(),children:"Close"})}),hn(se,{}),hn(q,{})]})},f8=m8.div`
2110
+ `,du=i8.button`
2111
+ ${s8}
2112
+ `;import c8 from"@heroicons/react/24/outline/ChevronRightIcon";import d8 from"@heroicons/react/24/outline/WalletIcon";import{jsx as pu,jsxs as p8}from"react/jsx-runtime";var Qc=({onClick:e,text:t})=>p8(Se,{onClick:e,children:[pu(d8,{}),pu(yr,{children:t}),pu(c8,{})]});import{Fragment as g2,jsx as fn,jsxs as Zc}from"react/jsx-runtime";var v2=()=>{let{connectors:e}=M(),{app:t,setModalData:r,data:o,navigate:n}=x(),[i,a]=m8("default"),l=rn(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=fn(Qc,{text:"More wallets",onClick:()=>a("overflow")});return u8(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),i==="overflow"?Zc(g2,{children:[fn(_,{backFn:()=>a("default")},"header"),Zc(nr,{children:[fn(bo,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),fn(q,{})]}):Zc(g2,{children:[fn(Lt,{}),fn(fe,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),Zc(nr,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,fn(du,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),fn(q,{})]})};import f8 from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import h8 from"styled-components";import{Fragment as g8,jsx as hn,jsxs as v8}from"react/jsx-runtime";var C2=()=>{let{closePrivyModal:e}=M();return v8(g8,{children:[hn(_,{},"header"),hn(y8,{children:hn(f8,{style:{width:32,height:32}})}),hn(fo,{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"}}),hn(lr,{children:hn(H,{onClick:()=>e(),children:"Close"})}),hn(se,{}),hn(q,{})]})},y8=h8.div`
2110
2113
  border-radius: 50%;
2111
2114
  height: 68px;
2112
2115
  width: 68px;
@@ -2116,18 +2119,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
2116
2119
  background-color: var(--privy-color-accent);
2117
2120
  color: white;
2118
2121
  margin: 0 auto 24px auto;
2119
- `;import*as b2 from"react-device-detect";import w8 from"styled-components";import pu from"styled-components";import{jsx as v2}from"react/jsx-runtime";var C2=({style:e,...t})=>v2("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:v2("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)"})});import{jsx as v8,jsxs as C8}from"react/jsx-runtime";var w2=pu.div`
2122
+ `;import*as T2 from"react-device-detect";import E8 from"styled-components";import uu from"styled-components";import{jsx as w2}from"react/jsx-runtime";var b2=({style:e,...t})=>w2("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:w2("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)"})});import{jsx as w8,jsxs as b8}from"react/jsx-runtime";var E2=uu.div`
2120
2123
  display: flex;
2121
2124
  flex-direction: column;
2122
2125
  justify-content: flex-start;
2123
2126
  gap: 4px;
2124
- `,uu=pu.div`
2127
+ `,mu=uu.div`
2125
2128
  &&& {
2126
2129
  margin-left: 7px; /* TODO: This is a total hack */
2127
2130
  border-left: 2px solid var(--privy-color-foreground-4);
2128
2131
  height: 12px;
2129
2132
  }
2130
- `,Zc=({children:e})=>C8(g8,{children:[v8(C2,{style:{width:"16px",height:"16px"}}),e]}),g8=pu.div`
2133
+ `,Jc=({children:e})=>b8(C8,{children:[w8(b2,{style:{width:"16px",height:"16px"}}),e]}),C8=uu.div`
2131
2134
  display: flex;
2132
2135
  justify-content: flex-start;
2133
2136
  justify-items: center;
@@ -2145,22 +2148,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
2145
2148
  margin-bottom: auto;
2146
2149
  }
2147
2150
  }
2148
- `;import{Fragment as T8,jsx as Pt,jsxs as hs}from"react/jsx-runtime";var b8=()=>hs(E8,{children:[Pt(Yn,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),Pt(St,{children:Pt(co,{style:{width:"152px",height:"152px"}})}),hs(w2,{children:[Pt(Zc,{children:hs("div",{children:[Pt("span",{children:"Install the "}),Pt("a",{href:b2.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"})]})}),Pt(uu,{}),Pt(Zc,{children:"Set up your first wallet"}),Pt(uu,{}),Pt(Zc,{children:"Store your recovery phrase in a safe place!"})]}),Pt(Jo,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),E2=()=>{let{navigateBack:e}=x();return hs(T8,{children:[Pt(_,{backFn:e},"header"),Pt(ie,{}),Pt(b8,{}),Pt(se,{}),hs(Z,{children:[Pt("span",{children:"Still not sure? "}),Pt("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},E8=w8(St)`
2151
+ `;import{Fragment as A8,jsx as Pt,jsxs as hs}from"react/jsx-runtime";var T8=()=>hs(S8,{children:[Pt(Yn,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),Pt(St,{children:Pt(co,{style:{width:"152px",height:"152px"}})}),hs(E2,{children:[Pt(Jc,{children:hs("div",{children:[Pt("span",{children:"Install the "}),Pt("a",{href:T2.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"})]})}),Pt(mu,{}),Pt(Jc,{children:"Set up your first wallet"}),Pt(mu,{}),Pt(Jc,{children:"Store your recovery phrase in a safe place!"})]}),Pt(Jo,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),S2=()=>{let{navigateBack:e}=x();return hs(A8,{children:[Pt(_,{backFn:e},"header"),Pt(ae,{}),Pt(T8,{}),Pt(se,{}),hs(Z,{children:[Pt("span",{children:"Still not sure? "}),Pt("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},S8=E8(St)`
2149
2152
  gap: 30px;
2150
2153
 
2151
2154
  > :first-child > svg {
2152
2155
  margin-top: 20px;
2153
2156
  }
2154
- `;import m9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as f9,useState as U2}from"react";import{isMobile as h9}from"react-device-detect";import y9 from"styled-components";var S8={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:",guest:"guest"},yn=e=>{let t=S8[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};import x8 from"styled-components";import A8 from"react";import{jsx as P8}from"react/jsx-runtime";var T2=()=>{let{app:e}=x(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?P8("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?A8.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};import{jsx as S2}from"react/jsx-runtime";var Jc=e=>{let{app:t}=x();return t?.appearance.logo?S2(k8,{...e,children:S2(T2,{})}):null},k8=x8.div`
2157
+ `;import h9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as y9,useState as B2}from"react";import{isMobile as g9}from"react-device-detect";import v9 from"styled-components";var P8={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:",guest:"guest"},yn=e=>{let t=P8[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};import _8 from"styled-components";import x8 from"react";import{jsx as k8}from"react/jsx-runtime";var A2=()=>{let{app:e}=x(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?k8("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?x8.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};import{jsx as P2}from"react/jsx-runtime";var $c=e=>{let{app:t}=x();return t?.appearance.logo?P2(R8,{...e,children:P2(A2,{})}):null},R8=_8.div`
2155
2158
  display: flex;
2156
2159
  flex-direction: column;
2157
2160
  align-items: center;
2158
2161
  padding: 24px 0;
2159
2162
  flex-grow: 1;
2160
2163
  justify-content: center;
2161
- `;import L8 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as O8}from"react";import _8 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as R8,useState as mu}from"react";import P2 from"styled-components";import{Fragment as W8,jsx as ii,jsxs as A2}from"react/jsx-runtime";var $c=R8((e,t)=>{let[r,o]=mu(""),[n,i]=mu(!1),{authenticated:a}=z(),{initLoginWithEmail:l}=M(),{navigate:s,setModalData:c,currentScreen:f}=x(),{enabled:m,token:u}=Te(),[C,v]=mu(!1),{accountType:g}=Mt(),b=$s(r),E=n,R=n||!b,S=k=>{i(!0),l(r,k).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(I=>{c({errorModalData:{error:I,previousScreen:f||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},A=()=>{m&&!u&&!a?(c({captchaModalData:{callback:k=>l(r,k),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):S(u)};return A2(W8,{children:[ii(M8,{children:A2(I8,{stacked:e.stacked,children:[ii(_8,{}),ii("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>v(!0),onChange:k=>o(k.target.value),onKeyUp:k=>{k.key==="Enter"&&A()},value:r,autoComplete:"email"}),g==="email"&&!C?ii(Rt,{color:"gray",children:"Recent"}):e.stacked?ii("span",{}):ii(Oi,{isSubmitting:E,onClick:A,disabled:R,children:"Submit"})]})}),e.stacked?ii(H,{loadingText:null,loading:E,disabled:R,onClick:A,children:"Submit"}):null]})}),M8=P2.div`
2164
+ `;import N8 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as D8}from"react";import M8 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as I8,useState as fu}from"react";import k2 from"styled-components";import{Fragment as O8,jsx as ii,jsxs as x2}from"react/jsx-runtime";var ed=I8((e,t)=>{let[r,o]=fu(""),[n,i]=fu(!1),{authenticated:a}=K(),{initLoginWithEmail:l}=M(),{navigate:s,setModalData:c,currentScreen:f}=x(),{enabled:m,token:u}=Te(),[C,v]=fu(!1),{accountType:g}=Mt(),b=$s(r),E=n,R=n||!b,S=k=>{i(!0),l(r,k).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(I=>{c({errorModalData:{error:I,previousScreen:f||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},A=()=>{m&&!u&&!a?(c({captchaModalData:{callback:k=>l(r,k),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):S(u)};return x2(O8,{children:[ii(W8,{children:x2(L8,{stacked:e.stacked,children:[ii(M8,{}),ii("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>v(!0),onChange:k=>o(k.target.value),onKeyUp:k=>{k.key==="Enter"&&A()},value:r,autoComplete:"email"}),g==="email"&&!C?ii(Rt,{color:"gray",children:"Recent"}):e.stacked?ii("span",{}):ii(Oi,{isSubmitting:E,onClick:A,disabled:R,children:"Submit"})]})}),e.stacked?ii(H,{loadingText:null,loading:E,disabled:R,onClick:A,children:"Submit"}):null]})}),W8=k2.div`
2162
2165
  width: 100%;
2163
- `,I8=P2.label`
2166
+ `,L8=k2.label`
2164
2167
  display: block;
2165
2168
  position: relative;
2166
2169
  width: 100%;
@@ -2227,11 +2230,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
2227
2230
  && > input::placeholder {
2228
2231
  color: var(--privy-color-foreground-3);
2229
2232
  }
2230
- `;import{Fragment as N8,jsx as ed,jsxs as x2}from"react/jsx-runtime";var td=({isEditable:e,setIsEditable:t})=>{let r=O8(null);return x2(N8,{children:[ed(Yr,{if:!e,children:ed($c,{ref:r})}),ed(Yr,{if:e,children:x2(Se,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[ed(L8,{})," Continue with Email"]})})]})};import{useState as D8}from"react";import U8 from"styled-components";import{jsx as fu,jsxs as B8}from"react/jsx-runtime";var rd=()=>{let[e,t]=D8(!1),{currentScreen:r,navigate:o,setModalData:n}=x(),{enabled:i,token:a}=Te(),{initLoginWithFarcaster:l}=M(),{accountType:s}=Mt();return B8(Se,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:f=>l(f),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(f){n({errorModalData:{error:f,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[fu(go,{})," Farcaster",e&&fu(po,{}),s==="farcaster"&&fu(F8,{color:"gray",children:"Recent"})]})},F8=U8(Rt)`
2233
+ `;import{Fragment as U8,jsx as td,jsxs as _2}from"react/jsx-runtime";var rd=({isEditable:e,setIsEditable:t})=>{let r=D8(null);return _2(U8,{children:[td(Yr,{if:!e,children:td(ed,{ref:r})}),td(Yr,{if:e,children:_2(Se,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[td(N8,{})," Continue with Email"]})})]})};import{useState as F8}from"react";import B8 from"styled-components";import{jsx as hu,jsxs as G8}from"react/jsx-runtime";var od=()=>{let[e,t]=F8(!1),{currentScreen:r,navigate:o,setModalData:n}=x(),{enabled:i,token:a}=Te(),{initLoginWithFarcaster:l}=M(),{accountType:s}=Mt();return G8(Se,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:f=>l(f),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(f){n({errorModalData:{error:f,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[hu(go,{})," Farcaster",e&&hu(po,{}),s==="farcaster"&&hu(H8,{color:"gray",children:"Recent"})]})},H8=B8(Rt)`
2231
2234
  margin-left: auto;
2232
- `;import $8 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as e9}from"react";import{forwardRef as X8,useState as id}from"react";import W2 from"styled-components";import H8 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as G8,AsYouType as V8,getCountries as q8,getCountryCallingCode as od,getExampleNumber as z8}from"libphonenumber-js/min";import{jsx as j8,jsxs as Y8}from"react/jsx-runtime";var ys=(e,t)=>G8(String(e),t),nd=(e,t)=>`+${od(t)} ${e}`,k2=e=>`*${e.replaceAll("-","").slice(-4)}`,_2=e=>new V8(e),K8=q8().map(e=>({code:e,callCode:od(e)})),R2=e=>{let t=z8(e,H8)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},M2=({value:e,onChange:t})=>j8("select",{value:e,onChange:t,children:K8.map(r=>Y8("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});import{Fragment as J8,jsx as ai,jsxs as I2}from"react/jsx-runtime";var gn=X8((e,t)=>{let{app:r}=x(),[o,n]=id(!1),{accountType:i}=Mt(),[a,l]=id(""),[s,c]=id(r?.intl.defaultCountry??"US"),f=ys(a,s),m=_2(s),u=R2(s),C=od(s),v=!f,[g,b]=id(!1),E=C.length,R=k=>{let I=k.target.value;c(I),l(""),e.onChange&&e.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:nd(a,I),countryCode:I,isValid:ys(a,s)})},S=k=>{try{let I=k.replace(/\D/g,""),F=a.replace(/\D/g,""),G=I===F?k:m.input(k);l(G),e.onChange&&e.onChange({rawPhoneNumber:G,qualifiedPhoneNumber:nd(k,s),countryCode:s,isValid:ys(k,s)})}catch(I){console.error("Error processing phone number:",I)}},A=()=>{b(!0);let k=nd(a,s);e.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:k,countryCode:s,isValid:ys(a,s)}).finally(()=>b(!1))};return I2(J8,{children:[ai(Q8,{children:I2(Z8,{callingCodeLength:E,stacked:e.stacked,children:[ai(M2,{value:s,onChange:R}),ai("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:u,onFocus:()=>n(!0),onChange:k=>{S(k.target.value)},onKeyUp:k=>{k.key==="Enter"&&A()},value:a,autoComplete:"tel"}),i==="phone"&&!o&&!e.hideRecent?ai(Rt,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?ai(Oi,{isSubmitting:g,onClick:A,disabled:v,children:"Submit"}):ai("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?ai(H,{loading:g,loadingText:null,onClick:A,disabled:v,children:"Submit"}):null]})}),Q8=W2.div`
2235
+ `;import t9 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as r9}from"react";import{forwardRef as Z8,useState as ad}from"react";import O2 from"styled-components";import V8 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as q8,AsYouType as z8,getCountries as K8,getCountryCallingCode as nd,getExampleNumber as Y8}from"libphonenumber-js/min";import{jsx as Q8,jsxs as X8}from"react/jsx-runtime";var ys=(e,t)=>q8(String(e),t),id=(e,t)=>`+${nd(t)} ${e}`,R2=e=>`*${e.replaceAll("-","").slice(-4)}`,M2=e=>new z8(e),j8=K8().map(e=>({code:e,callCode:nd(e)})),I2=e=>{let t=Y8(e,V8)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},W2=({value:e,onChange:t})=>Q8("select",{value:e,onChange:t,children:j8.map(r=>X8("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});import{Fragment as e9,jsx as ai,jsxs as L2}from"react/jsx-runtime";var gn=Z8((e,t)=>{let{app:r}=x(),[o,n]=ad(!1),{accountType:i}=Mt(),[a,l]=ad(""),[s,c]=ad(r?.intl.defaultCountry??"US"),f=ys(a,s),m=M2(s),u=I2(s),C=nd(s),v=!f,[g,b]=ad(!1),E=C.length,R=k=>{let I=k.target.value;c(I),l(""),e.onChange&&e.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:id(a,I),countryCode:I,isValid:ys(a,s)})},S=k=>{try{let I=k.replace(/\D/g,""),F=a.replace(/\D/g,""),G=I===F?k:m.input(k);l(G),e.onChange&&e.onChange({rawPhoneNumber:G,qualifiedPhoneNumber:id(k,s),countryCode:s,isValid:ys(k,s)})}catch(I){console.error("Error processing phone number:",I)}},A=()=>{b(!0);let k=id(a,s);e.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:k,countryCode:s,isValid:ys(a,s)}).finally(()=>b(!1))};return L2(e9,{children:[ai(J8,{children:L2($8,{callingCodeLength:E,stacked:e.stacked,children:[ai(W2,{value:s,onChange:R}),ai("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:u,onFocus:()=>n(!0),onChange:k=>{S(k.target.value)},onKeyUp:k=>{k.key==="Enter"&&A()},value:a,autoComplete:"tel"}),i==="phone"&&!o&&!e.hideRecent?ai(Rt,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?ai(Oi,{isSubmitting:g,onClick:A,disabled:v,children:"Submit"}):ai("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?ai(H,{loading:g,loadingText:null,onClick:A,disabled:v,children:"Submit"}):null]})}),J8=O2.div`
2233
2236
  width: 100%;
2234
- `,Z8=W2.label`
2237
+ `,$8=O2.label`
2235
2238
  --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
2236
2239
  --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
2237
2240
  display: block;
@@ -2324,15 +2327,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
2324
2327
  && > input::placeholder {
2325
2328
  color: var(--privy-color-foreground-3);
2326
2329
  }
2327
- `;import{Fragment as t9,jsx as ad,jsxs as L2}from"react/jsx-runtime";var sd=({isEditable:e,setIsEditable:t})=>{let r=e9(null),{authenticated:o}=z(),{navigate:n,setModalData:i,currentScreen:a}=x(),{initLoginWithSms:l}=M(),{enabled:s,token:c}=Te();async function f({qualifiedPhoneNumber:m}){if(s&&!c&&!o)i({captchaModalData:{callback:u=>l(m,u),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(m,c),n("AWAITING_PASSWORDLESS_CODE")}catch(u){i({errorModalData:{error:u,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return L2(t9,{children:[ad(Yr,{if:!e,children:ad(gn,{ref:r,onSubmit:f})}),ad(Yr,{if:e,children:L2(Se,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[ad($8,{})," Continue with SMS"]})})]})};import{useState as r9}from"react";import o9 from"styled-components";import{jsx as To,jsxs as a9}from"react/jsx-runtime";var n9={apple:{logo:To(dl,{}),displayName:"Apple"},discord:{logo:To(pl,{}),displayName:"Discord"},github:{logo:To(ul,{}),displayName:"GitHub"},google:{logo:To(fl,{}),displayName:"Google"},linkedin:{logo:To(vl,{}),displayName:"LinkedIn"},spotify:{logo:To(Cl,{}),displayName:"Spotify"},instagram:{logo:To(yl,{}),displayName:"Instagram"},twitter:{logo:To(bl,{}),displayName:"Twitter"},tiktok:{logo:To(wl,{}),displayName:"TikTok"}},dt=({provider:e})=>{let{enabled:t,token:r}=Te(),{navigate:o,setModalData:n}=x(),[i,a]=r9(!1),{initLoginWithOAuth:l}=M(),{accountType:s}=Mt(),c=s?yn(s):null,{displayName:f,logo:m}=n9[e];return a9(Se,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:C=>l(e,C),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[m," ",f,c?.loginMethod===e&&To(i9,{color:"gray",children:"Recent"})]})},i9=o9(Rt)`
2330
+ `;import{Fragment as o9,jsx as sd,jsxs as N2}from"react/jsx-runtime";var ld=({isEditable:e,setIsEditable:t})=>{let r=r9(null),{authenticated:o}=K(),{navigate:n,setModalData:i,currentScreen:a}=x(),{initLoginWithSms:l}=M(),{enabled:s,token:c}=Te();async function f({qualifiedPhoneNumber:m}){if(s&&!c&&!o)i({captchaModalData:{callback:u=>l(m,u),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(m,c),n("AWAITING_PASSWORDLESS_CODE")}catch(u){i({errorModalData:{error:u,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return N2(o9,{children:[sd(Yr,{if:!e,children:sd(gn,{ref:r,onSubmit:f})}),sd(Yr,{if:e,children:N2(Se,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[sd(t9,{})," Continue with SMS"]})})]})};import{useState as n9}from"react";import i9 from"styled-components";import{jsx as To,jsxs as l9}from"react/jsx-runtime";var a9={apple:{logo:To(dl,{}),displayName:"Apple"},discord:{logo:To(pl,{}),displayName:"Discord"},github:{logo:To(ul,{}),displayName:"GitHub"},google:{logo:To(fl,{}),displayName:"Google"},linkedin:{logo:To(vl,{}),displayName:"LinkedIn"},spotify:{logo:To(Cl,{}),displayName:"Spotify"},instagram:{logo:To(yl,{}),displayName:"Instagram"},twitter:{logo:To(bl,{}),displayName:"Twitter"},tiktok:{logo:To(wl,{}),displayName:"TikTok"}},dt=({provider:e})=>{let{enabled:t,token:r}=Te(),{navigate:o,setModalData:n}=x(),[i,a]=n9(!1),{initLoginWithOAuth:l}=M(),{accountType:s}=Mt(),c=s?yn(s):null,{displayName:f,logo:m}=a9[e];return l9(Se,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:C=>l(e,C),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[m," ",f,c?.loginMethod===e&&To(s9,{color:"gray",children:"Recent"})]})},s9=i9(Rt)`
2328
2331
  margin-left: auto;
2329
- `;import{useState as s9}from"react";import l9 from"styled-components";import{jsx as vn,jsxs as O2}from"react/jsx-runtime";function ld(e){return O2("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[vn("defs",{children:O2("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[vn("stop",{offset:"0",stopColor:"#1d93d2"}),vn("stop",{offset:"1",stopColor:"#38b0e3"})]})}),vn("title",{children:"Telegram_logo"}),vn("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),vn("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"}),vn("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"}),vn("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"})]})}import{jsx as N2,jsxs as d9}from"react/jsx-runtime";var cd=()=>{let{enabled:e,token:t}=Te(),{navigate:r,setModalData:o}=x(),[n,i]=s9(!1),{initLoginWithTelegram:a}=M(),{accountType:l}=Mt();async function s(f){try{await a(f),r("TELEGRAM_AUTH_SCREEN")}catch(m){console.error(m),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 d9(Se,{onClick:c,disabled:n,children:[N2(ld,{}),"Telegram",l==="telegram"&&N2(c9,{color:"gray",children:"Recent"})]})},c9=l9(Rt)`
2332
+ `;import{useState as c9}from"react";import d9 from"styled-components";import{jsx as vn,jsxs as D2}from"react/jsx-runtime";function cd(e){return D2("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[vn("defs",{children:D2("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[vn("stop",{offset:"0",stopColor:"#1d93d2"}),vn("stop",{offset:"1",stopColor:"#38b0e3"})]})}),vn("title",{children:"Telegram_logo"}),vn("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),vn("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"}),vn("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"}),vn("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"})]})}import{jsx as U2,jsxs as u9}from"react/jsx-runtime";var dd=()=>{let{enabled:e,token:t}=Te(),{navigate:r,setModalData:o}=x(),[n,i]=c9(!1),{initLoginWithTelegram:a}=M(),{accountType:l}=Mt();async function s(f){try{await a(f),r("TELEGRAM_AUTH_SCREEN")}catch(m){console.error(m),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 u9(Se,{onClick:c,disabled:n,children:[U2(cd,{}),"Telegram",l==="telegram"&&U2(p9,{color:"gray",children:"Recent"})]})},p9=d9(Rt)`
2330
2333
  margin-left: auto;
2331
- `;import p9 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as D2,jsxs as u9}from"react/jsx-runtime";var dd=({onClick:e,text:t,icon:r})=>u9(Se,{onClick:e,children:[r,D2(yr,{children:t}),D2(p9,{})]});import{Fragment as hu,jsx as rt,jsxs as ud}from"react/jsx-runtime";var md=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{appearance:{palette:{colorScheme:i}}}=De(),{accountType:a,walletClientType:l}=Mt(),s=a?yn(a):null,c=o.loginMethodsAndOrder?.primary??[],f=o.loginMethodsAndOrder?.overflow??[],m=[...c,...f],u=o.loginMethods.passkey,C=[];l&&m.includes(l)?C.push(l):a&&m.includes(s?.loginMethod)&&C.push(s?.loginMethod);let[v,g]=U2("default"),[b,E]=U2(a==="phone"?"sms":"email");f9(()=>{a==="phone"&&E("sms");let U=m.indexOf("sms"),W=m.indexOf("email");U>-1&&U<W&&E("sms")},[a,c,f]);let R=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{g("default")},150)};n.current=R;let S=U=>U==="email"?rt(td,{isEditable:b==="email",setIsEditable:()=>{E("email")}},U):U==="sms"?rt(sd,{isEditable:b==="sms",setIsEditable:()=>{E("sms")}},U):U==="apple"?rt(dt,{provider:"apple"},U):U==="discord"?rt(dt,{provider:"discord"},U):U==="farcaster"?rt(rd,{},U):U==="github"?rt(dt,{provider:"github"},U):U==="google"?rt(dt,{provider:"google"},U):U==="linkedin"?rt(dt,{provider:"linkedin"},U):U==="spotify"?rt(dt,{provider:"spotify"},U):U==="instagram"?rt(dt,{provider:"instagram"},U):U==="tiktok"?rt(dt,{provider:"tiktok"},U):U==="twitter"&&(!h9||o?.loginConfig.twitterOAuthOnMobileEnabled)?rt(dt,{provider:"twitter"},U):U==="telegram"?rt(cd,{},U):rn([U],r,e,m,o.externalWallets.walletConnect.enabled),A=C.flatMap(S),k=c.filter(U=>U!==l&&U!==s?.loginMethod).flatMap(S),I=f.filter(U=>U!==l&&U!==s?.loginMethod).flatMap(S),F=[...A,...k,...I],G=g9({primary:k.length+A.length,overflow:I.length}),[Y,j]=Vm(F,G),L=v==="default"?void 0:()=>{g("default")};return ud(hu,{children:[rt(_,{title:o.appearance.landingHeader,onClose:R,backFn:L}),v==="default"&&rt(v9,{}),v==="default"&&(typeof o.appearance.loginMessage=="string"?rt(Yl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),rt(Kl,{style:{overflow:"hidden"},children:ud(Oh,{colorScheme:i,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[v==="default"&&ud(hu,{children:[...Y,j.length>0&&rt(dd,{text:"More options",icon:rt(m9,{}),onClick:()=>g("overflow")})]}),v==="overflow"&&ud(hu,{children:[...j]}),u&&v==="default"&&rt(jc,{})]})}),o&&rt(Ui,{app:o}),rt(q,{})]})},pd=5,g9=({primary:e,overflow:t})=>e<pd?e:e===pd&&t===0?pd:pd-1,v9=y9(Jc)`
2334
+ `;import m9 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as F2,jsxs as f9}from"react/jsx-runtime";var pd=({onClick:e,text:t,icon:r})=>f9(Se,{onClick:e,children:[r,F2(yr,{children:t}),F2(m9,{})]});import{Fragment as yu,jsx as rt,jsxs as md}from"react/jsx-runtime";var fd=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{appearance:{palette:{colorScheme:i}}}=De(),{accountType:a,walletClientType:l}=Mt(),s=a?yn(a):null,c=o.loginMethodsAndOrder?.primary??[],f=o.loginMethodsAndOrder?.overflow??[],m=[...c,...f],u=o.loginMethods.passkey,C=[];l&&m.includes(l)?C.push(l):a&&m.includes(s?.loginMethod)&&C.push(s?.loginMethod);let[v,g]=B2("default"),[b,E]=B2(a==="phone"?"sms":"email");y9(()=>{a==="phone"&&E("sms");let U=m.indexOf("sms"),W=m.indexOf("email");U>-1&&U<W&&E("sms")},[a,c,f]);let R=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{g("default")},150)};n.current=R;let S=U=>U==="email"?rt(rd,{isEditable:b==="email",setIsEditable:()=>{E("email")}},U):U==="sms"?rt(ld,{isEditable:b==="sms",setIsEditable:()=>{E("sms")}},U):U==="apple"?rt(dt,{provider:"apple"},U):U==="discord"?rt(dt,{provider:"discord"},U):U==="farcaster"?rt(od,{},U):U==="github"?rt(dt,{provider:"github"},U):U==="google"?rt(dt,{provider:"google"},U):U==="linkedin"?rt(dt,{provider:"linkedin"},U):U==="spotify"?rt(dt,{provider:"spotify"},U):U==="instagram"?rt(dt,{provider:"instagram"},U):U==="tiktok"?rt(dt,{provider:"tiktok"},U):U==="twitter"&&(!g9||o?.loginConfig.twitterOAuthOnMobileEnabled)?rt(dt,{provider:"twitter"},U):U==="telegram"?rt(dd,{},U):rn([U],r,e,m,o.externalWallets.walletConnect.enabled),A=C.flatMap(S),k=c.filter(U=>U!==l&&U!==s?.loginMethod).flatMap(S),I=f.filter(U=>U!==l&&U!==s?.loginMethod).flatMap(S),F=[...A,...k,...I],G=C9({primary:k.length+A.length,overflow:I.length}),[Y,j]=zm(F,G),L=v==="default"?void 0:()=>{g("default")};return md(yu,{children:[rt(_,{title:o.appearance.landingHeader,onClose:R,backFn:L}),v==="default"&&rt(w9,{}),v==="default"&&(typeof o.appearance.loginMessage=="string"?rt(Yl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),rt(Kl,{style:{overflow:"hidden"},children:md(Dh,{colorScheme:i,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[v==="default"&&md(yu,{children:[...Y,j.length>0&&rt(pd,{text:"More options",icon:rt(h9,{}),onClick:()=>g("overflow")})]}),v==="overflow"&&md(yu,{children:[...j]}),u&&v==="default"&&rt(Xc,{})]})}),o&&rt(Ui,{app:o}),rt(q,{})]})},ud=5,C9=({primary:e,overflow:t})=>e<ud?e:e===ud&&t===0?ud:ud-1,w9=v9($c)`
2332
2335
  margin-bottom: 16px;
2333
- `;import C9 from"@heroicons/react/24/outline/EnvelopeIcon";import w9 from"@heroicons/react/24/outline/PhoneIcon";import b9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as E9,useMemo as H2,useState as G2}from"react";import{isMobile as T9}from"react-device-detect";import S9 from"styled-components";import{toObjectKeys as A9}from"@privy-io/js-sdk-core";import{jsx as gs,jsxs as F2}from"react/jsx-runtime";var B2=({...e})=>F2("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[F2("g",{clipPath:"url(#clip0_2856_1743)",children:[gs("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"}),gs("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"})]}),gs("defs",{children:gs("clipPath",{id:"clip0_2856_1743",children:gs("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import{Fragment as vs,jsx as Ue,jsxs as ya}from"react/jsx-runtime";var fd=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=x(),i=De(),{accountType:a,walletClientType:l}=Mt(),s=a?yn(a):null,c=o?.login,f=H2(()=>c?.loginMethods?A9(c.loginMethods,!0):null,[c]),{email:m,sms:u,google:C,twitter:v,discord:g,github:b,spotify:E,instagram:R,tiktok:S,linkedin:A,apple:k,wallet:I,farcaster:F,telegram:G}=f??i.loginMethods,{passkey:Y}=i.loginMethods,j=[m&&"email",u&&"sms",C&&"google",v&&"twitter",g&&"discord",b&&"github",E&&"spotify",R&&"instagram",S&&"tiktok",A&&"linkedin",k&&"apple",F&&"farcaster",G&&"telegram"].filter(D=>!!D),L=j.length>0,U=H2(()=>I&&!L?"web3-first":I&&i?.appearance.loginGroupPriority||"web2-first",[I,L,i?.appearance.loginGroupPriority]),W=i?.appearance.hideDirectWeb2Inputs,[be,Re]=G2("default"),[re,ae]=G2(V2({accountType:a,sms:u,email:m}));E9(()=>{ae(V2({accountType:a,sms:u,email:m}))},[m,u,a]);let oe=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{Re("default")},150)};n.current=oe;let Ae=[];l&&I?Ae.push(l):s?.loginMethod&&j.includes(s.loginMethod)&&Ae.push(s.loginMethod);let Pe=D=>D==="email"?Ue(td,{isEditable:re==="email",setIsEditable:()=>{ae("email")}},D):D==="sms"?Ue(sd,{isEditable:re==="sms",setIsEditable:()=>{ae("sms")}},D):D==="apple"?Ue(dt,{provider:"apple"},D):D==="discord"?Ue(dt,{provider:"discord"},D):D==="farcaster"?Ue(rd,{},D):D==="github"?Ue(dt,{provider:"github"},D):D==="google"?Ue(dt,{provider:"google"},D):D==="linkedin"?Ue(dt,{provider:"linkedin"},D):D==="tiktok"?Ue(dt,{provider:"tiktok"},D):D==="spotify"?Ue(dt,{provider:"spotify"},D):D==="instagram"?Ue(dt,{provider:"instagram"},D):D==="twitter"&&(!T9||i?.loginConfig.twitterOAuthOnMobileEnabled)?Ue(dt,{provider:"twitter"},D):D==="telegram"?Ue(cd,{},D):rn([D],r,e,[],i.externalWallets.walletConnect.enabled),ze=rn(i.appearance.walletList.filter(D=>D!==l),r,e,[...i.appearance.walletList,l],i.externalWallets.walletConnect.enabled),Ke=j.filter(D=>D!==s?.loginMethod).flatMap(Pe),mt=Ae.flatMap(Pe);U==="web3-first"&&be==="default"?ze.unshift(...mt):U==="web2-first"&&Ke.unshift(...mt);let Je=be==="default"?void 0:()=>{Re("default")},le=j.filter(D=>D!=="email"&&D!=="sms"),Zt=x9({priority:U,email:m,sms:u,social:le}),mr=k9({priority:U,email:m,sms:u,social:le}),_r=_9({priority:U}),O=Ue(Xc,{text:_r,onClick:()=>Re("web3-overflow")}),We=Ue(dd,{text:Zt,icon:mr,onClick:()=>Re("web2-overflow")}),ft=W?0:1;return ya(vs,{children:[Ue(_,{title:i.appearance.landingHeader,onClose:oe,backFn:Je}),be==="default"&&Ue(P9,{}),be==="default"&&(typeof i.appearance.loginMessage=="string"?Ue(Yl,{children:i.appearance.loginMessage}):i.appearance.loginMessage),Ue(Kl,{style:{overflow:"hidden",padding:2},children:ya(nr,{children:[be==="default"&&U==="web2-first"&&ya(vs,{children:[...Ke.length>4?Ke.slice(0,3):Ke,Ke.length>4&&We,I&&O]}),be==="default"&&U==="web3-first"&&ya(vs,{children:[I&&ya(vs,{children:[...ze.length>4?ze.slice(0,3):ze,ze.length>4&&O]}),Ke.length>ft&&We,Ke.length===ft&&Ke[0]]}),be==="web2-overflow"&&ya(vs,{children:[...U==="web3-first"?Ke:Ke.slice(3)]}),...be==="web3-overflow"?ze:[],Y&&be==="default"&&Ue(jc,{})]})}),i&&Ue(Ui,{app:i}),Ue(q,{})]})},P9=S9(Jc)`
2336
+ `;import b9 from"@heroicons/react/24/outline/EnvelopeIcon";import E9 from"@heroicons/react/24/outline/PhoneIcon";import T9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as S9,useMemo as V2,useState as q2}from"react";import{isMobile as A9}from"react-device-detect";import P9 from"styled-components";import{toObjectKeys as x9}from"@privy-io/js-sdk-core";import{jsx as gs,jsxs as H2}from"react/jsx-runtime";var G2=({...e})=>H2("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[H2("g",{clipPath:"url(#clip0_2856_1743)",children:[gs("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"}),gs("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"})]}),gs("defs",{children:gs("clipPath",{id:"clip0_2856_1743",children:gs("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import{Fragment as vs,jsx as Ue,jsxs as ya}from"react/jsx-runtime";var hd=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=x(),i=De(),{accountType:a,walletClientType:l}=Mt(),s=a?yn(a):null,c=o?.login,f=V2(()=>c?.loginMethods?x9(c.loginMethods,!0):null,[c]),{email:m,sms:u,google:C,twitter:v,discord:g,github:b,spotify:E,instagram:R,tiktok:S,linkedin:A,apple:k,wallet:I,farcaster:F,telegram:G}=f??i.loginMethods,{passkey:Y}=i.loginMethods,j=[m&&"email",u&&"sms",C&&"google",v&&"twitter",g&&"discord",b&&"github",E&&"spotify",R&&"instagram",S&&"tiktok",A&&"linkedin",k&&"apple",F&&"farcaster",G&&"telegram"].filter(D=>!!D),L=j.length>0,U=V2(()=>I&&!L?"web3-first":I&&i?.appearance.loginGroupPriority||"web2-first",[I,L,i?.appearance.loginGroupPriority]),W=i?.appearance.hideDirectWeb2Inputs,[be,Re]=q2("default"),[re,oe]=q2(z2({accountType:a,sms:u,email:m}));S9(()=>{oe(z2({accountType:a,sms:u,email:m}))},[m,u,a]);let ne=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{Re("default")},150)};n.current=ne;let Ae=[];l&&I?Ae.push(l):s?.loginMethod&&j.includes(s.loginMethod)&&Ae.push(s.loginMethod);let Pe=D=>D==="email"?Ue(rd,{isEditable:re==="email",setIsEditable:()=>{oe("email")}},D):D==="sms"?Ue(ld,{isEditable:re==="sms",setIsEditable:()=>{oe("sms")}},D):D==="apple"?Ue(dt,{provider:"apple"},D):D==="discord"?Ue(dt,{provider:"discord"},D):D==="farcaster"?Ue(od,{},D):D==="github"?Ue(dt,{provider:"github"},D):D==="google"?Ue(dt,{provider:"google"},D):D==="linkedin"?Ue(dt,{provider:"linkedin"},D):D==="tiktok"?Ue(dt,{provider:"tiktok"},D):D==="spotify"?Ue(dt,{provider:"spotify"},D):D==="instagram"?Ue(dt,{provider:"instagram"},D):D==="twitter"&&(!A9||i?.loginConfig.twitterOAuthOnMobileEnabled)?Ue(dt,{provider:"twitter"},D):D==="telegram"?Ue(dd,{},D):rn([D],r,e,[],i.externalWallets.walletConnect.enabled),ze=rn(i.appearance.walletList.filter(D=>D!==l),r,e,[...i.appearance.walletList,l],i.externalWallets.walletConnect.enabled),Ke=j.filter(D=>D!==s?.loginMethod).flatMap(Pe),mt=Ae.flatMap(Pe);U==="web3-first"&&be==="default"?ze.unshift(...mt):U==="web2-first"&&Ke.unshift(...mt);let Ze=be==="default"?void 0:()=>{Re("default")},le=j.filter(D=>D!=="email"&&D!=="sms"),Zt=_9({priority:U,email:m,sms:u,social:le}),mr=R9({priority:U,email:m,sms:u,social:le}),_r=M9({priority:U}),O=Ue(Qc,{text:_r,onClick:()=>Re("web3-overflow")}),We=Ue(pd,{text:Zt,icon:mr,onClick:()=>Re("web2-overflow")}),ft=W?0:1;return ya(vs,{children:[Ue(_,{title:i.appearance.landingHeader,onClose:ne,backFn:Ze}),be==="default"&&Ue(k9,{}),be==="default"&&(typeof i.appearance.loginMessage=="string"?Ue(Yl,{children:i.appearance.loginMessage}):i.appearance.loginMessage),Ue(Kl,{style:{overflow:"hidden",padding:2},children:ya(nr,{children:[be==="default"&&U==="web2-first"&&ya(vs,{children:[...Ke.length>4?Ke.slice(0,3):Ke,Ke.length>4&&We,I&&O]}),be==="default"&&U==="web3-first"&&ya(vs,{children:[I&&ya(vs,{children:[...ze.length>4?ze.slice(0,3):ze,ze.length>4&&O]}),Ke.length>ft&&We,Ke.length===ft&&Ke[0]]}),be==="web2-overflow"&&ya(vs,{children:[...U==="web3-first"?Ke:Ke.slice(3)]}),...be==="web3-overflow"?ze:[],Y&&be==="default"&&Ue(Xc,{})]})}),i&&Ue(Ui,{app:i}),Ue(q,{})]})},k9=P9($c)`
2334
2337
  margin-bottom: 16px;
2335
- `,x9=({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",k9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?Ue(b9,{}):t&&r?Ue(B2,{}):t?Ue(C9,{}):r?Ue(w9,{}):null,_9=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",V2=({accountType:e,sms:t,email:r})=>e==="email"&&r?"email":e==="phone"&&t||t&&!r?"sms":"email";import{jsx as q2}from"react/jsx-runtime";var z2=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?q2(md,{connectOnly:!0}):q2(fd,{connectOnly:!0})};import{jsx as K2}from"react/jsx-runtime";var Y2=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?K2(md,{connectOnly:!1}):K2(fd,{connectOnly:!1})};import R9 from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as M9,jsx as Cn,jsxs as I9}from"react/jsx-runtime";var j2=()=>{let{app:e}=x();return I9(M9,{children:[Cn(_,{},"header"),Cn(ie,{}),Cn(fe,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:Cn(R9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Cn(lr,{children:Cn($c,{stacked:!0})}),Cn(se,{}),Cn(q,{})]})};import W9 from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as L9,jsx as wn,jsxs as O9}from"react/jsx-runtime";var X2=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=x(),{initLoginWithSms:i}=M();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 O9(L9,{children:[wn(_,{},"header"),wn(ie,{}),wn(fe,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:wn(W9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),wn(lr,{children:wn(gn,{stacked:!0,onSubmit:a,hideRecent:!0})}),wn(se,{}),wn(q,{})]})};import{Fragment as N9,jsx as Cs,jsxs as D9}from"react/jsx-runtime";var Q2=()=>{let{linkingOrConnectingHint:e}=M(),{app:t}=x(),r=e?`Link the wallet with address ${et(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return D9(N9,{children:[Cs(_,{},"header"),Cs(fo,{title:"Link your wallet",description:r}),Cs(nr,{children:Cs(Ki,{connectOnly:!1})}),Cs(q,{})]})};import{jsx as Z2,jsxs as U9}from"react/jsx-runtime";var J2=({style:e,...t})=>U9("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:[Z2("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),Z2("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"})]});import{Fragment as F9,jsx as bn,jsxs as $2}from"react/jsx-runtime";var e3=()=>{let{closePrivyModal:e}=M(),{navigate:t}=x();return $2(F9,{children:[bn(_,{},"header"),bn(ie,{}),bn(J2,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),bn(fo,{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"}}),$2(lr,{children:[bn(H,{onClick:()=>t("LANDING"),children:"Try again"}),bn(Kr,{onClick:()=>e(),children:"Cancel"})]}),bn(se,{}),bn(q,{})]})};import ET from"@heroicons/react/24/solid/CheckBadgeIcon";import TT from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import ST from"@heroicons/react/24/solid/IdentificationIcon";import AT from"@heroicons/react/24/solid/PhoneIcon";import PT from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import m3 from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as xT,useState as ga}from"react";import{useContext as B9}from"react";function ws(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=B9(we);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}import{useContext as H9}from"react";function $r(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=H9(we);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)}}import G9 from"styled-components";import{jsx as t3,jsxs as q9}from"react/jsx-runtime";var r3=e=>q9(V9,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[t3("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),t3("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"})]}),V9=G9.svg`
2338
+ `,_9=({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",R9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?Ue(T9,{}):t&&r?Ue(G2,{}):t?Ue(b9,{}):r?Ue(E9,{}):null,M9=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",z2=({accountType:e,sms:t,email:r})=>e==="email"&&r?"email":e==="phone"&&t||t&&!r?"sms":"email";import{jsx as K2}from"react/jsx-runtime";var Y2=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?K2(fd,{connectOnly:!0}):K2(hd,{connectOnly:!0})};import{jsx as j2}from"react/jsx-runtime";var X2=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?j2(fd,{connectOnly:!1}):j2(hd,{connectOnly:!1})};import I9 from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as W9,jsx as Cn,jsxs as L9}from"react/jsx-runtime";var Q2=()=>{let{app:e}=x();return L9(W9,{children:[Cn(_,{},"header"),Cn(ae,{}),Cn(fe,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:Cn(I9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Cn(lr,{children:Cn(ed,{stacked:!0})}),Cn(se,{}),Cn(q,{})]})};import O9 from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as N9,jsx as wn,jsxs as D9}from"react/jsx-runtime";var Z2=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=x(),{initLoginWithSms:i}=M();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 D9(N9,{children:[wn(_,{},"header"),wn(ae,{}),wn(fe,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:wn(O9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),wn(lr,{children:wn(gn,{stacked:!0,onSubmit:a,hideRecent:!0})}),wn(se,{}),wn(q,{})]})};import{Fragment as U9,jsx as Cs,jsxs as F9}from"react/jsx-runtime";var J2=()=>{let{linkingOrConnectingHint:e}=M(),{app:t}=x(),r=e?`Link the wallet with address ${et(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return F9(U9,{children:[Cs(_,{},"header"),Cs(fo,{title:"Link your wallet",description:r}),Cs(nr,{children:Cs(Ki,{connectOnly:!1})}),Cs(q,{})]})};import{jsx as $2,jsxs as B9}from"react/jsx-runtime";var e3=({style:e,...t})=>B9("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:[$2("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),$2("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"})]});import{Fragment as H9,jsx as bn,jsxs as t3}from"react/jsx-runtime";var r3=()=>{let{closePrivyModal:e}=M(),{navigate:t}=x();return t3(H9,{children:[bn(_,{},"header"),bn(ae,{}),bn(e3,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),bn(fo,{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"}}),t3(lr,{children:[bn(H,{onClick:()=>t("LANDING"),children:"Try again"}),bn(Kr,{onClick:()=>e(),children:"Cancel"})]}),bn(se,{}),bn(q,{})]})};import ST from"@heroicons/react/24/solid/CheckBadgeIcon";import AT from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import PT from"@heroicons/react/24/solid/IdentificationIcon";import xT from"@heroicons/react/24/solid/PhoneIcon";import kT from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import h3 from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as _T,useState as ga}from"react";import{useContext as G9}from"react";function ws(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=G9(we);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}import{useContext as V9}from"react";function $r(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=V9(we);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)}}import q9 from"styled-components";import{jsx as o3,jsxs as K9}from"react/jsx-runtime";var n3=e=>K9(z9,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[o3("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),o3("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"})]}),z9=q9.svg`
2336
2339
  height: 90px;
2337
2340
  width: 90px;
2338
2341
 
@@ -2343,7 +2346,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2343
2346
  > path {
2344
2347
  fill: white;
2345
2348
  }
2346
- `;import yu from"@heroicons/react/20/solid/CheckIcon";import z9 from"@heroicons/react/24/outline/ChevronRightIcon";import K9 from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import Y9 from"@heroicons/react/24/outline/FingerPrintIcon";import j9 from"@heroicons/react/24/outline/PhoneIcon";import gu from"@heroicons/react/24/outline/TrashIcon";import X9 from"@heroicons/react/24/solid/ShieldCheckIcon";import{Fragment as Q9,jsx as ke,jsxs as ur}from"react/jsx-runtime";var o3=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:c,setRemovingMfaMethod:f})=>{let m=t.reduce((C,v)=>({...C,[v]:!0}),{}),u=r.reduce((C,v)=>({...C,[v]:!0}),{});return ur(Q9,{children:[ke(_,{backFn:e?s:void 0,onClose:l},"header"),ke(Le,{children:ke(Ze,{children:ke(X9,{})})}),ke(pe,{children:"Choose a verification method"}),t.length>0?ke(me,{children:"To add or delete verification methods, verification is required."}):ke(me,{children:"How would you like to verify your identity? You can change this later."}),a&&ke($l,{style:{marginTop:"1.25rem"},children:a.message}),ur(jl,{children:[(u.totp||m.totp)&&ur(Xl,{children:[ke(Se,{style:{justifyContent:"center"},disabled:m.totp||n,onClick:()=>c("totp"),children:n?ke(ct,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):ur(Jl,{children:[ur(Zl,{children:[ke(K9,{}),"Authenticator App"]}),m.totp?ur(Kn,{children:[ke(yu,{}),"Added"]}):ke(Kn,{children:"Recommended"})]})}),m.totp&&ke(Ql,{onClick:()=>f("totp"),children:ke(gu,{})})]},"totp"),(u.sms||m.sms)&&ur(Xl,{children:[ke(Se,{disabled:m.sms||o,onClick:()=>c("sms"),children:ur(Jl,{children:[ur(Zl,{children:[ke(j9,{}),"SMS"]}),m.sms&&ur(Kn,{children:[ke(yu,{}),"Added"]}),o&&ke(Kn,{children:"Disabled"})]})}),m.sms&&ke(Ql,{onClick:()=>f("sms"),children:ke(gu,{})})]},"sms"),(u.passkey||m.passkey)&&ur(Xl,{children:[ke(Se,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:m.passkey||i,children:i?ke(ct,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):ur(Jl,{children:[ur(Zl,{children:[ke(Y9,{}),"Passkey"]}),m.passkey?ur(Kn,{children:[ke(yu,{}),"Added"]}):ke(Kn,{isAccent:!0,children:ke(z9,{})})]})}),m.passkey&&ke(Ql,{onClick:()=>f("passkey"),children:ke(gu,{})})]},"passkey")]}),ke(Z,{})]})};import Z9 from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import J9 from"@heroicons/react/24/outline/ClockIcon";import $9 from"@heroicons/react/24/outline/ShieldCheckIcon";import eT from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as tT,useState as bs}from"react";import hd from"styled-components";import{Fragment as vu,jsx as he,jsxs as Gr}from"react/jsx-runtime";var i3=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=z(),{data:n}=x(),{initLinkWithPasskey:i,linkWithPasskey:a}=M(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=$r(),[c,f]=bs(!1),[m,u]=bs(!1),[C,v]=bs(!1),[g,b]=bs(null),E=tT(()=>o?.linkedAccounts.filter(k=>k.type==="passkey")??[],[o]),R=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},S=async k=>{f(!0);try{await l(),await s({credentialIds:k}),v(!0)}catch(I){b(I)}finally{f(!1)}},A=async()=>{u(!0),b(null);try{await i();let I=(await a())?.linkedAccounts.filter(F=>F.type==="passkey").map(F=>F.credentialId)??[];await S(I)}catch(k){b(k)}finally{u(!1)}};return E.length===0||m?he(rT,{onReset:r,onClose:t,onClick:A,isCreating:m}):C?he(nT,{onClick:R,onClose:R}):g?he(ei,{error:g,backFn:()=>b(null),onClick:()=>b(null)}):he(oT,{passkeys:E,isSubmitting:c,isCreating:m,onReset:r,onClose:t,onSubmitEnrollment:()=>S(E.map(k=>k.credentialId)),onAddPasskey:A})},rT=({onReset:e,onClose:t,onClick:r,isCreating:o})=>Gr(vu,{children:[he(_,{backFn:e,onClose:t},"header"),he(Le,{children:Gr(Uc,{children:[he(ti,{}),he(ri,{})]})}),he(pe,{children:"Set up passkey verification"}),Gr(zn,{children:[Gr(ar,{children:[he(ir,{children:he($9,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),Gr(ar,{children:[he(ir,{children:he(J9,{})}),"Takes seconds to set up and use"]}),Gr(ar,{children:[he(ir,{children:he(Z9,{})}),"Use your passkey to verify transactions and login to your account"]})]}),he(H,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),he(Z,{})]}),oT=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=bs(!1),c=l?n.length:n.length>3?2:3;return Gr(vu,{children:[he(_,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&he(Le,{children:Gr(Uc,{children:[he(ti,{}),he(ri,{})]})}),he(pe,{children:"Enable your passkeys for verification"}),Gr(zn,{children:[n.slice(0,c).map(f=>Gr(iT,{children:[he(aT,{children:lT(f)}),Gr(sT,{children:["Last used: ",f.latestVerifiedAt?.toLocaleString()]})]},f.credentialId)),!l&&n.length>3&&he(n3,{onClick:()=>s(!0),children:"View All"})]}),he(H,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&he(n3,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?he(ct,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),he(Z,{})]})},nT=({onClick:e,onClose:t})=>Gr(vu,{children:[he(_,{onClose:t},"header"),he(Le,{children:he(Ze,{status:"success",children:he(eT,{})})}),he(pe,{children:"Passkey verification added"}),he(me,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),he(_t,{children:he(H,{onClick:e,children:"Done"})}),he(Z,{})]}),iT=hd.div`
2349
+ `;import gu from"@heroicons/react/20/solid/CheckIcon";import Y9 from"@heroicons/react/24/outline/ChevronRightIcon";import j9 from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import X9 from"@heroicons/react/24/outline/FingerPrintIcon";import Q9 from"@heroicons/react/24/outline/PhoneIcon";import vu from"@heroicons/react/24/outline/TrashIcon";import Z9 from"@heroicons/react/24/solid/ShieldCheckIcon";import{Fragment as J9,jsx as ke,jsxs as ur}from"react/jsx-runtime";var i3=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:c,setRemovingMfaMethod:f})=>{let m=t.reduce((C,v)=>({...C,[v]:!0}),{}),u=r.reduce((C,v)=>({...C,[v]:!0}),{});return ur(J9,{children:[ke(_,{backFn:e?s:void 0,onClose:l},"header"),ke(Le,{children:ke(Qe,{children:ke(Z9,{})})}),ke(de,{children:"Choose a verification method"}),t.length>0?ke(me,{children:"To add or delete verification methods, verification is required."}):ke(me,{children:"How would you like to verify your identity? You can change this later."}),a&&ke($l,{style:{marginTop:"1.25rem"},children:a.message}),ur(jl,{children:[(u.totp||m.totp)&&ur(Xl,{children:[ke(Se,{style:{justifyContent:"center"},disabled:m.totp||n,onClick:()=>c("totp"),children:n?ke(ct,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):ur(Jl,{children:[ur(Zl,{children:[ke(j9,{}),"Authenticator App"]}),m.totp?ur(Kn,{children:[ke(gu,{}),"Added"]}):ke(Kn,{children:"Recommended"})]})}),m.totp&&ke(Ql,{onClick:()=>f("totp"),children:ke(vu,{})})]},"totp"),(u.sms||m.sms)&&ur(Xl,{children:[ke(Se,{disabled:m.sms||o,onClick:()=>c("sms"),children:ur(Jl,{children:[ur(Zl,{children:[ke(Q9,{}),"SMS"]}),m.sms&&ur(Kn,{children:[ke(gu,{}),"Added"]}),o&&ke(Kn,{children:"Disabled"})]})}),m.sms&&ke(Ql,{onClick:()=>f("sms"),children:ke(vu,{})})]},"sms"),(u.passkey||m.passkey)&&ur(Xl,{children:[ke(Se,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:m.passkey||i,children:i?ke(ct,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):ur(Jl,{children:[ur(Zl,{children:[ke(X9,{}),"Passkey"]}),m.passkey?ur(Kn,{children:[ke(gu,{}),"Added"]}):ke(Kn,{isAccent:!0,children:ke(Y9,{})})]})}),m.passkey&&ke(Ql,{onClick:()=>f("passkey"),children:ke(vu,{})})]},"passkey")]}),ke(Z,{})]})};import $9 from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import eT from"@heroicons/react/24/outline/ClockIcon";import tT from"@heroicons/react/24/outline/ShieldCheckIcon";import rT from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as oT,useState as bs}from"react";import yd from"styled-components";import{Fragment as Cu,jsx as he,jsxs as Gr}from"react/jsx-runtime";var s3=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=K(),{data:n}=x(),{initLinkWithPasskey:i,linkWithPasskey:a}=M(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=$r(),[c,f]=bs(!1),[m,u]=bs(!1),[C,v]=bs(!1),[g,b]=bs(null),E=oT(()=>o?.linkedAccounts.filter(k=>k.type==="passkey")??[],[o]),R=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},S=async k=>{f(!0);try{await l(),await s({credentialIds:k}),v(!0)}catch(I){b(I)}finally{f(!1)}},A=async()=>{u(!0),b(null);try{await i();let I=(await a())?.linkedAccounts.filter(F=>F.type==="passkey").map(F=>F.credentialId)??[];await S(I)}catch(k){b(k)}finally{u(!1)}};return E.length===0||m?he(nT,{onReset:r,onClose:t,onClick:A,isCreating:m}):C?he(aT,{onClick:R,onClose:R}):g?he(ei,{error:g,backFn:()=>b(null),onClick:()=>b(null)}):he(iT,{passkeys:E,isSubmitting:c,isCreating:m,onReset:r,onClose:t,onSubmitEnrollment:()=>S(E.map(k=>k.credentialId)),onAddPasskey:A})},nT=({onReset:e,onClose:t,onClick:r,isCreating:o})=>Gr(Cu,{children:[he(_,{backFn:e,onClose:t},"header"),he(Le,{children:Gr(Fc,{children:[he(ti,{}),he(ri,{})]})}),he(de,{children:"Set up passkey verification"}),Gr(zn,{children:[Gr(ar,{children:[he(ir,{children:he(tT,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),Gr(ar,{children:[he(ir,{children:he(eT,{})}),"Takes seconds to set up and use"]}),Gr(ar,{children:[he(ir,{children:he($9,{})}),"Use your passkey to verify transactions and login to your account"]})]}),he(H,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),he(Z,{})]}),iT=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=bs(!1),c=l?n.length:n.length>3?2:3;return Gr(Cu,{children:[he(_,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&he(Le,{children:Gr(Fc,{children:[he(ti,{}),he(ri,{})]})}),he(de,{children:"Enable your passkeys for verification"}),Gr(zn,{children:[n.slice(0,c).map(f=>Gr(sT,{children:[he(lT,{children:dT(f)}),Gr(cT,{children:["Last used: ",f.latestVerifiedAt?.toLocaleString()]})]},f.credentialId)),!l&&n.length>3&&he(a3,{onClick:()=>s(!0),children:"View All"})]}),he(H,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&he(a3,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?he(ct,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),he(Z,{})]})},aT=({onClick:e,onClose:t})=>Gr(Cu,{children:[he(_,{onClose:t},"header"),he(Le,{children:he(Qe,{status:"success",children:he(rT,{})})}),he(de,{children:"Passkey verification added"}),he(me,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),he(_t,{children:he(H,{onClick:e,children:"Done"})}),he(Z,{})]}),sT=yd.div`
2347
2350
  && {
2348
2351
  padding: 0.75rem 1rem;
2349
2352
  text-align: left;
@@ -2351,19 +2354,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
2351
2354
  border: 1px solid var(--privy-color-foreground-4);
2352
2355
  width: 100%;
2353
2356
  }
2354
- `,aT=hd.div`
2357
+ `,lT=yd.div`
2355
2358
  font-size: 0.875rem;
2356
2359
  line-height: 1.375rem;
2357
2360
  font-weight: 500;
2358
2361
 
2359
2362
  color: var(--privy-color-foreground-1);
2360
- `,sT=hd.div`
2363
+ `,cT=yd.div`
2361
2364
  font-size: 0.75rem;
2362
2365
  font-weight: 400;
2363
2366
  line-height: 1.125rem;
2364
2367
 
2365
2368
  color: var(--privy-color-foreground-2);
2366
- `,lT=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",n3=hd.button`
2369
+ `,dT=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",a3=yd.button`
2367
2370
  && {
2368
2371
  width: 100%;
2369
2372
  font-size: 0.875rem;
@@ -2388,7 +2391,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2388
2391
  box-shadow: none;
2389
2392
  }
2390
2393
  }
2391
- `;import gT from"@heroicons/react/24/solid/CheckCircleIcon";import l3 from"@heroicons/react/24/solid/PhoneIcon";import{useState as yd}from"react";import{useState as Cu}from"react";import{isMobile as cT}from"react-device-detect";import s3 from"styled-components";import{Fragment as yT,jsx as Es,jsxs as hT}from"react/jsx-runtime";var Ts=6,dT=new Array(Ts).fill("");function pT(e){return e.replace(/\s+/g,"")}function wu(e){return/^[0-9]{1}$/.test(e)}function a3(e){return e.length===Ts&&e.every(wu)}function uT(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var si=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=Cu(dT),[a,l]=Cu(null),[s,c]=Cu(null),f=async v=>{v.preventDefault();let g=pT(v.currentTarget.value);if(g==="")return;let b=uT(n,wu),E=g.split(""),R=!E.every(wu),S=E.length+b>Ts;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 A=Number(v.currentTarget.name?.charAt(4)),k=[...g||[""]].slice(0,Ts-A),I=[...n.slice(0,A),...k,...n.slice(A+k.length)];i(I);let F=k.length,G=Math.min(Math.max(A+F,0),Ts-1);if(document.querySelector(`input[name=pin-${G}]`)?.focus(),a3(I))try{await e(I.join("")),document.querySelector(`input[name=pin-${G}]`)?.blur()}catch(j){c(1),l(j.message)}else try{await e(null)}catch(j){c(1),l(j.message)}},m=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(),a3(g)?e(g.join("")):e(null)},C=o?"success":!!(r||a)?"fail":"";return Es(yT,{children:hT(mT,{children:[Es("div",{children:n.map((v,g)=>Es("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:f,onKeyUp:b=>{b.key==="Backspace"&&m(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:C,autoComplete:cT?"one-time-code":"off",disabled:t},g))}),Es("div",{children:Es(fT,{fail:!!r||!!a,children:r||a})})]})})},mT=s3.div`
2394
+ `;import CT from"@heroicons/react/24/solid/CheckCircleIcon";import d3 from"@heroicons/react/24/solid/PhoneIcon";import{useState as gd}from"react";import{useState as wu}from"react";import{isMobile as pT}from"react-device-detect";import c3 from"styled-components";import{Fragment as vT,jsx as Es,jsxs as gT}from"react/jsx-runtime";var Ts=6,uT=new Array(Ts).fill("");function mT(e){return e.replace(/\s+/g,"")}function bu(e){return/^[0-9]{1}$/.test(e)}function l3(e){return e.length===Ts&&e.every(bu)}function fT(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var si=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=wu(uT),[a,l]=wu(null),[s,c]=wu(null),f=async v=>{v.preventDefault();let g=mT(v.currentTarget.value);if(g==="")return;let b=fT(n,bu),E=g.split(""),R=!E.every(bu),S=E.length+b>Ts;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 A=Number(v.currentTarget.name?.charAt(4)),k=[...g||[""]].slice(0,Ts-A),I=[...n.slice(0,A),...k,...n.slice(A+k.length)];i(I);let F=k.length,G=Math.min(Math.max(A+F,0),Ts-1);if(document.querySelector(`input[name=pin-${G}]`)?.focus(),l3(I))try{await e(I.join("")),document.querySelector(`input[name=pin-${G}]`)?.blur()}catch(j){c(1),l(j.message)}else try{await e(null)}catch(j){c(1),l(j.message)}},m=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(),l3(g)?e(g.join("")):e(null)},C=o?"success":!!(r||a)?"fail":"";return Es(vT,{children:gT(hT,{children:[Es("div",{children:n.map((v,g)=>Es("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:f,onKeyUp:b=>{b.key==="Backspace"&&m(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:C,autoComplete:pT?"one-time-code":"off",disabled:t},g))}),Es("div",{children:Es(yT,{fail:!!r||!!a,children:r||a})})]})})},hT=c3.div`
2392
2395
  display: flex;
2393
2396
  flex-direction: column;
2394
2397
  width: 100%;
@@ -2456,7 +2459,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2456
2459
  transform: translate(1px, 0px);
2457
2460
  }
2458
2461
  }
2459
- `,fT=s3.div`
2462
+ `,yT=c3.div`
2460
2463
  line-height: 20px;
2461
2464
  font-size: 13px;
2462
2465
  display: flex;
@@ -2464,7 +2467,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2464
2467
  width: 100%;
2465
2468
 
2466
2469
  color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
2467
- `;import{Fragment as bu,jsx as Fe,jsxs as li}from"react/jsx-runtime";var c3=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=yd(""),[i,a]=yd(!1),[l,s]=yd(null),[c,f]=yd("enroll"),{initEnrollmentWithSms:m,submitEnrollmentWithSms:u}=$r(),{app:C,data:v}=x();function g(){v?.mfaEnrollmentFlow?.onSuccess(),e()}async function b({qualifiedPhoneNumber:S}){try{await m({phoneNumber:S}),n(S),f("verify")}catch(A){s(A)}}async function E(S){try{if(!S)return;await u({phoneNumber:o,mfaCode:S}),a(!0)}catch(A){throw mc(A)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Jn(A)?new Error("The code you entered is not valid"):Zn(A)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):fc(A)?new Error("Verification canceled"):new Error("Unknown error")}}function R(){c==="verify"?f("enroll"):t()}return l?Fe(ei,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):c==="enroll"?li(bu,{children:[Fe(_,{backFn:t,onClose:r},"header"),Fe(Le,{children:Fe(Ze,{children:Fe(l3,{})})}),Fe(pe,{children:"Set up SMS verification"}),Fe(me,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),li(Or,{children:[Fe(gn,{onSubmit:b,hideRecent:!0}),li(Hh,{children:["By providing your mobile number, you agree to receive text messages from ",C?.name,". Some carrier charges may apply"]})]}),Fe(Z,{})]}):i?li(bu,{children:[Fe(_,{onClose:g},"header"),Fe(Le,{children:Fe(Ze,{status:"success",children:Fe(gT,{})})}),Fe(pe,{children:"SMS verification added"}),Fe(me,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),Fe(_t,{children:Fe(H,{onClick:g,children:"Done"})}),Fe(Z,{})]}):li(bu,{children:[Fe(_,{backFn:R,onClose:r},"header"),Fe(Le,{children:Fe(Ze,{children:Fe(l3,{})})}),Fe(pe,{children:"Enter enrollment code"}),li(Or,{children:[Fe(si,{onChange:E}),li(me,{children:["To continue, enter the 6-digit code sent to ",Fe("strong",{children:k2(o)})]})]}),Fe(Z,{})]})};import wT from"@heroicons/react/24/solid/CheckCircleIcon";import bT from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import{useState as p3}from"react";import vT from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as CT}from"react/jsx-runtime";var d3=({size:e,authUrl:t})=>CT(un,{url:t,squareLogoElement:vT,size:e,fgColor:"#1F1F1F"});import{Fragment as Eu,jsx as Ne,jsxs as Ss}from"react/jsx-runtime";var u3=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=p3("enroll"),[a,l]=p3(!1),{submitEnrollmentWithTotp:s}=$r(),{data:c}=x();function f(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function m(){i("verify")}async function u(v){try{if(!v)return;await s({mfaCode:v}),l(!0)}catch(g){throw mc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Jn(g)?new Error("The code you entered is not valid"):Zn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):fc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function C(){n==="verify"?i("enroll"):r()}return n==="enroll"?Ss(Eu,{children:[Ne(_,{backFn:r,onClose:t},"header"),Ne(pe,{children:"Scan QR code"}),Ne(me,{children:"Open your authenticator app and scan the QR code to continue."}),Ne(Fi,{children:Ne(d3,{authUrl:o.authUrl,size:200})}),Ss(_t,{children:[Ne(St,{children:Ne(pn,{itemName:"secret",text:o.secret})}),Ne(H,{onClick:m,children:"Continue"})]}),Ne(Z,{})]}):a?Ss(Eu,{children:[Ne(_,{onClose:f},"header"),Ne(Le,{children:Ne(Ze,{status:"success",children:Ne(wT,{})})}),Ne(pe,{children:"Authenticator app verification added"}),Ne(me,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),Ne(_t,{children:Ne(H,{onClick:f,children:"Done"})}),Ne(Z,{})]}):Ss(Eu,{children:[Ne(_,{backFn:C,onClose:t},"header"),Ne(Le,{children:Ne(Ze,{children:Ne(bT,{})})}),Ne(pe,{children:"Enter enrollment code"}),Ne(Or,{children:Ne(si,{onChange:u})}),Ss(me,{children:["To continue, enter the 6-digit code generated from your ",Ne("strong",{children:"authenticator app"})]}),Ne(Z,{})]})};import{Fragment as va,jsx as $,jsxs as Ar}from"react/jsx-runtime";var f3=()=>{let{user:e,enrollInMfa:t}=z(),[r,o]=ga(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=$r(),{app:l,ready:s,data:c,onUserCloseViaDialogOrKeybindRef:f}=x(),{closePrivyModal:m}=M(),{promptMfa:u}=ws(),{initEnrollmentWithTotp:C}=$r(),[v,g]=ga(!1),[b,E]=ga(null),[R,S]=ga(null),A=()=>{m({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),E(null)},500)},{initEnrollmentWithPasskey:k,submitEnrollmentWithPasskey:I}=$r(),[F,G]=ga(!1),[Y,j]=ga(null);f.current=A;let L=e?.mfaMethods.includes("sms"),U=!!e?.phone,W=e?.mfaMethods.includes("totp"),be=e?.mfaMethods.includes("passkey"),Re=L||W||be,re=e?.linkedAccounts.filter(le=>le.type==="passkey").map(le=>le.credentialId)??[];xT(()=>{Re&&g(!0)},[Re]);function ae(){o(null),E(null)}function oe(){g(!1)}async function Ae(){G(!0);try{await k(),await I({credentialIds:re})}catch(le){j(le)}finally{G(!1)}}async function Pe(le){if(await u().catch(j),le==="totp"){E(le),S(null),C().then(Zt=>{S(Zt)}).catch(()=>{S(null),ae()});return}if(le==="passkey"&&re.length===1)return await Ae();E(le)}if(!s||!e||!l)return Ar(va,{children:[$(_,{onClose:A},"header"),$(Le,{children:$(r3,{})}),$(Or,{children:$(ct,{})}),$(Z,{})]});async function ze(){o(null);try{await n()}catch{o(null)}}async function Ke(){o(null);try{await i()}catch{o(null)}}async function mt(){o(null);try{await u(),await a()}catch{o(null)}}if(r==="sms")return Ar(va,{children:[$(_,{backFn:ae,onClose:A},"header"),$(Le,{children:$(Ze,{children:$(AT,{})})}),$(pe,{children:"Remove SMS verification?"}),Ar(me,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(_t,{children:$(H,{warn:!0,onClick:ze,children:"Remove SMS for MFA"})}),$(Z,{})]});if(r==="totp")return Ar(va,{children:[$(_,{backFn:ae,onClose:A},"header"),$(Le,{children:$(Ze,{children:$(TT,{})})}),$(pe,{children:"Remove Authenticator App verification?"}),Ar(me,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(_t,{children:$(H,{warn:!0,onClick:Ke,children:"Remove Authenticator App for MFA"})}),$(Z,{})]});if(r==="passkey")return Ar(va,{children:[$(_,{backFn:ae,onClose:A},"header"),$(Le,{children:$(Ze,{children:$(PT,{})})}),$(pe,{children:"Are you sure you want to remove passkey verification?"}),$(me,{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."}),$(_t,{children:$(H,{warn:!0,onClick:mt,children:"Yes, remove"})}),$(Z,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!Re)return Ar(va,{children:[$(_,{onClose:A},"header"),$(Le,{children:$(Ze,{children:$(m3,{})})}),$(pe,{children:"Add more security"}),Ar(me,{children:[l?.name," does not have any verification methods enabled."]}),$(_t,{children:$(H,{onClick:A,children:"Close"})}),$(Z,{})]});let Je=!Re&&!v;return Je?Ar(va,{children:[$(_,{onClose:A},"header"),$(Le,{children:$(Ze,{children:$(m3,{})})}),$(pe,{children:"Transaction Protection"}),$(me,{children:"Set up transaction protection to add an extra layer of security to your account"}),Ar(zn,{children:[Ar(ar,{children:[$(ir,{children:$(ET,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),Ar(ar,{children:[$(ir,{children:$(ST,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),Ar(_t,{children:[$(H,{onClick:()=>g(!0),children:"Continue"}),$(Kr,{onClick:A,children:"Not now"})]}),$(Z,{})]}):b==="sms"?$(c3,{onComplete:A,onReset:ae,onClose:A}):b==="totp"&&R?$(u3,{onComplete:A,onClose:A,onReset:ae,totpInfo:R}):b==="passkey"?$(i3,{onComplete:A,onReset:ae,onClose:A}):$(o3,{showIntro:Je,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:U,onBackToIntro:oe,handleSelectMethod:Pe,isTotpLoading:b==="totp"&&!R,isPasskeyLoading:F,error:Y,onClose:A,setRemovingMfaMethod:o})};import aS from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import sS from"@heroicons/react/24/outline/FingerPrintIcon";import lS from"@heroicons/react/24/outline/PhoneIcon";import cS from"@heroicons/react/24/outline/ShieldCheckIcon";import dS from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import pS from"@heroicons/react/24/solid/PhoneIcon";import{useEffect as uS,useState as xs}from"react";import{useMemo as ZT,useEffect as JT,useState as N3}from"react";import $T from"styled-components";import{calculateTotalGasEstimate as eS,populateTransactionRequest as tS}from"@privy-io/js-sdk-core";import L3 from"styled-components";import y3 from"styled-components";import{jsx as h3,jsxs as RT}from"react/jsx-runtime";var gd=({label:e,children:t,valueStyles:r})=>RT(kT,{children:[h3("div",{children:e}),h3(_T,{style:{...r},children:t})]}),kT=y3.div`
2470
+ `;import{Fragment as Eu,jsx as Fe,jsxs as li}from"react/jsx-runtime";var p3=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=gd(""),[i,a]=gd(!1),[l,s]=gd(null),[c,f]=gd("enroll"),{initEnrollmentWithSms:m,submitEnrollmentWithSms:u}=$r(),{app:C,data:v}=x();function g(){v?.mfaEnrollmentFlow?.onSuccess(),e()}async function b({qualifiedPhoneNumber:S}){try{await m({phoneNumber:S}),n(S),f("verify")}catch(A){s(A)}}async function E(S){try{if(!S)return;await u({phoneNumber:o,mfaCode:S}),a(!0)}catch(A){throw mc(A)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Jn(A)?new Error("The code you entered is not valid"):Zn(A)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):fc(A)?new Error("Verification canceled"):new Error("Unknown error")}}function R(){c==="verify"?f("enroll"):t()}return l?Fe(ei,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):c==="enroll"?li(Eu,{children:[Fe(_,{backFn:t,onClose:r},"header"),Fe(Le,{children:Fe(Qe,{children:Fe(d3,{})})}),Fe(de,{children:"Set up SMS verification"}),Fe(me,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),li(Or,{children:[Fe(gn,{onSubmit:b,hideRecent:!0}),li(Vh,{children:["By providing your mobile number, you agree to receive text messages from ",C?.name,". Some carrier charges may apply"]})]}),Fe(Z,{})]}):i?li(Eu,{children:[Fe(_,{onClose:g},"header"),Fe(Le,{children:Fe(Qe,{status:"success",children:Fe(CT,{})})}),Fe(de,{children:"SMS verification added"}),Fe(me,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),Fe(_t,{children:Fe(H,{onClick:g,children:"Done"})}),Fe(Z,{})]}):li(Eu,{children:[Fe(_,{backFn:R,onClose:r},"header"),Fe(Le,{children:Fe(Qe,{children:Fe(d3,{})})}),Fe(de,{children:"Enter enrollment code"}),li(Or,{children:[Fe(si,{onChange:E}),li(me,{children:["To continue, enter the 6-digit code sent to ",Fe("strong",{children:R2(o)})]})]}),Fe(Z,{})]})};import ET from"@heroicons/react/24/solid/CheckCircleIcon";import TT from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import{useState as m3}from"react";import wT from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as bT}from"react/jsx-runtime";var u3=({size:e,authUrl:t})=>bT(un,{url:t,squareLogoElement:wT,size:e,fgColor:"#1F1F1F"});import{Fragment as Tu,jsx as Ne,jsxs as Ss}from"react/jsx-runtime";var f3=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=m3("enroll"),[a,l]=m3(!1),{submitEnrollmentWithTotp:s}=$r(),{data:c}=x();function f(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function m(){i("verify")}async function u(v){try{if(!v)return;await s({mfaCode:v}),l(!0)}catch(g){throw mc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Jn(g)?new Error("The code you entered is not valid"):Zn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):fc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function C(){n==="verify"?i("enroll"):r()}return n==="enroll"?Ss(Tu,{children:[Ne(_,{backFn:r,onClose:t},"header"),Ne(de,{children:"Scan QR code"}),Ne(me,{children:"Open your authenticator app and scan the QR code to continue."}),Ne(Fi,{children:Ne(u3,{authUrl:o.authUrl,size:200})}),Ss(_t,{children:[Ne(St,{children:Ne(pn,{itemName:"secret",text:o.secret})}),Ne(H,{onClick:m,children:"Continue"})]}),Ne(Z,{})]}):a?Ss(Tu,{children:[Ne(_,{onClose:f},"header"),Ne(Le,{children:Ne(Qe,{status:"success",children:Ne(ET,{})})}),Ne(de,{children:"Authenticator app verification added"}),Ne(me,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),Ne(_t,{children:Ne(H,{onClick:f,children:"Done"})}),Ne(Z,{})]}):Ss(Tu,{children:[Ne(_,{backFn:C,onClose:t},"header"),Ne(Le,{children:Ne(Qe,{children:Ne(TT,{})})}),Ne(de,{children:"Enter enrollment code"}),Ne(Or,{children:Ne(si,{onChange:u})}),Ss(me,{children:["To continue, enter the 6-digit code generated from your ",Ne("strong",{children:"authenticator app"})]}),Ne(Z,{})]})};import{Fragment as va,jsx as ee,jsxs as Ar}from"react/jsx-runtime";var y3=()=>{let{user:e,enrollInMfa:t}=K(),[r,o]=ga(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=$r(),{app:l,ready:s,data:c,onUserCloseViaDialogOrKeybindRef:f}=x(),{closePrivyModal:m}=M(),{promptMfa:u}=ws(),{initEnrollmentWithTotp:C}=$r(),[v,g]=ga(!1),[b,E]=ga(null),[R,S]=ga(null),A=()=>{m({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),E(null)},500)},{initEnrollmentWithPasskey:k,submitEnrollmentWithPasskey:I}=$r(),[F,G]=ga(!1),[Y,j]=ga(null);f.current=A;let L=e?.mfaMethods.includes("sms"),U=!!e?.phone,W=e?.mfaMethods.includes("totp"),be=e?.mfaMethods.includes("passkey"),Re=L||W||be,re=e?.linkedAccounts.filter(le=>le.type==="passkey").map(le=>le.credentialId)??[];_T(()=>{Re&&g(!0)},[Re]);function oe(){o(null),E(null)}function ne(){g(!1)}async function Ae(){G(!0);try{await k(),await I({credentialIds:re})}catch(le){j(le)}finally{G(!1)}}async function Pe(le){if(await u().catch(j),le==="totp"){E(le),S(null),C().then(Zt=>{S(Zt)}).catch(()=>{S(null),oe()});return}if(le==="passkey"&&re.length===1)return await Ae();E(le)}if(!s||!e||!l)return Ar(va,{children:[ee(_,{onClose:A},"header"),ee(Le,{children:ee(n3,{})}),ee(Or,{children:ee(ct,{})}),ee(Z,{})]});async function ze(){o(null);try{await n()}catch{o(null)}}async function Ke(){o(null);try{await i()}catch{o(null)}}async function mt(){o(null);try{await u(),await a()}catch{o(null)}}if(r==="sms")return Ar(va,{children:[ee(_,{backFn:oe,onClose:A},"header"),ee(Le,{children:ee(Qe,{children:ee(xT,{})})}),ee(de,{children:"Remove SMS verification?"}),Ar(me,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),ee(_t,{children:ee(H,{warn:!0,onClick:ze,children:"Remove SMS for MFA"})}),ee(Z,{})]});if(r==="totp")return Ar(va,{children:[ee(_,{backFn:oe,onClose:A},"header"),ee(Le,{children:ee(Qe,{children:ee(AT,{})})}),ee(de,{children:"Remove Authenticator App verification?"}),Ar(me,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),ee(_t,{children:ee(H,{warn:!0,onClick:Ke,children:"Remove Authenticator App for MFA"})}),ee(Z,{})]});if(r==="passkey")return Ar(va,{children:[ee(_,{backFn:oe,onClose:A},"header"),ee(Le,{children:ee(Qe,{children:ee(kT,{})})}),ee(de,{children:"Are you sure you want to remove passkey verification?"}),ee(me,{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."}),ee(_t,{children:ee(H,{warn:!0,onClick:mt,children:"Yes, remove"})}),ee(Z,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!Re)return Ar(va,{children:[ee(_,{onClose:A},"header"),ee(Le,{children:ee(Qe,{children:ee(h3,{})})}),ee(de,{children:"Add more security"}),Ar(me,{children:[l?.name," does not have any verification methods enabled."]}),ee(_t,{children:ee(H,{onClick:A,children:"Close"})}),ee(Z,{})]});let Ze=!Re&&!v;return Ze?Ar(va,{children:[ee(_,{onClose:A},"header"),ee(Le,{children:ee(Qe,{children:ee(h3,{})})}),ee(de,{children:"Transaction Protection"}),ee(me,{children:"Set up transaction protection to add an extra layer of security to your account"}),Ar(zn,{children:[Ar(ar,{children:[ee(ir,{children:ee(ST,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),Ar(ar,{children:[ee(ir,{children:ee(PT,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),Ar(_t,{children:[ee(H,{onClick:()=>g(!0),children:"Continue"}),ee(Kr,{onClick:A,children:"Not now"})]}),ee(Z,{})]}):b==="sms"?ee(p3,{onComplete:A,onReset:oe,onClose:A}):b==="totp"&&R?ee(f3,{onComplete:A,onClose:A,onReset:oe,totpInfo:R}):b==="passkey"?ee(s3,{onComplete:A,onReset:oe,onClose:A}):ee(i3,{showIntro:Ze,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:U,onBackToIntro:ne,handleSelectMethod:Pe,isTotpLoading:b==="totp"&&!R,isPasskeyLoading:F,error:Y,onClose:A,setRemovingMfaMethod:o})};import lS from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import cS from"@heroicons/react/24/outline/FingerPrintIcon";import dS from"@heroicons/react/24/outline/PhoneIcon";import pS from"@heroicons/react/24/outline/ShieldCheckIcon";import uS from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import mS from"@heroicons/react/24/solid/PhoneIcon";import{useEffect as fS,useState as xs}from"react";import{useMemo as $T,useEffect as eS,useState as U3}from"react";import tS from"styled-components";import{calculateTotalGasEstimate as rS,populateTransactionRequest as oS}from"@privy-io/js-sdk-core";import N3 from"styled-components";import v3 from"styled-components";import{jsx as g3,jsxs as IT}from"react/jsx-runtime";var vd=({label:e,children:t,valueStyles:r})=>IT(RT,{children:[g3("div",{children:e}),g3(MT,{style:{...r},children:t})]}),RT=v3.div`
2468
2471
  display: flex;
2469
2472
  align-items: center;
2470
2473
  justify-content: space-between;
@@ -2479,7 +2482,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2479
2482
  color: var(--privy-color-foreground-2);
2480
2483
  text-align: right;
2481
2484
  }
2482
- `,_T=y3.div`
2485
+ `,MT=v3.div`
2483
2486
  font-size: 14px;
2484
2487
  line-height: 100%;
2485
2488
  display: flex;
@@ -2488,28 +2491,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
2488
2491
  border-radius: var(--privy-border-radius-full);
2489
2492
  background-color: var(--privy-color-background-2);
2490
2493
  padding: 4px 8px;
2491
- `;import Cd from"styled-components";import{Fragment as LT,jsx as vd,jsxs as g3}from"react/jsx-runtime";var v3=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=os(e),n=t?wo(o,t):void 0,i=At(o,r);return vd(C3,{children:n||i})},Tu=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=os(e),n=t?wo(o,t):void 0,i=At(o,r);return vd(C3,{children:n?g3(LT,{children:[vd(MT,{children:"USD"}),n==="<$0.01"?g3(WT,{children:[vd(IT,{children:"<"}),"$0.01"]}):n]}):i})},C3=Cd.span`
2494
+ `;import wd from"styled-components";import{Fragment as NT,jsx as Cd,jsxs as C3}from"react/jsx-runtime";var w3=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=os(e),n=t?wo(o,t):void 0,i=At(o,r);return Cd(b3,{children:n||i})},Su=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=os(e),n=t?wo(o,t):void 0,i=At(o,r);return Cd(b3,{children:n?C3(NT,{children:[Cd(WT,{children:"USD"}),n==="<$0.01"?C3(OT,{children:[Cd(LT,{children:"<"}),"$0.01"]}):n]}):i})},b3=wd.span`
2492
2495
  font-size: 14px;
2493
2496
  line-height: 140%;
2494
2497
  display: flex;
2495
2498
  gap: 4px;
2496
2499
  align-items: center;
2497
- `,MT=Cd.span`
2500
+ `,WT=wd.span`
2498
2501
  font-size: 12px;
2499
2502
  line-height: 12px;
2500
2503
  color: var(--privy-color-foreground-3);
2501
- `,IT=Cd.span`
2504
+ `,LT=wd.span`
2502
2505
  font-size: 10px;
2503
- `,WT=Cd.span`
2506
+ `,OT=wd.span`
2504
2507
  display: flex;
2505
2508
  align-items: center;
2506
- `;import Su from"styled-components";import{QuantityToBigNumber as w3}from"@privy-io/js-sdk-core";import{jsx as En,jsxs as wd}from"react/jsx-runtime";var b3=({gas:e,tokenPrice:t,tokenSymbol:r})=>wd(en,{style:{paddingBottom:"12px"},children:[wd(T3,{children:[En(A3,{children:"Est. Fees"}),En("div",{children:En(Tu,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&En(S3,{children:`${At(e,r)}`})]}),E3=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=w3(e.value||0).add(w3(t)).toHexString();return wd(en,{children:[wd(T3,{children:[En(A3,{children:"Total (including fees)"}),En("div",{children:En(Tu,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&En(S3,{children:At(n,o)})]})},T3=Su.div`
2509
+ `;import Au from"styled-components";import{QuantityToBigNumber as E3}from"@privy-io/js-sdk-core";import{jsx as En,jsxs as bd}from"react/jsx-runtime";var T3=({gas:e,tokenPrice:t,tokenSymbol:r})=>bd(en,{style:{paddingBottom:"12px"},children:[bd(A3,{children:[En(x3,{children:"Est. Fees"}),En("div",{children:En(Su,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&En(P3,{children:`${At(e,r)}`})]}),S3=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=E3(e.value||0).add(E3(t)).toHexString();return bd(en,{children:[bd(A3,{children:[En(x3,{children:"Total (including fees)"}),En("div",{children:En(Su,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&En(P3,{children:At(n,o)})]})},A3=Au.div`
2507
2510
  display: flex;
2508
2511
  flex-direction: row;
2509
2512
  justify-content: space-between;
2510
2513
  align-items: center;
2511
2514
  padding-top: 4px;
2512
- `,S3=Su.div`
2515
+ `,P3=Au.div`
2513
2516
  display: flex;
2514
2517
  flex-direction: row;
2515
2518
  height: 12px;
@@ -2518,23 +2521,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
2518
2521
  line-height: 12px;
2519
2522
  color: var(--privy-color-foreground-3);
2520
2523
  font-weight: 400;
2521
- `,A3=Su.div`
2524
+ `,x3=Au.div`
2522
2525
  font-size: 14px;
2523
2526
  line-height: 22.4px;
2524
2527
  font-weight: 400;
2525
- `;import OT from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as ci,useState as NT}from"react";import Tn from"styled-components";import{createContext as P3,useContext as Dre}from"react";var Ca=P3(void 0);var As=P3(void 0);import{Fragment as qT,jsx as eo,jsxs as x3}from"react/jsx-runtime";var k3=({defaultValue:e,children:t})=>{let[r,o]=NT(e||null),n=i=>{o(r===i?null:i)};return eo(Ca.Provider,{value:{activePanel:r,togglePanel:n},children:eo(DT,{children:t})})},_3=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=ci(Ca),n=r===e;return eo(As.Provider,{value:{onToggle:()=>o(e),value:e},children:eo(HT,{isActive:n,"data-open":n,children:t})})},R3=({children:e})=>{let{activePanel:t}=ci(Ca),{onToggle:r,value:o}=ci(As),n=t===o;return x3(qT,{children:[x3(UT,{onClick:r,"data-open":n,children:[eo(BT,{children:e}),eo(VT,{isactive:n,children:eo(OT,{height:"16px",width:"16px",strokeWidth:"2"})})]}),eo(FT,{})]})},M3=({children:e})=>{let{activePanel:t}=ci(Ca),{value:r}=ci(As);return eo(GT,{"data-open":t===r,children:eo(W3,{children:e})})},I3=({children:e})=>{let{activePanel:t}=ci(Ca),{value:r}=ci(As);return eo(W3,{children:typeof e=="function"?e({isActive:t===r}):e})},DT=Tn.div`
2528
+ `;import DT from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as ci,useState as UT}from"react";import Tn from"styled-components";import{createContext as k3,useContext as Bre}from"react";var Ca=k3(void 0);var As=k3(void 0);import{Fragment as KT,jsx as eo,jsxs as _3}from"react/jsx-runtime";var R3=({defaultValue:e,children:t})=>{let[r,o]=UT(e||null),n=i=>{o(r===i?null:i)};return eo(Ca.Provider,{value:{activePanel:r,togglePanel:n},children:eo(FT,{children:t})})},M3=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=ci(Ca),n=r===e;return eo(As.Provider,{value:{onToggle:()=>o(e),value:e},children:eo(VT,{isActive:n,"data-open":n,children:t})})},I3=({children:e})=>{let{activePanel:t}=ci(Ca),{onToggle:r,value:o}=ci(As),n=t===o;return _3(KT,{children:[_3(BT,{onClick:r,"data-open":n,children:[eo(GT,{children:e}),eo(zT,{isactive:n,children:eo(DT,{height:"16px",width:"16px",strokeWidth:"2"})})]}),eo(HT,{})]})},W3=({children:e})=>{let{activePanel:t}=ci(Ca),{value:r}=ci(As);return eo(qT,{"data-open":t===r,children:eo(O3,{children:e})})},L3=({children:e})=>{let{activePanel:t}=ci(Ca),{value:r}=ci(As);return eo(O3,{children:typeof e=="function"?e({isActive:t===r}):e})},FT=Tn.div`
2526
2529
  display: flex;
2527
2530
  flex-direction: column;
2528
2531
  width: 100%;
2529
2532
  gap: 8px;
2530
- `,UT=Tn.div`
2533
+ `,BT=Tn.div`
2531
2534
  display: flex;
2532
2535
  justify-content: space-between;
2533
2536
  align-items: center;
2534
2537
  width: 100%;
2535
2538
  cursor: pointer;
2536
2539
  padding-bottom: 8px;
2537
- `,FT=Tn.div`
2540
+ `,HT=Tn.div`
2538
2541
  width: 100%;
2539
2542
 
2540
2543
  && {
@@ -2542,13 +2545,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2542
2545
  border-color: var(--privy-color-foreground-4);
2543
2546
  }
2544
2547
  padding-bottom: 12px;
2545
- `,BT=Tn.div`
2548
+ `,GT=Tn.div`
2546
2549
  font-size: 14px;
2547
2550
  font-weight: 500;
2548
2551
  line-height: 19.6px;
2549
2552
  width: 100%;
2550
2553
  padding-right: 8px;
2551
- `,HT=Tn.div`
2554
+ `,VT=Tn.div`
2552
2555
  display: flex;
2553
2556
  flex-direction: column;
2554
2557
  width: 100%;
@@ -2560,7 +2563,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2560
2563
  border-color: var(--privy-color-foreground-4);
2561
2564
  border-radius: var(--privy-border-radius-md);
2562
2565
  }
2563
- `,GT=Tn.div`
2566
+ `,qT=Tn.div`
2564
2567
  position: relative;
2565
2568
  overflow: hidden;
2566
2569
  transition: max-height 25ms ease-out;
@@ -2572,36 +2575,36 @@ You will need this password to access your ${e} wallet on a new device. Please k
2572
2575
  &[data-open='false'] {
2573
2576
  max-height: 0;
2574
2577
  }
2575
- `,W3=Tn.div`
2578
+ `,O3=Tn.div`
2576
2579
  display: flex;
2577
2580
  flex-direction: column;
2578
2581
  gap: 12px;
2579
2582
  flex: 1 1 auto;
2580
2583
  min-height: 1px;
2581
- `,VT=Tn.div`
2584
+ `,zT=Tn.div`
2582
2585
  transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2583
- `;import zT from"styled-components";import{jsx as YT}from"react/jsx-runtime";var Au=({walletAddress:e,chainId:t=Mo})=>YT(KT,{href:Kg(t,e),target:"_blank",children:et(e)}),KT=zT.a`
2586
+ `;import YT from"styled-components";import{jsx as XT}from"react/jsx-runtime";var Pu=({walletAddress:e,chainId:t=Mo})=>XT(jT,{href:jg(t,e),target:"_blank",children:et(e)}),jT=YT.a`
2584
2587
  &:hover {
2585
2588
  text-decoration: underline;
2586
2589
  }
2587
- `;import{jsx as Pr,jsxs as Pu}from"react/jsx-runtime";var bd=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0,s=De();return Pr(k3,{...s.render.standalone?{defaultValue:"details"}:{},children:Pu(_3,{value:"details",children:[Pr(R3,{children:Pu(jT,{children:[Pr("div",{children:o?.title||o?.actionDescription||"Details"}),Pr(XT,{children:Pr(v3,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),Pu(M3,{children:[Pr(gd,{label:"From",children:Pr(Au,{walletAddress:e,chainId:r.chainId||Mo})}),Pr(gd,{label:"To",children:Pr(Au,{walletAddress:t,chainId:r.chainId||Mo})}),o&&o.action&&Pr(gd,{label:"Action",children:o.action}),i&&Pr(b3,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),Pr(I3,{children:({isActive:c})=>Pr(E3,{transactionData:r,displayFee:c,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},jT=L3.div`
2590
+ `;import{jsx as Pr,jsxs as xu}from"react/jsx-runtime";var Ed=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0,s=De();return Pr(R3,{...s.render.standalone?{defaultValue:"details"}:{},children:xu(M3,{value:"details",children:[Pr(I3,{children:xu(QT,{children:[Pr("div",{children:o?.title||o?.actionDescription||"Details"}),Pr(ZT,{children:Pr(w3,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),xu(W3,{children:[Pr(vd,{label:"From",children:Pr(Pu,{walletAddress:e,chainId:r.chainId||Mo})}),Pr(vd,{label:"To",children:Pr(Pu,{walletAddress:t,chainId:r.chainId||Mo})}),o&&o.action&&Pr(vd,{label:"Action",children:o.action}),i&&Pr(T3,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),Pr(L3,{children:({isActive:c})=>Pr(S3,{transactionData:r,displayFee:c,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},QT=N3.div`
2588
2591
  display: flex;
2589
2592
  flex-direction: row;
2590
2593
  justify-content: space-between;
2591
- `,XT=L3.div`
2594
+ `,ZT=N3.div`
2592
2595
  flex-shrink: 0;
2593
2596
  padding-left: 8px;
2594
- `;import QT from"styled-components";var O3=QT.img`
2597
+ `;import JT from"styled-components";var D3=JT.img`
2595
2598
  && {
2596
2599
  height: ${e=>e.size==="sm"?"65px":"140px"};
2597
2600
  width: ${e=>e.size==="sm"?"65px":"140px"};
2598
2601
  border-radius: 16px;
2599
2602
  margin-bottom: 12px;
2600
2603
  }
2601
- `;import{jsx as D3}from"react/jsx-runtime";var Ps=({pendingTransaction:e})=>{let{getAccessToken:t}=z(),{wallets:r}=Jr(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=M(),[s,c]=N3(null),[f,m]=N3(e),{tokenPrice:u}=Co(f),C=l(e.chainId)||"ETH",v=ZT(()=>r.find(g=>g.walletClientType==="privy"),[r]);return JT(()=>{async function g(){if(!await t()||!o||!v)return f;let E=Mr(f.chainId,i,n,{appId:a}),R=await tS(v.address,f,E),{totalGasEstimate:S}=await eS(R,E);return c(S.toHexString()),R}g().then(m).catch(console.error)},[o]),v?D3(rS,{children:D3(bd,{from:v.address,to:f.to,txn:f,gas:s??void 0,tokenPrice:u,tokenSymbol:C})}):null},rS=$T.div`
2604
+ `;import{jsx as F3}from"react/jsx-runtime";var Ps=({pendingTransaction:e})=>{let{getAccessToken:t}=K(),{wallets:r}=Jr(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=M(),[s,c]=U3(null),[f,m]=U3(e),{tokenPrice:u}=Co(f),C=l(e.chainId)||"ETH",v=$T(()=>r.find(g=>g.walletClientType==="privy"),[r]);return eS(()=>{async function g(){if(!await t()||!o||!v)return f;let E=Mr(f.chainId,i,n,{appId:a}),R=await oS(v.address,f,E),{totalGasEstimate:S}=await rS(R,E);return c(S.toHexString()),R}g().then(m).catch(console.error)},[o]),v?F3(nS,{children:F3(Ed,{from:v.address,to:f.to,txn:f,gas:s??void 0,tokenPrice:u,tokenSymbol:C})}):null},nS=tS.div`
2602
2605
  width: 100%;
2603
2606
  padding: 1rem 0;
2604
- `;import oS from"@heroicons/react/24/outline/CalendarIcon";import nS from"@heroicons/react/24/outline/ExclamationTriangleIcon";import iS from"@heroicons/react/24/outline/ShieldCheckIcon";import{Fragment as U3,jsx as Ft,jsxs as wa}from"react/jsx-runtime";var F3=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=M();return wa(U3,{children:[Ft(_,{onClose:r},"header"),Ft(tt,{children:wa("div",{children:[Ft(lt,{success:a,fail:!!t}),t?Ft(nS,{style:{width:"38px",height:"38px"}}):Ft(ti,{style:{width:"38px",height:"38px"}})]})}),Ft(pe,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),wa(zn,{children:[wa(ar,{children:[Ft(ir,{children:Ft(iS,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),wa(ar,{children:[Ft(ir,{children:Ft(oS,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&Ft(Or,{children:Ft(Ps,{pendingTransaction:l})}),t&&wa(U3,{children:[Ft($l,{style:{marginTop:"1.25rem"},children:t.message}),Ft(H,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&Ft(Va,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),Ft(Z,{})]})};import{Fragment as xu,jsx as ge,jsxs as to}from"react/jsx-runtime";var ku=({open:e,onClose:t})=>{let{user:r}=z(),[o,n]=xs(null),{init:i,cancel:a,submit:l}=ws(),[s,c]=xs(!1),[f,m]=xs(!1),[u,C]=xs(null),[v,g]=xs(null);uS(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?R(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let b=k=>Lp(k)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Jn(k)?(c(!1),new Error("The code you entered is not valid")):Zn(k)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(k),c(!1),new Error("Something went wrong."));async function E(k){g(null);try{if(!k||!o)return;await l(o,k),m(!0),c(!1),t()}catch(I){throw b(I)}}async function R(k){if(k==="passkey"){try{n(k);let I=await i(k);if(!I)throw new Error("something went wrong");C(I),await l(k,I),m(!0),c(!1),t()}catch(I){g(b(I))}return}try{n(k),await i(k)}catch(I){console.error(I)}}let S=()=>{n(null),g(null),a(),t()},A=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let k=r.linkedAccounts.filter(I=>I.type==="passkey"&&I.enrolledInMfa).sort((I,F)=>F.firstVerifiedAt.valueOf()-I.firstVerifiedAt.valueOf())[0];return ge(F3,{account:k,selectedMethod:o,submitSuccess:f,hasBlockingError:s,error:v,onClose:S,onBack:A,handleSubmit:()=>E(u).catch(g)})}return o?ge(mS,{submitSuccess:f,hasBlockingError:s,handleSubmitCode:E,selectedMethod:o,onClose:S,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):to(xu,{children:[ge(_,{onClose:S},"header"),ge(Le,{children:ge(Ze,{children:ge(cS,{})})}),ge(pe,{children:"Verify your identity"}),ge(me,{children:"Choose a verification method"}),to(jl,{children:[r.mfaMethods.includes("totp")&&to(Se,{onClick:()=>R("totp"),children:[ge(aS,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&to(Se,{onClick:()=>R("sms"),children:[ge(lS,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&to(Se,{onClick:()=>R("passkey"),children:[ge(sS,{}),"Passkey"]},"passkey")]}),ge(Z,{})]})},mS=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=x(),{pendingTransaction:l}=M();switch(e){case"sms":return to(xu,{children:[ge(_,{onClose:o},"header"),ge(Le,{children:ge(Ze,{children:ge(pS,{})})}),ge(pe,{children:"Enter verification code"}),to(Or,{children:[ge(si,{success:t,disabled:r,onChange:i}),to(me,{children:["To continue, please enter the 6-digit code sent to your ",ge("strong",{children:"mobile device"})]}),l&&ge(Ps,{pendingTransaction:l})]}),n&&ge(Va,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),ge(Kr,{onClick:o,children:"Not now"}),ge(Z,{})]});case"totp":return to(xu,{children:[ge(_,{onClose:o},"header"),ge(Le,{children:ge(Ze,{children:ge(dS,{})})}),ge(pe,{children:"Enter verification code"}),to(Or,{children:[ge(si,{success:t,disabled:r,onChange:i}),to(me,{children:["To continue, please enter the 6-digit code generated from your"," ",ge("strong",{children:"authenticator app"})]}),l&&ge(Ps,{pendingTransaction:l})]}),n&&ge(Va,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),ge(Kr,{onClick:o,children:"Not now"}),ge(Z,{})]});default:return null}};import{useEffect as B3,useState as H3}from"react";import fS from"styled-components";import{Fragment as yS,jsx as So,jsxs as Ed}from"react/jsx-runtime";var G3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=z(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=x(),{getAuthMeta:s,initLoginWithOAuth:c,loginWithOAuth:f,updateWallets:m,setReadyToTrue:u,closePrivyModal:C,createAnalyticsEvent:v}=M(),[g,b]=H3(!1),[E,R]=H3(void 0),S=s()?.provider||"google",{name:A,component:k}=La(S),I=Li(),F=Me;B3(()=>{f(S).then(j=>{b(!0),u(!0),j&&I("login","onOAuthLoginComplete",j)}).catch(j=>{if(u(!1),j?.privyErrorCode==="allowlist_rejected"){R(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(j?.privyErrorCode==="max_accounts_reached"){console.error(new Rr(j).toString()),R(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(j?.privyErrorCode==="user_does_not_exist"){R(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:L,detail:U}=xf(j,S);R({retryable:L,detail:U,message:"Authentication failed"})}).finally(()=>{Nn()})},[A,S]),B3(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let L=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},F);return()=>clearTimeout(L)}if(Gt(o,n?.embeddedWallets?.createOnLogin)){let L=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:U=>{console.error(U),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:U,provider:S,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},F);return()=>clearTimeout(L)}else{let L=setTimeout(()=>C({shouldCallAuthOnSuccess:!0,isSuccess:!0}),F);return m(),()=>clearTimeout(L)}}},[r,e,g,o]);let G=g?`Successfully connected with ${A}`:E?E.message:`Verifying connection to ${A}`,Y="";return g?Y="You\u2019re good to go!":E?Y=E.detail:Y="Just a few moments more",Ed(yS,{children:[So(_,{}),So(ie,{}),Ed(hS,{children:[So(tt,{children:Ed("div",{children:[So(lt,{success:g,fail:!!E}),So(k,{style:{width:"38px",height:"38px"}})]})}),Ed(Xe,{children:[So("h3",{children:G}),So("p",{children:Y})]}),E&&E?.retryable?So(Jo,{onClick:()=>{Nn(),c(S),R(void 0)},disabled:!g&&!E?.retryable,children:"Retry"}):null]}),So(se,{}),So(Z,{})]})},hS=fS.div`
2607
+ `;import iS from"@heroicons/react/24/outline/CalendarIcon";import aS from"@heroicons/react/24/outline/ExclamationTriangleIcon";import sS from"@heroicons/react/24/outline/ShieldCheckIcon";import{Fragment as B3,jsx as Ft,jsxs as wa}from"react/jsx-runtime";var H3=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=M();return wa(B3,{children:[Ft(_,{onClose:r},"header"),Ft(tt,{children:wa("div",{children:[Ft(lt,{success:a,fail:!!t}),t?Ft(aS,{style:{width:"38px",height:"38px"}}):Ft(ti,{style:{width:"38px",height:"38px"}})]})}),Ft(de,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),wa(zn,{children:[wa(ar,{children:[Ft(ir,{children:Ft(sS,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),wa(ar,{children:[Ft(ir,{children:Ft(iS,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&Ft(Or,{children:Ft(Ps,{pendingTransaction:l})}),t&&wa(B3,{children:[Ft($l,{style:{marginTop:"1.25rem"},children:t.message}),Ft(H,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&Ft(Va,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),Ft(Z,{})]})};import{Fragment as ku,jsx as ge,jsxs as to}from"react/jsx-runtime";var _u=({open:e,onClose:t})=>{let{user:r}=K(),[o,n]=xs(null),{init:i,cancel:a,submit:l}=ws(),[s,c]=xs(!1),[f,m]=xs(!1),[u,C]=xs(null),[v,g]=xs(null);fS(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?R(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let b=k=>Op(k)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Jn(k)?(c(!1),new Error("The code you entered is not valid")):Zn(k)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(k),c(!1),new Error("Something went wrong."));async function E(k){g(null);try{if(!k||!o)return;await l(o,k),m(!0),c(!1),t()}catch(I){throw b(I)}}async function R(k){if(k==="passkey"){try{n(k);let I=await i(k);if(!I)throw new Error("something went wrong");C(I),await l(k,I),m(!0),c(!1),t()}catch(I){g(b(I))}return}try{n(k),await i(k)}catch(I){console.error(I)}}let S=()=>{n(null),g(null),a(),t()},A=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let k=r.linkedAccounts.filter(I=>I.type==="passkey"&&I.enrolledInMfa).sort((I,F)=>F.firstVerifiedAt.valueOf()-I.firstVerifiedAt.valueOf())[0];return ge(H3,{account:k,selectedMethod:o,submitSuccess:f,hasBlockingError:s,error:v,onClose:S,onBack:A,handleSubmit:()=>E(u).catch(g)})}return o?ge(hS,{submitSuccess:f,hasBlockingError:s,handleSubmitCode:E,selectedMethod:o,onClose:S,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):to(ku,{children:[ge(_,{onClose:S},"header"),ge(Le,{children:ge(Qe,{children:ge(pS,{})})}),ge(de,{children:"Verify your identity"}),ge(me,{children:"Choose a verification method"}),to(jl,{children:[r.mfaMethods.includes("totp")&&to(Se,{onClick:()=>R("totp"),children:[ge(lS,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&to(Se,{onClick:()=>R("sms"),children:[ge(dS,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&to(Se,{onClick:()=>R("passkey"),children:[ge(cS,{}),"Passkey"]},"passkey")]}),ge(Z,{})]})},hS=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=x(),{pendingTransaction:l}=M();switch(e){case"sms":return to(ku,{children:[ge(_,{onClose:o},"header"),ge(Le,{children:ge(Qe,{children:ge(mS,{})})}),ge(de,{children:"Enter verification code"}),to(Or,{children:[ge(si,{success:t,disabled:r,onChange:i}),to(me,{children:["To continue, please enter the 6-digit code sent to your ",ge("strong",{children:"mobile device"})]}),l&&ge(Ps,{pendingTransaction:l})]}),n&&ge(Va,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),ge(Kr,{onClick:o,children:"Not now"}),ge(Z,{})]});case"totp":return to(ku,{children:[ge(_,{onClose:o},"header"),ge(Le,{children:ge(Qe,{children:ge(uS,{})})}),ge(de,{children:"Enter verification code"}),to(Or,{children:[ge(si,{success:t,disabled:r,onChange:i}),to(me,{children:["To continue, please enter the 6-digit code generated from your"," ",ge("strong",{children:"authenticator app"})]}),l&&ge(Ps,{pendingTransaction:l})]}),n&&ge(Va,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),ge(Kr,{onClick:o,children:"Not now"}),ge(Z,{})]});default:return null}};import{useEffect as G3,useState as V3}from"react";import yS from"styled-components";import{Fragment as vS,jsx as So,jsxs as Td}from"react/jsx-runtime";var q3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=K(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=x(),{getAuthMeta:s,initLoginWithOAuth:c,loginWithOAuth:f,updateWallets:m,setReadyToTrue:u,closePrivyModal:C,createAnalyticsEvent:v}=M(),[g,b]=V3(!1),[E,R]=V3(void 0),S=s()?.provider||"google",{name:A,component:k}=La(S),I=Li(),F=Me;G3(()=>{f(S).then(j=>{b(!0),u(!0),j&&I("login","onOAuthLoginComplete",j)}).catch(j=>{if(u(!1),j?.privyErrorCode==="allowlist_rejected"){R(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(j?.privyErrorCode==="max_accounts_reached"){console.error(new Rr(j).toString()),R(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(j?.privyErrorCode==="user_does_not_exist"){R(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:L,detail:U}=_f(j,S);R({retryable:L,detail:U,message:"Authentication failed"})}).finally(()=>{Nn()})},[A,S]),G3(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let L=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},F);return()=>clearTimeout(L)}if(Gt(o,n?.embeddedWallets?.createOnLogin)){let L=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:U=>{console.error(U),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:U,provider:S,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},F);return()=>clearTimeout(L)}else{let L=setTimeout(()=>C({shouldCallAuthOnSuccess:!0,isSuccess:!0}),F);return m(),()=>clearTimeout(L)}}},[r,e,g,o]);let G=g?`Successfully connected with ${A}`:E?E.message:`Verifying connection to ${A}`,Y="";return g?Y="You\u2019re good to go!":E?Y=E.detail:Y="Just a few moments more",Td(vS,{children:[So(_,{}),So(ae,{}),Td(gS,{children:[So(tt,{children:Td("div",{children:[So(lt,{success:g,fail:!!E}),So(k,{style:{width:"38px",height:"38px"}})]})}),Td(je,{children:[So("h3",{children:G}),So("p",{children:Y})]}),E&&E?.retryable?So(Jo,{onClick:()=>{Nn(),c(S),R(void 0)},disabled:!g&&!E?.retryable,children:"Retry"}):null]}),So(se,{}),So(Z,{})]})},gS=yS.div`
2605
2608
  display: flex;
2606
2609
  flex-direction: column;
2607
2610
  align-items: center;
@@ -2609,17 +2612,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
2609
2612
  margin-left: 27px;
2610
2613
  margin-right: 27px;
2611
2614
  gap: 24px;
2612
- `;import{useEffect as _u,useRef as gS,useState as V3}from"react";import q3 from"styled-components";import{Fragment as CS,jsx as Ho,jsxs as Td}from"react/jsx-runtime";var z3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=x(),{loginWithPasskey:o,closePrivyModal:n}=M(),i=Me,[a,l]=V3("loading"),[s,c]=V3(null),f=gS([]),m=b=>{f.current=[b,...f.current]};_u(()=>()=>{f.current.forEach(b=>clearTimeout(b)),f.current=[]},[]);let u=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},C=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2615
+ `;import{useEffect as Ru,useRef as CS,useState as z3}from"react";import K3 from"styled-components";import{Fragment as bS,jsx as Ho,jsxs as Sd}from"react/jsx-runtime";var Y3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=x(),{loginWithPasskey:o,closePrivyModal:n}=M(),i=Me,[a,l]=z3("loading"),[s,c]=z3(null),f=CS([]),m=b=>{f.current=[b,...f.current]};Ru(()=>()=>{f.current.forEach(b=>clearTimeout(b)),f.current=[]},[]);let u=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},C=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2613
2616
  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 it){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.
2614
2617
  You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
2615
- 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 Ho(H,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return Ho(H,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{l("loading");try{await o(),l("success")}catch(b){c(b),l("error")}};return _u(()=>{a==="success"&&m(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),_u(()=>{g()},[]),Td(CS,{children:[Ho(_,{backFn:!e||t===e?void 0:r}),Td(vS,{children:[Ho(tt,{children:Td("div",{children:[Ho(lt,{success:a==="success",fail:a==="error"}),Ho(ri,{style:{width:"38px",height:"38px"}})]})}),Td(Xe,{children:[Ho("h3",{children:u()}),Ho("p",{style:{whiteSpace:"pre-wrap"},children:C()})]}),v()]}),Ho(Z,{})]})},vS=q3.div`
2618
+ 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 Ho(H,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return Ho(H,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{l("loading");try{await o(),l("success")}catch(b){c(b),l("error")}};return Ru(()=>{a==="success"&&m(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),Ru(()=>{g()},[]),Sd(bS,{children:[Ho(_,{backFn:!e||t===e?void 0:r}),Sd(wS,{children:[Ho(tt,{children:Sd("div",{children:[Ho(lt,{success:a==="success",fail:a==="error"}),Ho(ri,{style:{width:"38px",height:"38px"}})]})}),Sd(je,{children:[Ho("h3",{children:u()}),Ho("p",{style:{whiteSpace:"pre-wrap"},children:C()})]}),v()]}),Ho(Z,{})]})},wS=K3.div`
2616
2619
  display: flex;
2617
2620
  flex-direction: column;
2618
2621
  align-items: center;
2619
2622
  justify-content: center;
2620
2623
  gap: 24px;
2621
2624
  width: 100%;
2622
- `,Lne=q3.div`
2625
+ `,Dne=K3.div`
2623
2626
  display: flex;
2624
2627
  align-items: center;
2625
2628
  justify-content: center;
@@ -2635,9 +2638,9 @@ You will have to sign up with another method first to register a passkey for you
2635
2638
  stroke: var(--privy-color-accent) !important;
2636
2639
  fill: var(--privy-color-accent) !important;
2637
2640
  }
2638
- `;import{useEffect as bS,useState as Y3}from"react";import ES from"styled-components";import{isMobile as wS}from"react-device-detect";var K3=(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(!zo()&&wS)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as SS,jsx as Go,jsxs as j3}from"react/jsx-runtime";var X3=()=>{let{forkSession:e,ready:t,authenticated:r}=z(),[o,n]=Y3(""),[i,a]=Y3(!1);bS(()=>{t&&r&&e().then(n)},[t,r]);let l=K3(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."),j3(SS,{children:[Go(_,{},"header"),Go(ie,{}),Go(fo,{title:s.title,description:s.description}),j3(lr,{children:[Go(TS,{children:Go(co,{style:{width:"72px",height:"72px"}})}),Go(ql,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?Go("p",{children:s.footnote}):null]}),Go(se,{}),Go(q,{})]})},TS=ES(St)`
2641
+ `;import{useEffect as TS,useState as X3}from"react";import SS from"styled-components";import{isMobile as ES}from"react-device-detect";var j3=(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(!zo()&&ES)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as PS,jsx as Go,jsxs as Q3}from"react/jsx-runtime";var Z3=()=>{let{forkSession:e,ready:t,authenticated:r}=K(),[o,n]=X3(""),[i,a]=X3(!1);TS(()=>{t&&r&&e().then(n)},[t,r]);let l=j3(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."),Q3(PS,{children:[Go(_,{},"header"),Go(ae,{}),Go(fo,{title:s.title,description:s.description}),Q3(lr,{children:[Go(AS,{children:Go(co,{style:{width:"72px",height:"72px"}})}),Go(ql,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?Go("p",{children:s.footnote}):null]}),Go(se,{}),Go(q,{})]})},AS=SS(St)`
2639
2642
  margin: 16px auto;
2640
- `;import AS from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as PS,useState as Sd}from"react";import Ad,{css as xS}from"styled-components";import{Fragment as IS,jsx as Xt,jsxs as di}from"react/jsx-runtime";var Q3=()=>{let[e,t]=Sd(!0),{authenticated:r,getAccessToken:o}=z(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=x(),[f,m]=Sd(void 0),[u,C]=Sd(""),[v,g]=Sd(!1),{privyWallet:b,onCompleteNavigateTo:E,onSuccess:R,onFailure:S}=s.recoverWallet,A=(F="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),S(typeof F=="string"?new Ht(F):F)};c.current=A,PS(()=>{if(!r||!b)return A("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let k=F=>{F&&m(F)};return di(IS,{children:[Xt(_,{onClose:A}),Xt(ie,{}),di(_S,{children:[di(kS,{children:[Xt(AS,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Xt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),Xt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),di("div",{children:[di(cn,{children:[Xt(ea,{type:e?"password":"text",onChange:F=>k(F.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),Xt(ta,{style:{right:"0.75rem"},children:e?Xt(ra,{onClick:()=>t(!1)}):Xt(oa,{onClick:()=>t(!0)})})]}),!!u&&Xt(RS,{children:u})]}),di("div",{children:[di(jh,{children:[Xt("h4",{children:"Why is this necessary?"}),Xt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),Xt(MS,{loading:v||!n,disabled:!f,onClick:async()=>{g(!0);let F=await o();if(F&&b&&f!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:b.address}}),await n?.recover({address:b.address,accessToken:F,recoveryPin:f,recoveryMethod:b.recoveryMethod}),C(""),E?l(E):i({shouldCallAuthOnSuccess:!1}),R?.(b),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:b.address}})}catch(G){Uy(G)?C("Invalid recovery password, please try again."):C("An error has occurred, please try again.")}finally{g(!1)}else return A("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!b&&v,children:"Recover your account"})]})]}),Xt(se,{}),Xt(q,{})]})},kS=Ad.div`
2643
+ `;import xS from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as kS,useState as Ad}from"react";import Pd,{css as _S}from"styled-components";import{Fragment as LS,jsx as Xt,jsxs as di}from"react/jsx-runtime";var J3=()=>{let[e,t]=Ad(!0),{authenticated:r,getAccessToken:o}=K(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=x(),[f,m]=Ad(void 0),[u,C]=Ad(""),[v,g]=Ad(!1),{privyWallet:b,onCompleteNavigateTo:E,onSuccess:R,onFailure:S}=s.recoverWallet,A=(F="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),S(typeof F=="string"?new Ht(F):F)};c.current=A,kS(()=>{if(!r||!b)return A("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let k=F=>{F&&m(F)};return di(LS,{children:[Xt(_,{onClose:A}),Xt(ae,{}),di(MS,{children:[di(RS,{children:[Xt(xS,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Xt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),Xt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),di("div",{children:[di(cn,{children:[Xt(ea,{type:e?"password":"text",onChange:F=>k(F.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),Xt(ta,{style:{right:"0.75rem"},children:e?Xt(ra,{onClick:()=>t(!1)}):Xt(oa,{onClick:()=>t(!0)})})]}),!!u&&Xt(IS,{children:u})]}),di("div",{children:[di(Qh,{children:[Xt("h4",{children:"Why is this necessary?"}),Xt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),Xt(WS,{loading:v||!n,disabled:!f,onClick:async()=>{g(!0);let F=await o();if(F&&b&&f!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:b.address}}),await n?.recover({address:b.address,accessToken:F,recoveryPin:f,recoveryMethod:b.recoveryMethod}),C(""),E?l(E):i({shouldCallAuthOnSuccess:!1}),R?.(b),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:b.address}})}catch(G){By(G)?C("Invalid recovery password, please try again."):C("An error has occurred, please try again.")}finally{g(!1)}else return A("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!b&&v,children:"Recover your account"})]})]}),Xt(se,{}),Xt(q,{})]})},RS=Pd.div`
2641
2644
  display: flex;
2642
2645
  flex-direction: column;
2643
2646
  align-items: center;
@@ -2659,40 +2662,40 @@ You will have to sign up with another method first to register a passkey for you
2659
2662
  font-weight: 400;
2660
2663
  line-height: 20px;
2661
2664
  }
2662
- `,_S=Ad.div`
2665
+ `,MS=Pd.div`
2663
2666
  display: flex;
2664
2667
  flex-direction: column;
2665
2668
  justify-content: space-between;
2666
- `,RS=Ad.div`
2669
+ `,IS=Pd.div`
2667
2670
  line-height: 20px;
2668
2671
  height: 20px;
2669
2672
  font-size: 13px;
2670
2673
  color: var(--privy-color-error);
2671
2674
  text-align: left;
2672
2675
  margin-top: 0.5rem;
2673
- `,MS=Ad(H)`
2674
- ${e=>e.hideAnimations&&xS`
2676
+ `,WS=Pd(H)`
2677
+ ${e=>e.hideAnimations&&_S`
2675
2678
  && {
2676
2679
  // Remove animations because the recoverWallet task on the iframe partially
2677
2680
  // blocks the renderer, so the animation stutters and doesn't look good
2678
2681
  transition: none;
2679
2682
  }
2680
2683
  `}
2681
- `;import{useCallback as WS,useEffect as t0,useState as Ru}from"react";import{jsx as Pd,jsxs as Z3}from"react/jsx-runtime";var xd=e=>Z3("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[Pd("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"}),Pd("defs",{children:Z3("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[Pd("stop",{stopColor:"#3E82F4"}),Pd("stop",{offset:1,stopColor:"#93DCF7"})]})})]});import{jsx as Vo,jsxs as J3}from"react/jsx-runtime";var kd=({style:e,...t})=>J3("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[J3("g",{clipPath:"url(#clip0_2115_829)",children:[Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"})]}),Vo("defs",{children:Vo("clipPath",{id:"clip0_2115_829",children:Vo("rect",{width:"16",height:"14",fill:"white"})})})]});import $3 from"styled-components";var ks=$3.div`
2684
+ `;import{useCallback as OS,useEffect as o0,useState as Mu}from"react";import{jsx as xd,jsxs as $3}from"react/jsx-runtime";var kd=e=>$3("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[xd("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"}),xd("defs",{children:$3("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[xd("stop",{stopColor:"#3E82F4"}),xd("stop",{offset:1,stopColor:"#93DCF7"})]})})]});import{jsx as Vo,jsxs as e0}from"react/jsx-runtime";var _d=({style:e,...t})=>e0("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e0("g",{clipPath:"url(#clip0_2115_829)",children:[Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"})]}),Vo("defs",{children:Vo("clipPath",{id:"clip0_2115_829",children:Vo("rect",{width:"16",height:"14",fill:"white"})})})]});import t0 from"styled-components";var ks=t0.div`
2682
2685
  display: flex;
2683
2686
  flex-direction: column;
2684
2687
  gap: 12px;
2685
2688
  padding-top: 24px;
2686
2689
  padding-bottom: 24px;
2687
- `,e0=$3.div`
2690
+ `,r0=t0.div`
2688
2691
  padding-bottom: 24px;
2689
- `;import{Fragment as o0,jsx as Sn,jsxs as _d}from"react/jsx-runtime";var r0={"google-drive":{name:"Google Drive",component:kd},icloud:{name:"iCloud",component:xd}},n0=()=>{let{logout:e}=z(),{navigate:t,setModalData:r,data:o}=x(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),[l,s]=Ru(!1),{provider:c,action:f,isInAccountCreateFlow:m}=o?.recoveryOAuthStatus,[u,C]=Ru(void 0),[v,g]=Ru(f==="create-wallet");if(c==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let b=r0[c].name,E=r0[c].component,R=o?.recoverWallet?.onCompleteNavigateTo,S=new je(async(j="create-wallet")=>(g(!0),new Promise((L,U)=>{setTimeout(async()=>{try{let W=window.open();await n(c,j,W),s(!0),L()}catch{C({message:`${j==="recover"?"Recovery":"Back up"} with ${b} unsuccessful`,detail:f==="recover"?`Please verify that you are selecting the ${b} account associated with your backup.`:"",retryable:!0}),U()}},0)})));t0(()=>{f!=="recover"&&S.execute(m?"create-wallet":"set-recovery")},[]),t0(()=>{if(!l)return;let j=setTimeout(()=>{m?(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})},Me);return()=>clearTimeout(j)},[l]);let A=WS(async()=>{await S.execute("recover"),R?t(R):s(!0)},[]),k=c==="google-drive"?"Google Drive":"Apple iCloud",I=f==="recover"?"recovered":"backed up",F=f==="recover"?"Recovering":"Backing up",G=l&&`Successfully ${I} with ${k}.`||u&&u.message||`${F} with ${k}...`,Y=u?u.detail:"";return _d(o0,{children:[Sn(_,{}),v?Sn(o0,{children:_d(ks,{children:[Sn(fe,{title:G,icon:Sn(E,{style:{width:"38px",height:"38px"}}),description:Y}),u&&u?.retryable?Sn(H,{onClick:()=>{Nn(),C(void 0),f==="create-wallet"?S.execute("create-wallet"):A()},disabled:!l&&!u?.retryable,children:"Try again"}):null]})}):_d(ks,{children:[Sn(fe,{title:"Confirm it's really you",icon:Sn(E,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${k} where your account is backed up.`}),_d(H,{onClick:A,children:["Confirm with ",k]})]}),Sn(q,{})]})};import{useEffect as i0,useState as _s}from"react";import{jsx as LS}from"react/jsx-runtime";var a0=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=x(),[n,i]=_s(""),[a,l]=_s(!1),[s,c]=_s(),[f,m]=_s(null),{authenticated:u}=z(),{closePrivyModal:C,isNewUserThisSession:v,initializeWalletProxy:g}=M(),{onSuccess:b,onFailure:E,callAuthOnSuccessOnClose:R}=r.createWallet,{createWallet:S}=vc(),[A,k]=_s(null),I=new je(async()=>{try{let Y=await S(s);if(!Y)return;k(Y),v?t("EMBEDDED_WALLET_CREATED_SCREEN"):(b(Y),C({shouldCallAuthOnSuccess:R}))}catch(Y){i(Y.message)}});i0(()=>{f||g(3e4).then(Y=>m(Y))},[f]),i0(()=>{if(!u){t("LANDING"),E(new Error("User must be authenticated before creating a Privy wallet"));return}},[u]);let F=()=>{A&&A?.recoveryMethod!=="user-passcode"?(E(new Ht("User created a wallet but failed to set a password for it")),C({shouldCallAuthOnSuccess:!1})):A?(b(A),C({shouldCallAuthOnSuccess:R})):(E(new Ht("User wallet creation failed")),C({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let G=async()=>{l(!0);let Y=250;return I.execute().then(()=>new Promise(j=>setTimeout(j,Y))).finally(()=>l(!1))};return LS(Ec,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!f,buttonLoading:a,buttonHideAnimations:!A&&a,isResettingPassword:!1,error:n,password:s||"",onClose:F,onPasswordChange:c,onPasswordGenerate:()=>c(bc()),onSubmit:G})};import OS from"@heroicons/react/24/outline/LockClosedIcon";import NS from"@heroicons/react/24/outline/PencilSquareIcon";import DS from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as US}from"react";import FS from"styled-components";import{Fragment as Iu,jsx as wt,jsxs as An}from"react/jsx-runtime";var Mu=FS.div`
2692
+ `;import{Fragment as i0,jsx as Sn,jsxs as Rd}from"react/jsx-runtime";var n0={"google-drive":{name:"Google Drive",component:_d},icloud:{name:"iCloud",component:kd}},a0=()=>{let{logout:e}=K(),{navigate:t,setModalData:r,data:o}=x(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),[l,s]=Mu(!1),{provider:c,action:f,isInAccountCreateFlow:m}=o?.recoveryOAuthStatus,[u,C]=Mu(void 0),[v,g]=Mu(f==="create-wallet");if(c==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let b=n0[c].name,E=n0[c].component,R=o?.recoverWallet?.onCompleteNavigateTo,S=new Ye(async(j="create-wallet")=>(g(!0),new Promise((L,U)=>{setTimeout(async()=>{try{let W=window.open();await n(c,j,W),s(!0),L()}catch{C({message:`${j==="recover"?"Recovery":"Back up"} with ${b} unsuccessful`,detail:f==="recover"?`Please verify that you are selecting the ${b} account associated with your backup.`:"",retryable:!0}),U()}},0)})));o0(()=>{f!=="recover"&&S.execute(m?"create-wallet":"set-recovery")},[]),o0(()=>{if(!l)return;let j=setTimeout(()=>{m?(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})},Me);return()=>clearTimeout(j)},[l]);let A=OS(async()=>{await S.execute("recover"),R?t(R):s(!0)},[]),k=c==="google-drive"?"Google Drive":"Apple iCloud",I=f==="recover"?"recovered":"backed up",F=f==="recover"?"Recovering":"Backing up",G=l&&`Successfully ${I} with ${k}.`||u&&u.message||`${F} with ${k}...`,Y=u?u.detail:"";return Rd(i0,{children:[Sn(_,{}),v?Sn(i0,{children:Rd(ks,{children:[Sn(fe,{title:G,icon:Sn(E,{style:{width:"38px",height:"38px"}}),description:Y}),u&&u?.retryable?Sn(H,{onClick:()=>{Nn(),C(void 0),f==="create-wallet"?S.execute("create-wallet"):A()},disabled:!l&&!u?.retryable,children:"Try again"}):null]})}):Rd(ks,{children:[Sn(fe,{title:"Confirm it's really you",icon:Sn(E,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${k} where your account is backed up.`}),Rd(H,{onClick:A,children:["Confirm with ",k]})]}),Sn(q,{})]})};import{useEffect as s0,useState as _s}from"react";import{jsx as NS}from"react/jsx-runtime";var l0=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=x(),[n,i]=_s(""),[a,l]=_s(!1),[s,c]=_s(),[f,m]=_s(null),{authenticated:u}=K(),{closePrivyModal:C,isNewUserThisSession:v,initializeWalletProxy:g}=M(),{onSuccess:b,onFailure:E,callAuthOnSuccessOnClose:R}=r.createWallet,{createWallet:S}=vc(),[A,k]=_s(null),I=new Ye(async()=>{try{let Y=await S(s);if(!Y)return;k(Y),v?t("EMBEDDED_WALLET_CREATED_SCREEN"):(b(Y),C({shouldCallAuthOnSuccess:R}))}catch(Y){i(Y.message)}});s0(()=>{f||g(3e4).then(Y=>m(Y))},[f]),s0(()=>{if(!u){t("LANDING"),E(new Error("User must be authenticated before creating a Privy wallet"));return}},[u]);let F=()=>{A&&A?.recoveryMethod!=="user-passcode"?(E(new Ht("User created a wallet but failed to set a password for it")),C({shouldCallAuthOnSuccess:!1})):A?(b(A),C({shouldCallAuthOnSuccess:R})):(E(new Ht("User wallet creation failed")),C({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let G=async()=>{l(!0);let Y=250;return I.execute().then(()=>new Promise(j=>setTimeout(j,Y))).finally(()=>l(!1))};return NS(Ec,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!f,buttonLoading:a,buttonHideAnimations:!A&&a,isResettingPassword:!1,error:n,password:s||"",onClose:F,onPasswordChange:c,onPasswordGenerate:()=>c(bc()),onSubmit:G})};import DS from"@heroicons/react/24/outline/LockClosedIcon";import US from"@heroicons/react/24/outline/PencilSquareIcon";import FS from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as BS}from"react";import HS from"styled-components";import{Fragment as Wu,jsx as wt,jsxs as An}from"react/jsx-runtime";var Iu=HS.div`
2690
2693
  width: 24px;
2691
2694
  height: 24px;
2692
2695
  display: flex;
2693
2696
  justify-content: center;
2694
2697
  align-items: center;
2695
- `,BS={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},HS=({onClose:e})=>An(e0,{children:[wt(fe,{title:"Why do I need to secure my account?",icon:wt(DS,{width:48}),description:An(Iu,{children:[wt("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),wt("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."})]})}),wt(H,{onClick:e,children:"Select backup method"})]}),s0=()=>{let[e,t]=US(!1),{navigate:r,lastScreen:o,navigateBack:n,setModalData:i,data:a,onUserCloseViaDialogOrKeybindRef:l}=x(),{user:s}=z(),{embeddedWallets:c}=De(),{closePrivyModal:f}=M(),m=ve(s),u=m===null,{isInAccountCreateFlow:C,isResettingPassword:v}=a.recoverySelection,g=m&&m.recoveryMethod!=="privy",b=g?"Update backup method":"Secure your account",E=g?An("span",{children:["Your account is currently secured using"," ",wt("strong",{children:BS[m?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function R(A){i({recoveryOAuthStatus:{provider:A,action:u?"create-wallet":"set-recovery",isInAccountCreateFlow:C}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}function S(){a?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),f({shouldCallAuthOnSuccess:a?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return l.current=S,An(Iu,{children:[wt(_,{onClose:S,backFn:e?()=>t(!1):o?n:void 0,infoFn:o||e?void 0:()=>t(!0)},"header"),e?wt(HS,{onClose:()=>t(!1)}):An(Iu,{children:[wt(fe,{title:b,icon:wt(OS,{width:48}),description:E}),wt(ks,{children:c.userOwnedRecoveryOptions.filter(A=>["icloud","google-drive"].includes(m?.recoveryMethod||"")?A!==m?.recoveryMethod:!0).sort().map(A=>{switch(A){case"google-drive":return An(Se,{onClick:()=>R("google-drive"),children:[wt(Mu,{children:wt(kd,{style:{width:18}})}),"Back up to Google Drive"]},A);case"icloud":return An(Se,{onClick:()=>R("icloud"),children:[wt(Mu,{children:wt(xd,{style:{width:24}})}),"Back up to Apple iCloud"]},A);case"user-passcode":return An(Se,{onClick:()=>{let k=Op({isCreatingWallet:u,skipSplashScreen:!0});r(k)},children:[wt(Mu,{children:wt(NS,{style:{width:18}})}),v?"Reset your":"Set a"," password"]},A);default:return null}})})]}),wt(q,{})]})};import VS from"@heroicons/react/24/outline/ExclamationTriangleIcon";import qS from"@heroicons/react/24/outline/LockClosedIcon";import{useState as Wu}from"react";import GS from"styled-components";var l0=GS.div`
2698
+ `,GS={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},VS=({onClose:e})=>An(r0,{children:[wt(fe,{title:"Why do I need to secure my account?",icon:wt(FS,{width:48}),description:An(Wu,{children:[wt("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),wt("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."})]})}),wt(H,{onClick:e,children:"Select backup method"})]}),c0=()=>{let[e,t]=BS(!1),{navigate:r,lastScreen:o,navigateBack:n,setModalData:i,data:a,onUserCloseViaDialogOrKeybindRef:l}=x(),{user:s}=K(),{embeddedWallets:c}=De(),{closePrivyModal:f}=M(),m=ve(s),u=m===null,{isInAccountCreateFlow:C,isResettingPassword:v}=a.recoverySelection,g=m&&m.recoveryMethod!=="privy",b=g?"Update backup method":"Secure your account",E=g?An("span",{children:["Your account is currently secured using"," ",wt("strong",{children:GS[m?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function R(A){i({recoveryOAuthStatus:{provider:A,action:u?"create-wallet":"set-recovery",isInAccountCreateFlow:C}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}function S(){a?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),f({shouldCallAuthOnSuccess:a?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return l.current=S,An(Wu,{children:[wt(_,{onClose:S,backFn:e?()=>t(!1):o?n:void 0,infoFn:o||e?void 0:()=>t(!0)},"header"),e?wt(VS,{onClose:()=>t(!1)}):An(Wu,{children:[wt(fe,{title:b,icon:wt(DS,{width:48}),description:E}),wt(ks,{children:c.userOwnedRecoveryOptions.filter(A=>["icloud","google-drive"].includes(m?.recoveryMethod||"")?A!==m?.recoveryMethod:!0).sort().map(A=>{switch(A){case"google-drive":return An(Se,{onClick:()=>R("google-drive"),children:[wt(Iu,{children:wt(_d,{style:{width:18}})}),"Back up to Google Drive"]},A);case"icloud":return An(Se,{onClick:()=>R("icloud"),children:[wt(Iu,{children:wt(kd,{style:{width:24}})}),"Back up to Apple iCloud"]},A);case"user-passcode":return An(Se,{onClick:()=>{let k=Np({isCreatingWallet:u,skipSplashScreen:!0});r(k)},children:[wt(Iu,{children:wt(US,{style:{width:18}})}),v?"Reset your":"Set a"," password"]},A);default:return null}})})]}),wt(q,{})]})};import zS from"@heroicons/react/24/outline/ExclamationTriangleIcon";import KS from"@heroicons/react/24/outline/LockClosedIcon";import{useState as Lu}from"react";import qS from"styled-components";var d0=qS.div`
2696
2699
  && {
2697
2700
  border-width: 4px;
2698
2701
  }
@@ -2705,9 +2708,9 @@ You will have to sign up with another method first to register a passkey for you
2705
2708
  border-style: solid;
2706
2709
  border-color: ${e=>e.$color??"var(--privy-color-accent)"};
2707
2710
  border-radius: 50%;
2708
- `;import{Fragment as c0,jsx as Qt,jsxs as d0}from"react/jsx-runtime";var p0=()=>{let{user:e,getAccessToken:t}=z(),r=ve(e),{walletProxy:o,refreshUser:n,closePrivyModal:i}=M(),a=De(),l=x(),[s,c]=Wu(!1),[f,m]=Wu(null),[u,C]=Wu(null);function v(){if(!s){if(u){l.data?.setWalletPassword?.onFailure(u),i();return}if(!f){l.data?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),i();return}}}l.onUserCloseViaDialogOrKeybindRef.current=v;async function g(){c(!0);try{let E=await t();if(!E||!o||!r)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:r.address,accessToken:E})).address)throw new Error("Unable to set recovery on wallet");let S=await n();if(!S)throw new Error("Unable to set recovery on wallet");let A=ve(S);if(!A)throw new Error("Unabled to set recovery on wallet");m(!!S),setTimeout(()=>{l.data?.setWalletPassword?.onSuccess(A),i()},Me)}catch(E){C(E)}finally{c(!1)}}let b=!!(s||f);return u?d0(c0,{children:[Qt(_,{onClose:v},"header"),Qt(l0,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:Qt(VS,{height:38,width:38,stroke:"var(--privy-color-error)"})}),Qt(Bo,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),Qt(yr,{style:{minHeight:"2rem"}}),Qt(Lo,{onClick:()=>C(null),children:"Try again"}),Qt(q,{})]}):d0(c0,{children:[Qt(_,{onClose:v},"header"),Qt(qS,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),Qt(Bo,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),Qt(bo,{style:{marginTop:"1rem"},children:"When you log into a new device, you\u2019ll only need to authenticate to access your account. Never get logged out if you forget your password."}),Qt(yr,{style:{minHeight:"2rem"}}),Qt(Lo,{loading:s,disabled:b,onClick:()=>g(),children:f?"Success":"Confirm"}),Qt(Vn,{disabled:b,onClick:()=>{let E=Qi({walletAction:"update",availableRecoveryMethods:a.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:r?.recoveryMethod==="user-passcode",showAutomaticRecovery:!1});l.navigate(E)},style:{marginTop:"0.5rem"},children:"More recovery options"}),Qt(q,{})]})};import{getAddress as k0}from"@ethersproject/address";import{useEffect as DA,useMemo as Od,useState as Rs}from"react";import{ProviderErrors as M0,QuantityToBigNumber as _0}from"@privy-io/js-sdk-core";import{EtherscanProvider as Nae}from"@ethersproject/providers";import{QuantityToBigNumber as zS}from"@privy-io/js-sdk-core";async function Rd(e,t,r,o,n,i){o=Object.assign({chainId:Mo},o),KS(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 Md(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(zS(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function KS(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!YS(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 YS(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&jS(e);return t||r||o}function jS(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Id(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 u0=["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"],m0={["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"},XS={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function Wd({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?XS[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}import f0 from"styled-components";import{Fragment as eA,jsx as qe,jsxs as Ao}from"react/jsx-runtime";var h0=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:i,title:a,subtitle:l,total:s,to:c,network:f,hasFunds:m,fee:u,from:C,cta:v,chain:g,isSubmitting:b,isPreparing:E,isTokenPriceLoading:R,isTokenContractInfoLoading:S,symbol:A,balance:k,onClick:I,spender:F})=>Ao(eA,{children:[qe(_,{onClose:o}),e&&qe($S,{children:e}),qe(Bo,{style:{marginTop:e?"1.5rem":0},children:a}),qe(bo,{children:l}),Ao(Ic,{style:{marginTop:"2rem"},children:[s&&Ao(Ot,{children:[qe(Ct,{children:"Total"}),qe(Kt,{$isLoading:E||R,children:s})]}),n&&n!=="transaction"&&Ao(Ot,{children:[qe(Ct,{children:"Action"}),qe(Kt,{children:n})]}),i?Ao(Ot,{children:[qe(Ct,{children:"Amount"}),Ao(Kt,{$isLoading:S,children:[JS(i)," ",A]})]}):null,F?Ao(Ot,{children:[qe(Ct,{children:"Spender"}),qe(Kt,{children:qe(ms,{address:F,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,c&&Ao(Ot,{children:[qe(Ct,{children:"To"}),qe(Kt,{children:qe(ms,{address:c,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),Ao(Ot,{children:[qe(Ct,{children:"Network"}),qe(Kt,{children:f})]}),Ao(Ot,{children:[qe(Ct,{children:"Estimated fee"}),qe(Kt,{$isLoading:E||R,children:u})]})]}),qe(yr,{}),t?qe(us,{style:{marginTop:"2rem"},children:t.message}):r?qe(us,{style:{marginTop:"2rem"},children:ZS}):null,qe(QS,{$useSmallMargins:!!(r||t),address:C,balance:k,isLoading:E||R,errMsg:!E&&!r&&!t&&!m?`Add funds on ${g?.name} to complete transaction.`:void 0}),qe(Lo,{style:{marginTop:"1rem"},loading:b,disabled:E,onClick:I,children:v}),qe(q,{})]}),QS=f0(qc)`
2711
+ `;import{Fragment as p0,jsx as Qt,jsxs as u0}from"react/jsx-runtime";var m0=()=>{let{user:e,getAccessToken:t}=K(),r=ve(e),{walletProxy:o,refreshUser:n,closePrivyModal:i}=M(),a=De(),l=x(),[s,c]=Lu(!1),[f,m]=Lu(null),[u,C]=Lu(null);function v(){if(!s){if(u){l.data?.setWalletPassword?.onFailure(u),i();return}if(!f){l.data?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),i();return}}}l.onUserCloseViaDialogOrKeybindRef.current=v;async function g(){c(!0);try{let E=await t();if(!E||!o||!r)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:r.address,accessToken:E})).address)throw new Error("Unable to set recovery on wallet");let S=await n();if(!S)throw new Error("Unable to set recovery on wallet");let A=ve(S);if(!A)throw new Error("Unabled to set recovery on wallet");m(!!S),setTimeout(()=>{l.data?.setWalletPassword?.onSuccess(A),i()},Me)}catch(E){C(E)}finally{c(!1)}}let b=!!(s||f);return u?u0(p0,{children:[Qt(_,{onClose:v},"header"),Qt(d0,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:Qt(zS,{height:38,width:38,stroke:"var(--privy-color-error)"})}),Qt(Bo,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),Qt(yr,{style:{minHeight:"2rem"}}),Qt(Lo,{onClick:()=>C(null),children:"Try again"}),Qt(q,{})]}):u0(p0,{children:[Qt(_,{onClose:v},"header"),Qt(KS,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),Qt(Bo,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),Qt(bo,{style:{marginTop:"1rem"},children:"When you log into a new device, you\u2019ll only need to authenticate to access your account. Never get logged out if you forget your password."}),Qt(yr,{style:{minHeight:"2rem"}}),Qt(Lo,{loading:s,disabled:b,onClick:()=>g(),children:f?"Success":"Confirm"}),Qt(Vn,{disabled:b,onClick:()=>{let E=Qi({walletAction:"update",availableRecoveryMethods:a.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:r?.recoveryMethod==="user-passcode",showAutomaticRecovery:!1});l.navigate(E)},style:{marginTop:"0.5rem"},children:"More recovery options"}),Qt(q,{})]})};import{getAddress as _0}from"@ethersproject/address";import{useEffect as FA,useMemo as Nd,useState as Rs}from"react";import{ProviderErrors as I0,QuantityToBigNumber as R0}from"@privy-io/js-sdk-core";import{EtherscanProvider as Fae}from"@ethersproject/providers";import{QuantityToBigNumber as YS}from"@privy-io/js-sdk-core";async function Md(e,t,r,o,n,i){o=Object.assign({chainId:Mo},o),jS(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 Id(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(YS(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function jS(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!XS(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 XS(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&QS(e);return t||r||o}function QS(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Wd(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 Ou=["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"],f0={["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"},ZS={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function Ld({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?ZS[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}import h0 from"styled-components";import{Fragment as rA,jsx as qe,jsxs as Ao}from"react/jsx-runtime";var y0=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:i,title:a,subtitle:l,total:s,to:c,network:f,hasFunds:m,fee:u,from:C,cta:v,chain:g,isSubmitting:b,isPreparing:E,isTokenPriceLoading:R,isTokenContractInfoLoading:S,symbol:A,balance:k,onClick:I,spender:F})=>Ao(rA,{children:[qe(_,{onClose:o}),e&&qe(tA,{children:e}),qe(Bo,{style:{marginTop:e?"1.5rem":0},children:a}),qe(bo,{children:l}),Ao(Wc,{style:{marginTop:"2rem"},children:[s&&Ao(Ot,{children:[qe(Ct,{children:"Total"}),qe(Kt,{$isLoading:E||R,children:s})]}),n&&n!=="transaction"&&Ao(Ot,{children:[qe(Ct,{children:"Action"}),qe(Kt,{children:n})]}),i?Ao(Ot,{children:[qe(Ct,{children:"Amount"}),Ao(Kt,{$isLoading:S,children:[eA(i)," ",A]})]}):null,F?Ao(Ot,{children:[qe(Ct,{children:"Spender"}),qe(Kt,{children:qe(ms,{address:F,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,c&&Ao(Ot,{children:[qe(Ct,{children:"To"}),qe(Kt,{children:qe(ms,{address:c,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),Ao(Ot,{children:[qe(Ct,{children:"Network"}),qe(Kt,{children:f})]}),Ao(Ot,{children:[qe(Ct,{children:"Estimated fee"}),qe(Kt,{$isLoading:E||R,children:u})]})]}),qe(yr,{}),t?qe(us,{style:{marginTop:"2rem"},children:t.message}):r?qe(us,{style:{marginTop:"2rem"},children:$S}):null,qe(JS,{$useSmallMargins:!!(r||t),address:C,balance:k,isLoading:E||R,errMsg:!E&&!r&&!t&&!m?`Add funds on ${g?.name} to complete transaction.`:void 0}),qe(Lo,{style:{marginTop:"1rem"},loading:b,disabled:E,onClick:I,children:v}),qe(q,{})]}),JS=h0(zc)`
2709
2712
  ${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
2710
- `,ZS="There was an error preparing your transaction. Your transaction request will likely fail.",JS=e=>e.toLocaleString(),$S=f0.div`
2713
+ `,$S="There was an error preparing your transaction. Your transaction request will likely fail.",eA=e=>e.toLocaleString(),tA=h0.div`
2711
2714
  display: flex;
2712
2715
  width: 100%;
2713
2716
  justify-content: center;
@@ -2717,12 +2720,12 @@ You will have to sign up with another method first to register a passkey for you
2717
2720
  object-fit: contain;
2718
2721
  border-radius: var(--privy-border-radius-sm);
2719
2722
  }
2720
- `;import rA from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import oA from"@heroicons/react/24/outline/ClipboardDocumentIcon";import nA from"@heroicons/react/24/outline/ExclamationCircleIcon";import{useState as iA}from"react";import xr from"styled-components";import{ErrorCode as Ld}from"@ethersproject/logger";var tA=new Set([Ld.CALL_EXCEPTION,Ld.NONCE_EXPIRED,Ld.REPLACEMENT_UNDERPRICED,Ld.TRANSACTION_REPLACED]),y0=e=>{let t;return e.code&&e.code!==-32e3&&tA.has(e.code)&&(t=e.transactionHash),t},g0=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";import{Fragment as CA,jsx as Bt,jsxs as pi}from"react/jsx-runtime";var aA=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=y0(e),o=g0(e);return{errorCode:t,transactionHash:r,errorMessage:o}},sA=()=>pi(pA,{children:[Bt(mA,{}),Bt(uA,{})]}),b0=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=M(),[i,a]=iA(!1),{errorCode:l,transactionHash:s,errorMessage:c}=aA(e),f=n.find(m=>m.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return pi(CA,{children:[Bt(_,{onClose:r}),pi(lA,{children:[Bt(sA,{}),Bt(cA,{children:l}),Bt(dA,{children:"Please try again."}),pi(C0,{children:[Bt(v0,{children:"Error message"}),Bt(w0,{clickable:!1,children:c})]}),s&&pi(C0,{children:[Bt(v0,{children:"Transaction hash"}),pi(hA,{children:["Copy this hash to view details about the transaction on a"," ",Bt("u",{children:Bt("a",{href:f,children:"block explorer"})}),"."]}),pi(w0,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,Bt(vA,{clicked:i})]})]}),Bt(fA,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),Bt(Z,{})]})},lA=xr.div`
2723
+ `;import nA from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import iA from"@heroicons/react/24/outline/ClipboardDocumentIcon";import aA from"@heroicons/react/24/outline/ExclamationCircleIcon";import{useState as sA}from"react";import xr from"styled-components";import{ErrorCode as Od}from"@ethersproject/logger";var oA=new Set([Od.CALL_EXCEPTION,Od.NONCE_EXPIRED,Od.REPLACEMENT_UNDERPRICED,Od.TRANSACTION_REPLACED]),g0=e=>{let t;return e.code&&e.code!==-32e3&&oA.has(e.code)&&(t=e.transactionHash),t},v0=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";import{Fragment as bA,jsx as Bt,jsxs as pi}from"react/jsx-runtime";var lA=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=g0(e),o=v0(e);return{errorCode:t,transactionHash:r,errorMessage:o}},cA=()=>pi(mA,{children:[Bt(hA,{}),Bt(fA,{})]}),E0=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=M(),[i,a]=sA(!1),{errorCode:l,transactionHash:s,errorMessage:c}=lA(e),f=n.find(m=>m.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return pi(bA,{children:[Bt(_,{onClose:r}),pi(dA,{children:[Bt(cA,{}),Bt(pA,{children:l}),Bt(uA,{children:"Please try again."}),pi(w0,{children:[Bt(C0,{children:"Error message"}),Bt(b0,{clickable:!1,children:c})]}),s&&pi(w0,{children:[Bt(C0,{children:"Transaction hash"}),pi(gA,{children:["Copy this hash to view details about the transaction on a"," ",Bt("u",{children:Bt("a",{href:f,children:"block explorer"})}),"."]}),pi(b0,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,Bt(wA,{clicked:i})]})]}),Bt(yA,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),Bt(Z,{})]})},dA=xr.div`
2721
2724
  display: flex;
2722
2725
  flex-direction: column;
2723
2726
  align-items: center;
2724
2727
  justify-content: center;
2725
- `,cA=xr.span`
2728
+ `,pA=xr.span`
2726
2729
  color: var(--privy-color-foreground);
2727
2730
  text-align: center;
2728
2731
  font-size: 1.125rem;
@@ -2730,7 +2733,7 @@ You will have to sign up with another method first to register a passkey for you
2730
2733
  line-height: 1.25rem; /* 111.111% */
2731
2734
  text-align: center;
2732
2735
  margin: 10px;
2733
- `,dA=xr.span`
2736
+ `,uA=xr.span`
2734
2737
  margin-top: 4px;
2735
2738
  margin-bottom: 10px;
2736
2739
  color: var(--privy-color-foreground-3);
@@ -2741,7 +2744,7 @@ You will have to sign up with another method first to register a passkey for you
2741
2744
  font-weight: 400;
2742
2745
  line-height: 20px; /* 142.857% */
2743
2746
  letter-spacing: -0.008px;
2744
- `,pA=xr.div`
2747
+ `,mA=xr.div`
2745
2748
  position: relative;
2746
2749
  width: 60px;
2747
2750
  height: 60px;
@@ -2749,37 +2752,37 @@ You will have to sign up with another method first to register a passkey for you
2749
2752
  display: flex;
2750
2753
  justify-content: center;
2751
2754
  align-items: center;
2752
- `,uA=xr(nA)`
2755
+ `,fA=xr(aA)`
2753
2756
  position: absolute;
2754
2757
  width: 35px;
2755
2758
  height: 35px;
2756
2759
  color: var(--privy-color-error);
2757
- `,mA=xr.div`
2760
+ `,hA=xr.div`
2758
2761
  position: absolute;
2759
2762
  width: 60px;
2760
2763
  height: 60px;
2761
2764
  border-radius: 50%;
2762
2765
  background-color: var(--privy-color-error);
2763
2766
  opacity: 0.1;
2764
- `,fA=xr(H)`
2767
+ `,yA=xr(H)`
2765
2768
  && {
2766
2769
  margin-top: 24px;
2767
2770
  }
2768
2771
  transition: color 350ms ease, background-color 350ms ease;
2769
- `,v0=xr.span`
2772
+ `,C0=xr.span`
2770
2773
  width: 100%;
2771
2774
  text-align: left;
2772
2775
  font-size: 0.825rem;
2773
2776
  color: var(--privy-color-foreground);
2774
2777
  padding: 4px;
2775
- `,C0=xr.div`
2778
+ `,w0=xr.div`
2776
2779
  width: 100%;
2777
2780
  margin: 5px;
2778
2781
  display: flex;
2779
2782
  flex-direction: column;
2780
2783
  justify-content: center;
2781
2784
  align-items: center;
2782
- `,hA=xr.text`
2785
+ `,gA=xr.text`
2783
2786
  position: relative;
2784
2787
  width: 100%;
2785
2788
  padding: 5px;
@@ -2787,7 +2790,7 @@ You will have to sign up with another method first to register a passkey for you
2787
2790
  color: var(--privy-color-foreground-3);
2788
2791
  text-align: left;
2789
2792
  word-wrap: break-word;
2790
- `,w0=xr.span`
2793
+ `,b0=xr.span`
2791
2794
  position: relative;
2792
2795
  width: 100%;
2793
2796
  background-color: var(--privy-color-background-2);
@@ -2805,24 +2808,24 @@ You will have to sign up with another method first to register a passkey for you
2805
2808
  &:hover {
2806
2809
  background-color: var(--privy-color-foreground-4);
2807
2810
  }`}
2808
- `,yA=xr(oA)`
2811
+ `,vA=xr(iA)`
2809
2812
  position: absolute;
2810
2813
  top: 13px;
2811
2814
  right: 13px;
2812
2815
  width: 24px;
2813
2816
  height: 24px;
2814
- `,gA=xr(rA)`
2817
+ `,CA=xr(nA)`
2815
2818
  position: absolute;
2816
2819
  top: 13px;
2817
2820
  right: 13px;
2818
2821
  width: 24px;
2819
2822
  height: 24px;
2820
- `,vA=({clicked:e})=>e?Bt(gA,{}):Bt(yA,{});import{BigNumber as Lu}from"@ethersproject/bignumber";import wA from"styled-components";import{Fragment as TA,jsx as ui,jsxs as SA}from"react/jsx-runtime";var bA=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Lu.from(e.gasUsed),o=Lu.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Lu.from(t);n=n.add(i)}return n.toString()}catch{return}else return},E0=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>SA(TA,{children:[ui(_,{onClose:o}),ui(Yn,{title:l??"Transaction complete!",description:s??"You're all set."}),ui(bd,{tokenPrice:n,from:t.from,to:t.to,gas:bA(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),ui(yr,{}),ui(EA,{loading:!1,onClick:o,children:"All Done"}),ui(se,{}),ui(q,{})]}),EA=wA(H)`
2823
+ `,wA=({clicked:e})=>e?Bt(CA,{}):Bt(vA,{});import{BigNumber as Nu}from"@ethersproject/bignumber";import EA from"styled-components";import{Fragment as AA,jsx as ui,jsxs as PA}from"react/jsx-runtime";var TA=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Nu.from(e.gasUsed),o=Nu.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Nu.from(t);n=n.add(i)}return n.toString()}catch{return}else return},T0=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>PA(AA,{children:[ui(_,{onClose:o}),ui(Yn,{title:l??"Transaction complete!",description:s??"You're all set."}),ui(Ed,{tokenPrice:n,from:t.from,to:t.to,gas:TA(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),ui(yr,{}),ui(SA,{loading:!1,onClick:o,children:"All Done"}),ui(se,{}),ui(q,{})]}),SA=EA(H)`
2821
2824
  && {
2822
2825
  margin-top: 24px;
2823
2826
  }
2824
2827
  transition: color 350ms ease, background-color 350ms ease;
2825
- `;import{createPublicClient as AA,http as PA}from"viem";var xA=(e,t)=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/Math.pow(10,t)),T0=[{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"}],S0=async({address:e,chain:t,amount:r,rpcConfig:o,privyAppId:n})=>{if(!r)return{value:"",symbol:""};try{let i=AA({chain:t,transport:PA(Ko(t,o,n))}),[a,l]=await Promise.all([i.readContract({abi:T0,address:e,functionName:"symbol"}),i.readContract({abi:T0,address:e,functionName:"decimals"})]);return{value:xA(parseFloat(r.toString()),l),symbol:a}}catch(i){return console.log(i),{value:r.toString(),symbol:""}}};import{decodeFunctionData as A0}from"viem";var P0=e=>{let t=_A(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=MA(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},kA=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],_A=e=>{try{return A0({abi:kA,data:e})}catch{return null}},RA=[{constant:!1,inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],MA=e=>{try{return A0({abi:RA,data:e})}catch{return null}};import{BigNumber as IA}from"@ethersproject/bignumber";import{useEffect as WA,useState as LA}from"react";import{calculateTotalGasEstimate as OA,populateTransactionRequest as NA}from"@privy-io/js-sdk-core";var x0=(e,t)=>{let[r,o]=LA(null),{getAccessToken:n,user:i}=z(),{walletProxy:a}=M(),l=ve(i),s=async()=>{if(!await n()||!a||!l)return null;let f=[],m=await NA(l.address,e,t).catch(b=>(f.push(b),e)),{totalGasEstimate:u,l1ExecutionFeeEstimate:C}=await OA(m,t).catch(b=>(f.push(b),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:v,hasSufficientFunds:g}=await Md(l.address,m,u??IA.from(0),t).catch(b=>(f.push(b),{balance:null,hasSufficientFunds:!1}));return{tx:m,totalGasEstimate:u,l1ExecutionFeeEstimate:C,balance:v,hasFunds:g,errors:f}};return WA(()=>{r&&o(null),s().then(o)},[e]),r};import{jsx as Ms}from"react/jsx-runtime";var R0=new Tt(new Wr("There was an issue preparing your transaction",M0.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),I0=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=x(),{rpcConfig:n,chains:i,closePrivyModal:a,walletProxy:l}=M(),{getAccessToken:s,user:c}=z(),{wallets:f}=Jr(),m=De(),[u,C]=Rs(e?.sendTransaction?.transactionRequest),[v,g]=Rs(null),[b,E]=Rs(!1),[R,S]=Rs(null),[A,k]=Rs(null);if(!u||!e?.sendTransaction)return Ms(ei,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(R0),a({shouldCallAuthOnSuccess:!1})}});let I=Od(()=>u.from?f.find(V=>k0(V.address)===k0(u.from)):ve(c),[u.from]),F=Od(()=>i.find(V=>Number(V.id)===Number(u.chainId)),[u.chainId]),G=F?.nativeCurrency.symbol??"ETH",{action:Y,amount:j,spender:L,isErc20Ish:U}=Od(()=>P0(u.data),[u.data]);DA(()=>{u.to&&F&&U&&S0({amount:j,address:u.to,chain:F,rpcConfig:m.rpcConfig,privyAppId:m.id}).then(g).catch(console.error)},[u.to,j,F]);let{tokenPrice:W,isTokenPriceLoading:be}=Co(u),Re=Od(()=>Mr(Number(u.chainId),i,n,{appId:m.id}),[u.chainId,n]),re=x0(u,Re),ae=()=>{if(!b)return R?(e?.sendTransaction?.onSuccess(R.response),a({shouldCallAuthOnSuccess:!1})):!A&&!re?.errors[0]?(e?.sendTransaction?.onFailure(new Tt(new Wr("The user rejected the request",M0.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(A??re?.errors[0]??R0),a({shouldCallAuthOnSuccess:!1}))};t.current=ae;let oe=async()=>{E(!0);try{let V=await s();if(b||!V||!I||!l)return;let J=await Rd(V,I.address,l,re?.tx??u,Re,e.sendTransaction?.requesterAppId),Be=await J.wait();S({receipt:Id(Be),response:J})}catch(V){console.warn({transaction:re?.tx??u,error:V}),k(V)}finally{E(!1)}},Ae=async()=>{if(!ve(c))return;if(!m.fundingConfig||m.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let J=Wd({fundingMethods:m.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:J}}),o(J)},Pe=m.embeddedWallets.priceDisplay.primary==="fiat-currency",ze=_0(re?.tx.value??0).add(_0(re?.totalGasEstimate?.toBigInt()??0)).toHexString(),Ke=At(ze,G),mt=Pe&&W?wo(ze,W):void 0,Je=At(re?.totalGasEstimate?.toString()??0,G),le=Pe&&W?wo(re?.totalGasEstimate?.toString()??0,W):void 0,Zt=At(re?.balance?.toString()??0,G,void 0,!0),mr=Pe&&W?wo(re?.balance?.toString()??0,W):void 0,_r=e.sendTransaction?.uiOptions?.transactionInfo?.title||(Y==="approve"?"Confirm address":`Approve ${Y}`),O=e.sendTransaction?.uiOptions?.description||`${m.name} wants your permission to approve the following transaction.`,We=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?Ms("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ft=re&&!re.errors[0]&&!re.hasFunds&&m.fundingConfig&&m.fundingConfig.methods.length>0,D=ft?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return R?.receipt?Ms(E0,{txn:re?.tx??u,onClose:ae,receipt:R.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:W,tokenSymbol:G,l1GasEstimate:re?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):A?Ms(b0,{transactionError:A,chainId:re?.tx.chainId??u.chainId,onClose:ae,onRetry:({resetNonce:V})=>{k(null);let J={...re?.tx??u};V&&(J.nonce=void 0),C(J)}}):Ms(h0,{isSubmitting:b,submitError:A,isPreparing:!re,isTokenPriceLoading:be,isTokenContractInfoLoading:!v,prepareError:re?.errors[0],symbol:v?.symbol,chain:F,img:We,title:_r,subtitle:O,spender:L,total:u.value?mt??Ke:void 0,fee:le??Je,to:u.to,network:m.chains.find(V=>V.id===u.chainId)?.name??"",from:I?.address??"",cta:D,hasFunds:re?.hasFunds,action:Y,balance:mr??Zt,amount:v?.value??j,onClose:ae,onClick:ft?Ae:oe})};import{isHexString as UA}from"@ethersproject/bytes";import{toUtf8String as FA}from"@ethersproject/strings";import{useEffect as W0,useState as Is}from"react";import ba from"styled-components";import{ProviderErrors as Ou}from"@privy-io/js-sdk-core";import{Fragment as O0,jsx as ot,jsxs as Ws}from"react/jsx-runtime";var BA=e=>{if(!UA(e))return e;try{return FA(e)}catch{return e}},HA=e=>JSON.stringify(e,null,2),GA=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?ot(qA,{children:Object.entries(r).map(([o,n])=>Ws("li",{children:[Ws("strong",{children:[o,":"]})," ",t(n)]},o))}):ot("span",{children:String(r)});return ot("div",{children:t(e)})},VA=e=>{let{types:t,primaryType:r,...o}=e.typedData;return Ws(O0,{children:[ot(Nu,{children:ot(GA,{data:o})}),ot(pn,{text:HA(e.typedData),itemName:"full payload to clipboard"})," "]})},L0=()=>{let{authenticated:e}=z(),{initializeWalletProxy:t,closePrivyModal:r}=M(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=x(),[a,l]=Is(!0),[s,c]=Is(""),[f,m]=Is(),[u,C]=Is(null),[v,g]=Is(!1),b=u!==null;W0(()=>{e||o("LANDING")},[e]),W0(()=>{t(Ci).then(Y=>{l(!1),Y||(c("An error has occurred, please try again."),m(new Tt(new Wr(s,Ou.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:E,data:R,confirmAndSign:S,onSuccess:A,onFailure:k,uiOptions:I}=n.signMessage,F={title:I.title||"Sign message",description:I.description||"Signing this message will not cost you any fees.",buttonText:I.buttonText||"Sign and continue"},G=Y=>{Y?A(Y):k(f||new Tt(new Wr("The user rejected the request.",Ou.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{C(null),c(""),m(void 0)},200)};return i.current=()=>{G(u)},Ws(O0,{children:[ot(_,{onClose:()=>G(u)}),ot(ie,{}),I.iconUrl&&typeof I.iconUrl=="string"?ot(YA,{children:ot(O3,{size:"sm",src:I.iconUrl,alt:"app image"})}):null,ot(Bo,{children:F.title}),ot(bo,{children:F.description}),E==="personal_sign"&&ot(Nu,{children:BA(R)}),E==="eth_signTypedData_v4"&&ot(VA,{typedData:R}),E==="solana_signMessage"&&ot(Nu,{children:R}),ot(jA,{}),ot(zA,{fail:!0,children:s}),ot(Lo,{disabled:v||b||a,loading:v,onClick:async()=>{g(!0),c("");try{let Y=await S();C(Y),g(!1),setTimeout(()=>{G(Y)},Me)}catch(Y){console.error(Y),c("An error has occurred, please try again."),m(new Tt(new Wr(s,Ou.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),g(!1)}},children:v?"Signing...":b?Ws(KA,{children:[ot(na,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",ot("span",{children:"Success"})]}):F.buttonText}),ot(se,{}),ot(q,{})]})},Nu=ba.div`
2828
+ `;import{createPublicClient as xA,http as kA}from"viem";var _A=(e,t)=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/Math.pow(10,t)),S0=[{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"}],A0=async({address:e,chain:t,amount:r,rpcConfig:o,privyAppId:n})=>{if(!r)return{value:"",symbol:""};try{let i=xA({chain:t,transport:kA(Ko(t,o,n))}),[a,l]=await Promise.all([i.readContract({abi:S0,address:e,functionName:"symbol"}),i.readContract({abi:S0,address:e,functionName:"decimals"})]);return{value:_A(parseFloat(r.toString()),l),symbol:a}}catch(i){return console.log(i),{value:r.toString(),symbol:""}}};import{decodeFunctionData as P0}from"viem";var x0=e=>{let t=MA(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=WA(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},RA=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],MA=e=>{try{return P0({abi:RA,data:e})}catch{return null}},IA=[{constant:!1,inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],WA=e=>{try{return P0({abi:IA,data:e})}catch{return null}};import{BigNumber as LA}from"@ethersproject/bignumber";import{useEffect as OA,useState as NA}from"react";import{calculateTotalGasEstimate as DA,populateTransactionRequest as UA}from"@privy-io/js-sdk-core";var k0=(e,t)=>{let[r,o]=NA(null),{getAccessToken:n,user:i}=K(),{walletProxy:a}=M(),l=ve(i),s=async()=>{if(!await n()||!a||!l)return null;let f=[],m=await UA(l.address,e,t).catch(b=>(f.push(b),e)),{totalGasEstimate:u,l1ExecutionFeeEstimate:C}=await DA(m,t).catch(b=>(f.push(b),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:v,hasSufficientFunds:g}=await Id(l.address,m,u??LA.from(0),t).catch(b=>(f.push(b),{balance:null,hasSufficientFunds:!1}));return{tx:m,totalGasEstimate:u,l1ExecutionFeeEstimate:C,balance:v,hasFunds:g,errors:f}};return OA(()=>{r&&o(null),s().then(o)},[e]),r};import{jsx as Ms}from"react/jsx-runtime";var M0=new Tt(new Wr("There was an issue preparing your transaction",I0.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),W0=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=x(),{rpcConfig:n,chains:i,closePrivyModal:a,walletProxy:l}=M(),{getAccessToken:s,user:c}=K(),{wallets:f}=Jr(),m=De(),[u,C]=Rs(e?.sendTransaction?.transactionRequest),[v,g]=Rs(null),[b,E]=Rs(!1),[R,S]=Rs(null),[A,k]=Rs(null);if(!u||!e?.sendTransaction)return Ms(ei,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(M0),a({shouldCallAuthOnSuccess:!1})}});let I=Nd(()=>u.from?f.find(V=>_0(V.address)===_0(u.from)):ve(c),[u.from]),F=Nd(()=>i.find(V=>Number(V.id)===Number(u.chainId)),[u.chainId]),G=F?.nativeCurrency.symbol??"ETH",{action:Y,amount:j,spender:L,isErc20Ish:U}=Nd(()=>x0(u.data),[u.data]);FA(()=>{u.to&&F&&U&&A0({amount:j,address:u.to,chain:F,rpcConfig:m.rpcConfig,privyAppId:m.id}).then(g).catch(console.error)},[u.to,j,F]);let{tokenPrice:W,isTokenPriceLoading:be}=Co(u),Re=Nd(()=>Mr(Number(u.chainId),i,n,{appId:m.id}),[u.chainId,n]),re=k0(u,Re),oe=()=>{if(!b)return R?(e?.sendTransaction?.onSuccess(R.response),a({shouldCallAuthOnSuccess:!1})):!A&&!re?.errors[0]?(e?.sendTransaction?.onFailure(new Tt(new Wr("The user rejected the request",I0.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(A??re?.errors[0]??M0),a({shouldCallAuthOnSuccess:!1}))};t.current=oe;let ne=async()=>{E(!0);try{let V=await s();if(b||!V||!I||!l)return;let J=await Md(V,I.address,l,re?.tx??u,Re,e.sendTransaction?.requesterAppId),Be=await J.wait();S({receipt:Wd(Be),response:J})}catch(V){console.warn({transaction:re?.tx??u,error:V}),k(V)}finally{E(!1)}},Ae=async()=>{if(!ve(c))return;if(!m.fundingConfig||m.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let J=Ld({fundingMethods:m.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:J}}),o(J)},Pe=m.embeddedWallets.priceDisplay.primary==="fiat-currency",ze=R0(re?.tx.value??0).add(R0(re?.totalGasEstimate?.toBigInt()??0)).toHexString(),Ke=At(ze,G),mt=Pe&&W?wo(ze,W):void 0,Ze=At(re?.totalGasEstimate?.toString()??0,G),le=Pe&&W?wo(re?.totalGasEstimate?.toString()??0,W):void 0,Zt=At(re?.balance?.toString()??0,G,void 0,!0),mr=Pe&&W?wo(re?.balance?.toString()??0,W):void 0,_r=e.sendTransaction?.uiOptions?.transactionInfo?.title||(Y==="approve"?"Confirm address":`Approve ${Y}`),O=e.sendTransaction?.uiOptions?.description||`${m.name} wants your permission to approve the following transaction.`,We=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?Ms("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ft=re&&!re.errors[0]&&!re.hasFunds&&m.fundingConfig&&m.fundingConfig.methods.length>0,D=ft?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return R?.receipt?Ms(T0,{txn:re?.tx??u,onClose:oe,receipt:R.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:W,tokenSymbol:G,l1GasEstimate:re?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):A?Ms(E0,{transactionError:A,chainId:re?.tx.chainId??u.chainId,onClose:oe,onRetry:({resetNonce:V})=>{k(null);let J={...re?.tx??u};V&&(J.nonce=void 0),C(J)}}):Ms(y0,{isSubmitting:b,submitError:A,isPreparing:!re,isTokenPriceLoading:be,isTokenContractInfoLoading:!v,prepareError:re?.errors[0],symbol:v?.symbol,chain:F,img:We,title:_r,subtitle:O,spender:L,total:u.value?mt??Ke:void 0,fee:le??Ze,to:u.to,network:m.chains.find(V=>V.id===u.chainId)?.name??"",from:I?.address??"",cta:D,hasFunds:re?.hasFunds,action:Y,balance:mr??Zt,amount:v?.value??j,onClose:oe,onClick:ft?Ae:ne})};import{isHexString as BA}from"@ethersproject/bytes";import{toUtf8String as HA}from"@ethersproject/strings";import{useEffect as L0,useState as Is}from"react";import ba from"styled-components";import{ProviderErrors as Du}from"@privy-io/js-sdk-core";import{Fragment as N0,jsx as ot,jsxs as Ws}from"react/jsx-runtime";var GA=e=>{if(!BA(e))return e;try{return HA(e)}catch{return e}},VA=e=>JSON.stringify(e,null,2),qA=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?ot(KA,{children:Object.entries(r).map(([o,n])=>Ws("li",{children:[Ws("strong",{children:[o,":"]})," ",t(n)]},o))}):ot("span",{children:String(r)});return ot("div",{children:t(e)})},zA=e=>{let{types:t,primaryType:r,...o}=e.typedData;return Ws(N0,{children:[ot(Uu,{children:ot(qA,{data:o})}),ot(pn,{text:VA(e.typedData),itemName:"full payload to clipboard"})," "]})},O0=()=>{let{authenticated:e}=K(),{initializeWalletProxy:t,closePrivyModal:r}=M(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=x(),[a,l]=Is(!0),[s,c]=Is(""),[f,m]=Is(),[u,C]=Is(null),[v,g]=Is(!1),b=u!==null;L0(()=>{e||o("LANDING")},[e]),L0(()=>{t(Ci).then(Y=>{l(!1),Y||(c("An error has occurred, please try again."),m(new Tt(new Wr(s,Du.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:E,data:R,confirmAndSign:S,onSuccess:A,onFailure:k,uiOptions:I}=n.signMessage,F={title:I.title||"Sign message",description:I.description||"Signing this message will not cost you any fees.",buttonText:I.buttonText||"Sign and continue"},G=Y=>{Y?A(Y):k(f||new Tt(new Wr("The user rejected the request.",Du.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{C(null),c(""),m(void 0)},200)};return i.current=()=>{G(u)},Ws(N0,{children:[ot(_,{onClose:()=>G(u)}),ot(ae,{}),I.iconUrl&&typeof I.iconUrl=="string"?ot(XA,{children:ot(D3,{size:"sm",src:I.iconUrl,alt:"app image"})}):null,ot(Bo,{children:F.title}),ot(bo,{children:F.description}),E==="personal_sign"&&ot(Uu,{children:GA(R)}),E==="eth_signTypedData_v4"&&ot(zA,{typedData:R}),E==="solana_signMessage"&&ot(Uu,{children:R}),ot(QA,{}),ot(YA,{fail:!0,children:s}),ot(Lo,{disabled:v||b||a,loading:v,onClick:async()=>{g(!0),c("");try{let Y=await S();C(Y),g(!1),setTimeout(()=>{G(Y)},Me)}catch(Y){console.error(Y),c("An error has occurred, please try again."),m(new Tt(new Wr(s,Du.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),g(!1)}},children:v?"Signing...":b?Ws(jA,{children:[ot(na,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",ot("span",{children:"Success"})]}):F.buttonText}),ot(se,{}),ot(q,{})]})},Uu=ba.div`
2826
2829
  margin-top: 1.5rem;
2827
2830
  background-color: var(--privy-color-background-2);
2828
2831
  border-radius: var(--privy-border-radius-md);
@@ -2841,7 +2844,7 @@ You will have to sign up with another method first to register a passkey for you
2841
2844
  display: none; /* Safari and Chrome */
2842
2845
  }
2843
2846
  }
2844
- `,qA=ba.ul`
2847
+ `,KA=ba.ul`
2845
2848
  margin-left: 12px !important;
2846
2849
  white-space: nowrap;
2847
2850
 
@@ -2853,7 +2856,7 @@ You will have to sign up with another method first to register a passkey for you
2853
2856
  font-weight: 500 !important;
2854
2857
  }
2855
2858
  }
2856
- `,zA=ba.div`
2859
+ `,YA=ba.div`
2857
2860
  line-height: 20px;
2858
2861
  height: 20px;
2859
2862
  font-size: 13px;
@@ -2863,20 +2866,20 @@ You will have to sign up with another method first to register a passkey for you
2863
2866
  width: 100%;
2864
2867
  margin-top: 16px;
2865
2868
  margin-bottom: 4px;
2866
- `,KA=ba.span`
2869
+ `,jA=ba.span`
2867
2870
  display: flex;
2868
2871
  align-items: center;
2869
2872
  gap: 8px;
2870
- `,YA=ba.div`
2873
+ `,XA=ba.div`
2871
2874
  display: flex;
2872
2875
  flex-direction: column;
2873
2876
  justify-content: center;
2874
2877
  align-items: center;
2875
2878
  width: 100%;
2876
2879
  height: 82px;
2877
- `,jA=ba.div`
2880
+ `,QA=ba.div`
2878
2881
  flex-grow: 1;
2879
- `;import{useEffect as N0,useState as D0}from"react";import XA from"styled-components";import{Fragment as ZA,jsx as Po,jsxs as Nd}from"react/jsx-runtime";var U0=()=>{let{authenticated:e,logout:t,ready:r,user:o}=z(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=x(),{initLoginWithTelegram:s,loginWithTelegram:c,updateWallets:f,setReadyToTrue:m,closePrivyModal:u,createAnalyticsEvent:C}=M(),[v,g]=D0(!1),[b,E]=D0(void 0),R=Me;async function S(){try{await c(),g(!0),m(!0)}catch(I){if(I?.privyErrorCode==="allowlist_rejected"){E(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(I?.privyErrorCode==="max_accounts_reached"){console.error(new Rr(I).toString()),E(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(I?.privyErrorCode==="user_does_not_exist"){E(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:F,detail:G}=tp(I);E({retryable:F,detail:G,message:"Authentication failed"})}}N0(()=>{S()},[]),N0(()=>{if(!(r&&e&&v&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(G)}if(Gt(o,n?.embeddedWallets?.createOnLogin)){let G=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Y=>{console.error(Y),C({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)}f();let F=setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R);return()=>clearTimeout(F)},[r,e,v,o]);let A=v?"Successfully connected with Telegram":b?b.message:"Verifying connection to Telegram",k="";return v?k="You\u2019re good to go!":b?k=b.detail:k="Just a few moments more",Nd(ZA,{children:[Po(_,{}),Po(ie,{}),Nd(QA,{children:[Po(tt,{children:Nd("div",{children:[Po(lt,{success:v,fail:!!b}),Po(ld,{style:{width:"38px",height:"38px"}})]})}),Nd(Xe,{children:[Po("h3",{children:A}),Po("p",{children:k})]}),b&&b?.retryable?Po(Jo,{onClick:()=>{s().then(async()=>S()).catch(I=>{let{retryable:F,detail:G}=tp(I);E({retryable:F,detail:G,message:"Authentication failed"})}),E(void 0)},disabled:!v&&!b?.retryable,children:"Retry"}):null]}),Po(se,{}),Po(Z,{})]})},QA=XA.div`
2882
+ `;import{useEffect as D0,useState as U0}from"react";import ZA from"styled-components";import{Fragment as $A,jsx as Po,jsxs as Dd}from"react/jsx-runtime";var F0=()=>{let{authenticated:e,logout:t,ready:r,user:o}=K(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=x(),{initLoginWithTelegram:s,loginWithTelegram:c,updateWallets:f,setReadyToTrue:m,closePrivyModal:u,createAnalyticsEvent:C}=M(),[v,g]=U0(!1),[b,E]=U0(void 0),R=Me;async function S(){try{await c(),g(!0),m(!0)}catch(I){if(I?.privyErrorCode==="allowlist_rejected"){E(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(I?.privyErrorCode==="max_accounts_reached"){console.error(new Rr(I).toString()),E(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(I?.privyErrorCode==="user_does_not_exist"){E(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:F,detail:G}=rp(I);E({retryable:F,detail:G,message:"Authentication failed"})}}D0(()=>{S()},[]),D0(()=>{if(!(r&&e&&v&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(G)}if(Gt(o,n?.embeddedWallets?.createOnLogin)){let G=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Y=>{console.error(Y),C({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)}f();let F=setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R);return()=>clearTimeout(F)},[r,e,v,o]);let A=v?"Successfully connected with Telegram":b?b.message:"Verifying connection to Telegram",k="";return v?k="You\u2019re good to go!":b?k=b.detail:k="Just a few moments more",Dd($A,{children:[Po(_,{}),Po(ae,{}),Dd(JA,{children:[Po(tt,{children:Dd("div",{children:[Po(lt,{success:v,fail:!!b}),Po(cd,{style:{width:"38px",height:"38px"}})]})}),Dd(je,{children:[Po("h3",{children:A}),Po("p",{children:k})]}),b&&b?.retryable?Po(Jo,{onClick:()=>{s().then(async()=>S()).catch(I=>{let{retryable:F,detail:G}=rp(I);E({retryable:F,detail:G,message:"Authentication failed"})}),E(void 0)},disabled:!v&&!b?.retryable,children:"Retry"}):null]}),Po(se,{}),Po(Z,{})]})},JA=ZA.div`
2880
2883
  display: flex;
2881
2884
  flex-direction: column;
2882
2885
  align-items: center;
@@ -2884,9 +2887,9 @@ You will have to sign up with another method first to register a passkey for you
2884
2887
  margin-left: 27px;
2885
2888
  margin-right: 27px;
2886
2889
  gap: 24px;
2887
- `;import oP from"@heroicons/react/24/outline/EnvelopeIcon";import JA from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as $A,useState as F0}from"react";import H0 from"styled-components";import{Fragment as rP,jsx as Ls,jsxs as B0}from"react/jsx-runtime";var G0=$A((e,t)=>{let[r,o]=F0(""),[n,i]=F0(!1),{authenticated:a,user:l}=z(),{initUpdateEmail:s}=M(),{navigate:c,setModalData:f,currentScreen:m}=x(),{enabled:u,token:C}=Te(),v=$s(r),g=n,b=n||!v,E=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(A){f({errorModalData:{error:A,previousScreen:m||"LANDING"}})}i(!1)},R=()=>{u&&!C&&!a?(f({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")):E(C)};return B0(rP,{children:[Ls(eP,{children:B0(tP,{children:[Ls(JA,{}),Ls("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:Ls(Oi,{isSubmitting:g,onClick:R,disabled:b,children:"Submit"})]})}),e.stacked?Ls(H,{loadingText:null,loading:g,disabled:b,onClick:R,children:"Submit"}):null]})}),eP=H0.div`
2890
+ `;import iP from"@heroicons/react/24/outline/EnvelopeIcon";import eP from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as tP,useState as B0}from"react";import G0 from"styled-components";import{Fragment as nP,jsx as Ls,jsxs as H0}from"react/jsx-runtime";var V0=tP((e,t)=>{let[r,o]=B0(""),[n,i]=B0(!1),{authenticated:a,user:l}=K(),{initUpdateEmail:s}=M(),{navigate:c,setModalData:f,currentScreen:m}=x(),{enabled:u,token:C}=Te(),v=$s(r),g=n,b=n||!v,E=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(A){f({errorModalData:{error:A,previousScreen:m||"LANDING"}})}i(!1)},R=()=>{u&&!C&&!a?(f({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")):E(C)};return H0(nP,{children:[Ls(rP,{children:H0(oP,{children:[Ls(eP,{}),Ls("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:Ls(Oi,{isSubmitting:g,onClick:R,disabled:b,children:"Submit"})]})}),e.stacked?Ls(H,{loadingText:null,loading:g,disabled:b,onClick:R,children:"Submit"}):null]})}),rP=G0.div`
2888
2891
  width: 100%;
2889
- `,tP=H0.label`
2892
+ `,oP=G0.label`
2890
2893
  display: block;
2891
2894
  position: relative;
2892
2895
  width: 100%;
@@ -2944,7 +2947,7 @@ You will have to sign up with another method first to register a passkey for you
2944
2947
  && > input::placeholder {
2945
2948
  color: var(--privy-color-foreground-3);
2946
2949
  }
2947
- `;import{Fragment as nP,jsx as Pn,jsxs as iP}from"react/jsx-runtime";var V0=()=>iP(nP,{children:[Pn(_,{},"header"),Pn(ie,{}),Pn(fe,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:Pn(oP,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Pn(lr,{children:Pn(G0,{stacked:!0})}),Pn(se,{}),Pn(q,{})]});import aP from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as sP,jsx as xn,jsxs as lP}from"react/jsx-runtime";var q0=()=>{let{currentScreen:e,data:t,navigate:r,setModalData:o}=x(),{user:n}=z(),{initUpdatePhone:i}=M();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 lP(sP,{children:[xn(_,{},"header"),xn(ie,{}),xn(fe,{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:xn(aP,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),xn(lr,{children:xn(gn,{stacked:!0,onSubmit:a,hideRecent:!0})}),xn(se,{}),xn(q,{})]})};import Uu from"styled-components";import{jsx as z0}from"react/jsx-runtime";var K0=({style:e,...t})=>z0("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:z0("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"})});import{Fragment as uP,jsx as mi,jsxs as Du}from"react/jsx-runtime";var Y0=()=>{let{navigate:e}=x();return Du(uP,{children:[mi(_,{}),Du(cP,{children:[mi(dP,{children:mi(K0,{})}),Du(pP,{children:[mi("h3",{children:"Unable to sign in"}),mi("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),mi(H,{onClick:()=>{e("LANDING")},children:"Go back"})]}),mi(q,{})]})},cP=Uu.div`
2950
+ `;import{Fragment as aP,jsx as Pn,jsxs as sP}from"react/jsx-runtime";var q0=()=>sP(aP,{children:[Pn(_,{},"header"),Pn(ae,{}),Pn(fe,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:Pn(iP,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Pn(lr,{children:Pn(V0,{stacked:!0})}),Pn(se,{}),Pn(q,{})]});import lP from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as cP,jsx as xn,jsxs as dP}from"react/jsx-runtime";var z0=()=>{let{currentScreen:e,data:t,navigate:r,setModalData:o}=x(),{user:n}=K(),{initUpdatePhone:i}=M();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 dP(cP,{children:[xn(_,{},"header"),xn(ae,{}),xn(fe,{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:xn(lP,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),xn(lr,{children:xn(gn,{stacked:!0,onSubmit:a,hideRecent:!0})}),xn(se,{}),xn(q,{})]})};import Bu from"styled-components";import{jsx as K0}from"react/jsx-runtime";var Y0=({style:e,...t})=>K0("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:K0("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"})});import{Fragment as fP,jsx as mi,jsxs as Fu}from"react/jsx-runtime";var j0=()=>{let{navigate:e}=x();return Fu(fP,{children:[mi(_,{}),Fu(pP,{children:[mi(uP,{children:mi(Y0,{})}),Fu(mP,{children:[mi("h3",{children:"Unable to sign in"}),mi("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),mi(H,{onClick:()=>{e("LANDING")},children:"Go back"})]}),mi(q,{})]})},pP=Bu.div`
2948
2951
  display: flex;
2949
2952
  flex-direction: column;
2950
2953
  align-items: center;
@@ -2953,7 +2956,7 @@ You will have to sign up with another method first to register a passkey for you
2953
2956
  width: 100%;
2954
2957
  padding-top: 8px;
2955
2958
  padding-bottom: 32px;
2956
- `,dP=Uu.div`
2959
+ `,uP=Bu.div`
2957
2960
  display: flex;
2958
2961
  align-items: center;
2959
2962
  justify-content: center;
@@ -2962,11 +2965,11 @@ You will have to sign up with another method first to register a passkey for you
2962
2965
  color: var(--privy-color-error);
2963
2966
  background-color: var(--privy-color-error-light);
2964
2967
  border-radius: 50%;
2965
- `,pP=Uu.div`
2968
+ `,mP=Bu.div`
2966
2969
  display: flex;
2967
2970
  flex-direction: column;
2968
2971
  gap: 8px;
2969
- `;import fP,{createGlobalStyle as hP}from"styled-components";var mP=`
2972
+ `;import yP,{createGlobalStyle as gP}from"styled-components";var hP=`
2970
2973
  *,
2971
2974
  ::before,
2972
2975
  ::after {
@@ -3196,7 +3199,7 @@ You will have to sign up with another method first to register a passkey for you
3196
3199
  [hidden] {
3197
3200
  display: none;
3198
3201
  }
3199
- `,j0=mP;var X0=hP`
3202
+ `,X0=hP;var Q0=gP`
3200
3203
  :root {
3201
3204
  // Borders
3202
3205
  --privy-border-radius-sm: 6px;
@@ -3231,10 +3234,10 @@ You will have to sign up with another method first to register a passkey for you
3231
3234
  --privy-height-modal-full: 620px;
3232
3235
  --privy-height-modal-compact: 480px;
3233
3236
  };
3234
- `,Fu=fP.div`
3237
+ `,Hu=yP.div`
3235
3238
  // css normalize only the privy application to avoid conflicts
3236
3239
  // with consuming application
3237
- ${j0}
3240
+ ${X0}
3238
3241
 
3239
3242
  // Privy styles
3240
3243
  color: var(--privy-color-foreground-2);
@@ -3285,7 +3288,7 @@ You will have to sign up with another method first to register a passkey for you
3285
3288
  opacity: 1;
3286
3289
  }
3287
3290
  }
3288
- `;import{Dialog as Q0,Transition as Bu}from"@headlessui/react";import Hu from"react";import Os from"styled-components";import{jsx as Ea,jsxs as wP}from"react/jsx-runtime";var Z0=({children:e,open:t,onClick:r,...o})=>Ea(Bu,{show:t,as:Hu.Fragment,children:wP(Q0,{onClose:r,...o,as:gP,children:[Ea(Bu.Child,{as:Hu.Fragment,enterFrom:"entering",leaveTo:"leaving",children:Ea(yP,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),Ea(vP,{children:Ea(Bu.Child,{as:Hu.Fragment,enterFrom:"entering",leaveTo:"leaving",children:Ea(Q0.Panel,{as:CP,children:e})})})]})}),yP=Os.div`
3291
+ `;import{Dialog as Z0,Transition as Gu}from"@headlessui/react";import Vu from"react";import Os from"styled-components";import{jsx as Ea,jsxs as EP}from"react/jsx-runtime";var J0=({children:e,open:t,onClick:r,...o})=>Ea(Gu,{show:t,as:Vu.Fragment,children:EP(Z0,{onClose:r,...o,as:CP,children:[Ea(Gu.Child,{as:Vu.Fragment,enterFrom:"entering",leaveTo:"leaving",children:Ea(vP,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),Ea(wP,{children:Ea(Gu.Child,{as:Vu.Fragment,enterFrom:"entering",leaveTo:"leaving",children:Ea(Z0.Panel,{as:bP,children:e})})})]})}),vP=Os.div`
3289
3292
  position: fixed;
3290
3293
  inset: 0;
3291
3294
 
@@ -3298,10 +3301,10 @@ You will have to sign up with another method first to register a passkey for you
3298
3301
  backdrop-filter: unset;
3299
3302
  -webkit-backdrop-filter: unset;
3300
3303
  }
3301
- `,gP=Os.div`
3304
+ `,CP=Os.div`
3302
3305
  position: relative;
3303
3306
  z-index: 999999;
3304
- `,vP=Os.div`
3307
+ `,wP=Os.div`
3305
3308
  position: fixed;
3306
3309
  inset: 0;
3307
3310
  display: flex;
@@ -3309,7 +3312,7 @@ You will have to sign up with another method first to register a passkey for you
3309
3312
  justify-content: center;
3310
3313
  width: 100vw;
3311
3314
  min-height: 100vh;
3312
- `,CP=Os.div`
3315
+ `,bP=Os.div`
3313
3316
  // reset some default dialog styles
3314
3317
  padding: 0;
3315
3318
  background: transparent;
@@ -3356,13 +3359,13 @@ You will have to sign up with another method first to register a passkey for you
3356
3359
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3357
3360
  border-radius: var(--privy-border-radius-lg);
3358
3361
  }
3359
- `,J0=Os.div`
3362
+ `,$0=Os.div`
3360
3363
  display: flex;
3361
3364
  flex-direction: column;
3362
3365
  align-items: center;
3363
3366
  justify-content: center;
3364
3367
  height: 100%;
3365
- `;import{Fragment as ev,jsx as pt,jsxs as tv}from"react/jsx-runtime";var SP={["LANDING"]:Y2,["CONNECT_OR_CREATE"]:z2,["AWAITING_PASSWORDLESS_CODE"]:ty,["AWAITING_CONNECTION"]:_y,["AWAITING_CONNECT_ONLY_CONNECTION"]:Iy,["AWAITING_FARCASTER_CONNECTION"]:Dg,["AWAITING_FARCASTER_SIGNER"]:Vg,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:z3,["PHANTOM_INTERSTITIAL_SCREEN"]:X3,["LOGIN_FAILED_SCREEN"]:e3,["AWAITING_OAUTH_SCREEN"]:G3,["CROSS_APP_AUTH_SCREEN"]:Ny,["ALLOWLIST_REJECTION_SCREEN"]:Kh,["ACCOUNT_NOT_FOUND_SCREEN"]:Uh,["USER_LIMIT_REACHED_SCREEN"]:Y0,["INSTALL_PHANTOM_SCREEN"]:E2,["LINK_EMAIL_SCREEN"]:j2,["LINK_PHONE_SCREEN"]:X2,["LINK_WALLET_SCREEN"]:Q2,["LINK_PASSKEY_SCREEN"]:A1,["UPDATE_EMAIL_SCREEN"]:V0,["UPDATE_PHONE_SCREEN"]:q0,["CONNECT_ONLY_LANDING_SCREEN"]:Sy,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Ty,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Qy,["EMBEDDED_WALLET_CREATED_SCREEN"]:qy,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Gy,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:Q3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:s0,["EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN"]:p0,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:n0,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Yy,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:L0,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:I0,["FUNDING_METHOD_SELECTION_SCREEN"]:J1,["MOONPAY_PROMPT_SCREEN"]:p2,["MOONPAY_STATUS_SCREEN"]:m2,["COINBASE_ONRAMP_STATUS_SCREEN"]:j1,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:y2,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:U1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:t2,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Eg,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:bg,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:a0,["MFA_ENROLLMENT_FLOW_SCREEN"]:f3,["CAPTCHA_SCREEN"]:iy,["ERROR_SCREEN"]:Sg,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:g2,["AFFIRMATIVE_CONSENT_SCREEN"]:Vh,["TELEGRAM_AUTH_SCREEN"]:U0},AP=["LANDING","AWAITING_CONNECTION"],ov=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=z(),{headless:n}=De(),{ready:i,currentScreen:a}=x(),{status:l,execute:s,reset:c,enabled:f}=Te(),m=o&&a&&AP.includes(a)&&!n&&l==="ready";if($0(()=>{m&&s()},[m]),$0(()=>{!o&&f&&c()},[o,f]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return tv(ev,{children:[pt(_,{}),pt(ie,{}),pt(J0,{children:pt(ct,{})}),pt(se,{}),pt(Z,{})]});if(!a&&e)return pt(ku,{open:e,onClose:t});if(!a)return null;let u=SP[a];return tv(ev,{children:[pt(Yr,{if:!!e,children:pt(u,{})}),pt(Yr,{if:!e,children:pt(ku,{open:e,onClose:t})})]})},PP=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=EP(null),o=kh(r);return pt(kP,{style:{height:o},id:"privy-modal-content",children:pt("div",{ref:r,children:pt(ov,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},xP=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=x();return{gracefulClosePrivyModal:bP(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Gu=({open:e})=>{let{app:t}=x(),{gracefulClosePrivyModal:r}=xP(),[o,n]=TP(!1);mp({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?pt(Fu,{children:pt(nv,{id:"privy-modal-content",children:pt(ov,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):pt(Z0,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:pt(Fu,{children:pt(PP,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},nv=rv.div`
3368
+ `;import{Fragment as tv,jsx as pt,jsxs as rv}from"react/jsx-runtime";var PP={["LANDING"]:X2,["CONNECT_OR_CREATE"]:Y2,["AWAITING_PASSWORDLESS_CODE"]:oy,["AWAITING_CONNECTION"]:My,["AWAITING_CONNECT_ONLY_CONNECTION"]:Ly,["AWAITING_FARCASTER_CONNECTION"]:Fg,["AWAITING_FARCASTER_SIGNER"]:zg,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:Y3,["PHANTOM_INTERSTITIAL_SCREEN"]:Z3,["LOGIN_FAILED_SCREEN"]:r3,["AWAITING_OAUTH_SCREEN"]:q3,["CROSS_APP_AUTH_SCREEN"]:Uy,["ALLOWLIST_REJECTION_SCREEN"]:jh,["ACCOUNT_NOT_FOUND_SCREEN"]:Bh,["USER_LIMIT_REACHED_SCREEN"]:j0,["INSTALL_PHANTOM_SCREEN"]:S2,["LINK_EMAIL_SCREEN"]:Q2,["LINK_PHONE_SCREEN"]:Z2,["LINK_WALLET_SCREEN"]:J2,["LINK_PASSKEY_SCREEN"]:x1,["UPDATE_EMAIL_SCREEN"]:q0,["UPDATE_PHONE_SCREEN"]:z0,["CONNECT_ONLY_LANDING_SCREEN"]:Py,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Ay,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Jy,["EMBEDDED_WALLET_CREATED_SCREEN"]:Ky,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:qy,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:J3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:c0,["EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN"]:m0,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:a0,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Xy,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:O0,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:W0,["FUNDING_METHOD_SELECTION_SCREEN"]:e2,["MOONPAY_PROMPT_SCREEN"]:m2,["MOONPAY_STATUS_SCREEN"]:h2,["COINBASE_ONRAMP_STATUS_SCREEN"]:Q1,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:v2,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:B1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:o2,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Sg,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Tg,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:l0,["MFA_ENROLLMENT_FLOW_SCREEN"]:y3,["CAPTCHA_SCREEN"]:sy,["ERROR_SCREEN"]:Pg,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:C2,["AFFIRMATIVE_CONSENT_SCREEN"]:zh,["TELEGRAM_AUTH_SCREEN"]:F0},xP=["LANDING","AWAITING_CONNECTION"],nv=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=K(),{headless:n}=De(),{ready:i,currentScreen:a}=x(),{status:l,execute:s,reset:c,enabled:f}=Te(),m=o&&a&&xP.includes(a)&&!n&&l==="ready";if(ev(()=>{m&&s()},[m]),ev(()=>{!o&&f&&c()},[o,f]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return rv(tv,{children:[pt(_,{}),pt(ae,{}),pt($0,{children:pt(ct,{})}),pt(se,{}),pt(Z,{})]});if(!a&&e)return pt(_u,{open:e,onClose:t});if(!a)return null;let u=PP[a];return rv(tv,{children:[pt(Yr,{if:!!e,children:pt(u,{})}),pt(Yr,{if:!e,children:pt(_u,{open:e,onClose:t})})]})},kP=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=SP(null),o=Rh(r);return pt(RP,{style:{height:o},id:"privy-modal-content",children:pt("div",{ref:r,children:pt(nv,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},_P=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=x();return{gracefulClosePrivyModal:TP(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},qu=({open:e})=>{let{app:t}=x(),{gracefulClosePrivyModal:r}=_P(),[o,n]=AP(!1);fp({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?pt(Hu,{children:pt(iv,{id:"privy-modal-content",children:pt(nv,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):pt(J0,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:pt(Hu,{children:pt(kP,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},iv=ov.div`
3366
3369
  display: flex;
3367
3370
  flex-direction: column;
3368
3371
  text-align: center;
@@ -3371,7 +3374,7 @@ You will have to sign up with another method first to register a passkey for you
3371
3374
  width: 100%;
3372
3375
  background: var(--privy-color-background);
3373
3376
  padding: 0 16px;
3374
- `,kP=rv(nv)`
3377
+ `,RP=ov(iv)`
3375
3378
  transition: height 150ms ease-out;
3376
3379
  overflow: hidden;
3377
3380
 
@@ -3385,4 +3388,4 @@ You will have to sign up with another method first to register a passkey for you
3385
3388
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3386
3389
  border-radius: var(--privy-border-radius-lg);
3387
3390
  }
3388
- `;import{useRef as iv,useEffect as _P}from"react";import{jsx as MP}from"react/jsx-runtime";function RP({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 av(e){let t=iv(null),r=iv();return _P(()=>{r.current?.remove(),r.current=RP(e),t.current?.after(r.current)},[e]),MP("div",{ref:t,hidden:!0})}import{useState as IP}from"react";import{useEffect as sv,useRef as lv}from"react";var Dd=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 kn(e,t,r,o,n,i=!1){let a=i,l=async f=>{if(a&&t&&t.length>0){f===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Oe("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((u,C)=>{r.current={resolve:u,reject:C};let v=1e3*60*5;setTimeout(()=>{let g=new Oe("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),C(g)},v)});return await e(m)}return await e()},s=4,c=null;for(let f=0;f<s;f++)try{c=await l(f),o.current?.resolve(void 0);break}catch(m){if(m.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),m}if(c===null){let f=new Oe("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(f),f}return c}import{jsx as UP}from"react/jsx-runtime";var WP=function(e){return()=>`id-${e++}`}(0);function LP(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function bt(e){return e.error!==void 0}var yt=new Dd,Vu=new Map,OP=(e,t)=>typeof t=="bigint"?t.toString():t,NP=(e,t)=>`${e}${JSON.stringify(t,OP)}`;function Et(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=NP(e,t);if(e==="privy:wallet:create"){let l=Vu.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=WP();yt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{Vu.delete(i)});return Vu.set(i,a),a}function DP(e){switch(e.event){case"privy:iframe:ready":let t=yt.dequeue(e.event,e.id);return bt(e)?t.reject(new Oe(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=yt.dequeue(e.event,e.id);return bt(e)?r.reject(new Oe(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=yt.dequeue(e.event,e.id);return bt(e)?o.reject(new Oe(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=yt.dequeue(e.event,e.id);return bt(e)?n.reject(new Oe(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let i=yt.dequeue(e.event,e.id);return bt(e)?i.reject(new Oe(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let a=yt.dequeue(e.event,e.id);return bt(e)?a.reject(new Oe(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery":let l=yt.dequeue(e.event,e.id);return bt(e)?l.reject(new Oe(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:verify":let s=yt.dequeue(e.event,e.id);return bt(e)?s.reject(new Oe(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:init-enrollment":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:submit-enrollment":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:unenroll":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:clear":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:init-signer":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:sign":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:solana-wallet:create":let c=yt.dequeue(e.event,e.id);return bt(e)?c.reject(new Oe(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let f=yt.dequeue(e.event,e.id);return bt(e)?f.reject(new Oe(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:recover":let m=yt.dequeue(e.event,e.id);return bt(e)?m.reject(new Oe(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:rpc":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function cv(e){let t=lv(null),r=lv(e.mfaMethods),o=Li(),[n,i]=IP(!1);return sv(()=>{r.current=e.mfaMethods},[e.mfaMethods]),sv(()=>{if(!n)return;let a=t.current;if(!a)return;function l(u){u&&u.origin===e.origin&&LP(u.data)&&DP(u.data)}let s={create(u){return Et("privy:wallet:create",u,a,e.origin)},import(u){return Et("privy:wallet:import",u,a,e.origin)},connect(u){return Et("privy:wallet:connect",u,a,e.origin)},recover(u){return kn(C=>Et("privy:wallet:recover",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!u.recoveryMethod||u.recoveryMethod==="privy")},rpc(u){return kn(C=>Et("privy:wallet:rpc",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(u){return Et("privy:solana-wallet:create",u,a,e.origin)},connectSolana(u){return Et("privy:solana-wallet:connect",u,a,e.origin)},recoverSolana(u){return Et("privy:solana-wallet:recover",u,a,e.origin)},rpcSolana(u){return Et("privy:solana-wallet:rpc",u,a,e.origin)},setRecovery(u){return kn(C=>Et("privy:wallet:set-recovery",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return kn(C=>Et("privy:mfa:verify",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return kn(C=>Et("privy:mfa:init-enrollment",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return kn(C=>Et("privy:mfa:submit-enrollment",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(u){return kn(C=>Et("privy:mfa:unenroll",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(u){return Et("privy:mfa:clear",u,a,e.origin)},initFarcasterSigner(u){return Et("privy:farcaster:init-signer",u,a,e.origin)},signFarcasterMessage(u){return Et("privy:farcaster:sign",u,a,e.origin)}};window.addEventListener("message",l);let c=()=>e.onLoad(s),f=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},m=new AbortController;return Pa(()=>Et("privy:iframe:ready",{},a,e.origin),{abortSignal:m.signal}).then(c,f),()=>{window.removeEventListener("message",l),m.abort()}},[n]),UP("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:el(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Ud=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 pv({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await Ce())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await dv())throw new w("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.")}}};function uv(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.")}async function mv({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new w("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",f)}let s,c=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(c),clearTimeout(a),n(new w("User rejected request")))},300);function f(m){m.data&&(m.data.type==="PRIVY_OAUTH_RESPONSE"&&m.data.stateCode&&m.data.authorizationCode&&(clearTimeout(a),o(m.data),l()),m.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new w(m.data.error)),l()),m.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=f))}window.addEventListener("message",f)})}var FP="https://cdn.apple-cloudkit.com";async function qu({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===FP&&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 fv=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});import{jsx as kr,jsxs as hv}from"react/jsx-runtime";var ko;function KP(e){return typeof e=="string"&&e.length===25}function Ce(){if(!ko){let e=X.get(Rn);return Promise.resolve(e||null)}return ko.getAccessToken()}var yv,If=(e,t,r)=>yv(e,t,r),gv,Wf=(e,t)=>gv(e,t),vv,Lf=(e,t)=>vv(e,t),Cv,Of=()=>Cv(),wv,dv=()=>wv(),bv,pv=({message:e})=>bv({message:e}),YP=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(_a,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},jP=({config:e,...t})=>{if(typeof window<"u"&&["localhost","127.0.0.1"].indexOf(window.location.hostname)<0&&window.location.protocol!=="https:")throw new w("Embedded wallet is only available over HTTPS");if(!KP(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");ko||(ko=new Ba({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."),kr(gh,{client:ko,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:kr(XP,{...t,client:ko})})},XP=e=>{let t=e.client,[r,o]=ut(!1),[n,i]=ut(!1),[a,l]=ut(!1),[s,c]=ut(null),[f,m]=ut([]),[u,C]=ut(null),v=Ta(f),[g,b]=ut(!1),[E,R]=ut(null),[S,A]=ut(!1),[k,I]=ut({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:T}),[F,G]=ut({status:"initial"}),[Y,j]=ut(null),[L,U]=ut(null),W=De(),be=Fl(),[Re,re]=ut(!0),[ae,oe]=ut({}),[Ae,Pe]=ut(null),[ze,Ke]=ut(null),[mt,Je]=ut(!1),[le,Zt]=ut(!1),mr=Ta(null),_r=Ta(null),O=Ta(_h),[We,ft]=ut(!1);t.onStoreToken=d=>{d&&B(O,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),B(O,"accessToken","onAccessTokenRemoved")};let D=Ta(null),V=Ta(null),J=d=>{R(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},Be=d=>{W.embeddedWallets.createOnLogin!=="off"&&re(!0),J(d)};ro(()=>{let d=Un(s);if(!d||!L){C(null);return}let p={address:d.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Qo,id:"io.privy.solana.wallet"},getProvider:async()=>new Ud(L,d.address)};C(p)},[L,s]),ro(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=ve(s),p=Sl(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,W.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,W.defaultChain,e.appId)},[L,s]),ro(()=>{L&&ze?.(L)},[L]),ro(()=>{(async()=>{if(!W.customAuth?.enabled)return;re(!0);let{getCustomAccessToken:p,isLoading:h}=W.customAuth;if(!(!n||h))try{let y=await p();if(!y&&a){await hi.logout();return}if(!y||a)return;t.startAuthFlow(new gi(y));let{user:P,isNewUser:N}=await t.authenticate();if(!P){await hi.logout();return}c(P||null),b(N||!1),l(!0),Zt(!0)}catch(y){console.warn(y),a&&await hi.logout()}})()},[W.customAuth?.enabled,W.customAuth?.getCustomAccessToken,W.customAuth?.isLoading,n,a]),ro(()=>{le&&L&&s&&Gt(s,W.embeddedWallets.createOnLogin)&&(Zt(!1),Fd(s,Ci).catch(console.error))},[le&&L&&s]),ro(()=>{async function d(){let p=_o(),h=oo();YP();let y=BP();t.initializeConnectorManager({walletConnectCloudProjectId:W.walletConnectCloudProjectId,rpcConfig:W.rpcConfig,chains:W.chains,defaultChain:W.defaultChain,store:y,walletList:W.appearance.walletList,shouldEnforceDefaultChainOnConnect:W.shouldEnforceDefaultChainOnConnect,externalWalletConfig:W.externalWallets,appName:W.name??"Privy"});let P;t.connectors?.on("connectorInitialized",()=>{P&&clearTimeout(P);let ee=t.connectors.walletConnectors.length,Q=t.connectors.walletConnectors.reduce((Ee,He)=>Ee+(He.initialized?1:0),0);Q===ee?ft(!0):P=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:Q,expected:ee}),ft(!0)},1500)}),t.connectors?.initialize().then(()=>{xv()});let N=await t.getAuthenticatedUser(),K=!!N;if(W.customAuth?.enabled||(l(!!N),N&&B(O,"login","onComplete",N,!1,!0,null,null),c(N)),p){V.current=K?"link":"login";return}if(h&&!K){V.current="login",Be("TELEGRAM_AUTH_SCREEN");return}ne.setReadyToTrue(!!N)}!n&&be&&d()},[t,Ae,n,be]),ro(()=>{if(!n)return;if(!s){Je(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){Je(!0);return}let p=!!f.find(h=>h.walletClientType==="privy");Je(p)},[n,s,f]);let _o=()=>{let d=Oa();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(y){return y.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 io(d)),Be("AWAITING_OAUTH_SCREEN"),!0)},oo=()=>{let d=_f();if(!d||!W.loginMethods.telegram||!W.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Ti;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,chat_instance:d.chat_instance,chat_type:d.chat_type}),!0},Ye=async(d,p,h,y)=>{let P=await t.connectors?.createWalletConnector(d,p)||null;fi(P,p,h,y)};async function fi(d,p,h,y){if(d)I({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:T});else return I({status:"disconnected",connectedWallet:null,connectError:new de("Unable to connect to wallet."),connector:null,connectRetry:T}),y?.(null,h);d instanceof zr&&p&&await d.resetConnection(p),I({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>fi(d,p,h,y)});try{let P=await d.connect({showPrompt:!0});if(W.shouldEnforceDefaultChainOnConnect&&!W.chains.find(N=>N.id===Number(P?.chainId.replace("eip155:","")))&&!(P?.connectorType==="wallet_connect_v2"&&P?.walletClientType==="metamask")){I(N=>({...N,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:T}));try{await P?.switchChain(W.defaultChain.id),P&&(P.chainId=vi(_n(W.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${W.defaultChain.id}`)}}return I(N=>({...N,status:"connected",connectedWallet:P,connectError:null,connectRetry:T})),P&&B(O,"connectWallet","onSuccess",P),y?.(P,h)}catch(P){return P instanceof it?(console.warn(P.cause?P.cause:P.message),B(O,"connectWallet","onError",P.privyErrorCode||"generic_connect_wallet_error")):(console.warn(P),B(O,"connectWallet","onError","unknown_connect_wallet_error")),I(N=>({...N,status:"disconnected",connectedWallet:null,connectError:P})),y?.(null,h)}}let Ns=async(d,p)=>{if(d===null)return;let h=new Io(d,t,p);t.startAuthFlow(h)},xv=()=>{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"&&!zo()&&Be("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");J("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),Ye(p,h,void 0,Ns)};ro(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let st=d=>{if(!a)throw B(O,"linkAccount","onError","must_be_authenticated",{linkMethod:d}),new w("User must be authenticated before linking an account.")},Ku=()=>{st("siwe"),D.current="siwe",V.current="link",J("LINK_WALLET_SCREEN")},kv=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},_v=async d=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(I(h=>({...h,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:T})),W.captchaEnabled&&!a){let h={callback:y=>Ns(d,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};oe({captchaModalData:h}),Be("CAPTCHA_SCREEN")}else await Ns(d),Be("AWAITING_CONNECTION")},Rv=async(d,p)=>{let{signedUrl:h,externalTransactionId:y}=await c2(t,d,p??{},W.appearance.palette,W.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:y}},Ds=()=>{m(d=>{let p=t.connectors?.wallets.map(h=>({...h,linked:kv(h),loginOrLink:async()=>{if(!await h.isConnected())throw new w("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");_v(h)},fund:async y=>{await ne.fundWallet(h.address,y)},unlink:async()=>{if(!a)throw new w("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let y=await t.unlinkWallet(h.address);c(y)}}))||[];return Al(d,p)?d:p})};ro(()=>{Ds()},[s?.linkedAccounts,a,n]),ro(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");Ds(),t.connectors.on("walletsUpdated",Ds)}},[n]);let Mv=d=>{if(d&&"suggestedAddress"in d&&d.suggestedAddress){let p=xo(d.suggestedAddress);j(p)}J(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};ro(()=>{if(!f[0])return;let d=f[0],p=v.current.find(y=>y.address===d.address),h;if(d.walletClientType==="privy"?h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType==="privy"):h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType!=="privy"),!p&&h){let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(y)}v.current=f},[f]);let Fd=async(d,p)=>{if(ve(d))throw B(O,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[y,P]=await Promise.all([ne.initializeWalletProxy(p),Ce()]);if(!y&&W.customAuth?.enabled)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!y||!P||W.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((N,K)=>{re(!0),oe({createWallet:{onSuccess:Q=>{B(O,"createWallet","onSuccess",Q),N(Q)},onFailure:Q=>{B(O,"createWallet","onError","unknown_embedded_wallet_error"),K(Q)},callAuthOnSuccessOnClose:!1}}),J("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await y.create({accessToken:P});let N=await ne.refreshUser(),K=ve(N);if(!K)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return B(O,"createWallet","onSuccess",K),K}},Iv=d=>{if(!W.chains.map(p=>p.id).includes(d))throw new de(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Yu=(d,p,h)=>new Promise(async(y,P)=>{let{requesterAppId:N}=p||{};if(!a||!s){B(O,"sendTransaction","onError","must_be_authenticated"),P(new Error("User must be authenticated before signing with a Privy wallet"));return}let K=d.from,ee=K?s?.linkedAccounts.find($e=>$e.type==="wallet"&&$e.walletClientType==="privy"&&xo($e.address)===xo(K)):ve(s);if(!ee){B(O,"sendTransaction","onError","embedded_wallet_not_found"),P(new Error("Must have a Privy wallet before signing"));return}re(!0);let Q=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,Ee=d.chainId?Number(d.chainId):Q.chainId;Iv(Ee);let He=Object.assign({},d,{chainId:Ee}),nt=async()=>{let $e=await Ce();if(!$e||!L){B(O,"sendTransaction","onError","embedded_wallet_not_found"),P(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ne.recoverEmbeddedEthereumWallet()){B(O,"sendTransaction","onError","unknown_connect_wallet_error"),P(new Error("Unable to connect to wallet"));return}let yi=Mr(He.chainId,W.chains,W.rpcConfig,{appId:e.appId}),no=await zP(ee.address,He,yi);if(W.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:Lv}=await qP(no,yi),{hasSufficientFunds:Ov}=await Md(ee.address,no,Lv,yi);if(!Ov)throw new Tt(new Wr("Wallet has insufficient funds for this transaction.",VP.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Ju=await Rd($e,ee.address,L,no,yi,N);B(O,"sendTransaction","onSuccess",Ju),y(Ju)}catch(Fs){B(O,"sendTransaction","onError","transaction_failure"),P(Fs)}};if(W.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),nt();else{let $e={transactionRequest:He,onSuccess:no=>{B(O,"sendTransaction","onSuccess",no),y(no)},onFailure:no=>{B(O,"sendTransaction","onError","transaction_failure"),P(no)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:N},Fs={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:no=>{B(O,"sendTransaction","onError","unknown_connect_wallet_error"),P(no)}},yi=Qu({address:ee.address,fundWalletConfig:h,chainIdOverride:He.chainId,comingFromSendTransactionScreen:!0});oe({connectWallet:Fs,sendTransaction:$e,funding:yi}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function ju(){return new Promise(async(d,p)=>{let h=await Ce();if(!h||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:h}),d()}catch(y){p(y)}})}let Xu=d=>d?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],Jt=d=>{let p=s?.linkedAccounts.filter(P=>P.type===d).length??0,{displayName:h,loginMethod:y}=yn(d);if(d==="passkey"&&p>=5||d!=="passkey"&&p>=1)throw B(O,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:y}),new w(`User already has an account of type ${h} linked.`)},Qu=({address:d,fundWalletConfig:p,methodScreen:h,chainIdOverride:y=null,comingFromSendTransactionScreen:P=!1})=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)return;let N=Yc(p)&&p.amount?p.amount:W.fundingConfig.defaultRecommendedAmount,K=Yc(p)&&p.chain?p.chain.id:uv(W.fundingConfig.defaultRecommendedCurrency.chain),ee=Yc(p)&&p.chain?p.chain:W.chains.find(Q=>Q.id===K);if(y&&W.chains.find(Q=>Q.id===y)&&(ee=W.chains.find(Q=>Q.id===y)),!ee)throw new w("Funding chain is not in PrivyProvider chains list");return{address:d,amount:N,chain:ee,methodScreen:h,comingFromSendTransactionScreen:P,...l2(p)?{moonpayConfigOverride:p.config}:{}}};async function Zu({showAutomaticRecovery:d=!1,legacySetWalletPasswordFlow:p=!1}){R(null);let h=p?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw B(O,h,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let y=ve(s);if(!y||!L)throw B(O,h,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(Un(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await ju()}catch(N){throw B(O,h,"onError","missing_or_invalid_mfa"),N}return new Promise((N,K)=>{re(!0);let ee={onSuccess:nt=>{B(O,h,"onSuccess","user-passcode",nt),N(nt)},onFailure:nt=>{B(O,h,"onError","user_exited_set_password_flow"),K(nt)},callAuthOnSuccessOnClose:!1},Q=y.recoveryMethod==="user-passcode",He={onCompleteNavigateTo:Qi({walletAction:"update",availableRecoveryMethods:W.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:Q,showAutomaticRecovery:d}),shouldForceMFA:!1,onFailure:nt=>{B(O,h,"onError","unknown_connect_wallet_error"),K(nt)}};oe({setWalletPassword:ee,createWallet:ee,connectWallet:He,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Q}}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Us({appId:d}){st(`privy:${d}`),D.current=`privy:${d}`,V.current="link";let p=window.open(void 0,void 0,ds({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:d}}),new Promise(async(h,y)=>{let{name:P,logoUrl:N}=await Hc({api:t.api,providerAppId:d,requesterAppId:W.id});oe({crossAppAuth:{appId:d,name:P,logoUrl:N,popup:p,onSuccess:h,onError:y}}),Be("CROSS_APP_AUTH_SCREEN")})}let hi={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Mv,importWallet:async({privateKey:d})=>{st("siwe");let[p,h]=await Promise.all([ne.initializeWalletProxy(15e3),Ce()]);if(p&&h){await p.import({privateKey:d,accessToken:h});let y=await ne.refreshUser(),P=Sl(y);if(!P)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return B(O,"createWallet","onSuccess",P),P}else throw new w("User is not authenticated")},linkWallet:Ku,linkCrossAppAccount:Us,linkEmail:()=>{st("email"),Jt("email"),D.current="email",V.current="link",J("LINK_EMAIL_SCREEN")},linkPhone:()=>{st("sms"),Jt("phone"),D.current="sms",V.current="link",J("LINK_PHONE_SCREEN")},linkGoogle:async()=>{st("google"),Jt("google_oauth"),V.current="link",await ne.initLoginWithOAuth("google")},linkTwitter:async()=>{st("twitter"),Jt("twitter_oauth"),V.current="link",await ne.initLoginWithOAuth("twitter")},linkDiscord:async()=>{st("discord"),Jt("discord_oauth"),V.current="link",await ne.initLoginWithOAuth("discord")},linkGithub:async()=>{st("github"),Jt("github_oauth"),V.current="link",await ne.initLoginWithOAuth("github")},linkSpotify:async()=>{st("spotify"),Jt("spotify_oauth"),V.current="link",await ne.initLoginWithOAuth("spotify")},linkInstagram:async()=>{st("instagram"),Jt("instagram_oauth"),V.current="link",await ne.initLoginWithOAuth("instagram")},linkTiktok:async()=>{st("tiktok"),Jt("tiktok_oauth"),V.current="link",await ne.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{st("linkedin"),Jt("linkedin_oauth"),V.current="link",await ne.initLoginWithOAuth("linkedin")},linkApple:async()=>{st("apple"),Jt("apple_oauth"),V.current="link",await ne.initLoginWithOAuth("apple")},linkPasskey:async()=>{st("passkey"),Jt("passkey"),await ne.initLinkWithPasskey(),J("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{st("telegram"),Jt("telegram"),V.current="link",D.current="telegram",await ne.initLoginWithTelegram(),J("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{st("farcaster"),Jt("farcaster"),await ne.initLoginWithFarcaster(),V.current="link",D.current="farcaster",J("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(st("email"),!s?.email)throw new w("User does not have an email linked to their account.");V.current="link",D.current="email",J("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(st("sms"),!s?.phone)throw new w("User does not have a phone number linked to their account.");V.current="link",D.current="sms",J("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(y=>{Pe(P=>y.bind(P))});if(Pe(null),h){console.warn(p);return}}if(s&&!s.isGuest){console.warn(p);return}V.current="login",oe({login:d}),Be("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{Pe(()=>d)}),Pe(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}Be("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(O,"logout","onSuccess"),V.current=null,D.current=null,o(!1),X.del(Ra),X.del(sl(W.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Qe;let d=f.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===d?.address));return!d||!p?new Qe:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new zu(new so(new Qe));let d=f.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===d?.address));return!d||!p?new zu(new so(new Qe)):new zu(new so(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Xo(new Qe);let d=f.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===d?.address));return!d||!p?new Xo(new Qe):new Xo(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(y=>y.type==="cross_app"&&y.subject===d)?.providerApp;if(!p)throw new w("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=f.find(y=>xo(y.address)===xo(d)),h=s?.linkedAccounts.find(y=>y.type==="wallet"&&xo(y.address)===xo(d));if(!p||!await p.isConnected())j(d),Ku();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(y)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw B(O,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Fd(s,15e3)},setWalletRecovery:async d=>Zu({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:d?.showAutomaticRecovery??!1}),setWalletPassword:async()=>Zu({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(d,p,h)=>new Promise(async(y,P)=>{let{requesterAppId:N}=p||{};if(!a||!s){B(O,"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(Q=>Q.type==="wallet"&&Q.walletClientType==="privy"&&xo(Q.address)===xo(h)):ve(s);if(!K){B(O,"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(O,"signMessage","onError","invalid_message"),P(new Error("Message must be a non-empty string"));return}re(!0);let ee=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Q=await Ce();if(!L||!Q)throw new Error("Unable to connect to wallet");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:K.address,requesterAppId:N}});let{response:He}=await L.rpc({accessToken:Q,address:K.address,requesterAppId:N,request:{method:"personal_sign",params:[d,K.address]}}),nt=He.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:K.address,requesterAppId:N}}),nt};if(W.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Q=await ee();B(O,"signMessage","onSuccess",Q),y(Q)}catch(Q){B(O,"signMessage","onError","unable_to_sign"),P(Q??new Tt("Unable to sign message"))}}else{let He={method:"personal_sign",data:d,confirmAndSign:ee,onSuccess:$e=>{B(O,"signMessage","onSuccess",$e),y($e)},onFailure:$e=>{B(O,"signMessage","onError","unable_to_sign"),P($e)},uiOptions:p||{}},nt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:$e=>{B(O,"signMessage","onError","unknown_connect_wallet_error"),P($e)},address:K.address};oe({signMessage:He,connectWallet:nt}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(h,y)=>{let{requesterAppId:P}=p||{};if(!a||!s){B(O,"signTypedData","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let N=ve(s);if(!N){B(O,"signTypedData","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}re(!0);let K=xa(d),ee=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Q=await Ce();if(!L||!Q)throw new Error("Unable to connect to wallet");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:N.address,requesterAppId:P}});let{response:He}=await L.rpc({accessToken:Q,address:N.address,requesterAppId:P,request:{method:"eth_signTypedData_v4",params:[N.address,K]}}),nt=He.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:N.address,requesterAppId:P}}),nt};if(W.embeddedWallets.noPromptOnSignature||(W.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Q=await ee();B(O,"signTypedData","onSuccess",Q),h(Q)}catch(Q){B(O,"signTypedData","onError","unable_to_sign"),y(Q??new Tt("Unable to sign message"))}}else{let He={method:"eth_signTypedData_v4",data:K,confirmAndSign:ee,onSuccess:$e=>{B(O,"signTypedData","onSuccess",$e),h($e)},onFailure:$e=>{B(O,"signTypedData","onError","unable_to_sign"),y($e)},uiOptions:p||{}},nt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:$e=>{B(O,"signMessage","onError","unknown_connect_wallet_error"),y($e)}};oe({signMessage:He,connectWallet:nt}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,h)=>{let P=await(await Yu(d,p,h)).wait();return Id(P)},exportWallet:d=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}d&&"target"in d&&d&&(d=void 0);let y=d?.address,P=s.linkedAccounts.filter(Ee=>Ee.type==="wallet"&&Ee.walletClientType==="privy"&&Ee.chainType==="ethereum"),N=y?P.find(Ee=>Ee.address===xo(y)):P.find(Ee=>!Ee.imported)||P[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}re(!0);let K={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:h,address:N.address,shouldForceMFA:!0};if(oe(ae),!await Ce()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}let Q={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};oe({keyExport:Q,connectWallet:K}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:ju,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 w("Invalid MFA code");mr.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((N,K)=>{_r.current={resolve:N,reject:K}});break;case"passkey":if(typeof p=="string")throw new w("Invalid authenticator response");let y=await(await import("@simplewebauthn/browser")).startAuthentication(p),P=fv(y);mr.current?.resolve({mfaMethod:d,mfaCode:P,relyingParty:window.origin}),await new Promise((N,K)=>{_r.current={resolve:N,reject:K}});break;default:throw mr.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${d}`)}},cancel(){mr.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ce();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){ne.closePrivyModal(),p();return}W.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."),oe({mfaEnrollmentFlow:{mfaMethods:W.mfa.methods,onSuccess:p,onFailure:h}}),J("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ce();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 Ce();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 Ce();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 Ce();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 Ce();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 Ce(),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 ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let y=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(y.status==="approved"){let P=await t.getAuthenticatedUser();c(P||s||null)}oe({farcasterSigner:y}),J("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let d=await Ce(),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 ne.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(N=>parseInt(N,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async d=>{let p=await Ce(),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 ne.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"),N=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(N.signature))},createGuestAccount:async()=>{if(s&&!s.isGuest)throw new Error("User cannot already be authenticated to create a guest account");return s?.isGuest?s:ne.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:S,loginWithCode(d){return ne.loginWithCode(d)},initLoginWithEmail(d){return ne.initLoginWithEmail(d)},initLoginWithSms(d){return ne.initLoginWithSms(d)},otpState:F,fundWallet(d,p){return ne.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return ne.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return ne.loginWithHeadlessOAuth(d)},generateSiweMessage({address:d,chainId:p}){return ne.generateSiweMessage({address:d,chainId:p})},linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:y,connectorType:P}){return st("siwe"),ne.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:y,connectorType:P})},signMessageWithCrossAppWallet(d,{address:p}){return Gc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"personal_sign",params:[d,p]},reconnect:Us})},signTypedDataWithCrossAppWallet(d,{address:p}){let h=xa(d);return Gc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:Us})},sendTransactionWithCrossAppWallet(d,{address:p}){return Gc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_sendTransaction",params:[d]},reconnect:Us})},isModalOpen:r,mfaMethods:W.mfa.methods};yv=hi.signMessage,gv=hi.signTypedData,vv=async(...d)=>{let p=await Yu(...d);return W.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let ne=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:Y,pendingTransaction:null,walletConnectionStatus:k,connectors:t.connectors?.walletConnectors??[],rpcConfig:W.rpcConfig,chains:W.chains,appId:e.appId,showFiatPrices:W.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>W.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(L)return L;let p=new Promise(P=>{Ke(()=>N=>P(N))}),h=new Promise(P=>setTimeout(()=>P(null),d)),y=await Promise.race([p,h]);return Ke(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;if(p&&D.current&&(h=Xu(s)),V.current==="login"?d.shouldCallAuthOnSuccess&&p&&D.current?(B(O,"login","onComplete",s,g,!1,D.current,h??null),e.onSuccess?.(s,g)):B(O,"login","onError","exited_auth_flow"):V.current==="link"&&h&&(d.isSuccess&&p&&D.current?B(O,"linkAccount","onSuccess",s,D.current,h):D.current&&B(O,"linkAccount","onError","exited_link_flow",{linkMethod:D.current})),E&&u0.includes(E)&&ae.funding){let y=m0[E]??null,P=Mr(ae.funding.chain.id,W.chains,W.rpcConfig,{appId:e.appId}),N;try{N=(await P.getBalance(ae.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}B(O,"fundWallet","onUserExited",{address:ae.funding.address,chain:ae.funding.chain,fundingMethod:y,balance:N})}j(null),V.current=null,D.current=null,b(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:d})=>new Promise(async(p,h)=>{let y=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 N=ne.walletProxy??await ne.initializeWalletProxy(15e3);if(!N)throw new Error("Failed to initialize embedded wallet proxy.");let{response:K}=await N.rpcSolana({accessToken:P,publicKey:u.address,request:{method:"signMessage",params:{message:d}}});return K.data.signature};if(W.embeddedWallets.noPromptOnSignature)try{let P=await y();p({signature:P})}catch(P){h(P)}else oe({signMessage:{method:"solana_signMessage",data:d,confirmAndSign:y,onSuccess:ee=>{p({signature:ee})},onFailure:ee=>{h(ee)},uiOptions:{}}}),Be("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:J,connectWallet:fi,initLoginWithWallet:async(d,p)=>{D.current="siwe",Ns(d,p)},loginWithWallet:async()=>{if(!n)throw new Ro;if(!(t.authFlow instanceof Io))throw new w("Must initialize SIWE flow first.");let d,p;if(a)try{({user:d}=await t.link()),D.current="siwe"}catch(h){throw B(O,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),D.current="siwe"}catch(h){throw B(O,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||s||null),b(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new ka(d);t.startAuthFlow(p);try{D.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw V.current==="login"?B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new Ro;if(!(t.authFlow instanceof ka))throw new w("Must initialize Farcaster flow first.");let d,p;if(a)try{({user:d}=await t.link()),D.current="farcaster"}catch(h){throw B(O,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),D.current="farcaster"}catch(h){throw B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d||null),b(p||!1),l(!0)},async loginWithGuestAccountFlow(){let d=new wi(this.appId);t.startAuthFlow(d);try{V.current="login",D.current="guest";let p=await t.authenticate(),{user:h,isNewUser:y}=p;if(y=y||!1,!h)throw new w("Unable to authenticate guest account");if(Gt(h,W.embeddedWallets.createOnLogin))try{await Fd(h,15e3),h=await ne.refreshUser()}catch{c(h),console.warn("Unable to create embedded wallet for guest account")}else c(h);return b(y),l(!0),B(O,"login","onComplete",h,y,!1,"guest",null),h}catch(p){throw B(O,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:d,popup:p}){let h=`privy:${d}`;D.current=h;let{url:y,stateCode:P,codeVerifier:N}=await F1({api:t.api,appId:d});if(!y)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:d}}),new w("No authorization URL returned for cross-app auth.");try{let K=await mv({url:y,popup:p,provider:h}),ee=K.stateCode,Q=K.authorizationCode;if(ee!==P)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:P??"",returnedStateCode:ee??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let Ee=await B1({api:ko.api,appId:d,codeVerifier:N,stateCode:ee,authorizationCode:Q});Ee&&t.storeProviderAccessToken(d,Ee);let He=await ne.refreshUser();if(!He)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:d}}),He}catch(K){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:K.toString(),provider:h}}),K}},async initLoginWithOAuth(d,p){if(D.current=d,Sa()){if(d==="google"&&qi(window.navigator.userAgent)){Be("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Be("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}d==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),X.del(Wn);let h=new io({provider:d});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&(d==="twitter"&&GP&&(y.url=y.url.replace("x.com","twitter.com")),window.location.assign(y.url))},async initLoginWithTelegram(d){if(!n)throw new Ro;D.current="telegram";let p=new Ti(d);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,y)=>{if(!W.loginConfig.telegramAuthConfiguration)return y(new w("Telegram Auth configuration is not loaded"));if(!window.Telegram)return y(new w("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:W.loginConfig.telegramAuthConfiguration.botId,request_access:!0},P=>P?h(P):y(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Ti))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let d,p;if(V.current==="login")try{let h=await t.authenticate();d=h.user,p=h.isNewUser,D.current="telegram"}catch(h){throw B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}else if(V.current==="link")try{d=(await t.link()).user,D.current="telegram"}catch(h){throw B(O,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else throw new w("Unknown auth intent");c(d),b(p||!1),l(!0)},async recoveryOAuthFlow(d,p,h){let y,P;function N(K){if(!K)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new w("Recovery OAuth failed")}switch(d){case"google-drive":{let{url:K,codeVerifier:ee,stateCode:Q}=await Np({api:ko.api,provider:d});N(K);let Ee,He;try{let nt=await qu({url:K,popup:h,provider:d});if(Ee=nt.stateCode,He=nt.authorizationCode,Ee!==Q)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:Q??"",returnedStateCode:Ee??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(nt){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:nt.toString(),provider:d}}),new w("Recovery OAuth failed")}[y,P]=await Promise.all([Ce(),Fy({api:ko.api,provider:d,codeVerifier:ee,stateCode:Ee,authorizationCode:He})]);break}case"icloud":{let{url:K}=await Np({api:ko.api,provider:d});N(K);let{ckWebAuthToken:ee}=await qu({url:K,popup:h,provider:d});P=ee,y=await Ce();break}}if(!L)throw new w("Cannot connect to wallet proxy");if(!y)throw new w("Unable to authorize user");switch(p){case"recover":let K=ae.recoverWallet?.privyWallet?.address;if(!K)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:K,recoveryMethod:d}}),await L.recover({address:K,accessToken:y,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:y,recoveryAccessToken:P,recoveryMethod:d});let ee=await ne.refreshUser(),Q=ve(ee);if(!Q)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:Q.address}}),B(O,"createWallet","onSuccess",Q);break;case"set-recovery":let Ee=ve(s);if(!Ee)throw B(O,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:Ee.address,existingRecoveryMethod:Ee.recoveryMethod,targetRecoveryMethod:d}}),await L.setRecovery({address:Ee.address,accessToken:y,recoveryAccessToken:P,recoveryMethod:d});let He=ve(await ne.refreshUser());if(!He)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:Ee.address,existingRecoveryMethod:Ee.recoveryMethod,targetRecoveryMethod:d}}),B(O,"setWalletRecovery","onSuccess",d,He);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof io))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(Mn),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:h??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken({disableAutoRefresh:!0}),P,N,K;if(a||y!==null)try{let ee=await t.link();P=ee.user,K=ee.oAuthTokens,D.current=d}catch(ee){throw B(O,"linkAccount","onError",ee.privyErrorCode||"failed_to_link_account",{linkMethod:d}),ee}else try{let ee=await t.authenticate();P=ee.user,N=ee.isNewUser,K=ee.oAuthTokens,D.current=d}catch(ee){throw V.current==="login"?B(O,"login","onError",ee.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",ee.privyErrorCode||"failed_to_link_account",{linkMethod:d}),ee}return c(P),b(N||!1),l(!0),K&&P&&B(O,"oAuthAuthorization","onOAuthTokenGrant",K,{user:P}),K},async initLoginWithPasskey(d){let p=new Dn(d);t.startAuthFlow(p),V.current="login";try{D.current="passkey",await p.initAuthenticationFlow()}catch(h){throw B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new Ro;if(!(t.authFlow instanceof Dn))throw new w("Must initialize Passkey flow first.");if(D.current!=="passkey")throw new w("Must init login with Passkey flow first.");let d,p;try{D.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(h){throw B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d),b(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new Dn(d);t.startAuthFlow(p),V.current="link",D.current="passkey";try{await p.initLinkFlow()}catch(h){throw B(O,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new Ro;if(!(t.authFlow instanceof Dn))throw new w("Must initialize Passkey flow first.");if(D.current!=="passkey")throw new w("Must init login with Passkey flow first.");let d;try{D.current="passkey",{user:d}=await t.link()}catch(p){throw B(O,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return c(d||s||null),d},async initLoginWithHeadlessOAuth(d,p){if(Sa()){if(d==="google"&&qi(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 io({provider:d,headless:!0});p&&h.addCaptchaToken(p);let y=await t.startAuthFlow(h).getAuthorizationUrl();y?.url&&window.location.assign(y.url)},async loginWithHeadlessOAuth(d){A(!0),t.startAuthFlow(new io(d));let p=X.get(Mn),h=d.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:h??""}}),A(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y,P;if(a)try{({user:y}=await t.link()),D.current=d.provider}catch(N){throw B(O,"linkAccount","onError",N.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),N}else try{({user:y,isNewUser:P}=await t.authenticate()),D.current=d.provider}catch(N){throw V.current==="login"?B(O,"login","onError",N.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",N.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),N}return c(y),b(P||!1),l(!0),A(!1),y??void 0},initLoginWithEmail:async(d,p)=>{let h=new qo(d,p);t.startAuthFlow(h);try{D.current="email",await h.sendCodeEmail()}catch(y){throw V.current==="login"?B(O,"login","onError",y.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),y}},initUpdateEmail:async(d,p,h)=>{let y=new Xs(d,p,h);t.startAuthFlow(y),await y.sendCodeEmail()},initUpdatePhone:async(d,p,h)=>{let y=new Tl(d,p,h);t.startAuthFlow(y),await y.sendSmsCode()},initLoginWithSms:async(d,p)=>{G({status:"sending-code"});let h=new Yo(d,p);t.startAuthFlow(h);try{D.current="sms",await h.sendSmsCode(),G({status:"awaiting-code-input"})}catch(y){throw G({status:"error",error:y}),V.current==="login"?B(O,"login","onError",y.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),y}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(G({status:"submitting-code"}),!n){let y=new Ro;throw G({status:"error",error:y}),y}if(t.authFlow instanceof qo)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof Yo)t.authFlow.meta.smsCode=d.trim();else{let y=new w("Must initialize a passwordless code flow first");throw G({status:"error",error:y}),y}await Ce();let p,h;if(V.current==="link")try{({user:p}=await t.link())}catch(y){throw G({status:"error",error:y}),B(O,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:D.current}),y}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(y){throw G({status:"error",error:y}),B(O,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}c(p||s||null),b(h||!1),l(!0),G({status:"done"})},generateSiweMessage:async({address:d,chainId:p,captchaToken:h})=>{V.current="link",D.current="siwe";let y=await t.generateSiweNonce({address:d,captchaToken:h}),P=p.replace("eip155:","");return El({address:d,chainId:P,nonce:y})},linkWithSiwe:async({message:d,signature:p,chainId:h,walletClientType:y,connectorType:P})=>{let N;try{N=await t.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:y,connectorType:P}),N=await ne.refreshUser()??N;let K=Xu(N);K&&B(O,"linkAccount","onSuccess",N,"siwe",K)}catch(K){throw B(O,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),V.current=null,D.current=null,K}c(N||s||null),V.current=null,D.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 d=>new Promise(async(p,h)=>{let y=ve(d?.user??s)||Sl(d?.user??s),P=await Ce();if(!P||!L||!y){h(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await L.connect({accessToken:P,address:y.address}),p(!0)}catch(N){if(Qn(N)&&y.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:y.address}}),(await L.recover({address:y.address,accessToken:P,recoveryMethod:y.recoveryMethod})).address||h(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:y.address}}),p(!0);else if(Qn(N)&&y.recoveryMethod!=="privy"){oe({recoverWallet:{privyWallet:y,onFailure:h,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:y.recoveryMethod,action:"recover"}});let K=hc(y.recoveryMethod);J(K)}else h(N)}}),embeddedSolanaWallet:u,createEmbeddedSolanaWallet:async()=>{re(!0);let d=await Ce(),p=await ne.refreshUser(),h=Un(p),y=ve(p);if(!p||!d)throw new w("User must be logged in to create a Solana wallet");if(h)throw new w("User already has an embedded Solana wallet.");if(y)if(y.recoveryMethod==="privy")await ne.recoverEmbeddedEthereumWallet({user:p});else throw new w("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let P=await ne.initializeWalletProxy(15e3);if(!P)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await P.createSolana({accessToken:d,ethereumAddress:y?.address});let N=await ne.refreshUser(),K=Un(N);if(!K)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:K.address}}),K}catch(N){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",N)}},exportSolanaWallet:d=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=d?.address,P=s.linkedAccounts.filter(Q=>Q.type==="wallet"&&Q.walletClientType==="privy"&&Q.chainType==="solana"),N=y?P.find(Q=>Q.address.toLowerCase()===y.toLowerCase()):P.find(Q=>!Q.imported)||P[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}if(re(!0),!await Ce()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}await ne.recoverEmbeddedSolanaWallet();let ee={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};oe({keyExport:ee}),J("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(d,p)=>{let h=Un(s),y=await Ce();if(!y||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await L.connectSolana({accessToken:y,publicKey:h.address}),d(!0)}catch(P){Qn(P)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recoverSolana({publicKey:h.address,accessToken:y})).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:Rv,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:d=>{i(!0),Ae?.(d)},updateWallets:()=>Ds(),fundWallet:async(d,p)=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Wd({fundingMethods:W.fundingConfig.methods});oe({funding:Qu({address:d,fundWalletConfig:p,methodScreen:h})}),J(h)},requestFarcasterSignerStatus:async d=>{let p=await Ce(),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 y=await t.requestFarcasterSignerStatus(d);if(y.status==="approved"){let P=await t.getAuthenticatedUser();c(P||s||null)}return y},connectCoinbaseSmartWallet:async()=>{W.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let d=t.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||t.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(d)return d.updateConnectionPreference("smartWalletOnly"),fi(d);await Ye("coinbase_wallet","coinbase_smart_wallet")}}))();Cv=ne.recoverEmbeddedEthereumWallet,wv=ne.recoverEmbeddedSolanaWallet,bv=ne.solanaSignMessage;let Wv=HP(()=>({wallets:f,ready:mt&&We}),[f,mt,We]);return kr(we.Provider,{value:hi,children:kr(up.Provider,{value:O,children:kr(Zp.Provider,{value:Wv,children:kr(Ph,{...W,children:hv(pp.Provider,{value:ne,children:[kr(wy,{children:hv(Ch,{data:ae,setModalData:oe,setInitialScreen:R,initialScreen:E,authenticated:a,open:r,children:[e.children,!W.headless&&W.captchaEnabled&&n&&!a&&kr(dp,{delayedExecution:!1}),kr(X0,{theme:{...W.appearance.palette||{}}}),!W.render.standalone&&kr(Gu,{open:r})]})}),Re&&be?kr(cv,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:mr,mfaSubmitPromise:_r,onLoad:U,onLoadFailed:()=>null}):null,W.loginConfig.telegramAuthConfiguration&&kr(Yr,{if:!0,children:kr(av,{scriptHost:e.apiUrl||nl,botUsername:W.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};import{useContext as QP}from"react";function ZP(e){let{login:t}=QP(we);return xe("login",e),{login:t}}import{useContext as JP}from"react";function $P(e){let{logout:t}=JP(we);return xe("logout",e),{logout:t}}import{useCallback as Ev,useEffect as ex}from"react";function tx(){let e=Te(),t=Fl(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=z(),l=Ev(async c=>{if(e.enabled&&e.status!=="success")throw new hr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=Ev(async()=>{let c=Oa();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(f){throw f}finally{Nn()}},[o]);return ex(()=>{let c=Oa();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}import{useCallback as Tv}from"react";var rx=()=>{let e=Te(),{initLoginWithEmail:t,loginWithCode:r}=z(),o=Tv(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=Tv(async({code:i})=>{if(e.enabled&&e.status==="error")throw new hr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as Sv}from"react";var ox=()=>{let e=Te(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=z(),n=Sv(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=Sv(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new hr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};import{useCallback as Av}from"react";var nx=()=>{let e=Te(),{generateSiweMessage:t,linkWithSiwe:r}=z(),o=Av(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=Av(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:c})=>{if(e.enabled&&e.status!=="success")throw new hr(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}};import{useContext as ix}from"react";function ax(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:f,linkSpotify:m,linkInstagram:u,linkTelegram:C,linkFarcaster:v}=ix(we);return xe("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:f,linkSpotify:m,linkInstagram:u,linkFarcaster:v,linkTelegram:C}}import{useContext as sx}from"react";function lx(e){let{connectWallet:t}=sx(we);return xe("connectWallet",e),{connectWallet:t}}import{useContext as cx}from"react";function dx(e){let{createWallet:t}=cx(we);return xe("createWallet",e),{createWallet:t}}var px=e=>{xe("fundWallet",e);let{fundWallet:t}=z();return{fundWallet:t}};var ux=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r}=M();return{createWallet:r,exportWallet:t,wallets:e?[e]:[]}};var mx=()=>{let{connectCoinbaseSmartWallet:e}=M();return{connectCoinbaseSmartWallet:e}};var fx=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=z();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};import{useContext as hx}from"react";function yx(e){let{sendTransaction:t}=hx(we);return xe("sendTransaction",e),{sendTransaction:t}}import{useContext as gx}from"react";function vx(e){let{setWalletPassword:t}=gx(we);return xe("setWalletPassword",e),{setWalletPassword:t}}import{useContext as Cx}from"react";function wx(){let{createGuestAccount:e}=Cx(we);return{createGuestAccount:e}}import{useContext as bx}from"react";function Ex(e){let{setWalletRecovery:t}=bx(we);return xe("setWalletRecovery",e),{setWalletRecovery:t}}import{useContext as Tx}from"react";function Sx(e){let{signMessage:t}=Tx(we);return xe("signMessage",e),{signMessage:t}}import{useContext as Ax}from"react";function Px(e){let{signTypedData:t}=Ax(we);return xe("signTypedData",e),{signTypedData:t}}import{useContext as xx}from"react";var kx=()=>{let{isModalOpen:e}=xx(we);return{isOpen:e}};import{useContext as _x}from"react";function Rx(e){let{getAccessToken:t}=_x(we);return xe("accessToken",e),{getAccessToken:t}}function Mx(e){let{authenticated:t,user:r}=z(),{initLoginWithOAuth:o}=M(),n=Li();return xe("oAuthAuthorization",e),{reauthorize:i=>Ix(t,r,o,n,i.provider)}}var Ix=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new w("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new w(`OAuth account of type ${n} not linked to the account.`);await r(n)};var Wx=Pv;function Pv(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=z();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function Lx(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Ox(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}export{so as AsExternalProvider,dp as Captcha,Fa as ConnectorManager,Gu as LoginModal,Ba as PrivyClient,jP as PrivyProvider,Qe as PrivyProxyProvider,Bn as SUPPORTED_CHAINS,Kd as VERSION,tr as WalletConnector,Lx as addRpcUrlOverrideToChain,Lp as errorIndicatesMaxMfaRetries,Zn as errorIndicatesMfaTimeout,Jn as errorIndicatesMfaVerificationFailed,Ce as getAccessToken,Ox as getEmbeddedConnectedWallet,mx as useConnectCoinbaseSmartWallet,lx as useConnectWallet,dx as useCreateWallet,fx as useCrossAppAccounts,Wx as useExperimentalFarcasterSigner,Pv as useFarcasterSigner,px as useFundWallet,wx as useGuestAccounts,ax as useLinkAccount,nx as useLinkWithSiwe,ZP as useLogin,rx as useLoginWithEmail,tx as useLoginWithOAuth,ox as useLoginWithSms,$P as useLogout,ws as useMfa,$r as useMfaEnrollment,kx as useModalStatus,Mx as useOAuthTokens,z as usePrivy,mp as useRegisterMfaListener,yx as useSendTransaction,vx as useSetWalletPassword,Ex as useSetWalletRecovery,Sx as useSignMessage,Px as useSignTypedData,ux as useSolanaWallets,Rx as useToken,Jr as useWallets};
3391
+ `;import{useRef as av,useEffect as MP}from"react";import{jsx as WP}from"react/jsx-runtime";function IP({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 sv(e){let t=av(null),r=av();return MP(()=>{r.current?.remove(),r.current=IP(e),t.current?.after(r.current)},[e]),WP("div",{ref:t,hidden:!0})}import{useState as LP}from"react";import{useEffect as lv,useRef as cv}from"react";var Ud=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 kn(e,t,r,o,n,i=!1){let a=i,l=async f=>{if(a&&t&&t.length>0){f===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Oe("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((u,C)=>{r.current={resolve:u,reject:C};let v=1e3*60*5;setTimeout(()=>{let g=new Oe("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),C(g)},v)});return await e(m)}return await e()},s=4,c=null;for(let f=0;f<s;f++)try{c=await l(f),o.current?.resolve(void 0);break}catch(m){if(m.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),m}if(c===null){let f=new Oe("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(f),f}return c}import{jsx as BP}from"react/jsx-runtime";var OP=function(e){return()=>`id-${e++}`}(0);function NP(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function bt(e){return e.error!==void 0}var yt=new Ud,zu=new Map,DP=(e,t)=>typeof t=="bigint"?t.toString():t,UP=(e,t)=>`${e}${JSON.stringify(t,DP)}`;function Et(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=UP(e,t);if(e==="privy:wallet:create"){let l=zu.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=OP();yt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{zu.delete(i)});return zu.set(i,a),a}function FP(e){switch(e.event){case"privy:iframe:ready":let t=yt.dequeue(e.event,e.id);return bt(e)?t.reject(new Oe(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=yt.dequeue(e.event,e.id);return bt(e)?r.reject(new Oe(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=yt.dequeue(e.event,e.id);return bt(e)?o.reject(new Oe(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=yt.dequeue(e.event,e.id);return bt(e)?n.reject(new Oe(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let i=yt.dequeue(e.event,e.id);return bt(e)?i.reject(new Oe(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let a=yt.dequeue(e.event,e.id);return bt(e)?a.reject(new Oe(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery":let l=yt.dequeue(e.event,e.id);return bt(e)?l.reject(new Oe(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:verify":let s=yt.dequeue(e.event,e.id);return bt(e)?s.reject(new Oe(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:init-enrollment":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:submit-enrollment":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:unenroll":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:clear":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:init-signer":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:sign":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:solana-wallet:create":let c=yt.dequeue(e.event,e.id);return bt(e)?c.reject(new Oe(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let f=yt.dequeue(e.event,e.id);return bt(e)?f.reject(new Oe(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:recover":let m=yt.dequeue(e.event,e.id);return bt(e)?m.reject(new Oe(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:rpc":{let u=yt.dequeue(e.event,e.id);return bt(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function dv(e){let t=cv(null),r=cv(e.mfaMethods),o=Li(),[n,i]=LP(!1);return lv(()=>{r.current=e.mfaMethods},[e.mfaMethods]),lv(()=>{if(!n)return;let a=t.current;if(!a)return;function l(u){u&&u.origin===e.origin&&NP(u.data)&&FP(u.data)}let s={create(u){return Et("privy:wallet:create",u,a,e.origin)},import(u){return Et("privy:wallet:import",u,a,e.origin)},connect(u){return Et("privy:wallet:connect",u,a,e.origin)},recover(u){return kn(C=>Et("privy:wallet:recover",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!u.recoveryMethod||u.recoveryMethod==="privy")},rpc(u){return kn(C=>Et("privy:wallet:rpc",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(u){return Et("privy:solana-wallet:create",u,a,e.origin)},connectSolana(u){return Et("privy:solana-wallet:connect",u,a,e.origin)},recoverSolana(u){return Et("privy:solana-wallet:recover",u,a,e.origin)},rpcSolana(u){return Et("privy:solana-wallet:rpc",u,a,e.origin)},setRecovery(u){return kn(C=>Et("privy:wallet:set-recovery",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return kn(C=>Et("privy:mfa:verify",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return kn(C=>Et("privy:mfa:init-enrollment",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return kn(C=>Et("privy:mfa:submit-enrollment",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(u){return kn(C=>Et("privy:mfa:unenroll",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(u){return Et("privy:mfa:clear",u,a,e.origin)},initFarcasterSigner(u){return Et("privy:farcaster:init-signer",u,a,e.origin)},signFarcasterMessage(u){return Et("privy:farcaster:sign",u,a,e.origin)}};window.addEventListener("message",l);let c=()=>e.onLoad(s),f=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},m=new AbortController;return Pa(()=>Et("privy:iframe:ready",{},a,e.origin),{abortSignal:m.signal}).then(c,f),()=>{window.removeEventListener("message",l),m.abort()}},[n]),BP("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:el(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Fd=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 uv({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await Ce())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await pv())throw new w("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.")}}};function mv(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.")}async function fv({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new w("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",f)}let s,c=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(c),clearTimeout(a),n(new w("User rejected request")))},300);function f(m){m.data&&(m.data.type==="PRIVY_OAUTH_RESPONSE"&&m.data.stateCode&&m.data.authorizationCode&&(clearTimeout(a),o(m.data),l()),m.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new w(m.data.error)),l()),m.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=f))}window.addEventListener("message",f)})}var HP="https://cdn.apple-cloudkit.com";async function Ku({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===HP&&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 hv=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});import{jsx as kr,jsxs as yv}from"react/jsx-runtime";var ko;function jP(e){return typeof e=="string"&&e.length===25}function Ce(){if(!ko){let e=X.get(Rn);return Promise.resolve(e||null)}return ko.getAccessToken()}var gv,Lf=(e,t,r)=>gv(e,t,r),vv,Of=(e,t)=>vv(e,t),Cv,Nf=(e,t)=>Cv(e,t),wv,Df=()=>wv(),bv,pv=()=>bv(),Ev,uv=({message:e})=>Ev({message:e}),XP=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(_a,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},QP=({config:e,...t})=>{if(typeof window<"u"&&["localhost","127.0.0.1"].indexOf(window.location.hostname)<0&&window.location.protocol!=="https:")throw new w("Embedded wallet is only available over HTTPS");if(!jP(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");ko||(ko=new Ba({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."),kr(Ch,{client:ko,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:kr(ZP,{...t,client:ko})})},ZP=e=>{let t=e.client,[r,o]=ut(!1),[n,i]=ut(!1),[a,l]=ut(!1),[s,c]=ut(null),[f,m]=ut([]),[u,C]=ut(null),v=Ta(f),[g,b]=ut(!1),[E,R]=ut(null),[S,A]=ut(!1),[k,I]=ut({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:T}),[F,G]=ut({status:"initial"}),[Y,j]=ut(null),[L,U]=ut(null),W=De(),be=Fl(),[Re,re]=ut(!0),[oe,ne]=ut({}),[Ae,Pe]=ut(null),[ze,Ke]=ut(null),[mt,Ze]=ut(!1),[le,Zt]=ut(!1),mr=Ta(null),_r=Ta(null),O=Ta(Mh),[We,ft]=ut(!1);t.onStoreToken=d=>{d&&B(O,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),B(O,"accessToken","onAccessTokenRemoved")};let D=Ta(null),V=Ta(null),J=d=>{R(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},Be=d=>{W.embeddedWallets.createOnLogin!=="off"&&re(!0),J(d)};ro(()=>{let d=Un(s);if(!d||!L){C(null);return}let p={address:d.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Qo,id:"io.privy.solana.wallet"},getProvider:async()=>new Fd(L,d.address)};C(p)},[L,s]),ro(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=ve(s),p=Sl(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,W.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,W.defaultChain,e.appId)},[L,s]),ro(()=>{L&&ze?.(L)},[L]),ro(()=>{(async()=>{if(!W.customAuth?.enabled)return;re(!0);let{getCustomAccessToken:p,isLoading:h}=W.customAuth;if(!(!n||h))try{let y=await p();if(!y&&a){await hi.logout();return}if(!y||a)return;t.startAuthFlow(new gi(y));let{user:P,isNewUser:N}=await t.authenticate();if(!P){await hi.logout();return}c(P||null),b(N||!1),l(!0),Zt(!0)}catch(y){console.warn(y),a&&await hi.logout()}})()},[W.customAuth?.enabled,W.customAuth?.getCustomAccessToken,W.customAuth?.isLoading,n,a]),ro(()=>{le&&L&&s&&Gt(s,W.embeddedWallets.createOnLogin)&&(Zt(!1),Bd(s,Ci).catch(console.error))},[le&&L&&s]),ro(()=>{async function d(){let p=_o(),h=oo();XP();let y=GP();t.initializeConnectorManager({walletConnectCloudProjectId:W.walletConnectCloudProjectId,rpcConfig:W.rpcConfig,chains:W.chains,defaultChain:W.defaultChain,store:y,walletList:W.appearance.walletList,shouldEnforceDefaultChainOnConnect:W.shouldEnforceDefaultChainOnConnect,externalWalletConfig:W.externalWallets,appName:W.name??"Privy"});let P;t.connectors?.on("connectorInitialized",()=>{P&&clearTimeout(P);let $=t.connectors.walletConnectors.length,Q=t.connectors.walletConnectors.reduce((Ee,He)=>Ee+(He.initialized?1:0),0);Q===$?ft(!0):P=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:Q,expected:$}),ft(!0)},1500)}),t.connectors?.initialize().then(()=>{kv()});let N=await t.getAuthenticatedUser(),z=!!N;if(W.customAuth?.enabled||(l(!!N),N&&B(O,"login","onComplete",N,!1,!0,null,null),c(N)),p){V.current=z?"link":"login";return}if(h&&!z){V.current="login",Be("TELEGRAM_AUTH_SCREEN");return}ie.setReadyToTrue(!!N)}!n&&be&&d()},[t,Ae,n,be]),ro(()=>{if(!n)return;if(!s){Ze(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){Ze(!0);return}let p=!!f.find(h=>h.walletClientType==="privy");Ze(p)},[n,s,f]);let _o=()=>{let d=Oa();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(y){return y.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 io(d)),Be("AWAITING_OAUTH_SCREEN"),!0)},oo=()=>{let d=Mf();if(!d||!W.loginMethods.telegram||!W.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Ti;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,chat_instance:d.chat_instance,chat_type:d.chat_type}),!0},Je=async(d,p,h,y)=>{let P=await t.connectors?.createWalletConnector(d,p)||null;fi(P,p,h,y)};async function fi(d,p,h,y){if(d)I({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:T});else return I({status:"disconnected",connectedWallet:null,connectError:new ue("Unable to connect to wallet."),connector:null,connectRetry:T}),y?.(null,h);d instanceof zr&&p&&await d.resetConnection(p),I({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>fi(d,p,h,y)});try{let P=await d.connect({showPrompt:!0});if(W.shouldEnforceDefaultChainOnConnect&&!W.chains.find(N=>N.id===Number(P?.chainId.replace("eip155:","")))&&!(P?.connectorType==="wallet_connect_v2"&&P?.walletClientType==="metamask")){I(N=>({...N,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:T}));try{await P?.switchChain(W.defaultChain.id),P&&(P.chainId=vi(_n(W.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${W.defaultChain.id}`)}}return I(N=>({...N,status:"connected",connectedWallet:P,connectError:null,connectRetry:T})),P&&B(O,"connectWallet","onSuccess",P),y?.(P,h)}catch(P){return P instanceof it?(console.warn(P.cause?P.cause:P.message),B(O,"connectWallet","onError",P.privyErrorCode||"generic_connect_wallet_error")):(console.warn(P),B(O,"connectWallet","onError","unknown_connect_wallet_error")),I(N=>({...N,status:"disconnected",connectedWallet:null,connectError:P})),y?.(null,h)}}let Ns=async(d,p)=>{if(d===null)return;let h=new Io(d,t,p);t.startAuthFlow(h)},kv=()=>{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"&&!zo()&&Be("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");J("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),Je(p,h,void 0,Ns)};ro(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let st=d=>{if(!a)throw B(O,"linkAccount","onError","must_be_authenticated",{linkMethod:d}),new w("User must be authenticated before linking an account.")},ju=()=>{st("siwe"),D.current="siwe",V.current="link",J("LINK_WALLET_SCREEN")},_v=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},Rv=async d=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(I(h=>({...h,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:T})),W.captchaEnabled&&!a){let h={callback:y=>Ns(d,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};ne({captchaModalData:h}),Be("CAPTCHA_SCREEN")}else await Ns(d),Be("AWAITING_CONNECTION")},Mv=async(d,p)=>{let{signedUrl:h,externalTransactionId:y}=await p2(t,d,p??{},W.appearance.palette,W.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:y}},Ds=()=>{m(d=>{let p=t.connectors?.wallets.map(h=>({...h,linked:_v(h),loginOrLink:async()=>{if(!await h.isConnected())throw new w("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");Rv(h)},fund:async y=>{await ie.fundWallet(h.address,y)},unlink:async()=>{if(!a)throw new w("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let y=await t.unlinkWallet(h.address);c(y)}}))||[];return Al(d,p)?d:p})};ro(()=>{Ds()},[s?.linkedAccounts,a,n]),ro(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");Ds(),t.connectors.on("walletsUpdated",Ds)}},[n]);let Iv=d=>{if(d&&"suggestedAddress"in d&&d.suggestedAddress){let p=xo(d.suggestedAddress);j(p)}J(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};ro(()=>{if(!f[0])return;let d=f[0],p=v.current.find(y=>y.address===d.address),h;if(d.walletClientType==="privy"?h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType==="privy"):h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType!=="privy"),!p&&h){let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(y)}v.current=f},[f]);let Bd=async(d,p)=>{if(ve(d))throw B(O,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[y,P]=await Promise.all([ie.initializeWalletProxy(p),Ce()]);if(!y&&W.customAuth?.enabled)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!y||!P||W.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((N,z)=>{re(!0),ne({createWallet:{onSuccess:Q=>{B(O,"createWallet","onSuccess",Q),N(Q)},onFailure:Q=>{B(O,"createWallet","onError","unknown_embedded_wallet_error"),z(Q)},callAuthOnSuccessOnClose:!1}}),J("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await y.create({accessToken:P});let N=await ie.refreshUser(),z=ve(N);if(!z)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return B(O,"createWallet","onSuccess",z),z}},Wv=d=>{if(!W.chains.map(p=>p.id).includes(d))throw new ue(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Xu=(d,p,h)=>new Promise(async(y,P)=>{let{requesterAppId:N}=p||{};if(!a||!s){B(O,"sendTransaction","onError","must_be_authenticated"),P(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=d.from,$=z?s?.linkedAccounts.find($e=>$e.type==="wallet"&&$e.walletClientType==="privy"&&xo($e.address)===xo(z)):ve(s);if(!$){B(O,"sendTransaction","onError","embedded_wallet_not_found"),P(new Error("Must have a Privy wallet before signing"));return}re(!0);let Q=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,Ee=d.chainId?Number(d.chainId):Q.chainId;Wv(Ee);let He=Object.assign({},d,{chainId:Ee}),nt=async()=>{let $e=await Ce();if(!$e||!L){B(O,"sendTransaction","onError","embedded_wallet_not_found"),P(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ie.recoverEmbeddedEthereumWallet()){B(O,"sendTransaction","onError","unknown_connect_wallet_error"),P(new Error("Unable to connect to wallet"));return}let yi=Mr(He.chainId,W.chains,W.rpcConfig,{appId:e.appId}),no=await YP($.address,He,yi);if(W.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:Ov}=await KP(no,yi),{hasSufficientFunds:Nv}=await Id($.address,no,Ov,yi);if(!Nv)throw new Tt(new Wr("Wallet has insufficient funds for this transaction.",zP.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let em=await Md($e,$.address,L,no,yi,N);B(O,"sendTransaction","onSuccess",em),y(em)}catch(Fs){B(O,"sendTransaction","onError","transaction_failure"),P(Fs)}};if(W.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),nt();else{let $e={transactionRequest:He,onSuccess:no=>{B(O,"sendTransaction","onSuccess",no),y(no)},onFailure:no=>{B(O,"sendTransaction","onError","transaction_failure"),P(no)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:N},Fs={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:no=>{B(O,"sendTransaction","onError","unknown_connect_wallet_error"),P(no)}},yi=Ju({address:$.address,fundWalletConfig:h,chainIdOverride:He.chainId,comingFromSendTransactionScreen:!0});ne({connectWallet:Fs,sendTransaction:$e,funding:yi}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Qu(){return new Promise(async(d,p)=>{let h=await Ce();if(!h||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:h}),d()}catch(y){p(y)}})}let Zu=d=>d?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],Jt=d=>{let p=s?.linkedAccounts.filter(P=>P.type===d).length??0,{displayName:h,loginMethod:y}=yn(d);if(d==="passkey"&&p>=5||d!=="passkey"&&p>=1)throw B(O,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:y}),new w(`User already has an account of type ${h} linked.`)},Ju=({address:d,fundWalletConfig:p,methodScreen:h,chainIdOverride:y=null,comingFromSendTransactionScreen:P=!1})=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)return;let N=jc(p)&&p.amount?p.amount:W.fundingConfig.defaultRecommendedAmount,z=jc(p)&&p.chain?p.chain.id:mv(W.fundingConfig.defaultRecommendedCurrency.chain),$=jc(p)&&p.chain?p.chain:W.chains.find(Q=>Q.id===z);if(y&&W.chains.find(Q=>Q.id===y)&&($=W.chains.find(Q=>Q.id===y)),!$)throw new w("Funding chain is not in PrivyProvider chains list");return{address:d,amount:N,chain:$,methodScreen:h,comingFromSendTransactionScreen:P,...d2(p)?{moonpayConfigOverride:p.config}:{}}};async function $u({showAutomaticRecovery:d=!1,legacySetWalletPasswordFlow:p=!1}){R(null);let h=p?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw B(O,h,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let y=ve(s);if(!y||!L)throw B(O,h,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(Un(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Qu()}catch(N){throw B(O,h,"onError","missing_or_invalid_mfa"),N}return new Promise((N,z)=>{re(!0);let $={onSuccess:nt=>{B(O,h,"onSuccess","user-passcode",nt),N(nt)},onFailure:nt=>{B(O,h,"onError","user_exited_set_password_flow"),z(nt)},callAuthOnSuccessOnClose:!1},Q=y.recoveryMethod==="user-passcode",He={onCompleteNavigateTo:Qi({walletAction:"update",availableRecoveryMethods:W.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:Q,showAutomaticRecovery:d}),shouldForceMFA:!1,onFailure:nt=>{B(O,h,"onError","unknown_connect_wallet_error"),z(nt)}};ne({setWalletPassword:$,createWallet:$,connectWallet:He,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Q}}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Us({appId:d}){st(`privy:${d}`),D.current=`privy:${d}`,V.current="link";let p=window.open(void 0,void 0,ds({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:d}}),new Promise(async(h,y)=>{let{name:P,logoUrl:N}=await Gc({api:t.api,providerAppId:d,requesterAppId:W.id});ne({crossAppAuth:{appId:d,name:P,logoUrl:N,popup:p,onSuccess:h,onError:y}}),Be("CROSS_APP_AUTH_SCREEN")})}let hi={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Iv,importWallet:async({privateKey:d})=>{st("siwe");let[p,h]=await Promise.all([ie.initializeWalletProxy(15e3),Ce()]);if(p&&h){await p.import({privateKey:d,accessToken:h});let y=await ie.refreshUser(),P=Sl(y);if(!P)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return B(O,"createWallet","onSuccess",P),P}else throw new w("User is not authenticated")},linkWallet:ju,linkCrossAppAccount:Us,linkEmail:()=>{st("email"),Jt("email"),D.current="email",V.current="link",J("LINK_EMAIL_SCREEN")},linkPhone:()=>{st("sms"),Jt("phone"),D.current="sms",V.current="link",J("LINK_PHONE_SCREEN")},linkGoogle:async()=>{st("google"),Jt("google_oauth"),V.current="link",await ie.initLoginWithOAuth("google")},linkTwitter:async()=>{st("twitter"),Jt("twitter_oauth"),V.current="link",await ie.initLoginWithOAuth("twitter")},linkDiscord:async()=>{st("discord"),Jt("discord_oauth"),V.current="link",await ie.initLoginWithOAuth("discord")},linkGithub:async()=>{st("github"),Jt("github_oauth"),V.current="link",await ie.initLoginWithOAuth("github")},linkSpotify:async()=>{st("spotify"),Jt("spotify_oauth"),V.current="link",await ie.initLoginWithOAuth("spotify")},linkInstagram:async()=>{st("instagram"),Jt("instagram_oauth"),V.current="link",await ie.initLoginWithOAuth("instagram")},linkTiktok:async()=>{st("tiktok"),Jt("tiktok_oauth"),V.current="link",await ie.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{st("linkedin"),Jt("linkedin_oauth"),V.current="link",await ie.initLoginWithOAuth("linkedin")},linkApple:async()=>{st("apple"),Jt("apple_oauth"),V.current="link",await ie.initLoginWithOAuth("apple")},linkPasskey:async()=>{st("passkey"),Jt("passkey"),await ie.initLinkWithPasskey(),J("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{st("telegram"),Jt("telegram"),V.current="link",D.current="telegram",await ie.initLoginWithTelegram(),J("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{st("farcaster"),Jt("farcaster"),await ie.initLoginWithFarcaster(),V.current="link",D.current="farcaster",J("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(st("email"),!s?.email)throw new w("User does not have an email linked to their account.");V.current="link",D.current="email",J("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(st("sms"),!s?.phone)throw new w("User does not have a phone number linked to their account.");V.current="link",D.current="sms",J("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(y=>{Pe(P=>y.bind(P))});if(Pe(null),h){console.warn(p);return}}if(s&&!s.isGuest){console.warn(p);return}V.current="login",ne({login:d}),Be("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{Pe(()=>d)}),Pe(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}Be("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(O,"logout","onSuccess"),V.current=null,D.current=null,o(!1),X.del(Ra),X.del(sl(W.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Xe;let d=f.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===d?.address));return!d||!p?new Xe:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Yu(new so(new Xe));let d=f.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===d?.address));return!d||!p?new Yu(new so(new Xe)):new Yu(new so(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Xo(new Xe);let d=f.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===d?.address));return!d||!p?new Xo(new Xe):new Xo(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(y=>y.type==="cross_app"&&y.subject===d)?.providerApp;if(!p)throw new w("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=f.find(y=>xo(y.address)===xo(d)),h=s?.linkedAccounts.find(y=>y.type==="wallet"&&xo(y.address)===xo(d));if(!p||!await p.isConnected())j(d),ju();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(y)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw B(O,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Bd(s,15e3)},setWalletRecovery:async d=>$u({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:d?.showAutomaticRecovery??!1}),setWalletPassword:async()=>$u({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(d,p,h)=>new Promise(async(y,P)=>{let{requesterAppId:N}=p||{};if(!a||!s){B(O,"signMessage","onError","must_be_authenticated"),P(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=h?s?.linkedAccounts.find(Q=>Q.type==="wallet"&&Q.walletClientType==="privy"&&xo(Q.address)===xo(h)):ve(s);if(!z){B(O,"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(O,"signMessage","onError","invalid_message"),P(new Error("Message must be a non-empty string"));return}re(!0);let $=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Q=await Ce();if(!L||!Q)throw new Error("Unable to connect to wallet");if(!await ie.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:z.address,requesterAppId:N}});let{response:He}=await L.rpc({accessToken:Q,address:z.address,requesterAppId:N,request:{method:"personal_sign",params:[d,z.address]}}),nt=He.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:z.address,requesterAppId:N}}),nt};if(W.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Q=await $();B(O,"signMessage","onSuccess",Q),y(Q)}catch(Q){B(O,"signMessage","onError","unable_to_sign"),P(Q??new Tt("Unable to sign message"))}}else{let He={method:"personal_sign",data:d,confirmAndSign:$,onSuccess:$e=>{B(O,"signMessage","onSuccess",$e),y($e)},onFailure:$e=>{B(O,"signMessage","onError","unable_to_sign"),P($e)},uiOptions:p||{}},nt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:$e=>{B(O,"signMessage","onError","unknown_connect_wallet_error"),P($e)},address:z.address};ne({signMessage:He,connectWallet:nt}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(h,y)=>{let{requesterAppId:P}=p||{};if(!a||!s){B(O,"signTypedData","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let N=ve(s);if(!N){B(O,"signTypedData","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}re(!0);let z=xa(d),$=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Q=await Ce();if(!L||!Q)throw new Error("Unable to connect to wallet");if(!await ie.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:N.address,requesterAppId:P}});let{response:He}=await L.rpc({accessToken:Q,address:N.address,requesterAppId:P,request:{method:"eth_signTypedData_v4",params:[N.address,z]}}),nt=He.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:N.address,requesterAppId:P}}),nt};if(W.embeddedWallets.noPromptOnSignature||(W.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Q=await $();B(O,"signTypedData","onSuccess",Q),h(Q)}catch(Q){B(O,"signTypedData","onError","unable_to_sign"),y(Q??new Tt("Unable to sign message"))}}else{let He={method:"eth_signTypedData_v4",data:z,confirmAndSign:$,onSuccess:$e=>{B(O,"signTypedData","onSuccess",$e),h($e)},onFailure:$e=>{B(O,"signTypedData","onError","unable_to_sign"),y($e)},uiOptions:p||{}},nt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:$e=>{B(O,"signMessage","onError","unknown_connect_wallet_error"),y($e)}};ne({signMessage:He,connectWallet:nt}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,h)=>{let P=await(await Xu(d,p,h)).wait();return Wd(P)},exportWallet:d=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}d&&"target"in d&&d&&(d=void 0);let y=d?.address,P=s.linkedAccounts.filter(Ee=>Ee.type==="wallet"&&Ee.walletClientType==="privy"&&Ee.chainType==="ethereum"),N=y?P.find(Ee=>Ee.address===xo(y)):P.find(Ee=>!Ee.imported)||P[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}re(!0);let z={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:h,address:N.address,shouldForceMFA:!0};if(ne(oe),!await Ce()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}let Q={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};ne({keyExport:Q,connectWallet:z}),J("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Qu,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 w("Invalid MFA code");mr.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((N,z)=>{_r.current={resolve:N,reject:z}});break;case"passkey":if(typeof p=="string")throw new w("Invalid authenticator response");let y=await(await import("@simplewebauthn/browser")).startAuthentication(p),P=hv(y);mr.current?.resolve({mfaMethod:d,mfaCode:P,relyingParty:window.origin}),await new Promise((N,z)=>{_r.current={resolve:N,reject:z}});break;default:throw mr.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${d}`)}},cancel(){mr.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ce();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){ie.closePrivyModal(),p();return}W.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."),ne({mfaEnrollmentFlow:{mfaMethods:W.mfa.methods,onSuccess:p,onFailure:h}}),J("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ce();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 Ce();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 Ce();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 Ce();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 Ce();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 Ce(),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 ie.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let y=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(y.status==="approved"){let P=await t.getAuthenticatedUser();c(P||s||null)}ne({farcasterSigner:y}),J("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let d=await Ce(),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 ie.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(N=>parseInt(N,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async d=>{let p=await Ce(),h=s?.linkedAccounts.find(z=>z.type==="wallet"&&z.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 ie.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"),N=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(N.signature))},createGuestAccount:async()=>{if(s&&!s.isGuest)throw new Error("User cannot already be authenticated to create a guest account");return s?.isGuest?s:ie.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:S,loginWithCode(d){return ie.loginWithCode(d)},initLoginWithEmail(d){return ie.initLoginWithEmail(d)},initLoginWithSms(d){return ie.initLoginWithSms(d)},otpState:F,fundWallet(d,p){return ie.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return ie.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return ie.loginWithHeadlessOAuth(d)},generateSiweMessage({address:d,chainId:p}){return ie.generateSiweMessage({address:d,chainId:p})},linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:y,connectorType:P}){return st("siwe"),ie.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:y,connectorType:P})},signMessageWithCrossAppWallet(d,{address:p}){return Vc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"personal_sign",params:[d,p]},reconnect:Us})},signTypedDataWithCrossAppWallet(d,{address:p}){let h=xa(d);return Vc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:Us})},sendTransactionWithCrossAppWallet(d,{address:p}){return Vc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_sendTransaction",params:[d]},reconnect:Us})},isModalOpen:r,mfaMethods:W.mfa.methods};gv=hi.signMessage,vv=hi.signTypedData,Cv=async(...d)=>{let p=await Xu(...d);return W.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let ie=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:Y,pendingTransaction:null,walletConnectionStatus:k,connectors:t.connectors?.walletConnectors??[],rpcConfig:W.rpcConfig,chains:W.chains,appId:e.appId,showFiatPrices:W.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>W.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(L)return L;let p=new Promise(P=>{Ke(()=>N=>P(N))}),h=new Promise(P=>setTimeout(()=>P(null),d)),y=await Promise.race([p,h]);return Ke(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;p&&D.current&&(h=Zu(s)),V.current==="login"?d.shouldCallAuthOnSuccess&&p&&D.current?(B(O,"login","onComplete",s,g,!1,D.current,h??null),e.onSuccess?.(s,g)):B(O,"login","onError","exited_auth_flow"):V.current==="link"&&h&&(d.isSuccess&&p&&D.current?B(O,"linkAccount","onSuccess",s,D.current,h):D.current&&B(O,"linkAccount","onError","exited_link_flow",{linkMethod:D.current}));let y=E&&Ou.includes(E),P=E==="ERROR_SCREEN"&&oe.errorModalData&&Ou.includes(oe.errorModalData.previousScreen);if((y||P)&&oe.funding){let N=f0[E]??null,z=Mr(oe.funding.chain.id,W.chains,W.rpcConfig,{appId:e.appId}),$;try{$=(await z.getBalance(oe.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}B(O,"fundWallet","onUserExited",{address:oe.funding.address,chain:oe.funding.chain,fundingMethod:N,balance:$})}j(null),V.current=null,D.current=null,b(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:d})=>new Promise(async(p,h)=>{let y=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 N=ie.walletProxy??await ie.initializeWalletProxy(15e3);if(!N)throw new Error("Failed to initialize embedded wallet proxy.");let{response:z}=await N.rpcSolana({accessToken:P,publicKey:u.address,request:{method:"signMessage",params:{message:d}}});return z.data.signature};if(W.embeddedWallets.noPromptOnSignature)try{let P=await y();p({signature:P})}catch(P){h(P)}else ne({signMessage:{method:"solana_signMessage",data:d,confirmAndSign:y,onSuccess:$=>{p({signature:$})},onFailure:$=>{h($)},uiOptions:{}}}),Be("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:J,connectWallet:fi,initLoginWithWallet:async(d,p)=>{D.current="siwe",Ns(d,p)},loginWithWallet:async()=>{if(!n)throw new Ro;if(!(t.authFlow instanceof Io))throw new w("Must initialize SIWE flow first.");let d,p;if(a)try{({user:d}=await t.link()),D.current="siwe"}catch(h){throw B(O,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),D.current="siwe"}catch(h){throw B(O,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||s||null),b(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new ka(d);t.startAuthFlow(p);try{D.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw V.current==="login"?B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new Ro;if(!(t.authFlow instanceof ka))throw new w("Must initialize Farcaster flow first.");let d,p;if(a)try{({user:d}=await t.link()),D.current="farcaster"}catch(h){throw B(O,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),D.current="farcaster"}catch(h){throw B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d||null),b(p||!1),l(!0)},async loginWithGuestAccountFlow(){let d=new wi(this.appId);t.startAuthFlow(d);try{V.current="login",D.current="guest";let p=await t.authenticate(),{user:h,isNewUser:y}=p;if(y=y||!1,!h)throw new w("Unable to authenticate guest account");if(Gt(h,W.embeddedWallets.createOnLogin))try{await Bd(h,15e3),h=await ie.refreshUser()}catch{c(h),console.warn("Unable to create embedded wallet for guest account")}else c(h);return b(y),l(!0),B(O,"login","onComplete",h,y,!1,"guest",null),h}catch(p){throw B(O,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:d,popup:p}){let h=`privy:${d}`;D.current=h;let{url:y,stateCode:P,codeVerifier:N}=await H1({api:t.api,appId:d});if(!y)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:d}}),new w("No authorization URL returned for cross-app auth.");try{let z=await fv({url:y,popup:p,provider:h}),$=z.stateCode,Q=z.authorizationCode;if($!==P)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:P??"",returnedStateCode:$??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let Ee=await G1({api:ko.api,appId:d,codeVerifier:N,stateCode:$,authorizationCode:Q});Ee&&t.storeProviderAccessToken(d,Ee);let He=await ie.refreshUser();if(!He)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:d}}),He}catch(z){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:z.toString(),provider:h}}),z}},async initLoginWithOAuth(d,p){if(D.current=d,Sa()){if(d==="google"&&qi(window.navigator.userAgent)){Be("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Be("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}d==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),X.del(Wn);let h=new io({provider:d});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&(d==="twitter"&&qP&&(y.url=y.url.replace("x.com","twitter.com")),window.location.assign(y.url))},async initLoginWithTelegram(d){if(!n)throw new Ro;D.current="telegram";let p=new Ti(d);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,y)=>{if(!W.loginConfig.telegramAuthConfiguration)return y(new w("Telegram Auth configuration is not loaded"));if(!window.Telegram)return y(new w("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:W.loginConfig.telegramAuthConfiguration.botId,request_access:!0},P=>P?h(P):y(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Ti))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let d,p;if(V.current==="login")try{let h=await t.authenticate();d=h.user,p=h.isNewUser,D.current="telegram"}catch(h){throw B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}else if(V.current==="link")try{d=(await t.link()).user,D.current="telegram"}catch(h){throw B(O,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else throw new w("Unknown auth intent");c(d),b(p||!1),l(!0)},async recoveryOAuthFlow(d,p,h){let y,P;function N(z){if(!z)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new w("Recovery OAuth failed")}switch(d){case"google-drive":{let{url:z,codeVerifier:$,stateCode:Q}=await Dp({api:ko.api,provider:d});N(z);let Ee,He;try{let nt=await Ku({url:z,popup:h,provider:d});if(Ee=nt.stateCode,He=nt.authorizationCode,Ee!==Q)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:Q??"",returnedStateCode:Ee??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(nt){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:nt.toString(),provider:d}}),new w("Recovery OAuth failed")}[y,P]=await Promise.all([Ce(),Hy({api:ko.api,provider:d,codeVerifier:$,stateCode:Ee,authorizationCode:He})]);break}case"icloud":{let{url:z}=await Dp({api:ko.api,provider:d});N(z);let{ckWebAuthToken:$}=await Ku({url:z,popup:h,provider:d});P=$,y=await Ce();break}}if(!L)throw new w("Cannot connect to wallet proxy");if(!y)throw new w("Unable to authorize user");switch(p){case"recover":let z=oe.recoverWallet?.privyWallet?.address;if(!z)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:z,recoveryMethod:d}}),await L.recover({address:z,accessToken:y,recoveryAccessToken:P,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:z,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:y,recoveryAccessToken:P,recoveryMethod:d});let $=await ie.refreshUser(),Q=ve($);if(!Q)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:Q.address}}),B(O,"createWallet","onSuccess",Q);break;case"set-recovery":let Ee=ve(s);if(!Ee)throw B(O,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:Ee.address,existingRecoveryMethod:Ee.recoveryMethod,targetRecoveryMethod:d}}),await L.setRecovery({address:Ee.address,accessToken:y,recoveryAccessToken:P,recoveryMethod:d});let He=ve(await ie.refreshUser());if(!He)throw B(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:Ee.address,existingRecoveryMethod:Ee.recoveryMethod,targetRecoveryMethod:d}}),B(O,"setWalletRecovery","onSuccess",d,He);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof io))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(Mn),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:h??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken({disableAutoRefresh:!0}),P,N,z;if(a||y!==null)try{let $=await t.link();P=$.user,z=$.oAuthTokens,D.current=d}catch($){throw B(O,"linkAccount","onError",$.privyErrorCode||"failed_to_link_account",{linkMethod:d}),$}else try{let $=await t.authenticate();P=$.user,N=$.isNewUser,z=$.oAuthTokens,D.current=d}catch($){throw V.current==="login"?B(O,"login","onError",$.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",$.privyErrorCode||"failed_to_link_account",{linkMethod:d}),$}return c(P),b(N||!1),l(!0),z&&P&&B(O,"oAuthAuthorization","onOAuthTokenGrant",z,{user:P}),z},async initLoginWithPasskey(d){let p=new Dn(d);t.startAuthFlow(p),V.current="login";try{D.current="passkey",await p.initAuthenticationFlow()}catch(h){throw B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new Ro;if(!(t.authFlow instanceof Dn))throw new w("Must initialize Passkey flow first.");if(D.current!=="passkey")throw new w("Must init login with Passkey flow first.");let d,p;try{D.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(h){throw B(O,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d),b(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new Dn(d);t.startAuthFlow(p),V.current="link",D.current="passkey";try{await p.initLinkFlow()}catch(h){throw B(O,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new Ro;if(!(t.authFlow instanceof Dn))throw new w("Must initialize Passkey flow first.");if(D.current!=="passkey")throw new w("Must init login with Passkey flow first.");let d;try{D.current="passkey",{user:d}=await t.link()}catch(p){throw B(O,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return c(d||s||null),d},async initLoginWithHeadlessOAuth(d,p){if(Sa()){if(d==="google"&&qi(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 io({provider:d,headless:!0});p&&h.addCaptchaToken(p);let y=await t.startAuthFlow(h).getAuthorizationUrl();y?.url&&window.location.assign(y.url)},async loginWithHeadlessOAuth(d){A(!0),t.startAuthFlow(new io(d));let p=X.get(Mn),h=d.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:h??""}}),A(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y,P;if(a)try{({user:y}=await t.link()),D.current=d.provider}catch(N){throw B(O,"linkAccount","onError",N.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),N}else try{({user:y,isNewUser:P}=await t.authenticate()),D.current=d.provider}catch(N){throw V.current==="login"?B(O,"login","onError",N.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",N.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),N}return c(y),b(P||!1),l(!0),A(!1),y??void 0},initLoginWithEmail:async(d,p)=>{let h=new qo(d,p);t.startAuthFlow(h);try{D.current="email",await h.sendCodeEmail()}catch(y){throw V.current==="login"?B(O,"login","onError",y.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),y}},initUpdateEmail:async(d,p,h)=>{let y=new Xs(d,p,h);t.startAuthFlow(y),await y.sendCodeEmail()},initUpdatePhone:async(d,p,h)=>{let y=new Tl(d,p,h);t.startAuthFlow(y),await y.sendSmsCode()},initLoginWithSms:async(d,p)=>{G({status:"sending-code"});let h=new Yo(d,p);t.startAuthFlow(h);try{D.current="sms",await h.sendSmsCode(),G({status:"awaiting-code-input"})}catch(y){throw G({status:"error",error:y}),V.current==="login"?B(O,"login","onError",y.privyErrorCode||"unknown_auth_error"):V.current==="link"&&B(O,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),y}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(G({status:"submitting-code"}),!n){let y=new Ro;throw G({status:"error",error:y}),y}if(t.authFlow instanceof qo)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof Yo)t.authFlow.meta.smsCode=d.trim();else{let y=new w("Must initialize a passwordless code flow first");throw G({status:"error",error:y}),y}await Ce();let p,h;if(V.current==="link")try{({user:p}=await t.link())}catch(y){throw G({status:"error",error:y}),B(O,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:D.current}),y}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(y){throw G({status:"error",error:y}),B(O,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}c(p||s||null),b(h||!1),l(!0),G({status:"done"})},generateSiweMessage:async({address:d,chainId:p,captchaToken:h})=>{V.current="link",D.current="siwe";let y=await t.generateSiweNonce({address:d,captchaToken:h}),P=p.replace("eip155:","");return El({address:d,chainId:P,nonce:y})},linkWithSiwe:async({message:d,signature:p,chainId:h,walletClientType:y,connectorType:P})=>{let N;try{N=await t.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:y,connectorType:P}),N=await ie.refreshUser()??N;let z=Zu(N);z&&B(O,"linkAccount","onSuccess",N,"siwe",z)}catch(z){throw B(O,"linkAccount","onError",z.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),V.current=null,D.current=null,z}c(N||s||null),V.current=null,D.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 d=>new Promise(async(p,h)=>{let y=ve(d?.user??s)||Sl(d?.user??s),P=await Ce();if(!P||!L||!y){h(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await L.connect({accessToken:P,address:y.address}),p(!0)}catch(N){if(Qn(N)&&y.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:y.address}}),(await L.recover({address:y.address,accessToken:P,recoveryMethod:y.recoveryMethod})).address||h(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:y.address}}),p(!0);else if(Qn(N)&&y.recoveryMethod!=="privy"){ne({recoverWallet:{privyWallet:y,onFailure:h,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:y.recoveryMethod,action:"recover"}});let z=hc(y.recoveryMethod);J(z)}else h(N)}}),embeddedSolanaWallet:u,createEmbeddedSolanaWallet:async()=>{re(!0);let d=await Ce(),p=await ie.refreshUser(),h=Un(p),y=ve(p);if(!p||!d)throw new w("User must be logged in to create a Solana wallet");if(h)throw new w("User already has an embedded Solana wallet.");if(y)if(y.recoveryMethod==="privy")await ie.recoverEmbeddedEthereumWallet({user:p});else throw new w("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let P=await ie.initializeWalletProxy(15e3);if(!P)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await P.createSolana({accessToken:d,ethereumAddress:y?.address});let N=await ie.refreshUser(),z=Un(N);if(!z)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:z.address}}),z}catch(N){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",N)}},exportSolanaWallet:d=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=d?.address,P=s.linkedAccounts.filter(Q=>Q.type==="wallet"&&Q.walletClientType==="privy"&&Q.chainType==="solana"),N=y?P.find(Q=>Q.address.toLowerCase()===y.toLowerCase()):P.find(Q=>!Q.imported)||P[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}if(re(!0),!await Ce()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}await ie.recoverEmbeddedSolanaWallet();let $={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};ne({keyExport:$}),J("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(d,p)=>{let h=Un(s),y=await Ce();if(!y||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await L.connectSolana({accessToken:y,publicKey:h.address}),d(!0)}catch(P){Qn(P)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recoverSolana({publicKey:h.address,accessToken:y})).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:Mv,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:d=>{i(!0),Ae?.(d)},updateWallets:()=>Ds(),fundWallet:async(d,p)=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Ld({fundingMethods:W.fundingConfig.methods});ne({funding:Ju({address:d,fundWalletConfig:p,methodScreen:h})}),J(h)},requestFarcasterSignerStatus:async d=>{let p=await Ce(),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 y=await t.requestFarcasterSignerStatus(d);if(y.status==="approved"){let P=await t.getAuthenticatedUser();c(P||s||null)}return y},connectCoinbaseSmartWallet:async()=>{W.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let d=t.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||t.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(d)return d.updateConnectionPreference("smartWalletOnly"),fi(d);await Je("coinbase_wallet","coinbase_smart_wallet")}}))();wv=ie.recoverEmbeddedEthereumWallet,bv=ie.recoverEmbeddedSolanaWallet,Ev=ie.solanaSignMessage;let Lv=VP(()=>({wallets:f,ready:mt&&We}),[f,mt,We]);return kr(we.Provider,{value:hi,children:kr(mp.Provider,{value:O,children:kr(Jp.Provider,{value:Lv,children:kr(kh,{...W,children:yv(up.Provider,{value:ie,children:[kr(Ey,{children:yv(bh,{data:oe,setModalData:ne,setInitialScreen:R,initialScreen:E,authenticated:a,open:r,children:[e.children,!W.headless&&W.captchaEnabled&&n&&!a&&kr(pp,{delayedExecution:!1}),kr(Q0,{theme:{...W.appearance.palette||{}}}),!W.render.standalone&&kr(qu,{open:r})]})}),Re&&be?kr(dv,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:mr,mfaSubmitPromise:_r,onLoad:U,onLoadFailed:()=>null}):null,W.loginConfig.telegramAuthConfiguration&&kr(Yr,{if:!0,children:kr(sv,{scriptHost:e.apiUrl||nl,botUsername:W.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};import{useContext as JP}from"react";function $P(e){let{login:t}=JP(we);return xe("login",e),{login:t}}import{useContext as ex}from"react";function tx(e){let{logout:t}=ex(we);return xe("logout",e),{logout:t}}import{useCallback as Tv,useEffect as rx}from"react";function ox(){let e=Te(),t=Fl(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=K(),l=Tv(async c=>{if(e.enabled&&e.status!=="success")throw new hr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=Tv(async()=>{let c=Oa();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(f){throw f}finally{Nn()}},[o]);return rx(()=>{let c=Oa();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}import{useCallback as Sv}from"react";var nx=()=>{let e=Te(),{initLoginWithEmail:t,loginWithCode:r}=K(),o=Sv(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=Sv(async({code:i})=>{if(e.enabled&&e.status==="error")throw new hr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as Av}from"react";var ix=()=>{let e=Te(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=K(),n=Av(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=Av(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new hr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};import{useCallback as Pv}from"react";var ax=()=>{let e=Te(),{generateSiweMessage:t,linkWithSiwe:r}=K(),o=Pv(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=Pv(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:c})=>{if(e.enabled&&e.status!=="success")throw new hr(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}};import{useContext as sx}from"react";function lx(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:f,linkSpotify:m,linkInstagram:u,linkTelegram:C,linkFarcaster:v}=sx(we);return xe("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:f,linkSpotify:m,linkInstagram:u,linkFarcaster:v,linkTelegram:C}}import{useContext as cx}from"react";function dx(e){let{connectWallet:t}=cx(we);return xe("connectWallet",e),{connectWallet:t}}import{useContext as px}from"react";function ux(e){let{createWallet:t}=px(we);return xe("createWallet",e),{createWallet:t}}var mx=e=>{xe("fundWallet",e);let{fundWallet:t}=K();return{fundWallet:t}};var fx=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r}=M();return{createWallet:r,exportWallet:t,wallets:e?[e]:[]}};var hx=()=>{let{connectCoinbaseSmartWallet:e}=M();return{connectCoinbaseSmartWallet:e}};var yx=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=K();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};import{useContext as gx}from"react";function vx(e){let{sendTransaction:t}=gx(we);return xe("sendTransaction",e),{sendTransaction:t}}import{useContext as Cx}from"react";function wx(e){let{setWalletPassword:t}=Cx(we);return xe("setWalletPassword",e),{setWalletPassword:t}}import{useContext as bx}from"react";function Ex(){let{createGuestAccount:e}=bx(we);return{createGuestAccount:e}}import{useContext as Tx}from"react";function Sx(e){let{setWalletRecovery:t}=Tx(we);return xe("setWalletRecovery",e),{setWalletRecovery:t}}import{useContext as Ax}from"react";function Px(e){let{signMessage:t}=Ax(we);return xe("signMessage",e),{signMessage:t}}import{useContext as xx}from"react";function kx(e){let{signTypedData:t}=xx(we);return xe("signTypedData",e),{signTypedData:t}}import{useContext as _x}from"react";var Rx=()=>{let{isModalOpen:e}=_x(we);return{isOpen:e}};import{useContext as Mx}from"react";function Ix(e){let{getAccessToken:t}=Mx(we);return xe("accessToken",e),{getAccessToken:t}}function Wx(e){let{authenticated:t,user:r}=K(),{initLoginWithOAuth:o}=M(),n=Li();return xe("oAuthAuthorization",e),{reauthorize:i=>Lx(t,r,o,n,i.provider)}}var Lx=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new w("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new w(`OAuth account of type ${n} not linked to the account.`);await r(n)};var Ox=xv;function xv(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=K();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function Nx(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}export{so as AsExternalProvider,pp as Captcha,Fa as ConnectorManager,qu as LoginModal,Ba as PrivyClient,QP as PrivyProvider,Xe as PrivyProxyProvider,Bn as SUPPORTED_CHAINS,Yd as VERSION,tr as WalletConnector,kb as addRpcUrlOverrideToChain,Op as errorIndicatesMaxMfaRetries,Zn as errorIndicatesMfaTimeout,Jn as errorIndicatesMfaVerificationFailed,Ce as getAccessToken,Nx as getEmbeddedConnectedWallet,hx as useConnectCoinbaseSmartWallet,dx as useConnectWallet,ux as useCreateWallet,yx as useCrossAppAccounts,Ox as useExperimentalFarcasterSigner,xv as useFarcasterSigner,mx as useFundWallet,Ex as useGuestAccounts,lx as useLinkAccount,ax as useLinkWithSiwe,$P as useLogin,nx as useLoginWithEmail,ox as useLoginWithOAuth,ix as useLoginWithSms,tx as useLogout,ws as useMfa,$r as useMfaEnrollment,Rx as useModalStatus,Wx as useOAuthTokens,K as usePrivy,fp as useRegisterMfaListener,vx as useSendTransaction,wx as useSetWalletPassword,Sx as useSetWalletRecovery,Px as useSignMessage,kx as useSignTypedData,fx as useSolanaWallets,Ix as useToken,Jr as useWallets};