@privy-io/react-auth 1.73.1 → 1.73.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var K3=Object.create;var Bs=Object.defineProperty;var j3=Object.getOwnPropertyDescriptor;var Y3=Object.getOwnPropertyNames;var Z3=Object.getPrototypeOf,Q3=Object.prototype.hasOwnProperty;var J3=(e,t)=>{for(var r in t)Bs(e,r,{get:t[r],enumerable:!0})},ou=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Y3(t))!Q3.call(e,n)&&n!==r&&Bs(e,n,{get:()=>t[n],enumerable:!(o=j3(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?K3(Z3(e)):{},ou(t||!e||!e.__esModule?Bs(r,"default",{value:e,enumerable:!0}):r,e)),X3=e=>ou(Bs({},"__esModule",{value:!0}),e);var cp=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var nu=(e,t,r)=>(cp(e,t,"read from private field"),r?r.call(e):t.get(e)),Hs=(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)},pp=(e,t,r,o)=>(cp(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var iu=(e,t,r)=>(cp(e,t,"access private method"),r);var g6={};J3(g6,{AsExternalProvider:()=>no,Captcha:()=>Nl,ConnectorManager:()=>Gi,LoginModal:()=>rp,PrivyClient:()=>qi,PrivyProvider:()=>s3,PrivyProxyProvider:()=>ot,SUPPORTED_CHAINS:()=>Hi,VERSION:()=>sl,WalletConnector:()=>ar,addRpcUrlOverrideToChain:()=>H3,errorIndicatesMaxMfaRetries:()=>tc,errorIndicatesMfaTimeout:()=>Tn,errorIndicatesMfaVerificationFailed:()=>Pn,getAccessToken:()=>Pe,getEmbeddedConnectedWallet:()=>V3,useConnectWallet:()=>C3,useCreateWallet:()=>b3,useCrossAppAccounts:()=>P3,useExperimentalFarcasterSigner:()=>B3,useFundWallet:()=>E3,useLinkAccount:()=>g3,useLinkWithSiwe:()=>h3,useLogin:()=>c3,useLoginWithEmail:()=>m3,useLoginWithOAuth:()=>u3,useLoginWithSms:()=>f3,useLogout:()=>d3,useMfa:()=>ba,useMfaEnrollment:()=>Xr,useModalStatus:()=>N3,useOAuthTokens:()=>F3,usePrivy:()=>G,useRegisterMfaListener:()=>Bl,useSendTransaction:()=>_3,useSetWalletPassword:()=>x3,useSetWalletRecovery:()=>R3,useSignMessage:()=>W3,useSignTypedData:()=>O3,useSolanaWallets:()=>T3,useToken:()=>U3,useWallets:()=>Sa});module.exports=X3(g6);var Ho=require("@ethersproject/address"),sp=require("@ethersproject/providers"),e3=require("mipd"),pe=require("react"),t3=require("react-device-detect"),Ia=require("@privy-io/js-sdk-core");var au=require("ofetch"),yt=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}]`:""}`}},or=class extends yt{constructor(r,o,n,a,i){super(n,a,i);this.type=r;this.status=o}},w=class extends yt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Vs=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var he=class extends yt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},me=e=>{if(e instanceof yt)return e;if(!(e instanceof au.FetchError))return Pt(e);if(!e.response)return new or("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new or(t||"ApiError",e.response.status,r||o,e,n)},Pt=e=>e instanceof yt?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var qo=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},nr=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 Hr=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 qs="/api/v1/sessions",zs="/api/v1/sessions/logout",su="/api/v1/sessions/fork",$s="/api/v1/sessions/fork/recover",lu="/api/v1/siwe/init",cu="/api/v1/siwe/authenticate",pu="/api/v1/siwe/link",du="/api/v1/siwe/unlink",uu="/api/v1/farcaster/init",mu="/api/v1/farcaster/authenticate",fu="/api/v1/farcaster/link",hu="/api/v1/farcaster/status",yu="/api/v1/farcaster/unlink",gu="/api/v1/passwordless/init",vu="/api/v1/passwordless/authenticate",Cu="/api/v1/passwordless/link",wu="/api/v1/passwordless/unlink",bu="/api/v1/passwordless/update",Eu="/api/v1/passwordless_sms/init",Tu="/api/v1/passwordless_sms/link",Pu="/api/v1/passwordless_sms/unlink",Su="/api/v1/passwordless_sms/authenticate",Ks="/api/v1/oauth/init",_u="/api/v1/oauth/authenticate",js="/api/v1/oauth/link",Au="/api/v1/oauth/unlink",xu="/api/v1/recovery/oauth/init",ku="/api/v1/recovery/oauth/init_icloud",Ru="/api/v1/recovery/oauth/authenticate",Iu="/api/v1/passkeys/link/init",Wu="/api/v1/passkeys/authenticate/init",Mu="/api/v1/passkeys/link",Ou="/api/v1/passkeys/authenticate",Lu="/api/v1/passkeys/unlink",Nu="/api/v1/telegram/authenticate",Du="/api/v1/telegram/link",Uu="/api/v1/telegram/unlink";var Fu="/api/v1/mfa/passwordless_sms/init",Bu="/api/v1/mfa/passkeys/init",Hu="/api/v1/users/me/accept_terms",Ys="/api/v1/analytics_events",Vu="/api/v1/plugins/moonpay_on_ramp/sign",Gu="/api/v1/custom_jwt_account/authenticate";var Pi=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(Gu,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){throw new Error("Unimplemented")}};var mn=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(vu,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(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(Cu,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw me(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(gu,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw me(o)}}},Zs=class extends mn{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(bu,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw me(r)}}};var il=require("react-device-detect");var dp=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 up(){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 e0(){return typeof window<"u"&&window.localStorage?new Qs:new dp}var re=e0();var Si=require("@ethersproject/providers");function qu(){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 Js=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 mp=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Js(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!mp(r))return!1}return!0},fn=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Xs=()=>{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 zu=(e,t)=>{let r=[],o=[];for(let[n,a]of e.entries())n<t?r.push(a):o.push(a);return[r,o]},el=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,}))$/),$u=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Vr=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let a=e.slice(0,o+t),i=e.slice(e.length-r,e.length);return`${a}...${i}`},fp=e=>new Promise(t=>setTimeout(t,e));function Ku(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let a=0,i,s=()=>{if(a>=r){n("Max attempts reached without result");return}if(i=e(),a+=t,i!=null){o(i);return}setTimeout(s,t)};s()})}var Oa=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,a)=>{let i=!1,s=0;for(;!i&&s<o;){if(t.abortSignal?.aborted)return;e().then(l=>{i=!0,n(l)},(...l)=>{i=!0,a(...l)}),s+=1,await fp(r)}i||a(new Error("Exceeded max attempts before resolving function"))})},tl=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[i,s]of Object.entries(r))s!==void 0&&n.searchParams.set(i,s);let a=Object.entries(o);if(a.length>0){let i=new URLSearchParams;for(let[s,l]of a)i.append(s,l);n.hash=i.toString()}return n.href};var ju=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Gn=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Yu(e,t,r,o=3e3){let n=!1,a=window;return new Promise(i=>{a.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout(()=>{s()},o));function s(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",s);let l=e.getProviders(),c=[];for(let u of l)t.includes("coinbase_wallet")&&u.info.rdns==="com.coinbase.wallet"||c.push({type:u.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:u});for(let u of qu()){let h=Js(u);if(!l.some(m=>m.info.name===h)){if(mp(u,!0)&&!c.find(m=>m.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:u});continue}if(h==="Phantom"&&!c.find(m=>m.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:u});continue}if(h==="Coinbase Wallet"&&!c.find(m=>m.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:u});continue}c.find(m=>m.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:u})}}i(c)}})}function _i(e){return`eip155:${String(Number(e))}`}var Zu=(e,t,r,o)=>{let n=Number(e),a=t.find(s=>s.id===n);if(!a)throw new he(`Unsupported chainId ${e}`,4901);let i;if(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0])i=a.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[n])i=r.rpcUrls[n];else if(a.rpcUrls.privy?.http[0]){let s=new URL(a.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",o),i=s.toString()}else a.rpcUrls.public?.http[0]?i=a.rpcUrls.public.http[0]:i=a.rpcUrls.default?.http[0];if(!i)throw new he(`No RPC url found for ${e}`);return i},Qu=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new he(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},zo=(e,t,r,o)=>{let n=Number(e),a=t.find(s=>s.id===n);if(!a)throw new he(`Unsupported chainId ${e}`,4901);let i;if(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0]?i=new Si.StaticJsonRpcProvider(a.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?i=new Si.StaticJsonRpcProvider(r.rpcUrls[n]):a.rpcUrls.privy?.http[0]?i=new Si.StaticJsonRpcProvider({url:a.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):a.rpcUrls.public?.http[0]?i=new Si.StaticJsonRpcProvider(a.rpcUrls.public.http[0]):i=new Si.StaticJsonRpcProvider(a.rpcUrls.default?.http[0]),!i)throw new he(`No RPC url found for ${e}`);return i},La=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var rl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(ol))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var ol={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 Ju(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function Xu(e,t){let r=Ju(t);if(r.deepLink)return im(r.deepLink,e);if(r.universalLink)return hp(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function em(e,t){let r=Ju(t);if(r.universalLink)return hp(r.universalLink,e)}var tm="WALLETCONNECT_DEEPLINK_CHOICE";function rm(){try{localStorage.removeItem(tm)}catch{}}function om({href:e,name:t}){try{localStorage.setItem(tm,JSON.stringify({href:e,name:t}))}catch{}}function nm(e){return e.startsWith("http://")||e.startsWith("https://")}function im(e,t){if(nm(e))return hp(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 hp(e,t){if(!nm(e))return im(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function nl(e,t){window.open(e,t,"noreferrer noopener")}var rt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var Na=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new 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(mu,{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,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(fu,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw me(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(uu,{token:this.captchaToken});il.isMobile&&!il.isIOS&&t.connect_uri&&nl(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(hu,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var am="1.73.1";var sm="34357d3c125c2bcf2ce2bc3309d98715",al="https://auth.privy.io",lm=2e4,et=1400,cm=2500,sl=am;var qn="privy:token",yp="privy-token",ll="privy:refresh_token",pm="privy-refresh-token",cl="privy-session",Da="privy:session_transfer_token",r0="privy:wallet",Ua="privy:caid",Fa=e=>`privy:cross-app:${e}`,zn="privy:state_code",$n="privy:code_verifier",Kn="privy:headless_oauth",pl=e=>`${r0}:${e}`,gp="privy:connectors",vp="privy:connections";var jn=12e4,$o=1,Cp="0x1",Ai=3e4,dm="https://api.moonpay.com/v1",um="https://api.moonpay.com/v1",mm="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",fm="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var hm="deprecated";var wp=require("jose");async function ym(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function gm(e){return crypto.getRandomValues(new Uint8Array(e))}var o0="S256",n0="S256";function Yn(){return wp.base64url.encode(gm(36))}function xi(){return Yn()}async function ki(e,t=o0){if(t==n0){let r=await ym(e);return wp.base64url.encode(r)}else return e}function vm(){let e=re.get($n);if(!e)throw new w("Authentication error.");return e}function dl(){return!!re.get(Kn)}var So=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:dl();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new 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=vm();try{let r=await this.api.post(_u,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return re.del($n),this.meta.headless&&re.del(Kn),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=me(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=re.get($n);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(js,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return re.del($n),r}catch(r){throw me(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=Yn();re.put($n,t);let r=xi();re.put(zn,r);let o=await ki(t);this.meta.headless&&re.put(Kn,!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 me(n)}}};function bp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ba=require("react/jsx-runtime"),ul=({style:e,...t})=>(0,Ba.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,Ba.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,Ba.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var hn=require("react/jsx-runtime"),ml=({style:e,...t})=>(0,hn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,hn.jsx)("g",{clipPath:"url(#clip0)",children:(0,hn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,hn.jsx)("defs",{children:(0,hn.jsx)("clipPath",{id:"clip0",children:(0,hn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Ep=require("react/jsx-runtime"),fl=({style:e,...t})=>(0,Ep.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,Ep.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var Cm=require("@heroicons/react/24/outline"),bm=require("react/jsx-runtime"),wm=({style:e})=>(0,bm.jsx)(Cm.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var Zn=require("react/jsx-runtime"),hl=({style:e,...t})=>(0,Zn.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,Zn.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,Zn.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,Zn.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,Zn.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Rt=require("react/jsx-runtime");function yl(e){return(0,Rt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Rt.jsxs)("defs",{children:[(0,Rt.jsxs)("linearGradient",{id:"b",children:[(0,Rt.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Rt.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Rt.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Rt.jsxs)("linearGradient",{id:"a",children:[(0,Rt.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Rt.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Rt.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Rt.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Rt.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Rt.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Rt.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Rt.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Rt.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var Ha=require("react/jsx-runtime");function gl({style:e,...t}){return(0,Ha.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,Ha.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,Ha.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,Ha.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var Va=require("react/jsx-runtime");function vl(e){return(0,Va.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,Va.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,Va.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Ri=require("react/jsx-runtime");function Cl(e){return(0,Ri.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Ri.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Ri.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Ri.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Tp=require("react/jsx-runtime"),wl=({style:e,...t})=>(0,Tp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Tp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Em={google:{name:"Google",component:hl},discord:{name:"Discord",component:ml},github:{name:"Github",component:fl},linkedin:{name:"LinkedIn",component:gl},twitter:{name:"Twitter",component:wl},spotify:{name:"Spotify",component:vl},instagram:{name:"Instagram",component:yl},tiktok:{name:"Tiktok",component:Cl},apple:{name:"Apple",component:ul}},Ga=e=>e in Em?Em[e]:{name:"Unknown",component:wm};function Tm(e,t){let r={detail:"",retryable:!1},o=bp(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=Ga(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=Ga(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 qa(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:dl(),popupFlow:window.opener!==null&&n}}function Qn(){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"),re.del(zn),window.history.replaceState({},"",e)}var Jn=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new 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(Ou,{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"):me(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(Mu,{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"):me(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Wu,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Iu,{})}_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 bl=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",i=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
1
+ "use strict";var e0=Object.create;var Hs=Object.defineProperty;var t0=Object.getOwnPropertyDescriptor;var r0=Object.getOwnPropertyNames;var o0=Object.getPrototypeOf,n0=Object.prototype.hasOwnProperty;var i0=(e,t)=>{for(var r in t)Hs(e,r,{get:t[r],enumerable:!0})},iu=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of r0(t))!n0.call(e,n)&&n!==r&&Hs(e,n,{get:()=>t[n],enumerable:!(o=t0(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?e0(o0(e)):{},iu(t||!e||!e.__esModule?Hs(r,"default",{value:e,enumerable:!0}):r,e)),a0=e=>iu(Hs({},"__esModule",{value:!0}),e);var pp=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var au=(e,t,r)=>(pp(e,t,"read from private field"),r?r.call(e):t.get(e)),Vs=(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)},dp=(e,t,r,o)=>(pp(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var su=(e,t,r)=>(pp(e,t,"access private method"),r);var b6={};i0(b6,{AsExternalProvider:()=>oo,Captcha:()=>Dl,ConnectorManager:()=>qi,LoginModal:()=>op,PrivyClient:()=>zi,PrivyProvider:()=>f3,PrivyProxyProvider:()=>ot,SUPPORTED_CHAINS:()=>Vi,VERSION:()=>ll,WalletConnector:()=>sr,addRpcUrlOverrideToChain:()=>j3,errorIndicatesMaxMfaRetries:()=>rc,errorIndicatesMfaTimeout:()=>Tn,errorIndicatesMfaVerificationFailed:()=>Sn,getAccessToken:()=>Se,getEmbeddedConnectedWallet:()=>Y3,useConnectWallet:()=>_3,useCreateWallet:()=>x3,useCrossAppAccounts:()=>I3,useExperimentalFarcasterSigner:()=>K3,useFarcasterSigner:()=>tu,useFundWallet:()=>k3,useLinkAccount:()=>S3,useLinkWithSiwe:()=>E3,useLogin:()=>y3,useLoginWithEmail:()=>w3,useLoginWithOAuth:()=>C3,useLoginWithSms:()=>b3,useLogout:()=>v3,useMfa:()=>Ea,useMfaEnrollment:()=>Jr,useModalStatus:()=>G3,useOAuthTokens:()=>$3,usePrivy:()=>G,useRegisterMfaListener:()=>Hl,useSendTransaction:()=>M3,useSetWalletPassword:()=>L3,useSetWalletRecovery:()=>D3,useSignMessage:()=>F3,useSignTypedData:()=>H3,useSolanaWallets:()=>R3,useToken:()=>z3,useWallets:()=>_a});module.exports=a0(b6);var Ho=require("@ethersproject/address"),lp=require("@ethersproject/providers"),s3=require("mipd"),pe=require("react"),l3=require("react-device-detect"),Wa=require("@privy-io/js-sdk-core");var lu=require("ofetch"),yt=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}]`:""}`}},nr=class extends yt{constructor(r,o,n,a,i){super(n,a,i);this.type=r;this.status=o}},w=class extends yt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Gs=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var he=class extends yt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},me=e=>{if(e instanceof yt)return e;if(!(e instanceof lu.FetchError))return St(e);if(!e.response)return new nr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new nr(t||"ApiError",e.response.status,r||o,e,n)},St=e=>e instanceof yt?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var qo=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ir=class extends w{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},qs=class extends w{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Br=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 zs="/api/v1/sessions",$s="/api/v1/sessions/logout",cu="/api/v1/sessions/fork",Ks="/api/v1/sessions/fork/recover",pu="/api/v1/siwe/init",du="/api/v1/siwe/authenticate",uu="/api/v1/siwe/link",mu="/api/v1/siwe/unlink",fu="/api/v1/farcaster/init",hu="/api/v1/farcaster/authenticate",yu="/api/v1/farcaster/link",gu="/api/v1/farcaster/status",vu="/api/v1/farcaster/unlink",Cu="/api/v1/passwordless/init",wu="/api/v1/passwordless/authenticate",bu="/api/v1/passwordless/link",Eu="/api/v1/passwordless/unlink",Tu="/api/v1/passwordless/update",Su="/api/v1/passwordless_sms/init",Pu="/api/v1/passwordless_sms/link",_u="/api/v1/passwordless_sms/unlink",Au="/api/v1/passwordless_sms/authenticate",js="/api/v1/oauth/init",xu="/api/v1/oauth/authenticate",Ys="/api/v1/oauth/link",ku="/api/v1/oauth/unlink",Ru="/api/v1/recovery/oauth/init",Iu="/api/v1/recovery/oauth/init_icloud",Wu="/api/v1/recovery/oauth/authenticate",Mu="/api/v1/passkeys/link/init",Ou="/api/v1/passkeys/authenticate/init",Lu="/api/v1/passkeys/link",Nu="/api/v1/passkeys/authenticate",Du="/api/v1/passkeys/unlink",Uu="/api/v1/telegram/authenticate",Fu="/api/v1/telegram/link",Bu="/api/v1/telegram/unlink";var Hu="/api/v1/mfa/passwordless_sms/init",Vu="/api/v1/mfa/passkeys/init",Gu="/api/v1/users/me/accept_terms",Zs="/api/v1/analytics_events",qu="/api/v1/plugins/moonpay_on_ramp/sign",zu="/api/v1/custom_jwt_account/authenticate";var Pi=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(zu,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){throw new Error("Unimplemented")}};var mn=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(wu,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(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(bu,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw me(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(Cu,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw me(o)}}},Qs=class extends mn{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(Tu,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw me(r)}}};var al=require("react-device-detect");var up=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)}},Js=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 mp(){try{let e="privy:__session_storage__test",t="blobby",r=new Js;return r.put(e,t),r.del(e),!0}catch{return!1}}function s0(){return typeof window<"u"&&window.localStorage?new Js:new up}var re=s0();var _i=require("@ethersproject/providers");function $u(){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 Xs=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 fp=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Xs(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!fp(r))return!1}return!0},fn=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),el=()=>{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 Ku=(e,t)=>{let r=[],o=[];for(let[n,a]of e.entries())n<t?r.push(a):o.push(a);return[r,o]},tl=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,}))$/),ju=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Hr=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let a=e.slice(0,o+t),i=e.slice(e.length-r,e.length);return`${a}...${i}`},hp=e=>new Promise(t=>setTimeout(t,e));function Yu(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let a=0,i,s=()=>{if(a>=r){n("Max attempts reached without result");return}if(i=e(),a+=t,i!=null){o(i);return}setTimeout(s,t)};s()})}var La=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,a)=>{let i=!1,s=0;for(;!i&&s<o;){if(t.abortSignal?.aborted)return;e().then(l=>{i=!0,n(l)},(...l)=>{i=!0,a(...l)}),s+=1,await hp(r)}i||a(new Error("Exceeded max attempts before resolving function"))})},rl=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[i,s]of Object.entries(r))s!==void 0&&n.searchParams.set(i,s);let a=Object.entries(o);if(a.length>0){let i=new URLSearchParams;for(let[s,l]of a)i.append(s,l);n.hash=i.toString()}return n.href};var Zu=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Gn=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Qu(e,t,r,o=3e3){let n=!1,a=window;return new Promise(i=>{a.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout(()=>{s()},o));function s(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",s);let l=e.getProviders(),c=[];for(let u of l)t.includes("coinbase_wallet")&&u.info.rdns==="com.coinbase.wallet"||c.push({type:u.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:u});for(let u of $u()){let h=Xs(u);if(!l.some(m=>m.info.name===h)){if(fp(u,!0)&&!c.find(m=>m.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:u});continue}if(h==="Phantom"&&!c.find(m=>m.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:u});continue}if(h==="Coinbase Wallet"&&!c.find(m=>m.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:u});continue}c.find(m=>m.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:u})}}i(c)}})}function Ai(e){return`eip155:${String(Number(e))}`}var Ju=(e,t,r,o)=>{let n=Number(e),a=t.find(s=>s.id===n);if(!a)throw new he(`Unsupported chainId ${e}`,4901);let i;if(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0])i=a.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[n])i=r.rpcUrls[n];else if(a.rpcUrls.privy?.http[0]){let s=new URL(a.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",o),i=s.toString()}else a.rpcUrls.public?.http[0]?i=a.rpcUrls.public.http[0]:i=a.rpcUrls.default?.http[0];if(!i)throw new he(`No RPC url found for ${e}`);return i},Xu=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new he(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},zo=(e,t,r,o)=>{let n=Number(e),a=t.find(s=>s.id===n);if(!a)throw new he(`Unsupported chainId ${e}`,4901);let i;if(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0]?i=new _i.StaticJsonRpcProvider(a.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?i=new _i.StaticJsonRpcProvider(r.rpcUrls[n]):a.rpcUrls.privy?.http[0]?i=new _i.StaticJsonRpcProvider({url:a.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):a.rpcUrls.public?.http[0]?i=new _i.StaticJsonRpcProvider(a.rpcUrls.public.http[0]):i=new _i.StaticJsonRpcProvider(a.rpcUrls.default?.http[0]),!i)throw new he(`No RPC url found for ${e}`);return i},Na=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var ol=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(nl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var nl={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 em(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function tm(e,t){let r=em(t);if(r.deepLink)return sm(r.deepLink,e);if(r.universalLink)return yp(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function rm(e,t){let r=em(t);if(r.universalLink)return yp(r.universalLink,e)}var om="WALLETCONNECT_DEEPLINK_CHOICE";function nm(){try{localStorage.removeItem(om)}catch{}}function im({href:e,name:t}){try{localStorage.setItem(om,JSON.stringify({href:e,name:t}))}catch{}}function am(e){return e.startsWith("http://")||e.startsWith("https://")}function sm(e,t){if(am(e))return yp(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 yp(e,t){if(!am(e))return sm(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function il(e,t){window.open(e,t,"noreferrer noopener")}var rt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var Da=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new 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(hu,{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,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(yu,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw me(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(fu,{token:this.captchaToken});al.isMobile&&!al.isIOS&&t.connect_uri&&il(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(gu,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var lm="1.73.2";var cm="34357d3c125c2bcf2ce2bc3309d98715",sl="https://auth.privy.io",pm=2e4,et=1400,dm=2500,ll=lm;var qn="privy:token",gp="privy-token",cl="privy:refresh_token",um="privy-refresh-token",pl="privy-session",Ua="privy:session_transfer_token",c0="privy:wallet",Fa="privy:caid",Ba=e=>`privy:cross-app:${e}`,zn="privy:state_code",$n="privy:code_verifier",Kn="privy:headless_oauth",dl=e=>`${c0}:${e}`,vp="privy:connectors",Cp="privy:connections";var jn=12e4,$o=1,wp="0x1",xi=3e4,mm="https://api.moonpay.com/v1",fm="https://api.moonpay.com/v1",hm="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",ym="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var gm="deprecated";var bp=require("jose");async function vm(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Cm(e){return crypto.getRandomValues(new Uint8Array(e))}var p0="S256",d0="S256";function Yn(){return bp.base64url.encode(Cm(36))}function ki(){return Yn()}async function Ri(e,t=p0){if(t==d0){let r=await vm(e);return bp.base64url.encode(r)}else return e}function wm(){let e=re.get($n);if(!e)throw new w("Authentication error.");return e}function ul(){return!!re.get(Kn)}var So=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:ul();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=wm();try{let r=await this.api.post(xu,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return re.del($n),this.meta.headless&&re.del(Kn),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=me(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=re.get($n);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 re.del($n),r}catch(r){throw me(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=Yn();re.put($n,t);let r=ki();re.put(zn,r);let o=await Ri(t);this.meta.headless&&re.put(Kn,!0);try{return await this.api.post(js,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw me(n)}}};function Ep(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ha=require("react/jsx-runtime"),ml=({style:e,...t})=>(0,Ha.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,Ha.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,Ha.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var hn=require("react/jsx-runtime"),fl=({style:e,...t})=>(0,hn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,hn.jsx)("g",{clipPath:"url(#clip0)",children:(0,hn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,hn.jsx)("defs",{children:(0,hn.jsx)("clipPath",{id:"clip0",children:(0,hn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Tp=require("react/jsx-runtime"),hl=({style:e,...t})=>(0,Tp.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,Tp.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var bm=require("@heroicons/react/24/outline"),Tm=require("react/jsx-runtime"),Em=({style:e})=>(0,Tm.jsx)(bm.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var Zn=require("react/jsx-runtime"),yl=({style:e,...t})=>(0,Zn.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,Zn.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,Zn.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,Zn.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,Zn.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var It=require("react/jsx-runtime");function gl(e){return(0,It.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,It.jsxs)("defs",{children:[(0,It.jsxs)("linearGradient",{id:"b",children:[(0,It.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,It.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,It.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,It.jsxs)("linearGradient",{id:"a",children:[(0,It.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,It.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,It.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,It.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,It.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,It.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,It.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,It.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,It.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var Va=require("react/jsx-runtime");function vl({style:e,...t}){return(0,Va.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,Va.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,Va.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,Va.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var Ga=require("react/jsx-runtime");function Cl(e){return(0,Ga.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,Ga.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,Ga.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Ii=require("react/jsx-runtime");function wl(e){return(0,Ii.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Ii.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Ii.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Ii.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Sp=require("react/jsx-runtime"),bl=({style:e,...t})=>(0,Sp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Sp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Sm={google:{name:"Google",component:yl},discord:{name:"Discord",component:fl},github:{name:"Github",component:hl},linkedin:{name:"LinkedIn",component:vl},twitter:{name:"Twitter",component:bl},spotify:{name:"Spotify",component:Cl},instagram:{name:"Instagram",component:gl},tiktok:{name:"Tiktok",component:wl},apple:{name:"Apple",component:ml}},qa=e=>e in Sm?Sm[e]:{name:"Unknown",component:Em};function Pm(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=qa(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=qa(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 za(){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:ul(),popupFlow:window.opener!==null&&n}}function Qn(){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"),re.del(zn),window.history.replaceState({},"",e)}var Jn=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new 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(Nu,{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"):me(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(Lu,{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"):me(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Ou,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Mu,{})}_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,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",i=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
2
2
  ${e}
3
3
 
4
4
  ${a}
@@ -9,7 +9,7 @@ Chain ID: ${t}
9
9
  Nonce: ${r}
10
10
  Issued At: ${i}
11
11
  Resources:
12
- - https://privy.io`};var Xn=class{constructor(t,r,o){this.getNonceOnce=new rt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new 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,is_new_user:o.is_new_user}}catch(t){throw me(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 me(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=bl({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var ei=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(Su,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(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(Tu,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw me(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(Eu,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw me(o)}}};var Ii=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(Nu,{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,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Du,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw me(t)}}};function Sp(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 Pm(){let e;if(e=i0(),e)return Pp(),{...e,flowType:"login-url"};if(e=a0(),e)return Pp(),{...e,flowType:"web-app"};Pp()}function i0(){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"),a=e.get("last_name")||void 0,i=e.get("username")||void 0,s=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:a,username:i,photo_url:s,auth_date:o,hash:r}}function a0(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),a=t.get("hash");if(!(!r||!o||!n||!a))return{query_id:r,user:o,auth_date:n,hash:a}}function Pp(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var Mf=require("uuid");function X(e){return e?new Date(e*1e3):null}function s0(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:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(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 a={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(a);break;case"email":let i={address:r.address,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(i);break;case"phone":let s={number:r.phoneNumber,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(s);break;case"google_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(l);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let u={subject:r.subject,username:r.username,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(u);break;case"twitter_oauth":let h={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(h);break;case"discord_oauth":let m={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(m);break;case"github_oauth":let v={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(v);break;case"tiktok_oauth":let b={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(b);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let P={subject:r.subject,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(P);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)});break;case"farcaster":let A={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:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(A);break;case"passkey":let E={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:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(E);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:X(r.first_verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function fr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var Oe=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,ti=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,El=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,l0=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),hr=(e,t)=>Oe(e)||ti(e)?!1:t==="all-users"||t==="users-without-wallets"&&!l0(e)?.length;function yr(e){if(!e)return null;let t=s0(e.linked_accounts),r=fr(t,"wallet"),o=fr(t,"email"),n=fr(t,"phone"),a=fr(t,"google_oauth"),i=fr(t,"twitter_oauth"),s=fr(t,"discord_oauth"),l=fr(t,"github_oauth"),c=fr(t,"spotify_oauth"),u=fr(t,"instagram_oauth"),h=fr(t,"tiktok_oauth"),m=fr(t,"linkedin_oauth"),v=fr(t,"apple_oauth"),b=fr(t,"farcaster"),g=fr(t,"telegram"),P=e.mfa_methods.map(({type:E,verified_at:S})=>({type:E,verifiedAt:X(S)}));return{id:e.id,createdAt:X(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:a&&{subject:a.subject,email:a.email,name:a.name},twitter:i&&{subject:i.subject,username:i.username,name:i.name,profilePictureUrl:i.profilePictureUrl},discord:s&&{subject:s.subject,username:s.username,email:s.email},github:l&&{subject:l.subject,username:l.username,name:l.name,email:l.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:u&&{subject:u.subject,username:u.username},tiktok:h&&{subject:h.subject,username:h.username,name:h.name},linkedin:m&&{subject:m.subject,name:m.name,email:m.email,vanityName:m.vanityName},apple:v&&{subject:v.subject,email:v.email},farcaster:b&&{fid:b.fid,ownerAddress:b.ownerAddress,displayName:b.displayName,username:b.username,bio:b.bio,pfp:b.pfp,url:b.url,signerPublicKey:b.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:P.map(E=>E.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Op=require("@ethersproject/address"),Af=require("@ethersproject/bytes"),xf=y(require("eventemitter3"));var Mm=y(require("@coinbase/wallet-sdk"));var za=require("react/jsx-runtime"),$a=({style:e,...t})=>(0,za.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,za.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,za.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var io=require("@ethersproject/address"),_p=require("@ethersproject/providers"),Wm=y(require("eventemitter3"));var Am=y(require("eventemitter3"));var c0=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Sm=e=>c0.includes(e);var _m=require("@ethersproject/logger"),yn=require("@privy-io/js-sdk-core");var Wi=class extends he{constructor(){super("Wallet timeout");this.type="wallet_error"}},Mi=class extends he{constructor(){super("User rejected connection");this.type="wallet_error"}},oo=e=>{if(e instanceof he)return e;if(e?.code&&e?.reason){let t=new It(e);return e.code===_m.ErrorCode.ACTION_REJECTED&&(t.details=yn.ProviderErrors.E4001_USER_REJECTED_REQUEST),t}return e?.code?new It(e):new he("Unknown connector error",e)},_r=class extends yt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},It=class extends _r{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(yn.ProviderErrors).find(a=>a.eipCode===o.code);this.details=n||yn.ProviderErrors.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=yn.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=yn.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=yn.ProviderErrors.E32002_WALLET_LOCKED))}},p0={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}},Ko={...p0,...yn.ProviderErrors};var ot=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 Wi,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||jn,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 he(`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 oo(r)})}},gn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Ka=class extends Am.default{constructor(r,o,n,a,i,s=1){super();this.walletProxy=r,this.address=o,this.chainId=s,this.rpcConfig=n,this.chains=a,this.provider=zo(s,this.chains,n,{appId:i}),this.rpcTimeoutDuration=Oi(n,"privy"),this.appId=i}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new gn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Pe()||!this.address)throw new gn("Disconnected",4900);return(await Rm(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new gn(`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 gn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=zo(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 xm(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 km(La(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:Gn(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(a){throw console.warn(`Gas estimation failed with error: ${a} 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 Gn(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(Sm(r.method)){let o=await Pe();if(await Im(),!o||!this.address)throw new gn("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 gn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Pe();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}}},no=class extends ot{constructor(r){super(r,r.rpcTimeoutDuration)}},vn=class extends ot{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 d0=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},ar=class extends Wm.default{constructor(r,o,n,a){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=_i(r),this.walletClientType==="privy"&&re.put(pl(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=a,this.rpcTimeoutDuration=Oi(a,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,a){let i=async()=>!!this.wallets.find(s=>(0,io.getAddress)(s.address)===(0,io.getAddress)(r));return{address:(0,io.getAddress)(r),chainId:o,meta:n,imported:a,switchChain:async s=>{if(!i)throw new he("Wallet is not currently connected.");let l=this.wallets.find(v=>(0,io.getAddress)(v.address)===(0,io.getAddress)(r))?.chainId;if(!l)throw new he("Unable to determine current chainId.");let c,u;if(typeof s=="number"?(c=`0x${s.toString(16)}`,u=s):(c=s,u=Number(s)),l===_i(c))return;let h=this.chains.find(v=>v.id===u);if(!h)throw new he(`Unsupported chainId: ${s}`);let m=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await m()}catch(v){if(d0(v,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:h.name,nativeCurrency:h.nativeCurrency,rpcUrls:[h.rpcUrls.default?.http[0]??""],blockExplorerUrls:[h.blockExplorers?.default.url??""]}]}),m();throw this.walletClientType==="rainbow"&&v.message?.includes("wallet_switchEthereumChain")?new he(`Rainbow does not support the chainId ${o}`):v}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new he("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new he("Wallet is not currently connected.");return new _p.Web3Provider(new no(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new he("Wallet is not currently connected.");return new vn(this.proxyProvider)},sign:async s=>{if(!await i())throw new he("Wallet is not currently connected.");return await this.sign(s)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await Oa(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch(c){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],a=(0,io.getAddress)(n),i=[],s;if(this.walletClientType==="privy"){let c=re.get(pl(a));this.chains.find(u=>u.id===Number(c))||(re.del(pl(a)),c=null),s=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${s} on initialization`)}}else try{let c=await Oa(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")s=c;else if(typeof c=="number")s=`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 ${Cp}`,c),s=Cp}let l=_i(s);if(!i.find(c=>(0,io.getAddress)(c.address)===a)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};i.push(this.buildConnectedWallet((0,io.getAddress)(n),l,c,this.connectorType==="embedded_imported"))}Tl(i,this.wallets)||(this.wallets=i,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,io.getAddress)(n)===(0,io.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new _p.Web3Provider(new no(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 u0=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],m0=(e,t)=>e.makeWeb3Provider({options:t}),Ap,Pl=class extends ar{constructor(r,o,n,a,i,s){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new ot(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=a.coinbaseWallet.connectionOptions??"eoaOnly",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Ap){let l=[o.id].concat(r.map(u=>u.id)),c=this.connectionOptions!=="eoaOnly"?l.filter(u=>!u0.includes(u)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),Ap=new Mm.default({appName:i,appLogoUrl:s,appChainIds:l})}this.proxyProvider.setWalletProvider(m0(Ap,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:$a,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 he("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw oo(r)}}};var xp=require("react/jsx-runtime"),Li=({...e})=>(0,xp.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,xp.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var ja=class extends ar{constructor(r,o,n,a,i=!1){super("privy",o,n,a);this.connectorType="embedded";this.proxyProvider=r,i&&(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:[Gn(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Li,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var kp=require("react/jsx-runtime"),Ni=({style:e,...t})=>(0,kp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,kp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var Zt=require("react/jsx-runtime"),Di=({style:e,...t})=>(0,Zt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,Zt.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,Zt.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,Zt.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,Zt.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,Zt.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,Zt.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,Zt.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,Zt.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,Zt.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,Zt.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,Zt.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,Zt.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,Zt.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var Ya=require("react/jsx-runtime"),_o=({style:e,...t})=>(0,Ya.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,Ya.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,Ya.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var Fi=class extends ar{constructor(r,o,n,a,i){super(i||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new ot(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=a;let s=a.provider;this.proxyProvider.setWalletProvider(s)}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 he("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw oo(r)}}},Ui,Bi=class extends ar{constructor(r,o,n,a,i){super(i??"unknown",r,o,n);this.connectorType="injected";Hs(this,Ui,void 0);this.proxyProvider=new ot(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(a),i==="metamask"?pp(this,Ui,{name:"MetaMask",icon:Di,id:"io.metamask"}):i==="phantom"&&pp(this,Ui,{name:"Phantom",icon:_o,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 nu(this,Ui)??{name:"Browser Extension",icon:Ni,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 he("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw oo(r)}}};Ui=new WeakMap;var f0=require("@ethersproject/address"),h0=require("@ethersproject/providers"),Om=require("react-device-detect");var Sl=class extends Fi{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Om.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new he("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw oo(t)}}};var _l=class extends ar{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new ot(void 0,jn);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 Al=class extends _l{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:_o,id:"phantom"}}};var Vi=require("@walletconnect/ethereum-provider"),_f=require("react-device-detect");var Gr=require("react");var Lm=require("react/jsx-runtime");function xl({src:e,...t}){return(0,Lm.jsx)("img",{src:e,...t,style:{display:"none"}})}var xo=require("react"),wf=require("react");var Ar={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:sm,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"eoaOnly"}},captchaEnabled:!1,_render:{standalone:!1},fiatOnRamp:{useSandbox:!1}};var Nm=({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 y0=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),Dm=e=>y0.has(e),Um=(e,t,r)=>r.indexOf(e)===t,Fm=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Dm).filter(Um):e?e.filter(Dm).filter(Um):Ar.appearance.walletList;var Bm={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 Hm={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var Vm={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 Gm={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 qm={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 zm={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 $m={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var Km={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 jm={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 Ym={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 Zm={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 Qm={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 Jm={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 Xm={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 ef={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var tf={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 rf={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 of={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 kl={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 nf={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 af={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var sf={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 lf={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 cf={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var pf={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 df={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var uf={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 mf={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 ff={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 hf={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 Hi=[Bm,Hm,Vm,ef,uf,kl,nf,af,sf,lf,cf,Ym,Zm,Qm,Jm,zm,$m,Km,jm,rf,of,Gm,qm,mf,hf,ff,tf,pf,Xm,df],m8=new Set(Hi.map(e=>e.id));var Cn=y(require("tinycolor2")),yf="#FFFFFF",g0="#000000",v0=yf,C0="#1E1E1D";function w0(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 Ao(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Cn.default)({...e.toHsl(),l:r})}function gf({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:a=yf,blackHex:i=g0}){let s;switch(e){case"light":s=v0;break;case"dark":s=C0;break;default:s=e;break}let l=(0,Cn.default)(s),c=(0,Cn.default)(t),u=(0,Cn.default)(r),h=(0,Cn.default)(o),m=(0,Cn.default)(n),v=w0(l.getLuminance()),b=Ao(l,v==="light"?-.04:.11),g=Ao(l,v==="light"?-.88:.87),P=Ao(l,v==="light"?-.77:.75),A=Ao(l,v==="light"?-.43:.45).desaturate(v==="light"?60:20),E=Ao(l,v==="light"?-.08:.25).desaturate(v==="light"?60:20),S=Ao(c,.15),W=Ao(c,-.06),D=Ao(m,.3),M=Ao(h,.3),I=(0,Cn.default)(c.getLuminance()>.5?i:a),H=Ao(u,-.16);return{colorScheme:v,background:l.toHslString(),background2:b.toHslString(),foreground:g.toHslString(),foreground2:P.toHslString(),foreground3:A.toHslString(),foreground4:E.toHslString(),accent:c.toHslString(),accentLight:S.toHslString(),accentDark:W.toHslString(),foregroundAccent:I.toHslString(),success:u.toHslString(),successDark:H.toHslString(),error:m.toHslString(),errorLight:D.toHslString(),warn:h.toHslString(),warnLight:M.toHslString()}}function Rp(e,t,r){let o=r?console.warn:()=>{},n,a,i,s,l,c,u,h,m,v,b,g,P,A,E;t?.loginMethods?(n=t.loginMethods.includes("email"),a=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),l=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),u=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),h=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),b=t.loginMethods.includes("linkedin"),P=t.loginMethods.includes("apple"),A=t.loginMethods.includes("farcaster"),E=t.loginMethods.includes("telegram")):(n=e.emailAuth,a=e.smsAuth,s=e.walletAuth,l=e.googleOAuth,c=e.twitterOAuth,u=e.discordOAuth,g=e.githubOAuth,m=e.spotifyOAuth,v=e.instagramOAuth,h=e.tiktokOAuth,b=e.linkedinOAuth,P=e.appleOAuth,A=e.farcasterAuth,E=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?i=!1:e.passkeyAuth&&(i=!0);let S=[n,a].filter(Boolean),W=[l,c,u,g,m,v,h,b,P,A,E].filter(Boolean),D=[s].filter(Boolean);if(S.length+W.length+D.length===0)throw new Error("You must enable at least one login method");let M=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;M&&D.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),M=!1):!M&&W.length+S.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),M=!0);let I=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let H=Fm({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),$=Nm({input:t?.loginMethodsAndOrder}),J=t?.intl?.defaultCountry??"US",{chains:O,defaultChain:K}=b0({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),N=!!t?.defaultChain,nt=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,ht,Xe=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?nt?ht=t?.embeddedWallets?.noPromptOnSignature??!0:ht=t?.embeddedWallets?.noPromptOnSignature??Xe:ht=Xe,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&ht!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:we,...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??Ar.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:gf({backgroundTheme:t?.appearance?.theme??Ar.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Ar.appearance.accentColor}),loginGroupPriority:M?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:H},loginMethods:{wallet:s,email:n,sms:a,passkey:i,google:l,twitter:c,discord:u,github:g,spotify:m,instagram:v,tiktok:h,linkedin:b,apple:P,farcaster:A,telegram:E},loginMethodsAndOrder:$,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Ar.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Ar.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Ar.rpcConfig.rpcTimeouts},chains:O,defaultChain:K,intl:{defaultCountry:J},shouldEnforceDefaultChainOnConnect:N,captchaEnabled:e.captchaEnabled??Ar.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??Ar.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:I}},embeddedWallets:{...e.embeddedWalletConfig,...typeof we=="boolean"?{requireUserOwnedRecoveryOnCreate:we}:{},...nt?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...ne,noPromptOnSignature:ht},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:nt?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Ar.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??Ar._render.standalone}}}function vf(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:a,...i}=e;return{...i,...o?{additionalChains:o.map(l=>l.id)}:void 0,...n?{supportedChains:n.map(l=>l.id)}:void 0,...a?{defaultChain:a.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function b0({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(l=>l.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(l=>l.rpcUrls.privyWalletOverride?l:Hi.find(u=>u.id===l.id)??l)}else n=Hi.concat(e??[]);let a=t?n[0]:kl,i=r??a;if(!n.find(s=>s.id===i.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:i}}var Cf=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,a;n<e.length;n++)a=e.charCodeAt(n),r=Math.imul(r^a,2654435761),o=Math.imul(o^a,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var Tf=require("react/jsx-runtime"),bf={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:""},Ip=Rp(bf,void 0,!1),Wp=(0,wf.createContext)({appConfig:Ip,isServerConfigLoaded:!1}),Ef=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,a]=(0,xo.useState)(null),i=(0,xo.useMemo)(()=>Rp(n??bf,o,!!n),[n,o]);return(0,xo.useEffect)(()=>{if(!n)return;let s=vf(o,t),l=Cf(JSON.stringify(s)).toString(),c=`privy:sent:${n.id}:${l}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:s}),localStorage.setItem(c,"t"))},[o,t,n]),(0,xo.useEffect)(()=>{n||(async()=>{try{let l=await r.getServerConfig();l.customApiUrl&&r.updateApiUrl(l.customApiUrl),a(l)}catch(l){console.warn("Error generating app config: ",l)}})()},[]),(0,Tf.jsx)(Wp.Provider,{value:{appConfig:i,isServerConfigLoaded:!!n},children:e})},Wt=()=>{let{appConfig:e}=(0,xo.useContext)(Wp);return e},Rl=()=>{let{isServerConfigLoaded:e}=(0,xo.useContext)(Wp);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var Il=require("react/jsx-runtime"),Pf=(0,Gr.createContext)({ready:!1,app:Ip,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),E0=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Sf=e=>{let t=Wt(),r=e.authenticated,[o,n]=(0,Gr.useState)(e.initialScreen);(0,Gr.useEffect)(()=>{!r&&!E0.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let a=(0,Gr.useRef)(null);(0,Gr.useEffect)(()=>{e.open||(a.current=null)},[e.open]),(0,Gr.useEffect)(()=>{a.current=null},[e.initialScreen]);let i={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(s,l=!0)=>{e.setInitialScreen(s),l&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:a};return(0,Il.jsxs)(Pf.Provider,{value:i,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,Il.jsx)(xl,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k=()=>(0,Gr.useContext)(Pf);var jo=require("react/jsx-runtime"),Za=({style:e,...t})=>{let{app:r}=k();return(0,jo.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,jo.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,jo.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,jo.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,jo.jsx)("defs",{children:(0,jo.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,jo.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var ao=class extends ar{constructor(r,o,n,a,i,s,l,c){super(c||"unknown",n,a,o);this.connectorType="wallet_connect_v2";this.privyAppId=s,this.privyAppName=l,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new ot(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=ol[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=rl(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:Di,id:"io.metamask"}:{name:ju(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Za,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=ol[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,rm(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Mi)};this.onQrModalClosed=n,(async()=>{let i="",s=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(s?.length&&(i=s[0]),!i||i==="")throw new he("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let l=rl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=l?.entry,this.walletClientType=l?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Oi(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(s),r()})().catch(i=>{if(i){o(oo(i));return}o(new he("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 i of this.chains){let s=Zu(i.id,this.chains,this.rpcConfig,this.privyAppId);s&&(r[i.id]=s)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(i=>i.id),a=await Vi.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:Vi.OPTIONAL_EVENTS,optionalMethods:Vi.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return a.on("display_uri",i=>{if(a.signer.abortPairingAttempt(),_f.isMobile&&this.walletEntry){let{redirect:s,href:l}=Xu(i,this.walletEntry);om({href:l,name:this.walletEntry.displayName}),this.redirectUri=s;let c=em(i,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),nl(s,"_self")}else this.modal?.openModal({uri:i,chains:[this.defaultChain.id]})}),a.on("connect",()=>{if(this.modal?.closeModal(),a.session?.peer.metadata.url){let i=rl(a.session?.peer.metadata.url);this.walletEntry=i?.entry,this.walletClientType=i?.walletClientType||"unknown"}}),a}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=>(0,Af.isHexString)(o)).map(o=>(0,Op.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Oi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||jn:jn,Gi=class extends xf.default{constructor(r,o,n,a,i,s,l,c,u,h,m){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(a=>a.address===r?.address));return!r||!o?new ot:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=a,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=s,this.walletList=l,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=u,this.privyAppName=h,this.privyAppLogo=m,this.storedConnections=Mp()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(a=>a.wallets).sort((a,i)=>a.connectedAt&&i.connectedAt?i.connectedAt-a.connectedAt:0).filter(a=>{let i=`${a.address}${a.walletClientType}${a.connectorType}`;return r.has(i)?!1:(r.add(i),!0)}),n=o.findIndex(a=>a.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;re.get(gp)&&(re.getKeys().forEach(o=>{o.startsWith("walletconnect")&&re.del(o)}),re.del(gp));let r=Yu(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:a,legacyInjectedProvider:i})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:a,legacyInjectedProvider:i})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!fn()&&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(a=>a.address===o.address&&a.connectorType===o.connectorType&&a.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,a){let i=this.findWalletConnector("embedded","privy");if(i)i.proxyProvider.walletProxy=r;else{let s=new Ka(r,o,this.rpcConfig,this.chains,a,n.id),l=new ja(s,this.chains,n,this.rpcConfig);this.addWalletConnector(l)}}addImportedWalletConnector(r,o,n,a){let i=this.findWalletConnector("embedded_imported","privy");if(i)i.proxyProvider.walletProxy=r;else{let s=new Ka(r,o,this.rpcConfig,this.chains,a,n.id),l=!0,c=new ja(s,this.chains,n,this.rpcConfig,l);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=Mp(),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=Mp(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let a=this.findWalletConnector(r,o);if(a)return a instanceof ao&&a.resetConnection(o),a;let s=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Sl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Bi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Bi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Bi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Fi(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Pl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Al(this.defaultChain):new ao(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return s&&this.addWalletConnector(s),s||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}));re.put(vp,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Op.getAddress)(r),this.emit("walletsUpdated")}};function Tl(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 T0=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Mp=()=>{let e=re.get(vp);return e&&Array.isArray(e)&&e.map(o=>T0(o)).every(Boolean)?e:[]};var kf=require("ofetch");var P0=[qs,$s,zs,Ys],Wl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=sl,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=kf.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:a,options:i})=>{let s=new Headers(i.headers);s.set("privy-app-id",this.appId),this.appClientId&&s.set("privy-client-id",this.appClientId),s.set("privy-ca-id",this.clientAnalyticsId||""),s.set("privy-client",`react-auth:${this.sdkVersion}`);let l=P0.includes(a.toString());if(!s.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:l});c!==null&&s.set("authorization",`Bearer ${c}`)}i.headers=s,i.retryDelay&&(i.retryDelay=i.retryDelay*3)},onRequestError:({error:a})=>{if(a instanceof DOMException&&a.name==="AbortError")throw new Vs}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw me(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw me(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw me(o)}}};var Rf=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var ri=y(require("js-cookie"));function If(e){return e instanceof mn?"email":e instanceof ei?"sms":e instanceof Xn?"siwe":e instanceof Pi?"custom_auth":e instanceof So?e.meta.provider:null}var Wf=y(require("jose")),so=class{static parse(t){try{return new so(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Wf.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 S0=30,Ml=class{constructor(){this.authenticateOnce=new rt(async t=>this._authenticate(t)),this.linkOnce=new rt(async t=>this._link(t)),this.refreshOnce=new rt(this._refresh.bind(this)),this.destroyOnce=new rt(this._destroy.bind(this)),this.forkSessionOnce=new rt(this._forkSession.bind(this))}get token(){try{let t=re.get(qn);return typeof t=="string"?new so(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=re.get(ll);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=re.get(Da);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=re.get(Fa(t));if(typeof r=="string"){let o=new so(r);return o.isExpired()?(re.del(Fa(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=ri.default.get(cl);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!==hm}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=so.parse(this.token);return t!==null&&!t.isExpired(S0)}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"?re.put(Fa(t),r):re.del(Fa(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:a}=r;this.handleTokenResponse(r);let i=a,s=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,refreshTokenExpiresInSeconds:a.refresh_token_expires_in_seconds,scopes:i.scopes}:void 0,l=If(t);return l&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:l,isNewUser:n}}),l==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:yr(o),isNewUser:n,oAuthTokens:s}}catch(r){throw console.warn("Error authenticating session"),Pt(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:yr(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),Pt(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 a={};t&&(a.authorization=`Bearer ${t}`);let i=r?{refresh_token:r}:{};n=await this.api.post(qs,i,{headers:a}),o&&this.clearForkedToken()}else if(o)n=await this.api.post($s,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),yr(n.user)}catch(n){if(n instanceof or&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Pt(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&this.storeToken(t.token):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token))}async _destroy(){try{await this.api?.post(zs,{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(su,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw Pt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=re.get(qn);if(re.put(qn,t),!this.client?.useServerCookies){let o=so.parse(t)?.expiration;ri.default.set(yp,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else re.del(qn),ri.default.remove(yp),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(re.put(ll,t),this.client?.useServerCookies||ri.default.set(cl,"t",{sameSite:"Strict",secure:!0,expires:30})):(re.del(ll),ri.default.remove(pm),ri.default.remove(cl))}clearForkedToken(){re.del(Da)}};var Np,Ol,Of,qi=class{constructor(t){Hs(this,Ol);this.apiUrl=t.apiUrl||al,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||lm,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=iu(this,Ol,Of).call(this),Np||(Np=new Ml),this.session=Np,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:a,walletList:i,shouldEnforceDefaultChainOnConnect:s,externalWalletConfig:l,appName:c}){this.connectors||(this.connectors=new Gi(this.appId,t,r,o,n,a,i,s,l,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Wl({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)}link(){if(!this.authFlow)throw new w("No auth flow in progress.");return this.session.link(this.authFlow)}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(Fu,{action:"verify"})}catch(t){throw me(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Bu,{});return Rf(t.options)}catch(t){throw me(t)}}async unlinkEmail(t){try{let r=await this.api.post(wu,{address:t});return yr(r)}catch(r){throw Pt(r)}}async acceptTerms(){try{let t=await this.api.post(Hu,{});return yr(t)}catch(t){throw Pt(t)}}async unlinkPhone(t){try{let r=await this.api.post(Pu,{phoneNumber:t});return yr(r)}catch(r){throw Pt(r)}}async unlinkWallet(t){try{let r=await this.api.post(du,{address:t});return yr(r)}catch(r){throw Pt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Au,{provider:t,subject:r});return yr(o)}catch(o){throw Pt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(yu,{fid:t});return yr(r)}catch(r){throw Pt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Uu,{telegram_user_id:t});return yr(r)}catch(r){throw Pt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Lu,{credential_id:t});return yr(r)}catch(r){throw Pt(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(Ys,{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(Vu,t)}catch(r){throw Pt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?so.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0;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}}catch(t){throw Pt(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(lu,{address:t,token:r})).nonce}catch(o){throw Pt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){return await this.api.post(cu,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:a})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){return await this.api.post(pu,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:a})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){try{let i=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a});return yr(i)}catch(i){throw Pt(i)}}};Ol=new WeakSet,Of=function(){if(typeof window>"u")return null;try{let r=re.get(Ua);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,Mf.v4)();try{return re.put(Ua,t),t}catch{return t}};var Uf=require("@marsidev/react-turnstile"),Ll=require("react");var qr=require("react");var Df=require("react/jsx-runtime"),Lf=(0,qr.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:T,setError:T,setExecuting:T,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:T,reset:T,execute:T}),xr=class extends yt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Nf=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,qr.useRef)(null),[a,i]=(0,qr.useState)(),[s,l]=(0,qr.useState)(),[c,u]=(0,qr.useState)(!1),h=(0,qr.useMemo)(()=>o?!c&&!a&&!s?{status:"ready"}:c&&!a&&!s?{status:"loading"}:a&&!s?{status:"success",token:a}:s?{status:"error",error:s}:{status:"ready"}:{status:"disabled"},[o,a,s,c]);return(0,Df.jsx)(Lf.Provider,{value:{...h,ref:n,enabled:o,siteKey:r,appId:t,setToken:i,setError:l,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),l(void 0),i(void 0))},reset(){o&&(n.current?.reset(),u(!1),l(void 0),i(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await Ku(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new xr("Captcha failed",null,"captcha_timeout")}}},children:e})},Se=()=>(0,qr.useContext)(Lf);var Dp=require("react/jsx-runtime"),Nl=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:a,setExecuting:i,ref:s}=Se(),[,l]=(0,Ll.useMemo)(()=>r?.split("t:")||[],[r]);if((0,Ll.useEffect)(()=>s.current?.remove,[]),!t)return null;if(!l)throw new Error("Unsupported captcha site key");return(0,Dp.jsx)("div",{className:"hidden h-0 w-0",children:(0,Dp.jsx)(Uf.Turnstile,{...e,ref:s,siteKey:l,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"),i(!1)},onSuccess:c=>{e.onSuccess?.(c),a(c),i(!1)},onExpire:()=>{e.onExpire?.();try{s.current?.reset(),n(void 0),a(void 0)}catch{n("expired_and_failed_reset")}}})})};var dn=require("react"),Kd=y(require("styled-components"));var Dl=require("react");var Up=(0,Dl.createContext)({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,crossAppAuthFlow:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,recoverEmbeddedEthereumWallet:T,getFiatOnRampConfig:T,updateWallets:T,fundWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T,generateSiweMessage:T,linkWithSiwe:T,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:T,recoverEmbeddedSolanaWallet:T}),R=()=>(0,Dl.useContext)(Up);var Ul=require("react");var xe=(0,Ul.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,linkCrossAppAccount:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkCrossAppAccount:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,importWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,initLoginWithEmail:T,initLoginWithSms:T,otpState:{status:"initial"},loginWithCode:T,fundWallet:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,generateSiweMessage:T,linkWithSiwe:T,signMessageWithCrossAppWallet:T,signTypedDataWithCrossAppWallet:T,sendTransactionWithCrossAppWallet:T,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),G=()=>(0,Ul.useContext)(xe);var Fl=require("react"),Ff=e=>{let[t,r]=(0,Fl.useState)("auto");return(0,Fl.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var zi=require("react"),Bf={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:[]}},Fp=(0,zi.createContext)(void 0),Hf=()=>(0,zi.useContext)(Fp);function Ze(e,t){if(!t)return;let o=Hf().current[e];return(0,zi.useEffect)(()=>{for(let[n,a]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(a);return()=>{for(let[n,a]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(i=>i!==a)}},[t])}function U(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function $i(){let e=Hf();return(t,r,...o)=>U(e,t,r,...o)}function Bl(e){Ze("configureMfa",e)}var Jf=require("@heroicons/react/24/outline"),Gp=y(require("styled-components"));var lo=y(require("styled-components"));var Hl=y(require("styled-components")),wn=require("react/jsx-runtime"),wt=({success:e,fail:t})=>(0,wn.jsxs)(wn.Fragment,{children:[(0,wn.jsx)(Mt,{className:e?"success":t?"fail":""}),(0,wn.jsx)(Bp,{className:e?"success":t?"fail":""})]}),Mt=Hl.default.span`
12
+ - https://privy.io`};var Ko=class{constructor(t,r,o){this.getNonceOnce=new rt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new 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,is_new_user:o.is_new_user}}catch(t){throw me(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 me(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 Xn=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(Au,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(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(Pu,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw me(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(Su,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw me(o)}}};var Wi=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(Uu,{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,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Fu,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw me(t)}}};function _p(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 _m(){let e;if(e=u0(),e)return Pp(),{...e,flowType:"login-url"};if(e=m0(),e)return Pp(),{...e,flowType:"web-app"};Pp()}function u0(){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"),a=e.get("last_name")||void 0,i=e.get("username")||void 0,s=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:a,username:i,photo_url:s,auth_date:o,hash:r}}function m0(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),a=t.get("hash");if(!(!r||!o||!n||!a))return{query_id:r,user:o,auth_date:n,hash:a}}function Pp(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var Lf=require("uuid");function X(e){return e?new Date(e*1e3):null}function f0(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:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(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 a={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(a);break;case"email":let i={address:r.address,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(i);break;case"phone":let s={number:r.phoneNumber,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(s);break;case"google_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(l);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let u={subject:r.subject,username:r.username,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(u);break;case"twitter_oauth":let h={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(h);break;case"discord_oauth":let m={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(m);break;case"github_oauth":let v={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(v);break;case"tiktok_oauth":let b={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(b);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let S={subject:r.subject,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(S);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)});break;case"farcaster":let A={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:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(A);break;case"passkey":let E={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:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(E);break;case"telegram":let P={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:X(r.first_verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(P);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function fr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var Me=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,ei=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Tl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,h0=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),hr=(e,t)=>Me(e)||ei(e)?!1:t==="all-users"||t==="users-without-wallets"&&!h0(e)?.length;function yr(e){if(!e)return null;let t=f0(e.linked_accounts),r=fr(t,"wallet"),o=fr(t,"email"),n=fr(t,"phone"),a=fr(t,"google_oauth"),i=fr(t,"twitter_oauth"),s=fr(t,"discord_oauth"),l=fr(t,"github_oauth"),c=fr(t,"spotify_oauth"),u=fr(t,"instagram_oauth"),h=fr(t,"tiktok_oauth"),m=fr(t,"linkedin_oauth"),v=fr(t,"apple_oauth"),b=fr(t,"farcaster"),g=fr(t,"telegram"),S=e.mfa_methods.map(({type:E,verified_at:P})=>({type:E,verifiedAt:X(P)}));return{id:e.id,createdAt:X(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:a&&{subject:a.subject,email:a.email,name:a.name},twitter:i&&{subject:i.subject,username:i.username,name:i.name,profilePictureUrl:i.profilePictureUrl},discord:s&&{subject:s.subject,username:s.username,email:s.email},github:l&&{subject:l.subject,username:l.username,name:l.name,email:l.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:u&&{subject:u.subject,username:u.username},tiktok:h&&{subject:h.subject,username:h.username,name:h.name},linkedin:m&&{subject:m.subject,name:m.name,email:m.email,vanityName:m.vanityName},apple:v&&{subject:v.subject,email:v.email},farcaster:b&&{fid:b.fid,ownerAddress:b.ownerAddress,displayName:b.displayName,username:b.username,bio:b.bio,pfp:b.pfp,url:b.url,signerPublicKey:b.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:S.map(E=>E.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Lp=require("@ethersproject/address"),kf=require("@ethersproject/bytes"),Rf=y(require("eventemitter3"));var Lm=y(require("@coinbase/wallet-sdk"));var $a=require("react/jsx-runtime"),Ka=({style:e,...t})=>(0,$a.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,$a.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,$a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var no=require("@ethersproject/address"),Ap=require("@ethersproject/providers"),Om=y(require("eventemitter3"));var km=y(require("eventemitter3"));var y0=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Am=e=>y0.includes(e);var xm=require("@ethersproject/logger"),yn=require("@privy-io/js-sdk-core");var Mi=class extends he{constructor(){super("Wallet timeout");this.type="wallet_error"}},Oi=class extends he{constructor(){super("User rejected connection");this.type="wallet_error"}},ro=e=>{if(e instanceof he)return e;if(e?.code&&e?.reason){let t=new Wt(e);return e.code===xm.ErrorCode.ACTION_REJECTED&&(t.details=yn.ProviderErrors.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Wt(e):new he("Unknown connector error",e)},_r=class extends yt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Wt=class extends _r{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(yn.ProviderErrors).find(a=>a.eipCode===o.code);this.details=n||yn.ProviderErrors.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=yn.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=yn.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=yn.ProviderErrors.E32002_WALLET_LOCKED))}},g0={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}},jo={...g0,...yn.ProviderErrors};var ot=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 Mi,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||jn,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 he(`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 ro(r)})}},gn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},ja=class extends km.default{constructor(r,o,n,a,i,s=1){super();this.walletProxy=r,this.address=o,this.chainId=s,this.rpcConfig=n,this.chains=a,this.provider=zo(s,this.chains,n,{appId:i}),this.rpcTimeoutDuration=Li(n,"privy"),this.appId=i}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new gn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Se()||!this.address)throw new gn("Disconnected",4900);return(await Wm(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new gn(`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 gn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=zo(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 Rm(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 Im(Na(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:Gn(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(a){throw console.warn(`Gas estimation failed with error: ${a} 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 Gn(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(Am(r.method)){let o=await Se();if(await Mm(),!o||!this.address)throw new gn("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 gn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Se();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}}},oo=class extends ot{constructor(r){super(r,r.rpcTimeoutDuration)}},vn=class extends ot{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 v0=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},sr=class extends Om.default{constructor(r,o,n,a){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=Ai(r),this.walletClientType==="privy"&&re.put(dl(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=a,this.rpcTimeoutDuration=Li(a,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,a){let i=async()=>!!this.wallets.find(s=>(0,no.getAddress)(s.address)===(0,no.getAddress)(r));return{address:(0,no.getAddress)(r),chainId:o,meta:n,imported:a,switchChain:async s=>{if(!i)throw new he("Wallet is not currently connected.");let l=this.wallets.find(v=>(0,no.getAddress)(v.address)===(0,no.getAddress)(r))?.chainId;if(!l)throw new he("Unable to determine current chainId.");let c,u;if(typeof s=="number"?(c=`0x${s.toString(16)}`,u=s):(c=s,u=Number(s)),l===Ai(c))return;let h=this.chains.find(v=>v.id===u);if(!h)throw new he(`Unsupported chainId: ${s}`);let m=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await m()}catch(v){if(v0(v,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:h.name,nativeCurrency:h.nativeCurrency,rpcUrls:[h.rpcUrls.default?.http[0]??""],blockExplorerUrls:[h.blockExplorers?.default.url??""]}]}),m();throw this.walletClientType==="rainbow"&&v.message?.includes("wallet_switchEthereumChain")?new he(`Rainbow does not support the chainId ${o}`):v}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new he("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new he("Wallet is not currently connected.");return new Ap.Web3Provider(new oo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new he("Wallet is not currently connected.");return new vn(this.proxyProvider)},sign:async s=>{if(!await i())throw new he("Wallet is not currently connected.");return await this.sign(s)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await La(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch(c){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],a=(0,no.getAddress)(n),i=[],s;if(this.walletClientType==="privy"){let c=re.get(dl(a));this.chains.find(u=>u.id===Number(c))||(re.del(dl(a)),c=null),s=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${s} on initialization`)}}else try{let c=await La(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")s=c;else if(typeof c=="number")s=`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 ${wp}`,c),s=wp}let l=Ai(s);if(!i.find(c=>(0,no.getAddress)(c.address)===a)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};i.push(this.buildConnectedWallet((0,no.getAddress)(n),l,c,this.connectorType==="embedded_imported"))}Sl(i,this.wallets)||(this.wallets=i,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,no.getAddress)(n)===(0,no.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new Ap.Web3Provider(new oo(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 C0=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],w0=(e,t)=>e.makeWeb3Provider({options:t}),xp,Pl=class extends sr{constructor(r,o,n,a,i,s){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new ot(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=a.coinbaseWallet.connectionOptions??"eoaOnly",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!xp){let l=[o.id].concat(r.map(u=>u.id)),c=this.connectionOptions!=="eoaOnly"?l.filter(u=>!C0.includes(u)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),xp=new Lm.default({appName:i,appLogoUrl:s,appChainIds:l})}this.proxyProvider.setWalletProvider(w0(xp,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:Ka,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 he("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw ro(r)}}};var kp=require("react/jsx-runtime"),Ni=({...e})=>(0,kp.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,kp.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var Ya=class extends sr{constructor(r,o,n,a,i=!1){super("privy",o,n,a);this.connectorType="embedded";this.proxyProvider=r,i&&(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:[Gn(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Ni,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Rp=require("react/jsx-runtime"),Di=({style:e,...t})=>(0,Rp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Rp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var Qt=require("react/jsx-runtime"),Ui=({style:e,...t})=>(0,Qt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,Qt.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,Qt.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,Qt.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,Qt.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,Qt.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,Qt.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,Qt.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,Qt.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,Qt.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,Qt.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,Qt.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,Qt.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,Qt.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var Za=require("react/jsx-runtime"),Po=({style:e,...t})=>(0,Za.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,Za.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,Za.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var Bi=class extends sr{constructor(r,o,n,a,i){super(i||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new ot(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=a;let s=a.provider;this.proxyProvider.setWalletProvider(s)}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 he("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw ro(r)}}},Fi,Hi=class extends sr{constructor(r,o,n,a,i){super(i??"unknown",r,o,n);this.connectorType="injected";Vs(this,Fi,void 0);this.proxyProvider=new ot(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(a),i==="metamask"?dp(this,Fi,{name:"MetaMask",icon:Ui,id:"io.metamask"}):i==="phantom"&&dp(this,Fi,{name:"Phantom",icon:Po,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 au(this,Fi)??{name:"Browser Extension",icon:Di,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 he("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw ro(r)}}};Fi=new WeakMap;var b0=require("@ethersproject/address"),E0=require("@ethersproject/providers"),Nm=require("react-device-detect");var _l=class extends Bi{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Nm.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new he("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw ro(t)}}};var Al=class extends sr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new ot(void 0,jn);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 xl=class extends Al{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Po,id:"phantom"}}};var Gi=require("@walletconnect/ethereum-provider"),xf=require("react-device-detect");var Vr=require("react");var Dm=require("react/jsx-runtime");function kl({src:e,...t}){return(0,Dm.jsx)("img",{src:e,...t,style:{display:"none"}})}var Ao=require("react"),Ef=require("react");var Ar={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:cm,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"eoaOnly"}},captchaEnabled:!1,_render:{standalone:!1},fiatOnRamp:{useSandbox:!1}};var Um=({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 T0=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),Fm=e=>T0.has(e),Bm=(e,t,r)=>r.indexOf(e)===t,Hm=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Fm).filter(Bm):e?e.filter(Fm).filter(Bm):Ar.appearance.walletList;var Vm={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 Gm={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var qm={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 zm={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 $m={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 Km={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 jm={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var Ym={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 Zm={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 Qm={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 Jm={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 Xm={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 ef={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 tf={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 rf={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var of={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 nf={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 af={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 Rl={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 sf={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 lf={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var cf={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 pf={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 df={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var uf={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 mf={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var ff={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 hf={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 yf={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 gf={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 Vi=[Vm,Gm,qm,rf,ff,Rl,sf,lf,cf,pf,df,Qm,Jm,Xm,ef,Km,jm,Ym,Zm,nf,af,zm,$m,hf,gf,yf,of,uf,tf,mf],g8=new Set(Vi.map(e=>e.id));var Cn=y(require("tinycolor2")),vf="#FFFFFF",S0="#000000",P0=vf,_0="#1E1E1D";function A0(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 _o(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Cn.default)({...e.toHsl(),l:r})}function Cf({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:a=vf,blackHex:i=S0}){let s;switch(e){case"light":s=P0;break;case"dark":s=_0;break;default:s=e;break}let l=(0,Cn.default)(s),c=(0,Cn.default)(t),u=(0,Cn.default)(r),h=(0,Cn.default)(o),m=(0,Cn.default)(n),v=A0(l.getLuminance()),b=_o(l,v==="light"?-.04:.11),g=_o(l,v==="light"?-.88:.87),S=_o(l,v==="light"?-.77:.75),A=_o(l,v==="light"?-.43:.45).desaturate(v==="light"?60:20),E=_o(l,v==="light"?-.08:.25).desaturate(v==="light"?60:20),P=_o(c,.15),W=_o(c,-.06),D=_o(m,.3),M=_o(h,.3),I=(0,Cn.default)(c.getLuminance()>.5?i:a),H=_o(u,-.16);return{colorScheme:v,background:l.toHslString(),background2:b.toHslString(),foreground:g.toHslString(),foreground2:S.toHslString(),foreground3:A.toHslString(),foreground4:E.toHslString(),accent:c.toHslString(),accentLight:P.toHslString(),accentDark:W.toHslString(),foregroundAccent:I.toHslString(),success:u.toHslString(),successDark:H.toHslString(),error:m.toHslString(),errorLight:D.toHslString(),warn:h.toHslString(),warnLight:M.toHslString()}}function Ip(e,t,r){let o=r?console.warn:()=>{},n,a,i,s,l,c,u,h,m,v,b,g,S,A,E;t?.loginMethods?(n=t.loginMethods.includes("email"),a=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),l=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),u=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),h=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),b=t.loginMethods.includes("linkedin"),S=t.loginMethods.includes("apple"),A=t.loginMethods.includes("farcaster"),E=t.loginMethods.includes("telegram")):(n=e.emailAuth,a=e.smsAuth,s=e.walletAuth,l=e.googleOAuth,c=e.twitterOAuth,u=e.discordOAuth,g=e.githubOAuth,m=e.spotifyOAuth,v=e.instagramOAuth,h=e.tiktokOAuth,b=e.linkedinOAuth,S=e.appleOAuth,A=e.farcasterAuth,E=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?i=!1:e.passkeyAuth&&(i=!0);let P=[n,a].filter(Boolean),W=[l,c,u,g,m,v,h,b,S,A,E].filter(Boolean),D=[s].filter(Boolean);if(P.length+W.length+D.length===0)throw new Error("You must enable at least one login method");let M=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;M&&D.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),M=!1):!M&&W.length+P.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),M=!0);let I=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let H=Hm({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),$=Um({input:t?.loginMethodsAndOrder}),J=t?.intl?.defaultCountry??"US",{chains:O,defaultChain:K}=x0({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),N=!!t?.defaultChain,nt=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,ht,Xe=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?nt?ht=t?.embeddedWallets?.noPromptOnSignature??!0:ht=t?.embeddedWallets?.noPromptOnSignature??Xe:ht=Xe,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&ht!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:be,...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??Ar.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:Cf({backgroundTheme:t?.appearance?.theme??Ar.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Ar.appearance.accentColor}),loginGroupPriority:M?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:H},loginMethods:{wallet:s,email:n,sms:a,passkey:i,google:l,twitter:c,discord:u,github:g,spotify:m,instagram:v,tiktok:h,linkedin:b,apple:S,farcaster:A,telegram:E},loginMethodsAndOrder:$,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Ar.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Ar.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Ar.rpcConfig.rpcTimeouts},chains:O,defaultChain:K,intl:{defaultCountry:J},shouldEnforceDefaultChainOnConnect:N,captchaEnabled:e.captchaEnabled??Ar.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??Ar.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:I}},embeddedWallets:{...e.embeddedWalletConfig,...typeof be=="boolean"?{requireUserOwnedRecoveryOnCreate:be}:{},...nt?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...ne,noPromptOnSignature:ht},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:nt?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Ar.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??Ar._render.standalone}}}function wf(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:a,...i}=e;return{...i,...o?{additionalChains:o.map(l=>l.id)}:void 0,...n?{supportedChains:n.map(l=>l.id)}:void 0,...a?{defaultChain:a.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function x0({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(l=>l.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(l=>l.rpcUrls.privyWalletOverride?l:Vi.find(u=>u.id===l.id)??l)}else n=Vi.concat(e??[]);let a=t?n[0]:Rl,i=r??a;if(!n.find(s=>s.id===i.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:i}}var bf=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,a;n<e.length;n++)a=e.charCodeAt(n),r=Math.imul(r^a,2654435761),o=Math.imul(o^a,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var Pf=require("react/jsx-runtime"),Tf={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:""},Wp=Ip(Tf,void 0,!1),Mp=(0,Ef.createContext)({appConfig:Wp,isServerConfigLoaded:!1}),Sf=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,a]=(0,Ao.useState)(null),i=(0,Ao.useMemo)(()=>Ip(n??Tf,o,!!n),[n,o]);return(0,Ao.useEffect)(()=>{if(!n)return;let s=wf(o,t),l=bf(JSON.stringify(s)).toString(),c=`privy:sent:${n.id}:${l}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:s}),localStorage.setItem(c,"t"))},[o,t,n]),(0,Ao.useEffect)(()=>{n||(async()=>{try{let l=await r.getServerConfig();l.customApiUrl&&r.updateApiUrl(l.customApiUrl),a(l)}catch(l){console.warn("Error generating app config: ",l)}})()},[]),(0,Pf.jsx)(Mp.Provider,{value:{appConfig:i,isServerConfigLoaded:!!n},children:e})},Mt=()=>{let{appConfig:e}=(0,Ao.useContext)(Mp);return e},Il=()=>{let{isServerConfigLoaded:e}=(0,Ao.useContext)(Mp);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var Wl=require("react/jsx-runtime"),_f=(0,Vr.createContext)({ready:!1,app:Wp,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),k0=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Af=e=>{let t=Mt(),r=e.authenticated,[o,n]=(0,Vr.useState)(e.initialScreen);(0,Vr.useEffect)(()=>{!r&&!k0.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let a=(0,Vr.useRef)(null);(0,Vr.useEffect)(()=>{e.open||(a.current=null)},[e.open]),(0,Vr.useEffect)(()=>{a.current=null},[e.initialScreen]);let i={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(s,l=!0)=>{e.setInitialScreen(s),l&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:a};return(0,Wl.jsxs)(_f.Provider,{value:i,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,Wl.jsx)(kl,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k=()=>(0,Vr.useContext)(_f);var Yo=require("react/jsx-runtime"),Qa=({style:e,...t})=>{let{app:r}=k();return(0,Yo.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Yo.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,Yo.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,Yo.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,Yo.jsx)("defs",{children:(0,Yo.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,Yo.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var io=class extends sr{constructor(r,o,n,a,i,s,l,c){super(c||"unknown",n,a,o);this.connectorType="wallet_connect_v2";this.privyAppId=s,this.privyAppName=l,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new ot(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=nl[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=ol(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:Ui,id:"io.metamask"}:{name:Zu(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Qa,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=nl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,nm(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Oi)};this.onQrModalClosed=n,(async()=>{let i="",s=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(s?.length&&(i=s[0]),!i||i==="")throw new he("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let l=ol(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=l?.entry,this.walletClientType=l?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Li(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(s),r()})().catch(i=>{if(i){o(ro(i));return}o(new he("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 i of this.chains){let s=Ju(i.id,this.chains,this.rpcConfig,this.privyAppId);s&&(r[i.id]=s)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(i=>i.id),a=await Gi.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:Gi.OPTIONAL_EVENTS,optionalMethods:Gi.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return a.on("display_uri",i=>{if(a.signer.abortPairingAttempt(),xf.isMobile&&this.walletEntry){let{redirect:s,href:l}=tm(i,this.walletEntry);im({href:l,name:this.walletEntry.displayName}),this.redirectUri=s;let c=rm(i,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),il(s,"_self")}else this.modal?.openModal({uri:i,chains:[this.defaultChain.id]})}),a.on("connect",()=>{if(this.modal?.closeModal(),a.session?.peer.metadata.url){let i=ol(a.session?.peer.metadata.url);this.walletEntry=i?.entry,this.walletClientType=i?.walletClientType||"unknown"}}),a}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var Np=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,kf.isHexString)(o)).map(o=>(0,Lp.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Li=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||jn:jn,qi=class extends Rf.default{constructor(r,o,n,a,i,s,l,c,u,h,m){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(a=>a.address===r?.address));return!r||!o?new ot:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=a,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=s,this.walletList=l,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=u,this.privyAppName=h,this.privyAppLogo=m,this.storedConnections=Op()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(a=>a.wallets).sort((a,i)=>a.connectedAt&&i.connectedAt?i.connectedAt-a.connectedAt:0).filter(a=>{let i=`${a.address}${a.walletClientType}${a.connectorType}`;return r.has(i)?!1:(r.add(i),!0)}),n=o.findIndex(a=>a.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;re.get(vp)&&(re.getKeys().forEach(o=>{o.startsWith("walletconnect")&&re.del(o)}),re.del(vp));let r=Qu(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:a,legacyInjectedProvider:i})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:a,legacyInjectedProvider:i})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!fn()&&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(a=>a.address===o.address&&a.connectorType===o.connectorType&&a.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,a){let i=this.findWalletConnector("embedded","privy");if(i)i.proxyProvider.walletProxy=r;else{let s=new ja(r,o,this.rpcConfig,this.chains,a,n.id),l=new Ya(s,this.chains,n,this.rpcConfig);this.addWalletConnector(l)}}addImportedWalletConnector(r,o,n,a){let i=this.findWalletConnector("embedded_imported","privy");if(i)i.proxyProvider.walletProxy=r;else{let s=new ja(r,o,this.rpcConfig,this.chains,a,n.id),l=!0,c=new Ya(s,this.chains,n,this.rpcConfig,l);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=Op(),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=Op(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let a=this.findWalletConnector(r,o);if(a)return a instanceof io&&a.resetConnection(o),a;let s=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new _l(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Hi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Hi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Hi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Bi(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Pl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new xl(this.defaultChain):new io(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return s&&this.addWalletConnector(s),s||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}));re.put(Cp,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Lp.getAddress)(r),this.emit("walletsUpdated")}};function Sl(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 R0=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Op=()=>{let e=re.get(Cp);return e&&Array.isArray(e)&&e.map(o=>R0(o)).every(Boolean)?e:[]};var If=require("ofetch");var I0=[zs,Ks,$s,Zs],Ml=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=ll,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=If.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:a,options:i})=>{let s=new Headers(i.headers);s.set("privy-app-id",this.appId),this.appClientId&&s.set("privy-client-id",this.appClientId),s.set("privy-ca-id",this.clientAnalyticsId||""),s.set("privy-client",`react-auth:${this.sdkVersion}`);let l=I0.includes(a.toString());if(!s.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:l});c!==null&&s.set("authorization",`Bearer ${c}`)}i.headers=s,i.retryDelay&&(i.retryDelay=i.retryDelay*3)},onRequestError:({error:a})=>{if(a instanceof DOMException&&a.name==="AbortError")throw new Gs}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw me(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw me(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw me(o)}}};var Wf=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var ti=y(require("js-cookie"));function Mf(e){return e instanceof mn?"email":e instanceof Xn?"sms":e instanceof Ko?"siwe":e instanceof Pi?"custom_auth":e instanceof So?e.meta.provider:null}var Of=y(require("jose")),ao=class{static parse(t){try{return new ao(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Of.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 W0=30,Ol=class{constructor(){this.authenticateOnce=new rt(async t=>this._authenticate(t)),this.linkOnce=new rt(async t=>this._link(t)),this.refreshOnce=new rt(this._refresh.bind(this)),this.destroyOnce=new rt(this._destroy.bind(this)),this.forkSessionOnce=new rt(this._forkSession.bind(this))}get token(){try{let t=re.get(qn);return typeof t=="string"?new ao(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=re.get(cl);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=re.get(Ua);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=re.get(Ba(t));if(typeof r=="string"){let o=new ao(r);return o.isExpired()?(re.del(Ba(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=ti.default.get(pl);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!==gm}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=ao.parse(this.token);return t!==null&&!t.isExpired(W0)}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"?re.put(Ba(t),r):re.del(Ba(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:a}=r;this.handleTokenResponse(r);let i=a,s=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,refreshTokenExpiresInSeconds:a.refresh_token_expires_in_seconds,scopes:i.scopes}:void 0,l=Mf(t);return l&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:l,isNewUser:n}}),l==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:yr(o),isNewUser:n,oAuthTokens:s}}catch(r){throw console.warn("Error authenticating session"),St(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:yr(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),St(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 a={};t&&(a.authorization=`Bearer ${t}`);let i=r?{refresh_token:r}:{};n=await this.api.post(zs,i,{headers:a}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(Ks,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),yr(n.user)}catch(n){if(n instanceof nr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw St(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&this.storeToken(t.token):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token))}async _destroy(){try{await this.api?.post($s,{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(cu,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw St(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=re.get(qn);if(re.put(qn,t),!this.client?.useServerCookies){let o=ao.parse(t)?.expiration;ti.default.set(gp,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else re.del(qn),ti.default.remove(gp),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(re.put(cl,t),this.client?.useServerCookies||ti.default.set(pl,"t",{sameSite:"Strict",secure:!0,expires:30})):(re.del(cl),ti.default.remove(um),ti.default.remove(pl))}clearForkedToken(){re.del(Ua)}};var Dp,Ll,Nf,zi=class{constructor(t){Vs(this,Ll);this.apiUrl=t.apiUrl||sl,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||pm,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=su(this,Ll,Nf).call(this),Dp||(Dp=new Ol),this.session=Dp,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:a,walletList:i,shouldEnforceDefaultChainOnConnect:s,externalWalletConfig:l,appName:c}){this.connectors||(this.connectors=new qi(this.appId,t,r,o,n,a,i,s,l,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Ml({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)}link(){if(!this.authFlow)throw new w("No auth flow in progress.");return this.session.link(this.authFlow)}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(Hu,{action:"verify"})}catch(t){throw me(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Vu,{});return Wf(t.options)}catch(t){throw me(t)}}async unlinkEmail(t){try{let r=await this.api.post(Eu,{address:t});return yr(r)}catch(r){throw St(r)}}async acceptTerms(){try{let t=await this.api.post(Gu,{});return yr(t)}catch(t){throw St(t)}}async unlinkPhone(t){try{let r=await this.api.post(_u,{phoneNumber:t});return yr(r)}catch(r){throw St(r)}}async unlinkWallet(t){try{let r=await this.api.post(mu,{address:t});return yr(r)}catch(r){throw St(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(ku,{provider:t,subject:r});return yr(o)}catch(o){throw St(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(vu,{fid:t});return yr(r)}catch(r){throw St(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Bu,{telegram_user_id:t});return yr(r)}catch(r){throw St(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Du,{credential_id:t});return yr(r)}catch(r){throw St(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(Zs,{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(qu,t)}catch(r){throw St(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?ao.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;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}}catch(t){throw St(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(pu,{address:t,token:r})).nonce}catch(o){throw St(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){return await this.api.post(du,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:a})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){return await this.api.post(uu,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:a})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){try{let i=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a});return yr(i)}catch(i){throw St(i)}}};Ll=new WeakSet,Nf=function(){if(typeof window>"u")return null;try{let r=re.get(Fa);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,Lf.v4)();try{return re.put(Fa,t),t}catch{return t}};var Bf=require("@marsidev/react-turnstile"),Nl=require("react");var Gr=require("react");var Ff=require("react/jsx-runtime"),Df=(0,Gr.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:T,setError:T,setExecuting:T,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:T,reset:T,execute:T}),xr=class extends yt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Uf=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,Gr.useRef)(null),[a,i]=(0,Gr.useState)(),[s,l]=(0,Gr.useState)(),[c,u]=(0,Gr.useState)(!1),h=(0,Gr.useMemo)(()=>o?!c&&!a&&!s?{status:"ready"}:c&&!a&&!s?{status:"loading"}:a&&!s?{status:"success",token:a}:s?{status:"error",error:s}:{status:"ready"}:{status:"disabled"},[o,a,s,c]);return(0,Ff.jsx)(Df.Provider,{value:{...h,ref:n,enabled:o,siteKey:r,appId:t,setToken:i,setError:l,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),l(void 0),i(void 0))},reset(){o&&(n.current?.reset(),u(!1),l(void 0),i(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await Yu(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new xr("Captcha failed",null,"captcha_timeout")}}},children:e})},Pe=()=>(0,Gr.useContext)(Df);var Up=require("react/jsx-runtime"),Dl=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:a,setExecuting:i,ref:s}=Pe(),[,l]=(0,Nl.useMemo)(()=>r?.split("t:")||[],[r]);if((0,Nl.useEffect)(()=>s.current?.remove,[]),!t)return null;if(!l)throw new Error("Unsupported captcha site key");return(0,Up.jsx)("div",{className:"hidden h-0 w-0",children:(0,Up.jsx)(Bf.Turnstile,{...e,ref:s,siteKey:l,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"),i(!1)},onSuccess:c=>{e.onSuccess?.(c),a(c),i(!1)},onExpire:()=>{e.onExpire?.();try{s.current?.reset(),n(void 0),a(void 0)}catch{n("expired_and_failed_reset")}}})})};var dn=require("react"),jd=y(require("styled-components"));var Ul=require("react");var Fp=(0,Ul.createContext)({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,crossAppAuthFlow:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,recoverEmbeddedEthereumWallet:T,getFiatOnRampConfig:T,updateWallets:T,fundWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T,generateSiweMessage:T,linkWithSiwe:T,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:T,recoverEmbeddedSolanaWallet:T}),R=()=>(0,Ul.useContext)(Fp);var Fl=require("react");var Ae=(0,Fl.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,linkCrossAppAccount:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkCrossAppAccount:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,importWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,initLoginWithEmail:T,initLoginWithSms:T,otpState:{status:"initial"},loginWithCode:T,fundWallet:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,generateSiweMessage:T,linkWithSiwe:T,signMessageWithCrossAppWallet:T,signTypedDataWithCrossAppWallet:T,sendTransactionWithCrossAppWallet:T,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),G=()=>(0,Fl.useContext)(Ae);var Bl=require("react"),Hf=e=>{let[t,r]=(0,Bl.useState)("auto");return(0,Bl.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var $i=require("react"),Vf={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:[]}},Bp=(0,$i.createContext)(void 0),Gf=()=>(0,$i.useContext)(Bp);function Ze(e,t){if(!t)return;let o=Gf().current[e];return(0,$i.useEffect)(()=>{for(let[n,a]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(a);return()=>{for(let[n,a]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(i=>i!==a)}},[t])}function U(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function Ki(){let e=Gf();return(t,r,...o)=>U(e,t,r,...o)}function Hl(e){Ze("configureMfa",e)}var eh=require("@heroicons/react/24/outline"),qp=y(require("styled-components"));var so=y(require("styled-components"));var Vl=y(require("styled-components")),wn=require("react/jsx-runtime"),wt=({success:e,fail:t})=>(0,wn.jsxs)(wn.Fragment,{children:[(0,wn.jsx)(Ot,{className:e?"success":t?"fail":""}),(0,wn.jsx)(Hp,{className:e?"success":t?"fail":""})]}),Ot=Vl.default.span`
13
13
  && {
14
14
  width: 82px;
15
15
  height: 82px;
@@ -42,13 +42,13 @@ Resources:
42
42
  border-color: var(--privy-color-error);
43
43
  border-bottom-color: var(--privy-color-error);
44
44
  }
45
- `,Bp=(0,Hl.default)(Mt)`
45
+ `,Hp=(0,Vl.default)(Ot)`
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
- `,ko=e=>(0,wn.jsx)(_0,{color:e.color||"var(--privy-color-foreground-3)"}),_0=(0,Hl.default)(Mt)`
51
+ `,xo=e=>(0,wn.jsx)(M0,{color:e.color||"var(--privy-color-foreground-3)"}),M0=(0,Vl.default)(Ot)`
52
52
  && {
53
53
  height: 1rem;
54
54
  width: 1rem;
@@ -58,7 +58,7 @@ Resources:
58
58
  /* Override default Loader to match button transitions */
59
59
  transition: border-color 200ms ease;
60
60
  }
61
- `;var bt=require("react/jsx-runtime"),Qa=lo.default.button`
61
+ `;var bt=require("react/jsx-runtime"),Ja=so.default.button`
62
62
  display: flex;
63
63
  flex-direction: row;
64
64
  align-items: center;
@@ -80,7 +80,7 @@ Resources:
80
80
  && {
81
81
  padding: 12px 16px;
82
82
  }
83
- `,F=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,bt.jsx)(Gf,{disabled:t||r,...n,children:t?(0,bt.jsxs)("span",{children:[(0,bt.jsx)(ko,{}),o?(0,bt.jsx)("span",{children:o}):null]}):e}),Vf=({children:e,loading:t,disabled:r,...o})=>(0,bt.jsx)(A0,{disabled:r,...o,children:t?(0,bt.jsx)(ko,{color:"var(--privy-color-foreground-accent)"}):e}),A0=(0,lo.default)(Qa)`
83
+ `,F=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,bt.jsx)(zf,{disabled:t||r,...n,children:t?(0,bt.jsxs)("span",{children:[(0,bt.jsx)(xo,{}),o?(0,bt.jsx)("span",{children:o}):null]}):e}),qf=({children:e,loading:t,disabled:r,...o})=>(0,bt.jsx)(O0,{disabled:r,...o,children:t?(0,bt.jsx)(xo,{color:"var(--privy-color-foreground-accent)"}):e}),O0=(0,so.default)(Ja)`
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
- `,Vl=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,bt.jsx)(Gf,{as:"a",disabled:t||r,...n,children:t?(0,bt.jsxs)("span",{children:[(0,bt.jsx)(ko,{}),o?(0,bt.jsx)("span",{children:o}):null]}):e}),Gf=(0,lo.default)(Qa)`
109
+ `,Gl=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,bt.jsx)(zf,{as:"a",disabled:t||r,...n,children:t?(0,bt.jsxs)("span",{children:[(0,bt.jsx)(xo,{}),o?(0,bt.jsx)("span",{children:o}):null]}):e}),zf=(0,so.default)(Ja)`
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?lo.css`
135
+ ${e=>e.disabled?so.css`
136
136
  &&&,
137
137
  &&&:hover,
138
138
  &&&:active {
@@ -151,7 +151,7 @@ Resources:
151
151
  opacity: 1;
152
152
  animation: fadein 200ms ease;
153
153
  }
154
- `,co=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,bt.jsx)(x0,{disabled:t||r,...n,children:t?(0,bt.jsxs)("span",{children:[(0,bt.jsx)(ko,{}),o?(0,bt.jsx)("span",{children:o}):null]}):e}),x0=(0,lo.default)(Qa)`
154
+ `,lo=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,bt.jsx)(L0,{disabled:t||r,...n,children:t?(0,bt.jsxs)("span",{children:[(0,bt.jsx)(xo,{}),o?(0,bt.jsx)("span",{children:o}):null]}):e}),L0=(0,so.default)(Ja)`
155
155
  && {
156
156
  border-width: 1px;
157
157
  border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
@@ -180,7 +180,7 @@ Resources:
180
180
  opacity: 1;
181
181
  animation: fadein 200ms ease;
182
182
  }
183
- `,Ki=lo.default.button`
183
+ `,ji=so.default.button`
184
184
  && {
185
185
  padding: 12px 16px;
186
186
  font-weight: 500;
@@ -193,7 +193,7 @@ Resources:
193
193
  transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
194
194
  user-select: none;
195
195
 
196
- ${e=>e.invisible&&lo.css`
196
+ ${e=>e.invisible&&so.css`
197
197
  pointer-events: none;
198
198
  `}
199
199
 
@@ -211,10 +211,10 @@ Resources:
211
211
  cursor: not-allowed;
212
212
  }
213
213
  }
214
- `,eT=lo.default.div`
214
+ `,nT=so.default.div`
215
215
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
216
216
  height: 44px;
217
- `,ji=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>(0,bt.jsxs)(k0,{isSubmitting:o,onClick:t,disabled:r,...n,children:[(0,bt.jsx)("span",{children:e}),(0,bt.jsx)("span",{children:(0,bt.jsx)(ko,{})})]}),k0=lo.default.button`
217
+ `,Yi=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>(0,bt.jsxs)(N0,{isSubmitting:o,onClick:t,disabled:r,...n,children:[(0,bt.jsx)("span",{children:e}),(0,bt.jsx)("span",{children:(0,bt.jsx)(xo,{})})]}),N0=so.default.button`
218
218
  && {
219
219
  color: var(--privy-color-accent);
220
220
  font-size: 16px;
@@ -256,7 +256,7 @@ Resources:
256
256
  cursor: not-allowed;
257
257
  }
258
258
  }
259
- `;var qf=y(require("styled-components")),zf=qf.default.span`
259
+ `;var $f=y(require("styled-components")),Kf=$f.default.span`
260
260
  && {
261
261
  width: 82px;
262
262
  height: 82px;
@@ -268,7 +268,7 @@ Resources:
268
268
  display: inline-block;
269
269
  box-sizing: border-box;
270
270
  }
271
- `;var $f=y(require("@heroicons/react/24/outline/ArrowLeftIcon")),Kf=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),jf=y(require("@heroicons/react/24/outline/XMarkIcon")),oi=y(require("styled-components"));var Ot=require("react/jsx-runtime"),R0=({backFn:e})=>(0,Ot.jsx)("div",{children:(0,Ot.jsx)(Hp,{onClick:e,children:(0,Ot.jsx)($f.default,{height:"16px",width:"16px",strokeWidth:2})})}),I0=({infoFn:e})=>(0,Ot.jsx)("div",{children:(0,Ot.jsx)(M0,{"aria-label":"info",onClick:e,children:(0,Ot.jsx)(Kf.default,{height:"22px",width:"22px",strokeWidth:2})})}),W0=e=>(0,Ot.jsx)("div",{children:(0,Ot.jsx)(Hp,{"aria-label":"close modal",onClick:e.onClose,children:(0,Ot.jsx)(jf.default,{height:"16px",width:"16px",strokeWidth:2})})});var _=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:a}=R(),i=Wt();return(0,Ot.jsxs)(O0,{children:[(0,Ot.jsxs)(L0,{children:[e&&(0,Ot.jsx)(R0,{backFn:e}),t&&(0,Ot.jsx)(I0,{infoFn:t})]}),o&&(0,Ot.jsx)(D0,{id:"privy-dialog-title",children:o}),(0,Ot.jsx)(N0,{children:!i.render.standalone&&n&&(0,Ot.jsx)(W0,{onClose:r||(()=>a())})})]})},Hp=oi.default.button`
271
+ `;var jf=y(require("@heroicons/react/24/outline/ArrowLeftIcon")),Yf=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),Zf=y(require("@heroicons/react/24/outline/XMarkIcon")),ri=y(require("styled-components"));var Lt=require("react/jsx-runtime"),D0=({backFn:e})=>(0,Lt.jsx)("div",{children:(0,Lt.jsx)(Vp,{onClick:e,children:(0,Lt.jsx)(jf.default,{height:"16px",width:"16px",strokeWidth:2})})}),U0=({infoFn:e})=>(0,Lt.jsx)("div",{children:(0,Lt.jsx)(B0,{"aria-label":"info",onClick:e,children:(0,Lt.jsx)(Yf.default,{height:"22px",width:"22px",strokeWidth:2})})}),F0=e=>(0,Lt.jsx)("div",{children:(0,Lt.jsx)(Vp,{"aria-label":"close modal",onClick:e.onClose,children:(0,Lt.jsx)(Zf.default,{height:"16px",width:"16px",strokeWidth:2})})});var _=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:a}=R(),i=Mt();return(0,Lt.jsxs)(H0,{children:[(0,Lt.jsxs)(V0,{children:[e&&(0,Lt.jsx)(D0,{backFn:e}),t&&(0,Lt.jsx)(U0,{infoFn:t})]}),o&&(0,Lt.jsx)(q0,{id:"privy-dialog-title",children:o}),(0,Lt.jsx)(G0,{children:!i.render.standalone&&n&&(0,Lt.jsx)(F0,{onClose:r||(()=>a())})})]})},Vp=ri.default.button`
272
272
  && {
273
273
  cursor: pointer;
274
274
  display: flex;
@@ -287,11 +287,11 @@ Resources:
287
287
  opacity: 1;
288
288
  }
289
289
  }
290
- `,M0=(0,oi.default)(Hp)`
290
+ `,B0=(0,ri.default)(Vp)`
291
291
  && {
292
292
  background-color: transparent;
293
293
  }
294
- `,O0=oi.default.div`
294
+ `,H0=ri.default.div`
295
295
  padding: 16px 0;
296
296
  display: flex;
297
297
  align-items: center;
@@ -303,23 +303,23 @@ Resources:
303
303
  font-weight: 600;
304
304
  color: var(--privy-color-foreground);
305
305
  }
306
- `,L0=oi.default.div`
306
+ `,V0=ri.default.div`
307
307
  flex: 1;
308
308
  align-items: center;
309
309
  display: flex;
310
310
  gap: 8px;
311
- `,N0=oi.default.div`
311
+ `,G0=ri.default.div`
312
312
  flex: 1;
313
313
  display: flex;
314
314
  justify-content: flex-end;
315
- `,D0=oi.default.div`
315
+ `,q0=ri.default.div`
316
316
  overflow: hidden;
317
317
  white-space: nowrap;
318
318
  max-width: 100%;
319
319
  text-overflow: ellipsis;
320
320
  text-align: center;
321
321
  color: var(--privy-color-foreground-2);
322
- `;var Yf=y(require("styled-components")),U0=Yf.default.div`
322
+ `;var Qf=y(require("styled-components")),z0=Qf.default.div`
323
323
  display: flex;
324
324
  flex-direction: column;
325
325
  justify-content: center;
@@ -342,15 +342,15 @@ Resources:
342
342
  left: -19px;
343
343
  top: -19px;
344
344
  }
345
- `,ut=U0;var po=y(require("styled-components")),bn=po.default.div`
345
+ `,ut=z0;var co=y(require("styled-components")),bn=co.default.div`
346
346
  text-align: left;
347
347
  flex-grow: 1;
348
- `,Gl=po.default.div`
348
+ `,ql=co.default.div`
349
349
  display: flex;
350
350
  flex-direction: column;
351
351
  justify-content: flex-end;
352
352
  flex-grow: 1;
353
- `,uo=po.default.div`
353
+ `,po=co.default.div`
354
354
  display: flex;
355
355
  flex-direction: column;
356
356
  gap: 12px;
@@ -365,13 +365,13 @@ Resources:
365
365
  &::-webkit-scrollbar {
366
366
  display: none;
367
367
  }
368
- `,Zf=(0,po.default)(uo)`
368
+ `,Jf=(0,co.default)(po)`
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
- `,Qf=po.css`
374
+ `,Xf=co.css`
375
375
  && {
376
376
  width: 100%;
377
377
  font-size: 16px;
@@ -408,22 +408,22 @@ Resources:
408
408
  max-width: 24px;
409
409
  }
410
410
  }
411
- `,ql=po.default.div`
411
+ `,zl=co.default.div`
412
412
  text-align: center;
413
413
  font-size: 14px;
414
414
  margin-bottom: 24px;
415
- `,Ue=po.default.button`
416
- ${Qf}
417
- `,Vp=po.default.a`
418
- ${Qf}
419
- `,mo=po.default.div`
415
+ `,De=co.default.button`
416
+ ${Xf}
417
+ `,Gp=co.default.a`
418
+ ${Xf}
419
+ `,uo=co.default.div`
420
420
  width: 100%;
421
421
  height: 100%;
422
422
  min-height: inherit;
423
423
  display: flex;
424
424
  flex-direction: column;
425
425
  ${e=>e.if?"display: none;":""}
426
- `;var Qt=require("react/jsx-runtime"),Xf=()=>{let{navigate:e,app:t}=k();return(0,Qt.jsxs)(Qt.Fragment,{children:[(0,Qt.jsx)(_,{}),(0,Qt.jsxs)(F0,{children:[(0,Qt.jsx)(ut,{children:(0,Qt.jsxs)("div",{children:[(0,Qt.jsx)(zf,{color:"var(--privy-color-warn-light)"}),(0,Qt.jsx)(Jf.QuestionMarkCircleIcon,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),(0,Qt.jsxs)(B0,{children:[(0,Qt.jsx)("h3",{children:"Account not found"}),(0,Qt.jsxs)("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),(0,Qt.jsx)(bn,{}),(0,Qt.jsx)(F,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},F0=Gp.default.div`
426
+ `;var Jt=require("react/jsx-runtime"),th=()=>{let{navigate:e,app:t}=k();return(0,Jt.jsxs)(Jt.Fragment,{children:[(0,Jt.jsx)(_,{}),(0,Jt.jsxs)($0,{children:[(0,Jt.jsx)(ut,{children:(0,Jt.jsxs)("div",{children:[(0,Jt.jsx)(Kf,{color:"var(--privy-color-warn-light)"}),(0,Jt.jsx)(eh.QuestionMarkCircleIcon,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),(0,Jt.jsxs)(K0,{children:[(0,Jt.jsx)("h3",{children:"Account not found"}),(0,Jt.jsxs)("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),(0,Jt.jsx)(bn,{}),(0,Jt.jsx)(F,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},$0=qp.default.div`
427
427
  display: flex;
428
428
  flex-direction: column;
429
429
  align-items: center;
@@ -432,11 +432,11 @@ Resources:
432
432
  width: 100%;
433
433
  padding-bottom: 16px;
434
434
  margin-top: 24px;
435
- `,B0=Gp.default.div`
435
+ `,K0=qp.default.div`
436
436
  display: flex;
437
437
  flex-direction: column;
438
438
  gap: 8px;
439
- `;var $p=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),th=y(require("@heroicons/react/24/solid/DocumentCheckIcon")),rh=y(require("styled-components"));var zp=y(require("styled-components"));var kr=require("react/jsx-runtime"),qp=zp.default.div`
439
+ `;var Kp=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),oh=y(require("@heroicons/react/24/solid/DocumentCheckIcon")),nh=y(require("styled-components"));var $p=y(require("styled-components"));var ko=require("react/jsx-runtime"),zp=$p.default.div`
440
440
  margin-top: 16px;
441
441
  font-size: 13px;
442
442
  text-align: center;
@@ -445,7 +445,7 @@ Resources:
445
445
  && > a {
446
446
  color: var(--privy-color-accent);
447
447
  }
448
- `;function Yi(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return(0,kr.jsx)(qp,{});if(!r&&!t)return(0,kr.jsx)(qp,{});let n=!!(t&&r);return(0,kr.jsxs)(qp,{children:["By logging in I agree to the"," ",r&&(0,kr.jsx)("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,kr.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var j=({protectedByPrivy:e})=>(0,kr.jsx)(Y,{children:e?(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(Li,{}),(0,kr.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}):null}),Y=zp.default.div`
448
+ `;function Zi(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return(0,ko.jsx)(zp,{});if(!r&&!t)return(0,ko.jsx)(zp,{});let n=!!(t&&r);return(0,ko.jsxs)(zp,{children:["By logging in I agree to the"," ",r&&(0,ko.jsx)("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,ko.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var j=()=>(0,ko.jsxs)(Y,{children:[(0,ko.jsx)(Ni,{}),(0,ko.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),Y=$p.default.div`
449
449
  display: flex;
450
450
  align-items: center;
451
451
  justify-content: center;
@@ -472,7 +472,7 @@ Resources:
472
472
  @media all and (display-mode: standalone) {
473
473
  padding-bottom: 30px;
474
474
  }
475
- `;var St=y(require("styled-components")),Ve=St.default.div`
475
+ `;var Pt=y(require("styled-components")),He=Pt.default.div`
476
476
  display: flex;
477
477
  flex-direction: column;
478
478
  align-items: center;
@@ -480,17 +480,17 @@ Resources:
480
480
  @media (max-width: 440px) {
481
481
  padding: 10px 10px 20px;
482
482
  }
483
- `,Ce=St.default.div`
483
+ `,we=Pt.default.div`
484
484
  font-size: 18px;
485
485
  line-height: 30px;
486
486
  text-align: center;
487
487
  font-weight: 600;
488
488
  margin-bottom: 10px;
489
- `,Ee=St.default.div`
489
+ `,Ee=Pt.default.div`
490
490
  font-size: 0.875rem;
491
491
 
492
492
  text-align: center;
493
- `,zr=St.default.div`
493
+ `,qr=Pt.default.div`
494
494
  display: flex;
495
495
  flex-direction: column;
496
496
  align-items: center;
@@ -500,7 +500,7 @@ Resources:
500
500
  @media (max-width: 440px) {
501
501
  padding: 10px 10px 20px;
502
502
  }
503
- `,ni=St.default.div`
503
+ `,oi=Pt.default.div`
504
504
  display: flex;
505
505
  flex-direction: column;
506
506
  align-items: stretch;
@@ -508,7 +508,7 @@ Resources:
508
508
  padding: 1rem 0rem 0rem;
509
509
  flex-grow: 1;
510
510
  width: 100%;
511
- `,gr=St.default.div`
511
+ `,gr=Pt.default.div`
512
512
  width: 25px;
513
513
  display: flex;
514
514
  align-items: center;
@@ -520,19 +520,19 @@ Resources:
520
520
  width: 25px !important;
521
521
  color: var(--privy-color-accent);
522
522
  }
523
- `,vr=St.default.div`
523
+ `,vr=Pt.default.div`
524
524
  display: flex;
525
525
  align-items: center;
526
526
  gap: 10px;
527
527
  font-size: 0.875rem;
528
528
  line-height: 1rem;
529
529
  text-align: left;
530
- `,Jt=St.default.div`
530
+ `,Xt=Pt.default.div`
531
531
  display: flex;
532
532
  flex-direction: column;
533
533
  gap: 10px;
534
534
  padding-top: 20px;
535
- `,zl=St.default.div`
535
+ `,$l=Pt.default.div`
536
536
  display: flex;
537
537
  flex-direction: column;
538
538
  align-items: stretch;
@@ -540,11 +540,11 @@ Resources:
540
540
  padding: 1rem 0rem 0rem;
541
541
  flex-grow: 1;
542
542
  width: 100%;
543
- `,$l=St.default.div`
543
+ `,Kl=Pt.default.div`
544
544
  display: flex;
545
545
  gap: 5px;
546
546
  width: 100%;
547
- `,Kl=St.default.button`
547
+ `,jl=Pt.default.button`
548
548
  && {
549
549
  background-color: transparent;
550
550
  color: var(--privy-color-foreground-3);
@@ -562,7 +562,7 @@ Resources:
562
562
  &&:hover {
563
563
  color: var(--privy-color-error);
564
564
  }
565
- `,jl=St.default.div`
565
+ `,Yl=Pt.default.div`
566
566
  display: flex;
567
567
  align-items: center;
568
568
  gap: 0.5rem;
@@ -572,7 +572,7 @@ Resources:
572
572
  height: 20px !important;
573
573
  width: 20px !important;
574
574
  }
575
- `,ii=St.default.div`
575
+ `,ni=Pt.default.div`
576
576
  display: flex;
577
577
  align-items: center;
578
578
  gap: 6px;
@@ -586,15 +586,15 @@ Resources:
586
586
  display: flex !important;
587
587
  align-items: flex-end;
588
588
  }
589
- `,Yl=St.default.div`
589
+ `,Zl=Pt.default.div`
590
590
  width: 100%;
591
591
  display: flex;
592
592
  justify-content: space-between;
593
- `,eh=St.default.p`
593
+ `,rh=Pt.default.p`
594
594
  text-align: left;
595
595
  width: 100%;
596
596
  color: var(--privy-color-foreground-3) !important;
597
- `,Ja=St.default.button`
597
+ `,Xa=Pt.default.button`
598
598
  display: flex;
599
599
  flex-direction: row;
600
600
  align-items: center;
@@ -624,7 +624,7 @@ Resources:
624
624
  &:hover {
625
625
  text-decoration: underline;
626
626
  }
627
- `,lt=St.default.div`
627
+ `,lt=Pt.default.div`
628
628
  display: flex;
629
629
  align-items: center;
630
630
  justify-content: center;
@@ -639,12 +639,12 @@ Resources:
639
639
  width: auto !important;
640
640
  color: white;
641
641
  }
642
- `,Zl=St.default.div`
642
+ `,Ql=Pt.default.div`
643
643
  color: var(--privy-color-error);
644
- `;var _t=require("react/jsx-runtime"),oh=()=>{let{user:e,logout:t}=G(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:a}=k(),{acceptTerms:i,closePrivyModal:s,createAnalyticsEvent:l}=R(),c=h=>{h?.preventDefault(),s({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let u=async h=>{h.preventDefault(),await i(),e&&hr(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:m=>{console.error(m),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:m,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):s()};return(0,_t.jsx)(H0,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:c})},H0=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(_,{closeable:!1}),(0,_t.jsx)(th.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,_t.jsx)(Ce,{style:{marginTop:24},children:"One last step"}),(0,_t.jsx)(Ee,{children:"By signing up, you agree to our terms and privacy policy."}),(0,_t.jsxs)(uo,{style:{marginTop:24},children:[e&&(0,_t.jsxs)(Vp,{target:"_blank",href:e,children:["View Terms ",(0,_t.jsx)($p.default,{style:{marginLeft:"auto"}})]}),t&&(0,_t.jsxs)(Vp,{target:"_blank",href:t,children:["View Privacy Policy ",(0,_t.jsx)($p.default,{style:{marginLeft:"auto"}})]})]}),(0,_t.jsxs)(V0,{style:{marginTop:24},children:[(0,_t.jsx)(co,{onClick:o,children:"No thanks"}),(0,_t.jsx)(F,{onClick:r,children:"Accept"})]}),(0,_t.jsx)(j,{protectedByPrivy:!0})]}),V0=rh.default.div`
644
+ `;var _t=require("react/jsx-runtime"),ih=()=>{let{user:e,logout:t}=G(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:a}=k(),{acceptTerms:i,closePrivyModal:s,createAnalyticsEvent:l}=R(),c=h=>{h?.preventDefault(),s({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let u=async h=>{h.preventDefault(),await i(),e&&hr(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:m=>{console.error(m),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:m,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):s()};return(0,_t.jsx)(j0,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:c})},j0=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(_,{closeable:!1}),(0,_t.jsx)(oh.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,_t.jsx)(we,{style:{marginTop:24},children:"One last step"}),(0,_t.jsx)(Ee,{children:"By signing up, you agree to our terms and privacy policy."}),(0,_t.jsxs)(po,{style:{marginTop:24},children:[e&&(0,_t.jsxs)(Gp,{target:"_blank",href:e,children:["View Terms ",(0,_t.jsx)(Kp.default,{style:{marginLeft:"auto"}})]}),t&&(0,_t.jsxs)(Gp,{target:"_blank",href:t,children:["View Privacy Policy ",(0,_t.jsx)(Kp.default,{style:{marginLeft:"auto"}})]})]}),(0,_t.jsxs)(Y0,{style:{marginTop:24},children:[(0,_t.jsx)(lo,{onClick:o,children:"No thanks"}),(0,_t.jsx)(F,{onClick:r,children:"Accept"})]}),(0,_t.jsx)(j,{})]}),Y0=nh.default.div`
645
645
  display: flex;
646
646
  gap: 10px;
647
- `;var jp=y(require("styled-components"));var nh=y(require("styled-components")),Ql=nh.default.span`
647
+ `;var Yp=y(require("styled-components"));var ah=y(require("styled-components")),Jl=ah.default.span`
648
648
  && {
649
649
  width: 82px;
650
650
  height: 82px;
@@ -659,7 +659,7 @@ Resources:
659
659
  transition: border-color 800ms;
660
660
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
661
661
  }
662
- `;var Kp=require("react/jsx-runtime"),Jl=({style:e,...t})=>(0,Kp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,Kp.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var Et=require("react/jsx-runtime"),ih=()=>{let{navigate:e,app:t}=k(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsx)(_,{}),(0,Et.jsxs)(G0,{children:[(0,Et.jsx)(ut,{children:(0,Et.jsxs)("div",{children:[(0,Et.jsx)(Ql,{}),(0,Et.jsx)(Jl,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,Et.jsxs)(q0,{children:[typeof r=="string"?(0,Et.jsx)("h3",{children:r}):(0,Et.jsx)(Et.Fragment,{children:r}),typeof o=="string"?(0,Et.jsx)("p",{children:o}):(0,Et.jsx)(Et.Fragment,{children:o})]}),t?.allowlistConfig.errorCtaLink?(0,Et.jsx)(F,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,Et.jsx)(F,{onClick:()=>{e("LANDING")},children:n})]})]})},G0=jp.default.div`
662
+ `;var jp=require("react/jsx-runtime"),Xl=({style:e,...t})=>(0,jp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,jp.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var Et=require("react/jsx-runtime"),sh=()=>{let{navigate:e,app:t}=k(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsx)(_,{}),(0,Et.jsxs)(Z0,{children:[(0,Et.jsx)(ut,{children:(0,Et.jsxs)("div",{children:[(0,Et.jsx)(Jl,{}),(0,Et.jsx)(Xl,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,Et.jsxs)(Q0,{children:[typeof r=="string"?(0,Et.jsx)("h3",{children:r}):(0,Et.jsx)(Et.Fragment,{children:r}),typeof o=="string"?(0,Et.jsx)("p",{children:o}):(0,Et.jsx)(Et.Fragment,{children:o})]}),t?.allowlistConfig.errorCtaLink?(0,Et.jsx)(F,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,Et.jsx)(F,{onClick:()=>{e("LANDING")},children:n})]})]})},Z0=Yp.default.div`
663
663
  display: flex;
664
664
  flex-direction: column;
665
665
  align-items: center;
@@ -667,11 +667,11 @@ Resources:
667
667
  gap: 24px;
668
668
  width: 100%;
669
669
  padding-bottom: 16px;
670
- `,q0=jp.default.div`
670
+ `,Q0=Yp.default.div`
671
671
  display: flex;
672
672
  flex-direction: column;
673
673
  gap: 8px;
674
- `;var mh=y(require("@heroicons/react/20/solid/CheckIcon")),fh=y(require("@heroicons/react/24/outline/EnvelopeIcon")),hh=y(require("@heroicons/react/24/outline/PhoneIcon")),Io=require("react"),yh=require("react-device-detect"),En=y(require("styled-components"));var Cr=y(require("styled-components")),$r=Cr.default.div`
674
+ `;var hh=y(require("@heroicons/react/20/solid/CheckIcon")),yh=y(require("@heroicons/react/24/outline/EnvelopeIcon")),gh=y(require("@heroicons/react/24/outline/PhoneIcon")),Io=require("react"),vh=require("react-device-detect"),En=y(require("styled-components"));var Cr=y(require("styled-components")),zr=Cr.default.div`
675
675
  display: flex;
676
676
  flex-direction: column;
677
677
  align-items: flex-start;
@@ -679,23 +679,23 @@ Resources:
679
679
  margin-top: auto;
680
680
  gap: 16px;
681
681
  flex-grow: 100;
682
- `,sr=Cr.default.div`
682
+ `,lr=Cr.default.div`
683
683
  display: flex;
684
684
  flex-direction: column;
685
685
  align-items: center;
686
686
  justify-content: center;
687
687
  flex-grow: 1;
688
688
  width: 100%;
689
- `,ah=Cr.default.div`
689
+ `,lh=Cr.default.div`
690
690
  display: flex;
691
691
  flex-direction: column;
692
692
  align-items: center;
693
693
  width: 100%;
694
- `,Zi=(0,Cr.default)(sr)`
694
+ `,Qi=(0,Cr.default)(lr)`
695
695
  padding: 20px 0;
696
- `,fo=(0,Cr.default)(sr)`
696
+ `,mo=(0,Cr.default)(lr)`
697
697
  gap: 16px;
698
- `,Yp=Cr.default.div`
698
+ `,Zp=Cr.default.div`
699
699
  display: flex;
700
700
  flex-direction: column;
701
701
  width: 100%;
@@ -703,12 +703,12 @@ Resources:
703
703
  display: flex;
704
704
  flex-direction: column;
705
705
  gap: 8px;
706
- `,DT=Cr.default.div`
706
+ `,HT=Cr.default.div`
707
707
  display: flex;
708
708
  flex-direction: column;
709
709
  justify-content: space-between;
710
710
  height: 100%;
711
- `,sh=Cr.default.div`
711
+ `,ch=Cr.default.div`
712
712
  display: flex;
713
713
  flex-direction: column;
714
714
  justify-content: flex-start;
@@ -735,9 +735,9 @@ Resources:
735
735
  height: 16px;
736
736
  `,ce=Cr.default.div`
737
737
  height: 12px;
738
- `,lh=Cr.default.div`
738
+ `,ph=Cr.default.div`
739
739
  position: relative;
740
- `,ch=Cr.default.div`
740
+ `,dh=Cr.default.div`
741
741
  background-color: var(--privy-color-accent);
742
742
  display: flex;
743
743
  justify-content: center;
@@ -745,9 +745,9 @@ Resources:
745
745
  border-radius: 50%;
746
746
  border-color: white;
747
747
  border-width: 2px !important;
748
- `;var Xl=y(require("styled-components")),ho=require("react/jsx-runtime"),ai=({title:e,description:t,children:r,...o})=>(0,ho.jsx)(ph,{...o,children:(0,ho.jsxs)(ho.Fragment,{children:[(0,ho.jsx)("h3",{children:e}),typeof t=="string"?(0,ho.jsx)("p",{children:t}):t,r]})}),Ro=(0,Xl.default)(ai)`
748
+ `;var ec=y(require("styled-components")),fo=require("react/jsx-runtime"),ii=({title:e,description:t,children:r,...o})=>(0,fo.jsx)(uh,{...o,children:(0,fo.jsxs)(fo.Fragment,{children:[(0,fo.jsx)("h3",{children:e}),typeof t=="string"?(0,fo.jsx)("p",{children:t}):t,r]})}),Ro=(0,ec.default)(ii)`
749
749
  margin-bottom: 24px;
750
- `,Ge=({title:e,description:t,icon:r,children:o,...n})=>(0,ho.jsxs)(z0,{...n,children:[r||null,(0,ho.jsx)("h3",{children:e}),t&&typeof t=="string"?(0,ho.jsx)("p",{children:t}):t,o]}),ph=Xl.default.div`
750
+ `,Ve=({title:e,description:t,icon:r,children:o,...n})=>(0,fo.jsxs)(J0,{...n,children:[r||null,(0,fo.jsx)("h3",{children:e}),t&&typeof t=="string"?(0,fo.jsx)("p",{children:t}):t,o]}),uh=ec.default.div`
751
751
  display: flex;
752
752
  flex-direction: column;
753
753
  justify-content: flex-start;
@@ -767,7 +767,7 @@ Resources:
767
767
  color: var(--privy-color-foreground-2);
768
768
  font-size: 14px;
769
769
  }
770
- `,z0=(0,Xl.default)(ph)`
770
+ `,J0=(0,ec.default)(uh)`
771
771
  align-items: center;
772
772
  text-align: center;
773
773
  gap: 16px;
@@ -775,7 +775,7 @@ Resources:
775
775
  h3 {
776
776
  margin-bottom: 24px;
777
777
  }
778
- `;var Fe=require("react/jsx-runtime"),Zp=6,dh=new Array(Zp).fill(""),$0=1400,K0=30;var gh=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:a}=k(),{closePrivyModal:i,resendEmailCode:s,resendSmsCode:l,getAuthMeta:c,loginWithCode:u,updateWallets:h,createAnalyticsEvent:m}=R(),{authenticated:v,logout:b,user:g}=G(),[P,A]=(0,Io.useState)(dh),[E,S]=(0,Io.useState)(!1),[W,D]=(0,Io.useState)(null),[M,I]=(0,Io.useState)(null),[H,$]=(0,Io.useState)(0);a.current=()=>null;let J=c()?.email?0:1,O=et,K=O-500;(0,Io.useEffect)(()=>{if(H){let we=setTimeout(()=>{$(H-1)},1e3);return()=>clearTimeout(we)}},[H]),(0,Io.useEffect)(()=>{if(v&&E&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let ne=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},K);return()=>clearTimeout(ne)}if(hr(g,e?.embeddedWallets?.createOnLogin)){let ne=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:Ne=>{console.error(Ne),m({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Ne,screen:"AwaitingPasswordlessCodeScreen"}}),b()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},K);return()=>clearTimeout(ne)}else{h();let ne=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),O);return()=>clearTimeout(ne)}}},[v,E,g]),(0,Io.useEffect)(()=>{if(W&&M===0){let we=setTimeout(()=>{A(dh),D(null),document.querySelector("input[name=code-0]")?.focus()},$0);return()=>clearTimeout(we)}},[W]);let N=we=>{we.preventDefault();let ne=we.currentTarget.value.replace(" ","");if(ne==="")return;if(isNaN(Number(ne))){D("Code should be numeric"),I(1);return}D(null),I(null);let Ne=Number(we.currentTarget.name?.charAt(5)),He=[...ne||[""]].slice(0,Zp-Ne),Yt=[...P.slice(0,Ne),...He,...P.slice(Ne+He.length)];A(Yt);let Fr=He.length,pr=Math.min(Math.max(Ne+Fr,0),Zp-1);isNaN(Number(we.currentTarget.value))||document.querySelector(`input[name=code-${pr}]`)?.focus(),Yt.every(kt=>kt&&!isNaN(+kt))&&(document.querySelector(`input[name=code-${pr}]`)?.blur(),u(Yt.join("")).then(()=>S(!0)).catch(ve=>{if(ve?.status===422)D("Invalid or expired verification code");else if(ve instanceof or&&ve.privyErrorCode==="cannot_link_more_of_type")D(ve.message);else if(ve instanceof or&&ve.privyErrorCode==="max_accounts_reached"){console.error(new Hr(ve).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(ve instanceof or&&ve.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(ve instanceof or&&ve.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:ve,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else D("Issue verifying code");I(0)}))},nt=we=>{M===1&&(D(null),I(null));let ne=[...P.slice(0,we),"",...P.slice(we+1)];A(ne),we>0&&document.querySelector(`input[name=code-${we-1}]`)?.focus()},ht=J==0?(0,Fe.jsx)(fh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,Fe.jsx)(hh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),Xe=J==0?(0,Fe.jsxs)("p",{children:["Please check ",(0,Fe.jsx)(uh,{children:c()?.email})," for an email from privy.io and enter your code below."]}):(0,Fe.jsxs)("p",{children:["Please check ",(0,Fe.jsx)(uh,{children:c()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(_,{backFn:()=>o()},"header"),(0,Fe.jsxs)(j0,{children:[(0,Fe.jsx)(Ge,{title:"Enter confirmation code",description:Xe,icon:ht}),(0,Fe.jsxs)(ah,{children:[(0,Fe.jsxs)(Y0,{children:[(0,Fe.jsx)(Z0,{fail:!!W,success:E,children:(0,Fe.jsx)("span",{children:W||(E?"Success!":"")})}),(0,Fe.jsx)("div",{children:P.map((we,ne)=>(0,Fe.jsx)("input",{name:`code-${ne}`,type:"text",value:P[ne],onChange:N,onKeyUp:Ne=>{Ne.key==="Backspace"&&nt(ne)},inputMode:"numeric",autoFocus:ne===0,pattern:"[0-9]",className:`${E?"success":""} ${W?"fail":""}`,autoComplete:yh.isMobile?"one-time-code":"off"},ne))})]}),(0,Fe.jsxs)(Q0,{children:[(0,Fe.jsxs)("span",{children:["Didn't get ",J==0?"an email":"a message","?"]}),H?(0,Fe.jsxs)(X0,{children:[(0,Fe.jsx)(mh.default,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),(0,Fe.jsx)("span",{children:"Code sent"})]}):(0,Fe.jsx)(J0,{children:(0,Fe.jsx)("button",{onClick:async()=>{$(K0),J==0?await s():await l()},children:"Resend code"})})]})]})]}),(0,Fe.jsx)(j,{protectedByPrivy:!0})]})},j0=En.default.div`
778
+ `;var Ue=require("react/jsx-runtime"),Qp=6,mh=new Array(Qp).fill(""),X0=1400,eC=30;var Ch=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:a}=k(),{closePrivyModal:i,resendEmailCode:s,resendSmsCode:l,getAuthMeta:c,loginWithCode:u,updateWallets:h,createAnalyticsEvent:m}=R(),{authenticated:v,logout:b,user:g}=G(),[S,A]=(0,Io.useState)(mh),[E,P]=(0,Io.useState)(!1),[W,D]=(0,Io.useState)(null),[M,I]=(0,Io.useState)(null),[H,$]=(0,Io.useState)(0);a.current=()=>null;let J=c()?.email?0:1,O=et,K=O-500;(0,Io.useEffect)(()=>{if(H){let be=setTimeout(()=>{$(H-1)},1e3);return()=>clearTimeout(be)}},[H]),(0,Io.useEffect)(()=>{if(v&&E&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let ne=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},K);return()=>clearTimeout(ne)}if(hr(g,e?.embeddedWallets?.createOnLogin)){let ne=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:Le=>{console.error(Le),m({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Le,screen:"AwaitingPasswordlessCodeScreen"}}),b()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},K);return()=>clearTimeout(ne)}else{h();let ne=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),O);return()=>clearTimeout(ne)}}},[v,E,g]),(0,Io.useEffect)(()=>{if(W&&M===0){let be=setTimeout(()=>{A(mh),D(null),document.querySelector("input[name=code-0]")?.focus()},X0);return()=>clearTimeout(be)}},[W]);let N=be=>{be.preventDefault();let ne=be.currentTarget.value.replace(" ","");if(ne==="")return;if(isNaN(Number(ne))){D("Code should be numeric"),I(1);return}D(null),I(null);let Le=Number(be.currentTarget.name?.charAt(5)),Be=[...ne||[""]].slice(0,Qp-Le),Zt=[...S.slice(0,Le),...Be,...S.slice(Le+Be.length)];A(Zt);let Ur=Be.length,dr=Math.min(Math.max(Le+Ur,0),Qp-1);isNaN(Number(be.currentTarget.value))||document.querySelector(`input[name=code-${dr}]`)?.focus(),Zt.every(kt=>kt&&!isNaN(+kt))&&(document.querySelector(`input[name=code-${dr}]`)?.blur(),u(Zt.join("")).then(()=>P(!0)).catch(ve=>{if(ve?.status===422)D("Invalid or expired verification code");else if(ve instanceof nr&&ve.privyErrorCode==="cannot_link_more_of_type")D(ve.message);else if(ve instanceof nr&&ve.privyErrorCode==="max_accounts_reached"){console.error(new Br(ve).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(ve instanceof nr&&ve.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(ve instanceof nr&&ve.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:ve,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else D("Issue verifying code");I(0)}))},nt=be=>{M===1&&(D(null),I(null));let ne=[...S.slice(0,be),"",...S.slice(be+1)];A(ne),be>0&&document.querySelector(`input[name=code-${be-1}]`)?.focus()},ht=J==0?(0,Ue.jsx)(yh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,Ue.jsx)(gh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),Xe=J==0?(0,Ue.jsxs)("p",{children:["Please check ",(0,Ue.jsx)(fh,{children:c()?.email})," for an email from privy.io and enter your code below."]}):(0,Ue.jsxs)("p",{children:["Please check ",(0,Ue.jsx)(fh,{children:c()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)(_,{backFn:()=>o()},"header"),(0,Ue.jsxs)(tC,{children:[(0,Ue.jsx)(Ve,{title:"Enter confirmation code",description:Xe,icon:ht}),(0,Ue.jsxs)(lh,{children:[(0,Ue.jsxs)(rC,{children:[(0,Ue.jsx)(oC,{fail:!!W,success:E,children:(0,Ue.jsx)("span",{children:W||(E?"Success!":"")})}),(0,Ue.jsx)("div",{children:S.map((be,ne)=>(0,Ue.jsx)("input",{name:`code-${ne}`,type:"text",value:S[ne],onChange:N,onKeyUp:Le=>{Le.key==="Backspace"&&nt(ne)},inputMode:"numeric",autoFocus:ne===0,pattern:"[0-9]",className:`${E?"success":""} ${W?"fail":""}`,autoComplete:vh.isMobile?"one-time-code":"off"},ne))})]}),(0,Ue.jsxs)(nC,{children:[(0,Ue.jsxs)("span",{children:["Didn't get ",J==0?"an email":"a message","?"]}),H?(0,Ue.jsxs)(aC,{children:[(0,Ue.jsx)(hh.default,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),(0,Ue.jsx)("span",{children:"Code sent"})]}):(0,Ue.jsx)(iC,{children:(0,Ue.jsx)("button",{onClick:async()=>{$(eC),J==0?await s():await l()},children:"Resend code"})})]})]})]}),(0,Ue.jsx)(j,{})]})},tC=En.default.div`
779
779
  display: flex;
780
780
  flex-direction: column;
781
781
  align-items: flex-start;
@@ -783,7 +783,7 @@ Resources:
783
783
  margin: auto;
784
784
  gap: 16px;
785
785
  flex-grow: 1;
786
- `,Y0=En.default.div`
786
+ `,rC=En.default.div`
787
787
  display: flex;
788
788
  flex-direction: column;
789
789
  width: 100%;
@@ -840,7 +840,7 @@ Resources:
840
840
  transform: translate(1px, 0px);
841
841
  }
842
842
  }
843
- `,Z0=En.default.div`
843
+ `,oC=En.default.div`
844
844
  line-height: 20px;
845
845
  height: 20px;
846
846
  font-size: 13px;
@@ -848,7 +848,7 @@ Resources:
848
848
  display: flex;
849
849
  justify-content: flex-end;
850
850
  width: 100%;
851
- `,Q0=En.default.div`
851
+ `,nC=En.default.div`
852
852
  font-size: 13px;
853
853
  color: var(--privy-color-foreground);
854
854
  display: flex;
@@ -859,13 +859,13 @@ Resources:
859
859
  // Equal opposing size buffer to account for auto margining when the
860
860
  // success/fail text does not show up
861
861
  padding-bottom: 32px;
862
- `,J0=En.default.div`
862
+ `,iC=En.default.div`
863
863
  color: var(--privy-color-accent);
864
864
  padding: 2px 0;
865
865
  > button {
866
866
  text-decoration: underline;
867
867
  }
868
- `,X0=En.default.div`
868
+ `,aC=En.default.div`
869
869
  display: flex;
870
870
  align-items: center;
871
871
  justify-content: center;
@@ -874,10 +874,10 @@ Resources:
874
874
  gap: 4px;
875
875
  background: var(--privy-color-background-2);
876
876
  color: var(--privy-color-foreground-2);
877
- `,uh=En.default.span`
877
+ `,fh=En.default.span`
878
878
  font-weight: 500;
879
879
  word-break: break-all;
880
- `;var bh=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Eh=y(require("@heroicons/react/24/solid/XCircleIcon")),Rr=require("react"),Th=y(require("styled-components"));var vh=y(require("styled-components"));var yo=require("react/jsx-runtime"),Ch=({icon:e})=>{let t=e;return(0,yo.jsx)(yo.Fragment,{children:(0,yo.jsx)(eC,{children:(0,yo.jsxs)("div",{children:[(0,yo.jsx)(wt,{}),typeof t=="string"?(0,yo.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,yo.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,yo.jsx)("span",{})]})})})},eC=vh.default.div`
880
+ `;var Th=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Sh=y(require("@heroicons/react/24/solid/XCircleIcon")),kr=require("react"),Ph=y(require("styled-components"));var wh=y(require("styled-components"));var ho=require("react/jsx-runtime"),bh=({icon:e})=>{let t=e;return(0,ho.jsx)(ho.Fragment,{children:(0,ho.jsx)(sC,{children:(0,ho.jsxs)("div",{children:[(0,ho.jsx)(wt,{}),typeof t=="string"?(0,ho.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,ho.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,ho.jsx)("span",{})]})})})},sC=wh.default.div`
881
881
  display: flex;
882
882
  flex-direction: column;
883
883
  justify-content: center;
@@ -900,14 +900,14 @@ Resources:
900
900
  left: -19px;
901
901
  top: -19px;
902
902
  }
903
- `;var Lt=require("react/jsx-runtime"),Ph=500,wh=Ph*2,Sh=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:a}=k(),{status:i,token:s,waitForResult:l,reset:c,execute:u}=Se(),h=(0,Rr.useRef)([]),m=K=>{h.current=[K,...h.current]},[v,b]=(0,Rr.useState)(!0);(0,Rr.useEffect)(()=>{let K=setTimeout(b,wh,!1);return m(K),()=>{h.current.forEach(N=>clearTimeout(N)),h.current=[]}},[]);let[g,P]=(0,Rr.useState)(""),[A,E]=(0,Rr.useState)("Checking that you are a human..."),[S,W]=(0,Rr.useState)((0,Lt.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"})),[D,M]=(0,Rr.useState)(!1),[I,H]=(0,Rr.useState)(3),$=r?.captchaModalData,J=async K=>{try{await $?.callback(K),$?.onSuccessNavigateTo&&n($?.onSuccessNavigateTo,!1)}catch(N){if(N instanceof xr)return;{let nt={error:N,previousScreen:e||"LANDING"};a({errorModalData:nt}),n($?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Rr.useEffect)(()=>{if(i==="success"){let K=setTimeout(async()=>{let N=await l();!N||$?.userIntentRequired||J(N)},wh);m(K)}else if(i==="ready"){let K=setTimeout(()=>{i==="ready"&&u()},Ph);m(K)}},[i]),(0,Rr.useEffect)(()=>{if(!v)switch(i){case"success":P("Success!"),E("CAPTCHA passed successfully."),W((0,Lt.jsx)(F,{onClick:()=>{M(!0),J(s)},disabled:!$?.userIntentRequired,loading:D,children:$?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":P(""),E("Checking that you are a human..."),W((0,Lt.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":P("Something went wrong"),I<=0?(E("If you use an adblocker or VPN, try disabling and re-attempting."),W(null)):(E("You did not pass CAPTCHA. Please try again."),W((0,Lt.jsx)(F,{onClick:O,children:"Retry"})));break;case"ready":default:break}},[i,v,D]);let O=async()=>{if(I<=0)return;H(N=>N-1),c(),u();let K=await l();!K||$?.userIntentRequired||J(K)};return(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(_,{backFn:!e||t===e?void 0:o}),(0,Lt.jsxs)(tC,{children:[i==="success"?(0,Lt.jsx)(bh.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):i==="error"?(0,Lt.jsx)(Eh.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Lt.jsx)(Ch,{}),(0,Lt.jsxs)(mt,{children:[g?(0,Lt.jsx)("h3",{children:g}):null,(0,Lt.jsx)("p",{children:A})]}),S]}),(0,Lt.jsx)(Y,{})]})},tC=Th.default.div`
903
+ `;var Nt=require("react/jsx-runtime"),_h=500,Eh=_h*2,Ah=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:a}=k(),{status:i,token:s,waitForResult:l,reset:c,execute:u}=Pe(),h=(0,kr.useRef)([]),m=K=>{h.current=[K,...h.current]},[v,b]=(0,kr.useState)(!0);(0,kr.useEffect)(()=>{let K=setTimeout(b,Eh,!1);return m(K),()=>{h.current.forEach(N=>clearTimeout(N)),h.current=[]}},[]);let[g,S]=(0,kr.useState)(""),[A,E]=(0,kr.useState)("Checking that you are a human..."),[P,W]=(0,kr.useState)((0,Nt.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"})),[D,M]=(0,kr.useState)(!1),[I,H]=(0,kr.useState)(3),$=r?.captchaModalData,J=async K=>{try{await $?.callback(K),$?.onSuccessNavigateTo&&n($?.onSuccessNavigateTo,!1)}catch(N){if(N instanceof xr)return;{let nt={error:N,previousScreen:e||"LANDING"};a({errorModalData:nt}),n($?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,kr.useEffect)(()=>{if(i==="success"){let K=setTimeout(async()=>{let N=await l();!N||$?.userIntentRequired||J(N)},Eh);m(K)}else if(i==="ready"){let K=setTimeout(()=>{i==="ready"&&u()},_h);m(K)}},[i]),(0,kr.useEffect)(()=>{if(!v)switch(i){case"success":S("Success!"),E("CAPTCHA passed successfully."),W((0,Nt.jsx)(F,{onClick:()=>{M(!0),J(s)},disabled:!$?.userIntentRequired,loading:D,children:$?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":S(""),E("Checking that you are a human..."),W((0,Nt.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":S("Something went wrong"),I<=0?(E("If you use an adblocker or VPN, try disabling and re-attempting."),W(null)):(E("You did not pass CAPTCHA. Please try again."),W((0,Nt.jsx)(F,{onClick:O,children:"Retry"})));break;case"ready":default:break}},[i,v,D]);let O=async()=>{if(I<=0)return;H(N=>N-1),c(),u();let K=await l();!K||$?.userIntentRequired||J(K)};return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(_,{backFn:!e||t===e?void 0:o}),(0,Nt.jsxs)(lC,{children:[i==="success"?(0,Nt.jsx)(Th.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):i==="error"?(0,Nt.jsx)(Sh.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Nt.jsx)(bh,{}),(0,Nt.jsxs)(mt,{children:[g?(0,Nt.jsx)("h3",{children:g}):null,(0,Nt.jsx)("p",{children:A})]}),P]}),(0,Nt.jsx)(Y,{})]})},lC=Ph.default.div`
904
904
  display: flex;
905
905
  flex-direction: column;
906
906
  align-items: center;
907
907
  justify-content: center;
908
908
  gap: 24px;
909
909
  width: 100%;
910
- `;var Wh=y(require("@heroicons/react/24/outline/WalletIcon")),Qp=require("react-device-detect"),Mh=y(require("styled-components"));function Qi(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}var lr=require("react/jsx-runtime"),_h=({...e})=>(0,lr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,lr.jsx)("defs",{children:(0,lr.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,lr.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,lr.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,lr.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,lr.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,lr.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,lr.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,lr.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,lr.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,lr.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,lr.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var Nt=require("react/jsx-runtime"),Ah=({style:e,...t})=>(0,Nt.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Nt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,Nt.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Nt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,Nt.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Nt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,Nt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,Nt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,Nt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,Nt.jsxs)("defs",{children:[(0,Nt.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Nt.jsx)("stop",{stopColor:"#002D72"}),(0,Nt.jsx)("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),(0,Nt.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Nt.jsx)("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),(0,Nt.jsx)("stop",{offset:"1",stopColor:"#002D72"})]})]})]});var gt=require("react/jsx-runtime"),xh=e=>(0,gt.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,gt.jsx)("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),(0,gt.jsx)("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),(0,gt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),(0,gt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),(0,gt.jsx)("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),(0,gt.jsxs)("defs",{children:[(0,gt.jsxs)("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[(0,gt.jsx)("stop",{stopColor:"white"}),(0,gt.jsx)("stop",{offset:"1",stopColor:"white"})]}),(0,gt.jsxs)("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[(0,gt.jsx)("stop",{stopColor:"#8697FF"}),(0,gt.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,gt.jsxs)("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[(0,gt.jsx)("stop",{stopColor:"#8697FF"}),(0,gt.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,gt.jsxs)("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[(0,gt.jsx)("stop",{stopColor:"white"}),(0,gt.jsx)("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});var ee=require("react/jsx-runtime"),kh=({style:e,...t})=>(0,ee.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,ee.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,ee.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,ee.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,ee.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,ee.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,ee.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,ee.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,ee.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,ee.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,ee.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,ee.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,ee.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,ee.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,ee.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,ee.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,ee.jsxs)("defs",{children:[(0,ee.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#174299"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,ee.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,ee.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ee.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#FF4000"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ee.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#8754C9"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,ee.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,ee.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ee.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#FFF700"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ee.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#FFF700"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ee.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,ee.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ee.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,ee.jsx)("stop",{stopColor:"#00AAFF"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ee.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,ee.jsx)("stop",{stopColor:"#00AAFF"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ee.jsx)("clipPath",{id:"clip0_5_32",children:(0,ee.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,ee.jsx)("clipPath",{id:"clip1_5_32",children:(0,ee.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var wr=require("react/jsx-runtime"),Rh=({style:e,...t})=>(0,wr.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,wr.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,wr.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,wr.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var Yo=require("react/jsx-runtime"),Ih=({style:e,...t})=>(0,Yo.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Yo.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,Yo.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,Yo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,Yo.jsx)("defs",{children:(0,Yo.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,Yo.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var Zo=require("react/jsx-runtime"),Kr={coinbase_wallet:{logo:$a,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:$a,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Di,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:_o,displayName:"Phantom"},rainbow:{logo:kh,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Za,displayName:"WalletConnect"},zerion:{logo:Ih,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:_h,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Ah,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Rh,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:xh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"}},si=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:a}=k(),{connectWallet:i}=R(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,l=window.matchMedia("(display-mode: standalone)").matches,c;return n.connectorType==="phantom"?c=()=>{fn()?(i(n,s),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):a(Qp.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Qp.isMobile&&!l&&!Xs()?c=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:c=()=>{Qi(window.navigator.userAgent)&&!event?.isTrusted||(i(n,s),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},(0,Zo.jsxs)(iC,{onClick:c,children:[(0,Zo.jsx)(nC,{icon:oC(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),(0,Zo.jsx)("span",{children:rC(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),(0,Zo.jsx)("span",{id:"connect-text",children:"Connect"})]})},rC=(e,t,r)=>{if(Kr[e]?.displayName)return e==="coinbase_wallet"?Kr[r].displayName:Kr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},oC=(e,t,r)=>{if(Kr[e]?.logo)return e==="coinbase_wallet"?Kr[r].logo:Kr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Za},nC=({icon:e,name:t})=>typeof e=="string"?(0,Zo.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,Zo.jsx)(Wh.default,{}):e?(0,Zo.jsx)(e,{}):null,iC=(0,Mh.default)(Ue)`
910
+ `;var Oh=y(require("@heroicons/react/24/outline/WalletIcon")),Jp=require("react-device-detect"),Lh=y(require("styled-components"));function Ji(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}var cr=require("react/jsx-runtime"),xh=({...e})=>(0,cr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,cr.jsx)("defs",{children:(0,cr.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,cr.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,cr.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,cr.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,cr.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,cr.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,cr.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,cr.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,cr.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,cr.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,cr.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var Dt=require("react/jsx-runtime"),kh=({style:e,...t})=>(0,Dt.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Dt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,Dt.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Dt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,Dt.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Dt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,Dt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,Dt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,Dt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,Dt.jsxs)("defs",{children:[(0,Dt.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Dt.jsx)("stop",{stopColor:"#002D72"}),(0,Dt.jsx)("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),(0,Dt.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Dt.jsx)("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),(0,Dt.jsx)("stop",{offset:"1",stopColor:"#002D72"})]})]})]});var gt=require("react/jsx-runtime"),Rh=e=>(0,gt.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,gt.jsx)("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),(0,gt.jsx)("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),(0,gt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),(0,gt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),(0,gt.jsx)("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),(0,gt.jsxs)("defs",{children:[(0,gt.jsxs)("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[(0,gt.jsx)("stop",{stopColor:"white"}),(0,gt.jsx)("stop",{offset:"1",stopColor:"white"})]}),(0,gt.jsxs)("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[(0,gt.jsx)("stop",{stopColor:"#8697FF"}),(0,gt.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,gt.jsxs)("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[(0,gt.jsx)("stop",{stopColor:"#8697FF"}),(0,gt.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,gt.jsxs)("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[(0,gt.jsx)("stop",{stopColor:"white"}),(0,gt.jsx)("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});var ee=require("react/jsx-runtime"),Ih=({style:e,...t})=>(0,ee.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,ee.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,ee.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,ee.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,ee.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,ee.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,ee.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,ee.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,ee.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,ee.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,ee.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,ee.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,ee.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,ee.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,ee.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,ee.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,ee.jsxs)("defs",{children:[(0,ee.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#174299"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,ee.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,ee.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ee.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#FF4000"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ee.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#8754C9"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,ee.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,ee.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ee.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#FFF700"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ee.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,ee.jsx)("stop",{stopColor:"#FFF700"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ee.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,ee.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ee.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,ee.jsx)("stop",{stopColor:"#00AAFF"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ee.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,ee.jsx)("stop",{stopColor:"#00AAFF"}),(0,ee.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ee.jsx)("clipPath",{id:"clip0_5_32",children:(0,ee.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,ee.jsx)("clipPath",{id:"clip1_5_32",children:(0,ee.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var wr=require("react/jsx-runtime"),Wh=({style:e,...t})=>(0,wr.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,wr.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,wr.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,wr.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,wr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var Zo=require("react/jsx-runtime"),Mh=({style:e,...t})=>(0,Zo.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Zo.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,Zo.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,Zo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,Zo.jsx)("defs",{children:(0,Zo.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,Zo.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var Qo=require("react/jsx-runtime"),$r={coinbase_wallet:{logo:Ka,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Ka,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Ui,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Po,displayName:"Phantom"},rainbow:{logo:Ih,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Qa,displayName:"WalletConnect"},zerion:{logo:Mh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:xh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:kh,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Wh,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:Rh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"}},ai=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:a}=k(),{connectWallet:i}=R(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,l=window.matchMedia("(display-mode: standalone)").matches,c;return n.connectorType==="phantom"?c=()=>{fn()?(i(n,s),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):a(Jp.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Jp.isMobile&&!l&&!el()?c=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:c=()=>{Ji(window.navigator.userAgent)&&!event?.isTrusted||(i(n,s),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},(0,Qo.jsxs)(uC,{onClick:c,children:[(0,Qo.jsx)(dC,{icon:pC(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),(0,Qo.jsx)("span",{children:cC(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),(0,Qo.jsx)("span",{id:"connect-text",children:"Connect"})]})},cC=(e,t,r)=>{if($r[e]?.displayName)return e==="coinbase_wallet"?$r[r].displayName:$r[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},pC=(e,t,r)=>{if($r[e]?.logo)return e==="coinbase_wallet"?$r[r].logo:$r[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Qa},dC=({icon:e,name:t})=>typeof e=="string"?(0,Qo.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,Qo.jsx)(Oh.default,{}):e?(0,Qo.jsx)(e,{}):null,uC=(0,Lh.default)(De)`
911
911
  /* Show "Connect" on hover */
912
912
  > #connect-text {
913
913
  font-weight: 500;
@@ -929,21 +929,21 @@ Resources:
929
929
  display: none;
930
930
  }
931
931
  }
932
- `;var go=require("react/jsx-runtime"),aC=["coinbase_wallet"],sC=["metamask","okx_wallet","rainbow","uniswap","zerion","rabby_wallet","cryptocom"],lC=[],cC=["phantom"],Ji=({connectOnly:e})=>{let{connectors:t}=R(),{app:r}=k(),o=Xa(r.appearance.walletList,t,e,r.appearance.walletList);return(0,go.jsxs)(go.Fragment,{children:[...o]})},Xa=(e,t,r,o,n)=>{let a=[],i=[],s=[],l=t.find(c=>c.connectorType==="wallet_connect_v2");for(let c of e)if(c==="detected_wallets"){let u=t.filter(({connectorType:h,walletClientType:m})=>m==="uniswap_wallet_extension"?!o.includes("uniswap"):m==="crypto.com_wallet_extension"?!o.includes("cryptocom"):h==="injected"&&!o.includes(m));for(let h of u){let{walletClientType:m,walletBranding:v}=h;(m==="unknown"?i:a).push((0,go.jsx)(si,{connectOnly:r,provider:m,logo:v.icon,displayName:v.name,connector:h},`${c}-${m}`))}}else if(cC.includes(c)){let u=t.find(h=>h.connectorType==="injected"&&h.walletClientType===c||h.connectorType===c);u&&a.push((0,go.jsx)(si,{connectOnly:r,provider:c,connector:u},c))}else if(sC.includes(c)){let u=t.find(h=>c==="uniswap"?h.walletClientType==="uniswap_wallet_extension":c==="cryptocom"?h.walletClientType==="crypto.com_wallet_extension":h.connectorType==="injected"&&h.walletClientType===c);n&&!u&&(u=l),u&&a.push((0,go.jsx)(si,{connectOnly:r,provider:c,connector:u},c))}else if(aC.includes(c)){let u=t.find(({connectorType:h})=>h===c);u&&a.push((0,go.jsx)(si,{connectOnly:r,provider:c,connector:u},c))}else lC.includes(c)?l&&s.push((0,go.jsx)(si,{connectOnly:r,provider:c,connector:l},c)):c==="wallet_connect"&&l&&s.push((0,go.jsx)(si,{connectOnly:r,provider:c,connector:l},c));return[...i,...a,...s]};var Wo=require("react/jsx-runtime"),Oh=()=>{let{app:e}=k(),{linkingOrConnectingHint:t}=R(),r=t?`Connect the wallet with address ${Vr(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,Wo.jsxs)(Wo.Fragment,{children:[(0,Wo.jsx)(_,{},"header"),(0,Wo.jsx)(Ro,{title:"Connect your wallet",description:r}),(0,Wo.jsx)(uo,{children:(0,Wo.jsx)(Ji,{connectOnly:!0})}),(0,Wo.jsx)(j,{protectedByPrivy:!0})]})};var Uh=y(require("styled-components"));var Lh=y(require("react"));var Dh=require("react/jsx-runtime"),Nh=()=>{let{app:e}=k(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,Dh.jsx)("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?Lh.default.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var Jp=require("react/jsx-runtime"),Xi=e=>{let{app:t}=k();return t?.appearance.logo?(0,Jp.jsx)(pC,{...e,children:(0,Jp.jsx)(Nh,{})}):null},pC=Uh.default.div`
932
+ `;var yo=require("react/jsx-runtime"),mC=["coinbase_wallet"],fC=["metamask","okx_wallet","rainbow","uniswap","zerion","rabby_wallet","cryptocom"],hC=[],yC=["phantom"],Xi=({connectOnly:e})=>{let{connectors:t}=R(),{app:r}=k(),o=es(r.appearance.walletList,t,e,r.appearance.walletList);return(0,yo.jsxs)(yo.Fragment,{children:[...o]})},es=(e,t,r,o,n)=>{let a=[],i=[],s=[],l=t.find(c=>c.connectorType==="wallet_connect_v2");for(let c of e)if(c==="detected_wallets"){let u=t.filter(({connectorType:h,walletClientType:m})=>m==="uniswap_wallet_extension"?!o.includes("uniswap"):m==="crypto.com_wallet_extension"?!o.includes("cryptocom"):h==="injected"&&!o.includes(m));for(let h of u){let{walletClientType:m,walletBranding:v}=h;(m==="unknown"?i:a).push((0,yo.jsx)(ai,{connectOnly:r,provider:m,logo:v.icon,displayName:v.name,connector:h},`${c}-${m}`))}}else if(yC.includes(c)){let u=t.find(h=>h.connectorType==="injected"&&h.walletClientType===c||h.connectorType===c);u&&a.push((0,yo.jsx)(ai,{connectOnly:r,provider:c,connector:u},c))}else if(fC.includes(c)){let u=t.find(h=>c==="uniswap"?h.walletClientType==="uniswap_wallet_extension":c==="cryptocom"?h.walletClientType==="crypto.com_wallet_extension":h.connectorType==="injected"&&h.walletClientType===c);n&&!u&&(u=l),u&&a.push((0,yo.jsx)(ai,{connectOnly:r,provider:c,connector:u},c))}else if(mC.includes(c)){let u=t.find(({connectorType:h})=>h===c);u&&a.push((0,yo.jsx)(ai,{connectOnly:r,provider:c,connector:u},c))}else hC.includes(c)?l&&s.push((0,yo.jsx)(ai,{connectOnly:r,provider:c,connector:l},c)):c==="wallet_connect"&&l&&s.push((0,yo.jsx)(ai,{connectOnly:r,provider:c,connector:l},c));return[...i,...a,...s]};var Wo=require("react/jsx-runtime"),Nh=()=>{let{app:e}=k(),{linkingOrConnectingHint:t}=R(),r=t?`Connect the wallet with address ${Hr(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,Wo.jsxs)(Wo.Fragment,{children:[(0,Wo.jsx)(_,{},"header"),(0,Wo.jsx)(Ro,{title:"Connect your wallet",description:r}),(0,Wo.jsx)(po,{children:(0,Wo.jsx)(Xi,{connectOnly:!0})}),(0,Wo.jsx)(j,{})]})};var Bh=y(require("styled-components"));var Dh=y(require("react"));var Fh=require("react/jsx-runtime"),Uh=()=>{let{app:e}=k(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,Fh.jsx)("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?Dh.default.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var Xp=require("react/jsx-runtime"),ea=e=>{let{app:t}=k();return t?.appearance.logo?(0,Xp.jsx)(gC,{...e,children:(0,Xp.jsx)(Uh,{})}):null},gC=Bh.default.div`
933
933
  display: flex;
934
934
  flex-direction: column;
935
935
  align-items: center;
936
936
  padding: 24px 0;
937
937
  flex-grow: 1;
938
938
  justify-content: center;
939
- `;var jr=require("react/jsx-runtime"),Fh=()=>{let{app:e}=k(),{linkingOrConnectingHint:t}=R(),r=t?`Connect the wallet with address ${Vr(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,jr.jsxs)(jr.Fragment,{children:[(0,jr.jsx)(_,{},"header"),(0,jr.jsx)(Xi,{}),(0,jr.jsx)(ai,{title:"Connect your wallet",description:r}),(0,jr.jsx)(uo,{children:(0,jr.jsx)(Ji,{connectOnly:!0})}),e&&(0,jr.jsx)(Yi,{app:e,alwaysShowImplicitConsent:!0}),(0,jr.jsx)(j,{protectedByPrivy:!0})]})};var ta=require("react"),Gh=require("react-device-detect"),qh=y(require("styled-components"));var Ir=require("react"),ts=require("react-device-detect"),ed=y(require("styled-components"));var es=require("react"),dC=(e,t)=>{let r=(0,es.useRef)(()=>{});(0,es.useEffect)(()=>{r.current=e}),(0,es.useEffect)(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Bh=dC;var ea=require("react");function Hh(){let[e,t]=(0,ea.useState)(!1),r=(0,ea.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,ea.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var Re=require("react/jsx-runtime"),Xp=2,td=e=>e?.privyErrorCode==="linked_to_another_user"?Ko.ERROR_USER_EXISTS:e instanceof It&&!e.details.default?e.details:e instanceof Wi?Ko.ERROR_TIMED_OUT:e instanceof Mi?Ko.ERROR_USER_REJECTED_CONNECTION:Ko.ERROR_WALLET_CONNECTION,Vh=()=>{let[e,t]=(0,Ir.useState)(!1),[r,o]=(0,Ir.useState)(!1),[n,a]=(0,Ir.useState)(void 0),{authenticated:i,logout:s}=G(),{app:l,navigate:c,navigateBack:u,lastScreen:h,currentScreen:m,setModalData:v}=k(),{getAuthFlow:b,walletConnectionStatus:g,closePrivyModal:P,initLoginWithWallet:A,loginWithWallet:E,updateWallets:S,createAnalyticsEvent:W}=R(),{walletConnectors:D}=G(),[M,I]=(0,Ir.useState)(0),{user:H}=G(),[$]=(0,Ir.useState)(H?.linkedAccounts.length||0),[J,O]=(0,Ir.useState)(""),[K,N]=(0,Ir.useState)(""),[nt,ht]=(0,Ir.useState)(!1),{hasTabbedAway:Xe}=Hh(),{enabled:we,token:ne}=Se(),Ne=ts.isMobile&&g?.connector?.connectorType==="wallet_connect_v2"||ts.isMobile&&g?.connector?.connectorType==="coinbase_wallet"||ts.isMobile&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",He=g?.status==="connected",Yt=g?.status==="switching_to_supported_chain";(0,Ir.useEffect)(()=>{let z=b();if(He&&!z&&(we&&!ne&&!i?(v({captchaModalData:{callback:be=>A(g.connectedWallet,be).then(()=>{ht(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):A(g.connectedWallet,ne).then(()=>{ht(!0)})),z&&Ne&&He&&!z.preparedMessage){z.buildSiweMessage();return}!z||Ne||!He||r||(async()=>{o(!0),a(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await fp(2500),await pr()}catch(be){console.warn("Auto-prompted signature failed",be)}finally{o(!1)}})()},[M,He,nt]),(0,Ir.useEffect)(()=>{if(H&&e){let be=et-500;if(l?.legal.requireUsersAcceptTerms&&!H.hasAcceptedTerms){let Hn=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},be);return()=>clearTimeout(Hn)}if(hr(H,l?.embeddedWallets?.createOnLogin)){let Hn=setTimeout(()=>{v({createWallet:{onSuccess:()=>{},onFailure:wi=>{console.error(wi),W({eventName:"embedded_wallet_creation_failure_logout",payload:{error:wi,screen:"ConnectionStatusScreen"}}),s()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},be);return()=>clearTimeout(Hn)}S();let dr=setTimeout(()=>P({shouldCallAuthOnSuccess:!0,isSuccess:!0}),et);return()=>clearTimeout(dr)}},[H,e]);let Fr=z=>{if(z?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(z?.privyErrorCode==="max_accounts_reached"){console.error(new Hr(z).toString()),c("USER_LIMIT_REACHED_SCREEN");return}else if(z?.privyErrorCode==="user_does_not_exist"){c("ACCOUNT_NOT_FOUND_SCREEN");return}a(td(z))};async function pr(){try{await E(),t(!0)}catch(z){Fr(z)}finally{o(!1)}}(0,Ir.useEffect)(()=>{g?.connectError&&Fr(g?.connectError)},[g]),Bh(()=>{let z=kt==="wallet_connect_v2"&&g?.connector instanceof ao?g.connector.redirectUri:void 0;z&&O(z);let be=kt==="wallet_connect_v2"&&g?.connector instanceof ao?g.connector.fallbackUniversalRedirectUri:void 0;be&&N(be)},g?.connector instanceof ao&&!J?500:null);let kt=g?.connector?.connectorType||"injected",ve=g?.connector?.walletClientType||"unknown",Eo=Kr[ve]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",it=Kr[ve]?.logo||g?.connector?.walletBranding.icon||(z=>(0,Re.jsx)(Ni,{...z})),un=Eo==="Browser Extension"?Eo.toLowerCase():Eo,L;e?L=`Successfully connected with ${un}`:n?L=n.message:Yt?L="Switching networks":He?L=r&&Ne?"Signing":"Sign to verify":L=`Waiting for ${un}`;let Gt="Don\u2019t see your wallet? Check your other browser windows.";if(e){let z=H?.linkedAccounts.length||0;$===z?Gt="Wallet was already linked.":Gt="You\u2019re good to go!"}else M>=Xp&&n?Gt="Unable to connect wallet":n?Gt=n.detail:Yt?Gt="Switch your wallet to the requested network.":He&&Ne?Gt="Sign the message in your wallet to verify it belongs to you.":ve==="metamask"&&ts.isMobile?Gt="Click continue to open and connect MetaMask.":ve==="metamask"?Gt="For the best experience, connect only one wallet at a time.":kt==="wallet_connect"?Gt="Open your mobile wallet app to continue":kt==="coinbase_wallet"&&(Xs()||(Lp(H)?Gt="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":Gt="Open the Coinbase app on your phone to continue."));let To=D?.walletConnectors?.find(z=>z.walletClientType==="coinbase_wallet"),ie=ve==="coinbase_wallet"&&(Lp(H)||n===Ko.ERROR_USER_EXISTS);return(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(_,{backFn:!h||m===h?void 0:u}),(0,Re.jsxs)(uC,{children:[(0,Re.jsx)(rd,{walletLogo:it,success:e,fail:!!n}),(0,Re.jsxs)(mt,{children:[(0,Re.jsx)("h3",{children:L}),(0,Re.jsx)("p",{children:Gt}),!He&&J&&!Xe?(0,Re.jsxs)("p",{children:["Still here?"," ",(0,Re.jsx)("a",{href:J,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),K&&(0,Re.jsxs)(Re.Fragment,{children:[" ","or"," ",(0,Re.jsx)("a",{href:K,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),ie?(0,Re.jsx)(F,{onClick:()=>To&&To?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Ko.ERROR_USER_EXISTS&&m!==h?(0,Re.jsx)(F,{onClick:u,children:"Use a different wallet"}):He&&!e&&Ne?(0,Re.jsx)(F,{onClick:()=>{o(!0),pr()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<Xp?(0,Re.jsx)(F,{onClick:()=>{I(M+1),a(void 0),He?(o(!0),pr()):g?.connectRetry()},disabled:!e&&(!n?.retryable||M>=Xp),children:"Retry"}):!e&&!n?(0,Re.jsx)(F,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,Re.jsx)(Y,{})]})},uC=ed.default.div`
939
+ `;var Kr=require("react/jsx-runtime"),Hh=()=>{let{app:e}=k(),{linkingOrConnectingHint:t}=R(),r=t?`Connect the wallet with address ${Hr(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(_,{},"header"),(0,Kr.jsx)(ea,{}),(0,Kr.jsx)(ii,{title:"Connect your wallet",description:r}),(0,Kr.jsx)(po,{children:(0,Kr.jsx)(Xi,{connectOnly:!0})}),e&&(0,Kr.jsx)(Zi,{app:e,alwaysShowImplicitConsent:!0}),(0,Kr.jsx)(j,{})]})};var ra=require("react"),zh=require("react-device-detect"),$h=y(require("styled-components"));var Rr=require("react"),rs=require("react-device-detect"),td=y(require("styled-components"));var ts=require("react"),vC=(e,t)=>{let r=(0,ts.useRef)(()=>{});(0,ts.useEffect)(()=>{r.current=e}),(0,ts.useEffect)(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Vh=vC;var ta=require("react");function Gh(){let[e,t]=(0,ta.useState)(!1),r=(0,ta.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,ta.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var ke=require("react/jsx-runtime"),ed=2,rd=e=>e?.privyErrorCode==="linked_to_another_user"?jo.ERROR_USER_EXISTS:e instanceof Wt&&!e.details.default?e.details:e instanceof Mi?jo.ERROR_TIMED_OUT:e instanceof Oi?jo.ERROR_USER_REJECTED_CONNECTION:jo.ERROR_WALLET_CONNECTION,qh=()=>{let[e,t]=(0,Rr.useState)(!1),[r,o]=(0,Rr.useState)(!1),[n,a]=(0,Rr.useState)(void 0),{authenticated:i,logout:s}=G(),{app:l,navigate:c,navigateBack:u,lastScreen:h,currentScreen:m,setModalData:v}=k(),{getAuthFlow:b,walletConnectionStatus:g,closePrivyModal:S,initLoginWithWallet:A,loginWithWallet:E,updateWallets:P,createAnalyticsEvent:W}=R(),{walletConnectors:D}=G(),[M,I]=(0,Rr.useState)(0),{user:H}=G(),[$]=(0,Rr.useState)(H?.linkedAccounts.length||0),[J,O]=(0,Rr.useState)(""),[K,N]=(0,Rr.useState)(""),[nt,ht]=(0,Rr.useState)(!1),{hasTabbedAway:Xe}=Gh(),{enabled:be,token:ne}=Pe(),Le=rs.isMobile&&g?.connector?.connectorType==="wallet_connect_v2"||rs.isMobile&&g?.connector?.connectorType==="coinbase_wallet"||rs.isMobile&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",Be=g?.status==="connected",Zt=g?.status==="switching_to_supported_chain";(0,Rr.useEffect)(()=>{let z=b(),Ce=z instanceof Ko?z:void 0;if(Be&&!Ce&&(be&&!ne&&!i?(v({captchaModalData:{callback:Rt=>A(g.connectedWallet,Rt).then(()=>{ht(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):A(g.connectedWallet,ne).then(()=>{ht(!0)})),Ce&&Le&&Be&&!Ce.preparedMessage){Ce.buildSiweMessage();return}!Ce||Le||!Be||r||(async()=>{o(!0),a(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await hp(2500),await dr()}catch(Rt){console.warn("Auto-prompted signature failed",Rt)}finally{o(!1)}})()},[M,Be,nt]),(0,Rr.useEffect)(()=>{if(H&&e){let Ce=et-500;if(l?.legal.requireUsersAcceptTerms&&!H.hasAcceptedTerms){let Hn=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},Ce);return()=>clearTimeout(Hn)}if(hr(H,l?.embeddedWallets?.createOnLogin)){let Hn=setTimeout(()=>{v({createWallet:{onSuccess:()=>{},onFailure:bi=>{console.error(bi),W({eventName:"embedded_wallet_creation_failure_logout",payload:{error:bi,screen:"ConnectionStatusScreen"}}),s()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Ce);return()=>clearTimeout(Hn)}P();let Rt=setTimeout(()=>S({shouldCallAuthOnSuccess:!0,isSuccess:!0}),et);return()=>clearTimeout(Rt)}},[H,e]);let Ur=z=>{if(z?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(z?.privyErrorCode==="max_accounts_reached"){console.error(new Br(z).toString()),c("USER_LIMIT_REACHED_SCREEN");return}else if(z?.privyErrorCode==="user_does_not_exist"){c("ACCOUNT_NOT_FOUND_SCREEN");return}a(rd(z))};async function dr(){try{await E(),t(!0)}catch(z){Ur(z)}finally{o(!1)}}(0,Rr.useEffect)(()=>{g?.connectError&&Ur(g?.connectError)},[g]),Vh(()=>{let z=kt==="wallet_connect_v2"&&g?.connector instanceof io?g.connector.redirectUri:void 0;z&&O(z);let Ce=kt==="wallet_connect_v2"&&g?.connector instanceof io?g.connector.fallbackUniversalRedirectUri:void 0;Ce&&N(Ce)},g?.connector instanceof io&&!J?500:null);let kt=g?.connector?.connectorType||"injected",ve=g?.connector?.walletClientType||"unknown",bo=$r[ve]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",it=$r[ve]?.logo||g?.connector?.walletBranding.icon||(z=>(0,ke.jsx)(Di,{...z})),un=bo==="Browser Extension"?bo.toLowerCase():bo,L;e?L=`Successfully connected with ${un}`:n?L=n.message:Zt?L="Switching networks":Be?L=r&&Le?"Signing":"Sign to verify":L=`Waiting for ${un}`;let qt="Don\u2019t see your wallet? Check your other browser windows.";if(e){let z=H?.linkedAccounts.length||0;$===z?qt="Wallet was already linked.":qt="You\u2019re good to go!"}else M>=ed&&n?qt="Unable to connect wallet":n?qt=n.detail:Zt?qt="Switch your wallet to the requested network.":Be&&Le?qt="Sign the message in your wallet to verify it belongs to you.":ve==="metamask"&&rs.isMobile?qt="Click continue to open and connect MetaMask.":ve==="metamask"?qt="For the best experience, connect only one wallet at a time.":kt==="wallet_connect"?qt="Open your mobile wallet app to continue":kt==="coinbase_wallet"&&(el()||(Np(H)?qt="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":qt="Open the Coinbase app on your phone to continue."));let Eo=D?.walletConnectors?.find(z=>z.walletClientType==="coinbase_wallet"),ie=ve==="coinbase_wallet"&&(Np(H)||n===jo.ERROR_USER_EXISTS);return(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)(_,{backFn:!h||m===h?void 0:u}),(0,ke.jsxs)(CC,{children:[(0,ke.jsx)(od,{walletLogo:it,success:e,fail:!!n}),(0,ke.jsxs)(mt,{children:[(0,ke.jsx)("h3",{children:L}),(0,ke.jsx)("p",{children:qt}),!Be&&J&&!Xe?(0,ke.jsxs)("p",{children:["Still here?"," ",(0,ke.jsx)("a",{href:J,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),K&&(0,ke.jsxs)(ke.Fragment,{children:[" ","or"," ",(0,ke.jsx)("a",{href:K,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),ie?(0,ke.jsx)(F,{onClick:()=>Eo&&Eo?.disconnect(),disabled:e,children:"Use a different wallet"}):n==jo.ERROR_USER_EXISTS&&m!==h?(0,ke.jsx)(F,{onClick:u,children:"Use a different wallet"}):Be&&!e&&Le?(0,ke.jsx)(F,{onClick:()=>{o(!0),dr()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<ed?(0,ke.jsx)(F,{onClick:()=>{I(M+1),a(void 0),Be?(o(!0),dr()):g?.connectRetry()},disabled:!e&&(!n?.retryable||M>=ed),children:"Retry"}):!e&&!n?(0,ke.jsx)(F,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,ke.jsx)(Y,{})]})},CC=td.default.div`
940
940
  display: flex;
941
941
  flex-direction: column;
942
942
  align-items: center;
943
943
  justify-content: center;
944
944
  gap: 24px;
945
945
  width: 100%;
946
- `,mC=ed.default.div`
946
+ `,wC=td.default.div`
947
947
  display: flex;
948
948
  flex-direction: column;
949
949
  justify-content: center;
@@ -966,14 +966,14 @@ Resources:
966
966
  left: -19px;
967
967
  top: -19px;
968
968
  }
969
- `,rd=e=>{let t=e.walletLogo;return(0,Re.jsx)(Re.Fragment,{children:(0,Re.jsx)(mC,{children:(0,Re.jsxs)("div",{children:[(0,Re.jsx)(wt,{success:e.success,fail:e.fail}),typeof t=="string"?(0,Re.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,Re.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var Xt=require("react/jsx-runtime"),ec=2,zh=()=>{let{navigateBack:e,lastScreen:t,currentScreen:r}=k(),{walletConnectionStatus:o,closePrivyModal:n}=R(),[a,i]=(0,ta.useState)(void 0),[s,l]=(0,ta.useState)(0),c=o?.status==="connected",u=o?.status==="switching_to_supported_chain";(0,ta.useEffect)(()=>{if(c){let S=setTimeout(n,et);return()=>clearTimeout(S)}},[c]);let h=S=>{i(td(S))};(0,ta.useEffect)(()=>{o?.connectError&&h(o?.connectError)},[o]);let m=o?.connector?.connectorType||"injected",v=o?.connector?.walletClientType||"unknown",b=Kr[v]?.displayName||o?.connector?.walletBranding.name||"Browser Extension",g=Kr[v]?.logo||o?.connector?.walletBranding.icon||(S=>(0,Xt.jsx)(Ni,{...S})),P=b==="Browser Extension"?b.toLowerCase():b,A;c?A=`Successfully connected with ${P}`:a?A=a.message:u?A="Switching networks":A=`Waiting for ${P}`;let E="Don\u2019t see your wallet? Check your other browser windows.";return c?E="You\u2019re good to go!":s>=ec&&a?E="Unable to connect wallet":a?E=a.detail:u?E="Switch your wallet to the requested network.":v==="metamask"&&Gh.isMobile?E="Click to continue to open and connect MetaMask.":v==="metamask"?E="For the best experience, connect only one wallet at a time.":m==="wallet_connect_v2"?E="Open your mobile wallet app to continue":m==="coinbase_wallet"&&(E="Open the Coinbase app on your phone to continue."),(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(_,{backFn:r===t?void 0:e}),(0,Xt.jsxs)(fC,{children:[(0,Xt.jsx)(rd,{walletLogo:g,success:c,fail:!!a}),(0,Xt.jsxs)(mt,{children:[(0,Xt.jsx)("h3",{children:A}),(0,Xt.jsx)("p",{children:E})]}),a==Ko.ERROR_USER_EXISTS?(0,Xt.jsx)(F,{onClick:e,children:"Use a different wallet"}):!c&&a?.retryable&&s<ec?(0,Xt.jsx)(F,{onClick:()=>{l(s+1),i(void 0),o?.connectRetry()},disabled:!c&&(!a?.retryable||s>=ec),children:"Retry"}):!c&&a&&s>=ec?(0,Xt.jsx)(F,{onClick:e,children:"Use a different wallet"}):null]}),(0,Xt.jsx)(Y,{})]})},fC=qh.default.div`
969
+ `,od=e=>{let t=e.walletLogo;return(0,ke.jsx)(ke.Fragment,{children:(0,ke.jsx)(wC,{children:(0,ke.jsxs)("div",{children:[(0,ke.jsx)(wt,{success:e.success,fail:e.fail}),typeof t=="string"?(0,ke.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,ke.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var er=require("react/jsx-runtime"),tc=2,Kh=()=>{let{navigateBack:e,lastScreen:t,currentScreen:r}=k(),{walletConnectionStatus:o,closePrivyModal:n}=R(),[a,i]=(0,ra.useState)(void 0),[s,l]=(0,ra.useState)(0),c=o?.status==="connected",u=o?.status==="switching_to_supported_chain";(0,ra.useEffect)(()=>{if(c){let P=setTimeout(n,et);return()=>clearTimeout(P)}},[c]);let h=P=>{i(rd(P))};(0,ra.useEffect)(()=>{o?.connectError&&h(o?.connectError)},[o]);let m=o?.connector?.connectorType||"injected",v=o?.connector?.walletClientType||"unknown",b=$r[v]?.displayName||o?.connector?.walletBranding.name||"Browser Extension",g=$r[v]?.logo||o?.connector?.walletBranding.icon||(P=>(0,er.jsx)(Di,{...P})),S=b==="Browser Extension"?b.toLowerCase():b,A;c?A=`Successfully connected with ${S}`:a?A=a.message:u?A="Switching networks":A=`Waiting for ${S}`;let E="Don\u2019t see your wallet? Check your other browser windows.";return c?E="You\u2019re good to go!":s>=tc&&a?E="Unable to connect wallet":a?E=a.detail:u?E="Switch your wallet to the requested network.":v==="metamask"&&zh.isMobile?E="Click to continue to open and connect MetaMask.":v==="metamask"?E="For the best experience, connect only one wallet at a time.":m==="wallet_connect_v2"?E="Open your mobile wallet app to continue":m==="coinbase_wallet"&&(E="Open the Coinbase app on your phone to continue."),(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(_,{backFn:r===t?void 0:e}),(0,er.jsxs)(bC,{children:[(0,er.jsx)(od,{walletLogo:g,success:c,fail:!!a}),(0,er.jsxs)(mt,{children:[(0,er.jsx)("h3",{children:A}),(0,er.jsx)("p",{children:E})]}),a==jo.ERROR_USER_EXISTS?(0,er.jsx)(F,{onClick:e,children:"Use a different wallet"}):!c&&a?.retryable&&s<tc?(0,er.jsx)(F,{onClick:()=>{l(s+1),i(void 0),o?.connectRetry()},disabled:!c&&(!a?.retryable||s>=tc),children:"Retry"}):!c&&a&&s>=tc?(0,er.jsx)(F,{onClick:e,children:"Use a different wallet"}):null]}),(0,er.jsx)(Y,{})]})},bC=$h.default.div`
970
970
  display: flex;
971
971
  flex-direction: column;
972
972
  align-items: center;
973
973
  justify-content: center;
974
974
  gap: 24px;
975
975
  width: 100%;
976
- `;var li=require("react"),Kh=y(require("styled-components"));var od=require("react/jsx-runtime"),$h=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?(0,od.jsx)("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):(0,od.jsx)("span",{})};var qt=require("react/jsx-runtime"),jh=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=k(),{crossAppAuthFlow:r,updateWallets:o,closePrivyModal:n}=R(),[a,i]=(0,li.useState)({}),s={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},l=et,c=new w(`There was an issue connecting your ${s.name} account. Please try again.`),u=new rt(async b=>{if(!e?.crossAppAuth?.popup){i({error:c});return}try{let g=await r({appId:b,popup:e.crossAppAuth.popup});i({data:g})}catch(g){g instanceof w?i({error:g}):g instanceof or?(e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),i({error:c})):i({error:c})}}),h=()=>{a.data&&(o(),e?.crossAppAuth?.onSuccess(a.data),n({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(a.error??new w("User canceled flow")),n({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=h,(0,li.useEffect)(()=>{s.id.length&&u.execute(s.id)},[s.id]),(0,li.useEffect)(()=>{if(!a.data)return;let b=setTimeout(h,l);return()=>clearTimeout(b)},[a.data]);let{title:m,subtitle:v}=(0,li.useMemo)(()=>a.data?{title:`Successfully connected with ${s.name}`,subtitle:"You're good to go!"}:a.error?{title:"Authentication failed",subtitle:a.error.message}:{title:`Connecting to ${s.name}`,subtitle:`Please check the pop-up from ${s.name} to continue`},[a,s.name]);return(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(_,{onClose:h}),(0,qt.jsx)(le,{}),(0,qt.jsxs)(hC,{children:[(0,qt.jsx)(ut,{children:(0,qt.jsxs)("div",{children:[(0,qt.jsx)(wt,{success:!!a.data,fail:!!a.error}),(0,qt.jsx)($h,{name:s.name,logoUrl:s.logoUrl})]})}),(0,qt.jsxs)(mt,{children:[(0,qt.jsx)("h3",{children:m}),(0,qt.jsx)("p",{children:v})]})]}),(0,qt.jsx)(ce,{}),(0,qt.jsx)(Y,{})]})},hC=Kh.default.div`
976
+ `;var si=require("react"),Yh=y(require("styled-components"));var nd=require("react/jsx-runtime"),jh=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?(0,nd.jsx)("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):(0,nd.jsx)("span",{})};var zt=require("react/jsx-runtime"),Zh=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=k(),{crossAppAuthFlow:r,updateWallets:o,closePrivyModal:n}=R(),[a,i]=(0,si.useState)({}),s={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},l=et,c=new w(`There was an issue connecting your ${s.name} account. Please try again.`),u=new rt(async b=>{if(!e?.crossAppAuth?.popup){i({error:c});return}try{let g=await r({appId:b,popup:e.crossAppAuth.popup});i({data:g})}catch(g){g instanceof w?i({error:g}):g instanceof nr?(e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),i({error:c})):i({error:c})}}),h=()=>{a.data&&(o(),e?.crossAppAuth?.onSuccess(a.data),n({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(a.error??new w("User canceled flow")),n({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=h,(0,si.useEffect)(()=>{s.id.length&&u.execute(s.id)},[s.id]),(0,si.useEffect)(()=>{if(!a.data)return;let b=setTimeout(h,l);return()=>clearTimeout(b)},[a.data]);let{title:m,subtitle:v}=(0,si.useMemo)(()=>a.data?{title:`Successfully connected with ${s.name}`,subtitle:"You're good to go!"}:a.error?{title:"Authentication failed",subtitle:a.error.message}:{title:`Connecting to ${s.name}`,subtitle:`Please check the pop-up from ${s.name} to continue`},[a,s.name]);return(0,zt.jsxs)(zt.Fragment,{children:[(0,zt.jsx)(_,{onClose:h}),(0,zt.jsx)(le,{}),(0,zt.jsxs)(EC,{children:[(0,zt.jsx)(ut,{children:(0,zt.jsxs)("div",{children:[(0,zt.jsx)(wt,{success:!!a.data,fail:!!a.error}),(0,zt.jsx)(jh,{name:s.name,logoUrl:s.logoUrl})]})}),(0,zt.jsxs)(mt,{children:[(0,zt.jsx)("h3",{children:m}),(0,zt.jsx)("p",{children:v})]})]}),(0,zt.jsx)(ce,{}),(0,zt.jsx)(Y,{})]})},EC=Yh.default.div`
977
977
  display: flex;
978
978
  flex-direction: column;
979
979
  align-items: center;
@@ -981,7 +981,7 @@ Resources:
981
981
  margin-left: 27px;
982
982
  margin-right: 27px;
983
983
  gap: 24px;
984
- `;var Xh=y(require("@heroicons/react/24/solid/XCircleIcon")),ia=require("react"),ey=y(require("styled-components"));var rs=y(require("styled-components")),ra=require("react/jsx-runtime"),oa=()=>(0,ra.jsx)(yC,{children:(0,ra.jsxs)(gC,{children:[(0,ra.jsx)(vC,{}),(0,ra.jsx)(CC,{})]})}),yC=rs.default.div`
984
+ `;var ty=y(require("@heroicons/react/24/solid/XCircleIcon")),aa=require("react"),ry=y(require("styled-components"));var os=y(require("styled-components")),oa=require("react/jsx-runtime"),na=()=>(0,oa.jsx)(TC,{children:(0,oa.jsxs)(SC,{children:[(0,oa.jsx)(PC,{}),(0,oa.jsx)(_C,{})]})}),TC=os.default.div`
985
985
  display: flex;
986
986
  justify-content: center;
987
987
  align-items: center;
@@ -993,14 +993,14 @@ Resources:
993
993
  @media all and (display-mode: standalone) {
994
994
  margin-bottom: 30px;
995
995
  }
996
- `,gC=rs.default.div`
996
+ `,SC=os.default.div`
997
997
  position: relative;
998
998
  height: 140px;
999
999
  width: 140px;
1000
1000
 
1001
1001
  opacity: 1;
1002
1002
  animation: fadein 200ms ease;
1003
- `,vC=rs.default.div`
1003
+ `,PC=os.default.div`
1004
1004
  position: absolute;
1005
1005
  top: 0;
1006
1006
  right: 0;
@@ -1013,7 +1013,7 @@ Resources:
1013
1013
  border: 4px solid var(--privy-color-accent-light);
1014
1014
  border-radius: 50%;
1015
1015
  }
1016
- `,CC=rs.default.div`
1016
+ `,_C=os.default.div`
1017
1017
  position: absolute;
1018
1018
  top: 0;
1019
1019
  right: 0;
@@ -1037,20 +1037,20 @@ Resources:
1037
1037
  transform: rotate(360deg);
1038
1038
  }
1039
1039
  }
1040
- `;var Yh=["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 qe=class extends Error{constructor(r,o){super(o);this.type=r}};function na(e){let t=e.type;return typeof t=="string"&&Yh.includes(t)}function wC(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function ci(e){return na(e)&&e.type==="wallet_not_on_device"}function Zh(e){return na(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Tn(e){return!!(na(e)&&e.type==="mfa_timeout")}function Pn(e){return!!(na(e)&&e.type==="missing_or_invalid_mfa")}function tc(e){return!!(na(e)&&e.type==="mfa_verification_max_attempts_reached")}function rc(e){return!!(na(e)&&e.message.includes("code 429"))}function oc(e){return!!(wC(e)&&e.message==="MFA canceled")}function nd({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function nc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r=!1,isResettingPassword:o=!1}){return r||t.length===1?nd({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function ic(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 id({api:e,provider:t}){let r=Yn(),o=xi(),n=await ki(r);try{return t==="icloud"?{url:(await e.post(ku,{client_type:"web"})).url}:{url:(await e.post(xu,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(a){throw me(a)}}async function Qh({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(Ru,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(a){let i=me(a);throw i.privyErrorCode?new w(i.message||"Invalid code during OAuth flow.",void 0,i.privyErrorCode):i.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")}}var br=require("react/jsx-runtime"),Jh=1,ty=()=>{let{authenticated:e,user:t,getAccessToken:r}=G(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:a}=R(),{navigate:i,data:s,setModalData:l,onUserCloseViaDialogOrKeybindRef:c}=k(),u=(0,ia.useMemo)(()=>Date.now(),[]),[h,m]=(0,ia.useState)(!1),{onCompleteNavigateTo:v,onFailure:b,shouldForceMFA:g,address:P}=s?.connectWallet,A=S=>{h||(m(!0),b(typeof S=="string"?new Error(S):S))};(0,ia.useEffect)(()=>{let S=P?t?.linkedAccounts.find(M=>M.type==="wallet"&&M.walletClientType==="privy"&&M.address===P):Oe(t),W;return!e||!S?A("User must be authenticated and have a Privy wallet before it can be connected"):a?((async()=>{let M=await r();if(!M)return A("User must be authenticated and have a Privy wallet before it can be connected");try{await a.connect({accessToken:M,address:S.address}),g&&await a.verifyMfa({accessToken:M});let I=(Date.now()-u)/1e3;v==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&I<Jh?W=setTimeout(()=>{i(v)},(Jh-I)*1e3):i(v)}catch(I){if(ci(I)&&S.recoveryMethod==="privy"){let H=await r();if(!H)return A("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 a?.recover({address:S.address,accessToken:H,recoveryMethod:S.recoveryMethod}))?.address||A(new Error("Unable to recover wallet")),v?i(v):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:S.address}}),i(v)}catch{A("An error has occurred, please try again.")}}else if(ci(I)&&S.recoveryMethod!=="privy"){l({...s,recoverWallet:{privyWallet:S,onCompleteNavigateTo:v,onFailure:b},recoveryOAuthStatus:{provider:S.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let H=ic(S.recoveryMethod);i(H)}else A(I)}})(),()=>clearTimeout(W)):void 0},[e,t,a]);let E=()=>{A("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=E,(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(_,{onClose:E}),h?(0,br.jsxs)(br.Fragment,{children:[(0,br.jsxs)(fo,{children:[(0,br.jsx)(Xh.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,br.jsx)(Ge,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,br.jsx)(F,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,br.jsx)(oa,{}),(0,br.jsx)(bC,{})]})},bC=ey.default.div`
1040
+ `;var Qh=["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 Ge=class extends Error{constructor(r,o){super(o);this.type=r}};function ia(e){let t=e.type;return typeof t=="string"&&Qh.includes(t)}function AC(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function li(e){return ia(e)&&e.type==="wallet_not_on_device"}function Jh(e){return ia(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Tn(e){return!!(ia(e)&&e.type==="mfa_timeout")}function Sn(e){return!!(ia(e)&&e.type==="missing_or_invalid_mfa")}function rc(e){return!!(ia(e)&&e.type==="mfa_verification_max_attempts_reached")}function oc(e){return!!(ia(e)&&e.message.includes("code 429"))}function nc(e){return!!(AC(e)&&e.message==="MFA canceled")}function id({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function ic({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r=!1,isResettingPassword:o=!1}){return r||t.length===1?id({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function ac(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 ad({api:e,provider:t}){let r=Yn(),o=ki(),n=await Ri(r);try{return t==="icloud"?{url:(await e.post(Iu,{client_type:"web"})).url}:{url:(await e.post(Ru,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(a){throw me(a)}}async function Xh({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(Wu,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(a){let i=me(a);throw i.privyErrorCode?new w(i.message||"Invalid code during OAuth flow.",void 0,i.privyErrorCode):i.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")}}var br=require("react/jsx-runtime"),ey=1,oy=()=>{let{authenticated:e,user:t,getAccessToken:r}=G(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:a}=R(),{navigate:i,data:s,setModalData:l,onUserCloseViaDialogOrKeybindRef:c}=k(),u=(0,aa.useMemo)(()=>Date.now(),[]),[h,m]=(0,aa.useState)(!1),{onCompleteNavigateTo:v,onFailure:b,shouldForceMFA:g,address:S}=s?.connectWallet,A=P=>{h||(m(!0),b(typeof P=="string"?new Error(P):P))};(0,aa.useEffect)(()=>{let P=S?t?.linkedAccounts.find(M=>M.type==="wallet"&&M.walletClientType==="privy"&&M.address===S):Me(t),W;return!e||!P?A("User must be authenticated and have a Privy wallet before it can be connected"):a?((async()=>{let M=await r();if(!M)return A("User must be authenticated and have a Privy wallet before it can be connected");try{await a.connect({accessToken:M,address:P.address}),g&&await a.verifyMfa({accessToken:M});let I=(Date.now()-u)/1e3;v==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&I<ey?W=setTimeout(()=>{i(v)},(ey-I)*1e3):i(v)}catch(I){if(li(I)&&P.recoveryMethod==="privy"){let H=await r();if(!H)return A("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:P.address}}),(await a?.recover({address:P.address,accessToken:H,recoveryMethod:P.recoveryMethod}))?.address||A(new Error("Unable to recover wallet")),v?i(v):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:P.address}}),i(v)}catch{A("An error has occurred, please try again.")}}else if(li(I)&&P.recoveryMethod!=="privy"){l({...s,recoverWallet:{privyWallet:P,onCompleteNavigateTo:v,onFailure:b},recoveryOAuthStatus:{provider:P.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let H=ac(P.recoveryMethod);i(H)}else A(I)}})(),()=>clearTimeout(W)):void 0},[e,t,a]);let E=()=>{A("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=E,(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(_,{onClose:E}),h?(0,br.jsxs)(br.Fragment,{children:[(0,br.jsxs)(mo,{children:[(0,br.jsx)(ty.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,br.jsx)(Ve,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,br.jsx)(F,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,br.jsx)(na,{}),(0,br.jsx)(xC,{})]})},xC=ry.default.div`
1041
1041
  height: 44px;
1042
- `;var ry=y(require("@heroicons/react/24/solid/CheckCircleIcon")),oy=require("react");var Yr=require("react/jsx-runtime"),ny=()=>{let{user:e}=G(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=R(),{app:n,data:a,onUserCloseViaDialogOrKeybindRef:i}=k(),{onSuccess:s,onFailure:l,callAuthOnSuccessOnClose:c}=a.createWallet,u=()=>{let h=Oe(e);h?(o(),s(h)):l(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,oy.useEffect)(()=>{let h=setTimeout(u,cm);return()=>clearTimeout(h)},[]),i.current=u,(0,Yr.jsxs)(Yr.Fragment,{children:[(0,Yr.jsx)(_,{onClose:u}),(0,Yr.jsx)(le,{}),(0,Yr.jsxs)(fo,{children:[(0,Yr.jsx)(ry.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,Yr.jsx)(Ge,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,Yr.jsx)(ce,{}),(0,Yr.jsx)(j,{protectedByPrivy:!0})]})};var sy=y(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),ly=y(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),Qo=require("react"),Jo=y(require("styled-components"));var Te=require("react/jsx-runtime"),cy=()=>{let[e,t]=(0,Qo.useState)(null),{authenticated:r,user:o,getAccessToken:n}=G(),{closePrivyModal:a,createAnalyticsEvent:i,clientAnalyticsId:s}=R(),{data:l,onUserCloseViaDialogOrKeybindRef:c}=k(),u=Oe(o)?.address,{onFailure:h,onSuccess:m,origin:v,appId:b,appClientId:g}=l.keyExport,P=E=>{a({shouldCallAuthOnSuccess:!1}),h(typeof E=="string"?new Error(E):E)},A=()=>{a({shouldCallAuthOnSuccess:!1}),m(),i({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:u}})};return(0,Qo.useEffect)(()=>{let E=Oe(o);if(!r||!E)return P("User must be authenticated before exporting their wallet");n().then(t,P)},[r,o]),c.current=A,(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(_,{onClose:A}),(0,Te.jsxs)(PC,{children:[(0,Te.jsxs)(Ge,{icon:(0,Te.jsx)(ly.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,Te.jsxs)(xC,{children:[(0,Te.jsx)(TC,{style:{marginRight:6}}),Vr(u)]}),(0,Te.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,Te.jsxs)(SC,{children:[(0,Te.jsxs)(iy,{children:[(0,Te.jsx)(ay,{children:"1"}),(0,Te.jsxs)("span",{children:[(0,Te.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,Te.jsxs)(iy,{children:[(0,Te.jsx)(ay,{children:"2"}),(0,Te.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,Te.jsx)("div",{style:{width:"100%"},children:e&&(0,Te.jsx)(EC,{origin:v,appId:b,appClientId:g,accessToken:e,clientAnalyticsId:s,address:u,dimensions:{height:"44px"}})}),(0,Te.jsxs)(kC,{children:[(0,Te.jsxs)("div",{children:[(0,Te.jsx)(sy.default,{viewBox:"0 0 20 18"}),(0,Te.jsx)("h4",{children:"Warning"})]}),(0,Te.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,Te.jsx)(j,{protectedByPrivy:!0})]})};function EC(e){let[t,r]=(0,Qo.useState)(e.dimensions.width),[o,n]=(0,Qo.useState)(void 0),a=(0,Qo.useRef)(null);return(0,Qo.useEffect)(()=>{if(a.current&&t===void 0){let{width:s}=a.current.getBoundingClientRect();r(s)}let i=getComputedStyle(document.documentElement);n({background2:i.getPropertyValue("--privy-color-background-2"),foreground3:i.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:i.getPropertyValue("--privy-color-foreground-accent"),accent:i.getPropertyValue("--privy-color-accent"),accentDark:i.getPropertyValue("--privy-color-accent-dark"),success:i.getPropertyValue("--privy-color-success")})},[]),(0,Te.jsx)("div",{ref:a,children:t&&(0,Te.jsxs)(_C,{children:[(0,Te.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:tl(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o},{token:e.accessToken})}),(0,Te.jsx)(AC,{children:"Loading..."})]})})}function TC(e){return(0,Te.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,Te.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var PC=Jo.default.div`
1042
+ `;var ny=y(require("@heroicons/react/24/solid/CheckCircleIcon")),iy=require("react");var jr=require("react/jsx-runtime"),ay=()=>{let{user:e}=G(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=R(),{app:n,data:a,onUserCloseViaDialogOrKeybindRef:i}=k(),{onSuccess:s,onFailure:l,callAuthOnSuccessOnClose:c}=a.createWallet,u=()=>{let h=Me(e);h?(o(),s(h)):l(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,iy.useEffect)(()=>{let h=setTimeout(u,dm);return()=>clearTimeout(h)},[]),i.current=u,(0,jr.jsxs)(jr.Fragment,{children:[(0,jr.jsx)(_,{onClose:u}),(0,jr.jsx)(le,{}),(0,jr.jsxs)(mo,{children:[(0,jr.jsx)(ny.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,jr.jsx)(Ve,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,jr.jsx)(ce,{}),(0,jr.jsx)(j,{})]})};var cy=y(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),py=y(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),Jo=require("react"),Xo=y(require("styled-components"));var Te=require("react/jsx-runtime"),dy=()=>{let[e,t]=(0,Jo.useState)(null),{authenticated:r,user:o,getAccessToken:n}=G(),{closePrivyModal:a,createAnalyticsEvent:i,clientAnalyticsId:s}=R(),{data:l,onUserCloseViaDialogOrKeybindRef:c}=k(),u=Me(o)?.address,{onFailure:h,onSuccess:m,origin:v,appId:b,appClientId:g}=l.keyExport,S=E=>{a({shouldCallAuthOnSuccess:!1}),h(typeof E=="string"?new Error(E):E)},A=()=>{a({shouldCallAuthOnSuccess:!1}),m(),i({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:u}})};return(0,Jo.useEffect)(()=>{let E=Me(o);if(!r||!E)return S("User must be authenticated before exporting their wallet");n().then(t,S)},[r,o]),c.current=A,(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(_,{onClose:A}),(0,Te.jsxs)(IC,{children:[(0,Te.jsxs)(Ve,{icon:(0,Te.jsx)(py.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,Te.jsxs)(LC,{children:[(0,Te.jsx)(RC,{style:{marginRight:6}}),Hr(u)]}),(0,Te.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,Te.jsxs)(WC,{children:[(0,Te.jsxs)(sy,{children:[(0,Te.jsx)(ly,{children:"1"}),(0,Te.jsxs)("span",{children:[(0,Te.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,Te.jsxs)(sy,{children:[(0,Te.jsx)(ly,{children:"2"}),(0,Te.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,Te.jsx)("div",{style:{width:"100%"},children:e&&(0,Te.jsx)(kC,{origin:v,appId:b,appClientId:g,accessToken:e,clientAnalyticsId:s,address:u,dimensions:{height:"44px"}})}),(0,Te.jsxs)(NC,{children:[(0,Te.jsxs)("div",{children:[(0,Te.jsx)(cy.default,{viewBox:"0 0 20 18"}),(0,Te.jsx)("h4",{children:"Warning"})]}),(0,Te.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,Te.jsx)(j,{})]})};function kC(e){let[t,r]=(0,Jo.useState)(e.dimensions.width),[o,n]=(0,Jo.useState)(void 0),a=(0,Jo.useRef)(null);return(0,Jo.useEffect)(()=>{if(a.current&&t===void 0){let{width:s}=a.current.getBoundingClientRect();r(s)}let i=getComputedStyle(document.documentElement);n({background2:i.getPropertyValue("--privy-color-background-2"),foreground3:i.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:i.getPropertyValue("--privy-color-foreground-accent"),accent:i.getPropertyValue("--privy-color-accent"),accentDark:i.getPropertyValue("--privy-color-accent-dark"),success:i.getPropertyValue("--privy-color-success")})},[]),(0,Te.jsx)("div",{ref:a,children:t&&(0,Te.jsxs)(MC,{children:[(0,Te.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:rl(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o},{token:e.accessToken})}),(0,Te.jsx)(OC,{children:"Loading..."})]})})}function RC(e){return(0,Te.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,Te.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var IC=Xo.default.div`
1043
1043
  display: flex;
1044
1044
  flex-direction: column;
1045
1045
  text-align: left;
1046
- `,SC=Jo.default.div`
1046
+ `,WC=Xo.default.div`
1047
1047
  display: flex;
1048
1048
  flex-direction: column;
1049
1049
  gap: 24px;
1050
1050
  padding-bottom: 16px;
1051
1051
  margin-left: 11px;
1052
1052
  border-left: 1px solid var(--privy-color-foreground-4) !important;
1053
- `,iy=Jo.default.div`
1053
+ `,sy=Xo.default.div`
1054
1054
  display: flex;
1055
1055
  align-items: top;
1056
1056
  gap: 8px;
@@ -1059,7 +1059,7 @@ Resources:
1059
1059
  color: var(--privy-color-accent);
1060
1060
  text-decoration: underline;
1061
1061
  }
1062
- `,ay=Jo.default.div`
1062
+ `,ly=Xo.default.div`
1063
1063
  display: flex;
1064
1064
  align-items: center;
1065
1065
  justify-content: center;
@@ -1073,11 +1073,11 @@ Resources:
1073
1073
  border-radius: 100%;
1074
1074
  background: var(--privy-color-background);
1075
1075
  color: var(--privy-color-accent);
1076
- `,_C=Jo.default.div`
1076
+ `,MC=Xo.default.div`
1077
1077
  overflow: visible;
1078
1078
  position: relative;
1079
1079
  height: 44px;
1080
- `,AC=Jo.default.div`
1080
+ `,OC=Xo.default.div`
1081
1081
  position: absolute;
1082
1082
  display: flex;
1083
1083
  align-items: center;
@@ -1089,7 +1089,7 @@ Resources:
1089
1089
  border-radius: var(--privy-border-radius-md);
1090
1090
  background-color: var(--privy-color-background-2);
1091
1091
  color: var(--privy-color-foreground-3);
1092
- `,xC=Jo.default.div`
1092
+ `,LC=Xo.default.div`
1093
1093
  display: flex;
1094
1094
  align-items: center;
1095
1095
  padding-top: 1px;
@@ -1102,7 +1102,7 @@ Resources:
1102
1102
  font-size: 12px;
1103
1103
  font-weight: 500;
1104
1104
  margin: auto;
1105
- `,kC=Jo.default.div`
1105
+ `,NC=Xo.default.div`
1106
1106
  border: 1px solid var(--privy-color-background-2) !important;
1107
1107
  border-radius: var(--privy-border-radius-md);
1108
1108
  padding: 16px;
@@ -1124,9 +1124,9 @@ Resources:
1124
1124
  color: var(--privy-color-error);
1125
1125
  }
1126
1126
  }
1127
- `;var py=y(require("@heroicons/react/24/solid/XCircleIcon")),os=require("react"),dy=y(require("styled-components"));var ac=require("react");function sc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=R(),o=(0,ac.useRef)(!1);return{createWallet:(0,ac.useCallback)(async a=>{let i=await Pe();if(!i)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 s=await r(Ai);if(!s)throw new Error("walletProxy does not exist.");let l=1e4,c=new Promise((v,b)=>{setTimeout(()=>{b(new Error("walletProxy.create timed out."))},l)});if(!await Promise.race([s.create({accessToken:i,recoveryPassword:a}),c]))throw new Error("walletProxy.create did not send a response.");let h=await e();if(!h)throw new Error("Failed to refresh user.");let m=Oe(h);if(!m)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:m.address}}),o.current=!0,m}catch(s){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:s.toString()}}),console.warn(s),s}},[])}}var Zr=require("react/jsx-runtime"),uy=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=k(),[a,i]=(0,os.useState)(""),{embeddedWallets:s}=Wt(),{authenticated:l}=G(),{closePrivyModal:c}=R(),{onSuccess:u,onFailure:h,callAuthOnSuccessOnClose:m}=o.createWallet,v=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:b}=sc(),[g,P]=(0,os.useState)(null),A=new rt(async()=>{try{let S=await b();if(!S)return;P(S),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(S){i(S.message)}});(0,os.useEffect)(()=>{if(!l){r("LANDING"),h(new Error("User must be authenticated before creating a Privy wallet"));return}if(v){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let S=nc({walletAction:"create",availableRecoveryMethods:s.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(S)}A.execute()},[v,l]);let E=()=>{g?(u(g),c({shouldCallAuthOnSuccess:m})):(h(new nr("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,a?(0,Zr.jsxs)(Zr.Fragment,{children:[(0,Zr.jsx)(_,{closeable:!1}),(0,Zr.jsxs)(fo,{children:[(0,Zr.jsx)(py.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Zr.jsx)(Ge,{title:"Something went wrong",description:a})]}),(0,Zr.jsx)(F,{onClick:E,children:"Close"}),(0,Zr.jsx)(RC,{})]}):(0,Zr.jsx)(oa,{})},RC=dy.default.div`
1127
+ `;var uy=y(require("@heroicons/react/24/solid/XCircleIcon")),ns=require("react"),my=y(require("styled-components"));var sc=require("react");function lc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=R(),o=(0,sc.useRef)(!1);return{createWallet:(0,sc.useCallback)(async a=>{let i=await Se();if(!i)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 s=await r(xi);if(!s)throw new Error("walletProxy does not exist.");let l=1e4,c=new Promise((v,b)=>{setTimeout(()=>{b(new Error("walletProxy.create timed out."))},l)});if(!await Promise.race([s.create({accessToken:i,recoveryPassword:a}),c]))throw new Error("walletProxy.create did not send a response.");let h=await e();if(!h)throw new Error("Failed to refresh user.");let m=Me(h);if(!m)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:m.address}}),o.current=!0,m}catch(s){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:s.toString()}}),console.warn(s),s}},[])}}var Yr=require("react/jsx-runtime"),fy=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=k(),[a,i]=(0,ns.useState)(""),{embeddedWallets:s}=Mt(),{authenticated:l}=G(),{closePrivyModal:c}=R(),{onSuccess:u,onFailure:h,callAuthOnSuccessOnClose:m}=o.createWallet,v=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:b}=lc(),[g,S]=(0,ns.useState)(null),A=new rt(async()=>{try{let P=await b();if(!P)return;S(P),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(P){i(P.message)}});(0,ns.useEffect)(()=>{if(!l){r("LANDING"),h(new Error("User must be authenticated before creating a Privy wallet"));return}if(v){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let P=ic({walletAction:"create",availableRecoveryMethods:s.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(P)}A.execute()},[v,l]);let E=()=>{g?(u(g),c({shouldCallAuthOnSuccess:m})):(h(new ir("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,a?(0,Yr.jsxs)(Yr.Fragment,{children:[(0,Yr.jsx)(_,{closeable:!1}),(0,Yr.jsxs)(mo,{children:[(0,Yr.jsx)(uy.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Yr.jsx)(Ve,{title:"Something went wrong",description:a})]}),(0,Yr.jsx)(F,{onClick:E,children:"Close"}),(0,Yr.jsx)(DC,{})]}):(0,Yr.jsx)(na,{})},DC=my.default.div`
1128
1128
  height: 44px;
1129
- `;var pi=require("react");var ma=require("react");var wy=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),pa=require("react");var my=y(require("@heroicons/react/24/outline/ArrowPathIcon")),fy=y(require("@heroicons/react/24/outline/EyeIcon")),hy=y(require("@heroicons/react/24/outline/EyeSlashIcon")),vt=y(require("styled-components"));var IC=vt.css`
1129
+ `;var ci=require("react");var fa=require("react");var Ey=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),da=require("react");var hy=y(require("@heroicons/react/24/outline/ArrowPathIcon")),yy=y(require("@heroicons/react/24/outline/EyeIcon")),gy=y(require("@heroicons/react/24/outline/EyeSlashIcon")),vt=y(require("styled-components"));var UC=vt.css`
1130
1130
  font-size: 14px;
1131
1131
  font-style: normal;
1132
1132
  font-weight: 400;
@@ -1134,8 +1134,8 @@ Resources:
1134
1134
  letter-spacing: -0.008px;
1135
1135
  text-align: left;
1136
1136
  transition: color 0.1s ease-in;
1137
- `,lc=vt.default.span`
1138
- ${IC}
1137
+ `,cc=vt.default.span`
1138
+ ${UC}
1139
1139
  transition: color 0.1s ease-in;
1140
1140
  color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1141
1141
  text-transform: ${({error:e})=>e?"":"capitalize"};
@@ -1143,7 +1143,7 @@ Resources:
1143
1143
  &[aria-hidden='true'] {
1144
1144
  visibility: hidden;
1145
1145
  }
1146
- `,Sn=vt.default.div`
1146
+ `,Pn=vt.default.div`
1147
1147
  display: flex;
1148
1148
  flex-direction: column;
1149
1149
  justify-content: center;
@@ -1154,7 +1154,7 @@ Resources:
1154
1154
  transition: none;
1155
1155
  }
1156
1156
  `}
1157
- `,yy=vt.css`
1157
+ `,vy=vt.css`
1158
1158
  && {
1159
1159
  width: 100%;
1160
1160
  border-width: 1px;
@@ -1169,8 +1169,8 @@ Resources:
1169
1169
  font-weight: 300;
1170
1170
  line-height: 22px; /* 137.5% */
1171
1171
  }
1172
- `,aa=vt.default.input`
1173
- ${yy}
1172
+ `,sa=vt.default.input`
1173
+ ${vy}
1174
1174
 
1175
1175
  &::placeholder {
1176
1176
  color: var(--privy-color-foreground-3);
@@ -1181,8 +1181,8 @@ Resources:
1181
1181
  overflow: hidden;
1182
1182
  text-overflow: ellipsis;
1183
1183
  white-space: nowrap;
1184
- `,gy=vt.default.div`
1185
- ${yy}
1184
+ `,Cy=vt.default.div`
1185
+ ${vy}
1186
1186
  `,An=vt.default.div`
1187
1187
  position: relative;
1188
1188
  width: 100%;
@@ -1211,12 +1211,12 @@ Resources:
1211
1211
  font-weight: 400;
1212
1212
  line-height: 20px;
1213
1213
  }
1214
- `,ns=vt.default.div`
1214
+ `,is=vt.default.div`
1215
1215
  display: flex;
1216
1216
  flex-direction: column;
1217
1217
  gap: 10px;
1218
1218
  padding-bottom: 1rem;
1219
- `,is=vt.default.div`
1219
+ `,as=vt.default.div`
1220
1220
  display: flex;
1221
1221
  text-align: left;
1222
1222
  align-items: center;
@@ -1236,13 +1236,13 @@ Resources:
1236
1236
  > :first-child {
1237
1237
  min-width: 24px;
1238
1238
  }
1239
- `,iA=vt.default.div`
1239
+ `,pA=vt.default.div`
1240
1240
  height: var(--privy-height-modal-full);
1241
1241
 
1242
1242
  @media (max-width: 440px) {
1243
1243
  height: var(--privy-height-modal-compact);
1244
1244
  }
1245
- `,ad=(0,vt.default)(Qa)`
1245
+ `,sd=(0,vt.default)(Ja)`
1246
1246
  display: flex;
1247
1247
  flex: 1;
1248
1248
  gap: 4px;
@@ -1254,7 +1254,7 @@ Resources:
1254
1254
  border-color: var(--privy-color-foreground-3);
1255
1255
  border-width: 1px;
1256
1256
  }
1257
- `,sa=vt.default.div`
1257
+ `,la=vt.default.div`
1258
1258
  position: absolute;
1259
1259
  right: 0.5rem;
1260
1260
 
@@ -1262,7 +1262,7 @@ Resources:
1262
1262
  flex-direction: row;
1263
1263
  justify-content: space-around;
1264
1264
  align-items: center;
1265
- `,vy=(0,vt.default)(my.default)`
1265
+ `,wy=(0,vt.default)(hy.default)`
1266
1266
  height: 1.25rem;
1267
1267
  width: 1.25rem;
1268
1268
  stroke: var(--privy-color-accent);
@@ -1271,7 +1271,7 @@ Resources:
1271
1271
  :active {
1272
1272
  stroke: var(--privy-color-accent-light);
1273
1273
  }
1274
- `,la=(0,vt.default)(hy.default)`
1274
+ `,ca=(0,vt.default)(gy.default)`
1275
1275
  height: 1.25rem;
1276
1276
  width: 1.25rem;
1277
1277
  stroke: var(--privy-color-accent);
@@ -1280,7 +1280,7 @@ Resources:
1280
1280
  :active {
1281
1281
  stroke: var(--privy-color-accent-light);
1282
1282
  }
1283
- `,ca=(0,vt.default)(fy.default)`
1283
+ `,pa=(0,vt.default)(yy.default)`
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
- `,Cy=vt.default.progress`
1292
+ `,by=vt.default.progress`
1293
1293
  height: 4px;
1294
1294
  width: 100%;
1295
1295
  margin: 8px 0;
@@ -1305,7 +1305,7 @@ Resources:
1305
1305
  transition: all 0.1s ease-out;
1306
1306
  background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1307
1307
  }
1308
- `;var Ct=require("react/jsx-runtime"),by=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[a,i]=(0,pa.useState)(!0),[s,l]=(0,pa.useState)(!1),[c,u]=(0,pa.useState)(""),h=r===c;return(0,pa.useEffect)(()=>{c&&!s&&l(!0)},[c]),(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsx)(_,{closeable:!1,backFn:n}),(0,Ct.jsx)(le,{}),(0,Ct.jsxs)(Sn,{children:[(0,Ct.jsxs)(xn,{children:[(0,Ct.jsx)(wy.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Ct.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,Ct.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,Ct.jsxs)(An,{children:[(0,Ct.jsx)(aa,{value:c,onChange:m=>u(m.target.value),onBlur:()=>l(!0),placeholder:"confirm your password",type:a?"password":"text",style:{paddingRight:"2.3rem"}}),(0,Ct.jsx)(sa,{style:{right:"0.75rem"},children:a?(0,Ct.jsx)(la,{onClick:()=>i(!1)}):(0,Ct.jsx)(ca,{onClick:()=>i(!0)})})]}),(0,Ct.jsx)(lc,{"aria-hidden":!s||h,error:!0,children:"Passwords do not match"})]}),(0,Ct.jsx)(_n,{onClick:o,loading:t,disabled:!h,hideAnimations:e,children:"Continue"}),(0,Ct.jsx)(ce,{}),(0,Ct.jsx)(j,{protectedByPrivy:!0})]})};var Sy=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),_y=require("react"),Ay=y(require("styled-components"));var da=y(require("styled-components")),kn=require("react/jsx-runtime"),Ey=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>(0,kn.jsx)("label",{children:(0,kn.jsxs)(WC,{className:e,children:[(0,kn.jsx)(Py,{checked:t,...o}),(0,kn.jsx)(MC,{color:r,checked:t,children:(0,kn.jsx)(Ty,{viewBox:"0 0 24 24",children:(0,kn.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})});var mA=da.default.label`
1308
+ `;var Ct=require("react/jsx-runtime"),Ty=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[a,i]=(0,da.useState)(!0),[s,l]=(0,da.useState)(!1),[c,u]=(0,da.useState)(""),h=r===c;return(0,da.useEffect)(()=>{c&&!s&&l(!0)},[c]),(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsx)(_,{closeable:!1,backFn:n}),(0,Ct.jsx)(le,{}),(0,Ct.jsxs)(Pn,{children:[(0,Ct.jsxs)(xn,{children:[(0,Ct.jsx)(Ey.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Ct.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,Ct.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,Ct.jsxs)(An,{children:[(0,Ct.jsx)(sa,{value:c,onChange:m=>u(m.target.value),onBlur:()=>l(!0),placeholder:"confirm your password",type:a?"password":"text",style:{paddingRight:"2.3rem"}}),(0,Ct.jsx)(la,{style:{right:"0.75rem"},children:a?(0,Ct.jsx)(ca,{onClick:()=>i(!1)}):(0,Ct.jsx)(pa,{onClick:()=>i(!0)})})]}),(0,Ct.jsx)(cc,{"aria-hidden":!s||h,error:!0,children:"Passwords do not match"})]}),(0,Ct.jsx)(_n,{onClick:o,loading:t,disabled:!h,hideAnimations:e,children:"Continue"}),(0,Ct.jsx)(ce,{}),(0,Ct.jsx)(j,{})]})};var Ay=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),xy=require("react"),ky=y(require("styled-components"));var ua=y(require("styled-components")),kn=require("react/jsx-runtime"),Sy=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>(0,kn.jsx)("label",{children:(0,kn.jsxs)(FC,{className:e,children:[(0,kn.jsx)(_y,{checked:t,...o}),(0,kn.jsx)(BC,{color:r,checked:t,children:(0,kn.jsx)(Py,{viewBox:"0 0 24 24",children:(0,kn.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})});var vA=ua.default.label`
1309
1309
  && {
1310
1310
  cursor: pointer;
1311
1311
  display: flex;
@@ -1317,14 +1317,14 @@ Resources:
1317
1317
  border: 1px solid var(--privy-color-foreground-4);
1318
1318
  width: 100%;
1319
1319
  }
1320
- `,WC=da.default.div`
1320
+ `,FC=ua.default.div`
1321
1321
  display: inline-block;
1322
1322
  vertical-align: middle;
1323
- `,Ty=da.default.svg`
1323
+ `,Py=ua.default.svg`
1324
1324
  fill: none;
1325
1325
  stroke: white;
1326
1326
  stroke-width: 3px;
1327
- `,Py=da.default.input.attrs({type:"checkbox"})`
1327
+ `,_y=ua.default.input.attrs({type:"checkbox"})`
1328
1328
  border: 0;
1329
1329
  clip: rect(0 0 0 0);
1330
1330
  clippath: inset(50%);
@@ -1335,7 +1335,7 @@ Resources:
1335
1335
  position: absolute;
1336
1336
  white-space: nowrap;
1337
1337
  width: 1px;
1338
- `,MC=da.default.div`
1338
+ `,BC=ua.default.div`
1339
1339
  display: inline-block;
1340
1340
  width: 18px;
1341
1341
  height: 18px;
@@ -1350,28 +1350,28 @@ Resources:
1350
1350
  border-width: 1px;
1351
1351
  }
1352
1352
 
1353
- ${Py}:focus + & {
1353
+ ${_y}:focus + & {
1354
1354
  box-shadow: 0 0 0 1px ${e=>e.color};
1355
1355
  }
1356
1356
 
1357
- ${Ty} {
1357
+ ${Py} {
1358
1358
  visibility: ${e=>e.checked?"visible":"hidden"};
1359
1359
  }
1360
- `;var ft=require("react/jsx-runtime"),xy=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[a,i]=(0,_y.useState)(!1);return(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(_,{closeable:!1,backFn:o}),(0,ft.jsx)(le,{}),(0,ft.jsxs)(Sn,{children:[(0,ft.jsxs)(xn,{children:[(0,ft.jsx)(Sy.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,ft.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,ft.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,ft.jsx)(ns,{children:(0,ft.jsxs)(is,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:s=>{s.preventDefault(),i(l=>!l)},children:[(0,ft.jsx)(Ey,{color:"var(--privy-color-error)",readOnly:!0,checked:a}),(0,ft.jsx)(ft.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),(0,ft.jsxs)(OC,{children:[n.initiatedBy==="user"&&(0,ft.jsx)(co,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,ft.jsx)(_n,{onClick:r,loading:t,hideAnimations:e,disabled:!a,children:"Set Password"})]}),(0,ft.jsx)(ce,{}),(0,ft.jsx)(j,{protectedByPrivy:!0})]})},OC=Ay.default.div`
1360
+ `;var ft=require("react/jsx-runtime"),Ry=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[a,i]=(0,xy.useState)(!1);return(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(_,{closeable:!1,backFn:o}),(0,ft.jsx)(le,{}),(0,ft.jsxs)(Pn,{children:[(0,ft.jsxs)(xn,{children:[(0,ft.jsx)(Ay.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,ft.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,ft.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,ft.jsx)(is,{children:(0,ft.jsxs)(as,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:s=>{s.preventDefault(),i(l=>!l)},children:[(0,ft.jsx)(Sy,{color:"var(--privy-color-error)",readOnly:!0,checked:a}),(0,ft.jsx)(ft.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),(0,ft.jsxs)(HC,{children:[n.initiatedBy==="user"&&(0,ft.jsx)(lo,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,ft.jsx)(_n,{onClick:r,loading:t,hideAnimations:e,disabled:!a,children:"Set Password"})]}),(0,ft.jsx)(ce,{}),(0,ft.jsx)(j,{})]})},HC=ky.default.div`
1361
1361
  display: flex;
1362
1362
  gap: 10px;
1363
- `;var Dy=y(require("@heroicons/react/24/outline/KeyIcon")),sd=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Xo=require("react"),ld=y(require("styled-components"));var ky=y(require("fast-password-entropy")),Ry=y(require("secure-password-utilities")),Iy=require("secure-password-utilities/wordlists"),LC=95,NC=8,DC=3,UC=.3,FC=/[a-z]/,BC=/[A-Z]/,HC=/[0-9]/,VC="a-zA-Z0-9",Wy="!@#$%^&*()\\-_+.",My=`${VC}${Wy}`,GC=new RegExp(`[${Wy}]`),qC=new RegExp(`[${My}]`),Oy=new RegExp(`^[${My}]{6,}$`),Ly=(e="")=>{let t=e.split("").filter(r=>!qC.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},cc=()=>Ry.generatePassphrase(4,Iy.DEFAULT_WORDLIST);function zC(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function $C(e){if(e.length<NC)return 0;let t=0;FC.test(e)&&(t+=1),BC.test(e)&&(t+=1),HC.test(e)&&(t+=1),GC.test(e)&&(t+=1);let r=t/DC;return Math.max(0,Math.min(1,r))}function KC(e=""){let t=$C(e),r=(0,ky.default)(e)/LC;return(t*UC+r)/2}function Ny(e=""){let t=KC(e);return{value:t,label:zC(t)}}var Ie=require("react/jsx-runtime"),Uy=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:a,onClose:i,onBack:s,onPasswordChange:l,onPasswordGenerate:c})=>{let[u,h]=(0,Xo.useState)(!1),[m,v]=(0,Xo.useState)(!1);(0,Xo.useEffect)(()=>{r&&!m&&v(!0)},[r]);let b=(0,Xo.useMemo)(()=>m?(r?.length||0)<6?"Password must be at least 6 characters":Oy.test(r||"")?null:`Invalid characters used ( ${Ly(r).join(" ")} )`:null,[r,m]),g=(0,Xo.useMemo)(()=>b?{value:0,label:"Weak"}:Ny(r),[r,b]),P=(0,Xo.useMemo)(()=>!!(!r?.length||b),[b,r]);return(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)(_,{onClose:i,closeable:o.initiatedBy==="user",backFn:s}),(0,Ie.jsx)(le,{}),(0,Ie.jsxs)(Sn,{children:[(0,Ie.jsxs)(xn,{children:[(0,Ie.jsx)(Dy.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ie.jsxs)("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),(0,Ie.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,Ie.jsxs)(An,{children:[(0,Ie.jsx)(aa,{value:r,onChange:A=>l(A.target.value),placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),(0,Ie.jsxs)(sa,{style:{width:"3.5rem"},children:[u?(0,Ie.jsx)(la,{onClick:()=>h(!1)}):(0,Ie.jsx)(ca,{onClick:()=>h(!0)}),(0,Ie.jsx)(vy,{onClick:c})]})]}),(0,Ie.jsx)(Cy,{value:g.value===0?.01:g.value,label:g.label}),(0,Ie.jsx)(lc,{error:!!b,children:b||`Password Strength: ${m?g.label:"--"}`}),(0,Ie.jsxs)(YC,{children:[(0,Ie.jsx)(jC,{children:(0,Ie.jsxs)(ns,{children:[(0,Ie.jsxs)(is,{children:[(0,Ie.jsx)(sd.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,Ie.jsxs)(is,{children:[(0,Ie.jsx)(sd.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),(0,Ie.jsx)(_n,{onClick:a,loading:t,disabled:P,hideAnimations:e,children:"Continue"})]})]}),(0,Ie.jsx)(ce,{}),(0,Ie.jsx)(j,{protectedByPrivy:!0})]})},jC=(0,ld.default)(ns)`
1363
+ `;var Fy=y(require("@heroicons/react/24/outline/KeyIcon")),ld=y(require("@heroicons/react/24/solid/CheckCircleIcon")),en=require("react"),cd=y(require("styled-components"));var Iy=y(require("fast-password-entropy")),Wy=y(require("secure-password-utilities")),My=require("secure-password-utilities/wordlists"),VC=95,GC=8,qC=3,zC=.3,$C=/[a-z]/,KC=/[A-Z]/,jC=/[0-9]/,YC="a-zA-Z0-9",Oy="!@#$%^&*()\\-_+.",Ly=`${YC}${Oy}`,ZC=new RegExp(`[${Oy}]`),QC=new RegExp(`[${Ly}]`),Ny=new RegExp(`^[${Ly}]{6,}$`),Dy=(e="")=>{let t=e.split("").filter(r=>!QC.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},pc=()=>Wy.generatePassphrase(4,My.DEFAULT_WORDLIST);function JC(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function XC(e){if(e.length<GC)return 0;let t=0;$C.test(e)&&(t+=1),KC.test(e)&&(t+=1),jC.test(e)&&(t+=1),ZC.test(e)&&(t+=1);let r=t/qC;return Math.max(0,Math.min(1,r))}function ew(e=""){let t=XC(e),r=(0,Iy.default)(e)/VC;return(t*zC+r)/2}function Uy(e=""){let t=ew(e);return{value:t,label:JC(t)}}var Re=require("react/jsx-runtime"),By=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:a,onClose:i,onBack:s,onPasswordChange:l,onPasswordGenerate:c})=>{let[u,h]=(0,en.useState)(!1),[m,v]=(0,en.useState)(!1);(0,en.useEffect)(()=>{r&&!m&&v(!0)},[r]);let b=(0,en.useMemo)(()=>m?(r?.length||0)<6?"Password must be at least 6 characters":Ny.test(r||"")?null:`Invalid characters used ( ${Dy(r).join(" ")} )`:null,[r,m]),g=(0,en.useMemo)(()=>b?{value:0,label:"Weak"}:Uy(r),[r,b]),S=(0,en.useMemo)(()=>!!(!r?.length||b),[b,r]);return(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(_,{onClose:i,closeable:o.initiatedBy==="user",backFn:s}),(0,Re.jsx)(le,{}),(0,Re.jsxs)(Pn,{children:[(0,Re.jsxs)(xn,{children:[(0,Re.jsx)(Fy.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Re.jsxs)("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),(0,Re.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,Re.jsxs)(An,{children:[(0,Re.jsx)(sa,{value:r,onChange:A=>l(A.target.value),placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),(0,Re.jsxs)(la,{style:{width:"3.5rem"},children:[u?(0,Re.jsx)(ca,{onClick:()=>h(!1)}):(0,Re.jsx)(pa,{onClick:()=>h(!0)}),(0,Re.jsx)(wy,{onClick:c})]})]}),(0,Re.jsx)(by,{value:g.value===0?.01:g.value,label:g.label}),(0,Re.jsx)(cc,{error:!!b,children:b||`Password Strength: ${m?g.label:"--"}`}),(0,Re.jsxs)(rw,{children:[(0,Re.jsx)(tw,{children:(0,Re.jsxs)(is,{children:[(0,Re.jsxs)(as,{children:[(0,Re.jsx)(ld.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,Re.jsxs)(as,{children:[(0,Re.jsx)(ld.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),(0,Re.jsx)(_n,{onClick:a,loading:t,disabled:S,hideAnimations:e,children:"Continue"})]})]}),(0,Re.jsx)(ce,{}),(0,Re.jsx)(j,{})]})},tw=(0,cd.default)(is)`
1364
1364
  flex: 1;
1365
1365
  padding-top: 1rem;
1366
- `,YC=ld.default.div`
1366
+ `,rw=cd.default.div`
1367
1367
  display: flex;
1368
1368
  flex-direction: column;
1369
1369
  height: 100%;
1370
- `;var Fy=y(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),By=y(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),Hy=y(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),Vy=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),as=require("react");var ze=require("react/jsx-runtime"),Gy=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:a})=>{let[i,s]=(0,as.useState)(!1),l=(0,as.useCallback)(()=>{s(!0),o&&navigator.clipboard.writeText(o)},[o]),c=(0,as.useCallback)(()=>{let u=document.createElement("a"),h=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),m=new Blob([ZC(r,o)],{type:"text/plain"}),v=URL.createObjectURL(m);u.href=v,u.target="_blank",u.download=`${h}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(v)},5e3)},[o]);return(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(_,{backFn:a,closeable:!1}),(0,ze.jsx)(le,{}),(0,ze.jsxs)(Sn,{children:[(0,ze.jsxs)(xn,{children:[(0,ze.jsx)(Vy.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,ze.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,ze.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),(0,ze.jsx)(An,{centered:!0,children:(0,ze.jsx)(gy,{children:o})}),(0,ze.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,ze.jsx)(ad,{onClick:l,children:i?(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(By.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(Hy.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,ze.jsxs)(ad,{onClick:c,children:[(0,ze.jsx)(Fy.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,ze.jsx)(_n,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,ze.jsx)(ce,{}),(0,ze.jsx)(j,{protectedByPrivy:!0})]})},ZC=(e,t)=>`Your wallet recovery password for ${e} is
1370
+ `;var Hy=y(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),Vy=y(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),Gy=y(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),qy=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ss=require("react");var qe=require("react/jsx-runtime"),zy=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:a})=>{let[i,s]=(0,ss.useState)(!1),l=(0,ss.useCallback)(()=>{s(!0),o&&navigator.clipboard.writeText(o)},[o]),c=(0,ss.useCallback)(()=>{let u=document.createElement("a"),h=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),m=new Blob([ow(r,o)],{type:"text/plain"}),v=URL.createObjectURL(m);u.href=v,u.target="_blank",u.download=`${h}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(v)},5e3)},[o]);return(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(_,{backFn:a,closeable:!1}),(0,qe.jsx)(le,{}),(0,qe.jsxs)(Pn,{children:[(0,qe.jsxs)(xn,{children:[(0,qe.jsx)(qy.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,qe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,qe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),(0,qe.jsx)(An,{centered:!0,children:(0,qe.jsx)(Cy,{children:o})}),(0,qe.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,qe.jsx)(sd,{onClick:l,children:i?(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Vy.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Gy.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,qe.jsxs)(sd,{onClick:c,children:[(0,qe.jsx)(Hy.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,qe.jsx)(_n,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,qe.jsx)(ce,{}),(0,qe.jsx)(j,{})]})},ow=(e,t)=>`Your wallet recovery password for ${e} is
1371
1371
 
1372
1372
  ${t}
1373
1373
 
1374
- You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var qy=y(require("@heroicons/react/24/solid/CheckCircleIcon")),zy=y(require("@heroicons/react/24/solid/XCircleIcon"));var er=require("react/jsx-runtime"),$y=({error:e,onClose:t})=>(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(_,{closeable:!1}),(0,er.jsx)(le,{}),e?(0,er.jsxs)(fo,{children:[(0,er.jsx)(zy.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,er.jsx)(Ge,{title:"Something went wrong",description:e})]}):(0,er.jsxs)(fo,{children:[(0,er.jsx)(qy.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,er.jsx)(Ge,{title:"Success"})]}),(0,er.jsx)(F,{onClick:t,children:"Close"}),(0,er.jsx)(ce,{}),(0,er.jsx)(j,{protectedByPrivy:!0})]});var Ky=require("react"),QC=(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}},jy=()=>{let[e,t]=(0,Ky.useReducer)(QC,"creating");return{send:t,state:e}};var ua=require("react/jsx-runtime"),pc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=k(),{send:n,state:a}=jy(),i=(0,ma.useCallback)(async()=>{a==="finalizing"&&await e(),n("next")},[a,n,e]);(0,ma.useEffect)(()=>{let c;return a==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),et)),()=>{c&&clearTimeout(c)}},[a,t.config.initiatedBy,t.onClose]);let s=(0,ma.useCallback)(()=>{n("back")},[n]),l=(0,ma.useCallback)(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return a==="creating"?(0,ua.jsx)(Uy,{...t,onSubmit:i,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?l:void 0}):a==="saving"?(0,ua.jsx)(Gy,{...t,onSubmit:i,onBack:s}):a==="confirming"?(0,ua.jsx)(by,{...t,onSubmit:i,onBack:s}):a==="finalizing"?(0,ua.jsx)(xy,{...t,onSubmit:i,onBack:s}):a==="done"?(0,ua.jsx)($y,{...t,onSubmit:i}):null};var Zy=require("react/jsx-runtime"),Yy=()=>{let[e,t]=(0,pi.useState)(null),[r,o]=(0,pi.useState)(!1),[n,a]=(0,pi.useState)(null),[i,s]=(0,pi.useState)(""),{authenticated:l,getAccessToken:c,user:u}=G(),{walletProxy:h,refreshUser:m,closePrivyModal:v,createAnalyticsEvent:b}=R(),{app:g,navigate:P,data:A,onUserCloseViaDialogOrKeybindRef:E}=k(),{onSuccess:S,onFailure:W}=A.createWallet,D=Oe(u),M=e?.recoveryMethod==="user-passcode",I=D?.recoveryMethod==="user-passcode";(0,pi.useEffect)(()=>{l||(P("LANDING"),W(new Gs("User must be authenticated before setting a password on a Privy wallet")))},[l]);let H=()=>{if(n){W(n),v({shouldCallAuthOnSuccess:!1});return}if(!M){W(new nr("Exited before password was added to wallet")),v({shouldCallAuthOnSuccess:!1});return}S(e),v({shouldCallAuthOnSuccess:!1})};E.current=H;let $=async()=>{let O=await c();if(O&&D?.address&&i&&h)try{if(b({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:I}}),!(await h.setRecovery({accessToken:O,address:D.address,recoveryPassword:i,recoveryMethod:"user-passcode"})).address){a(new nr("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:I,reason:"error setting password"}});return}let N=await m(),nt=Oe(N);if(!nt){a(new nr("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:I,reason:"wallet disconnected"}});return}t(nt),b({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:I}})}catch(K){console.warn(K),a(K instanceof Error?K:new Error("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:K}})}},J=async()=>{M?(S(e),v({shouldCallAuthOnSuccess:!1})):(o(!0),a(null),await $(),o(!1))};return(0,Zy.jsx)(pc,{appName:g?.name||"privy",config:{initiatedBy:"user",onCancel:H},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:i,isResettingPassword:I,onPasswordGenerate:()=>s(cc()),onPasswordChange:s,onSubmit:J,onClose:H})};var Qy=y(require("@heroicons/react/24/outline/UserCircleIcon")),Jy=y(require("@heroicons/react/24/solid/LockClosedIcon"));var zt=require("react/jsx-runtime"),Xy=()=>{let{closePrivyModal:e}=R(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{onSuccess:a,onFailure:i}=t.setWalletPassword,s=()=>{i(new nr("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=s,(0,zt.jsxs)(zt.Fragment,{children:[(0,zt.jsx)(_,{onClose:s}),(0,zt.jsx)(le,{}),(0,zt.jsxs)(fo,{children:[(0,zt.jsxs)(lh,{children:[(0,zt.jsx)(Qy.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,zt.jsx)(ch,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,zt.jsx)(Jy.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,zt.jsxs)(Ge,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,zt.jsx)("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),(0,zt.jsx)(F,{onClick:()=>{r({createWallet:{onFailure:i,onSuccess:a,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,zt.jsx)(ce,{}),(0,zt.jsx)(j,{protectedByPrivy:!0})]})};var eg=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),tg=y(require("@heroicons/react/24/outline/PhoneIcon")),cd=y(require("styled-components"));var Tt=require("react/jsx-runtime"),JC=e=>{let t=(0,Tt.jsx)(eg.default,{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:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof qe&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,Tt.jsx)(tg.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof yt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,Tt.jsx)(Jl,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,Tt.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,Tt.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:t};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof or&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},rg=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=k();return(0,Tt.jsx)(ss,{error:r?.errorModalData?.error||new Error,backFn:!o||n===o?void 0:t,onClick:()=>e(o||"LANDING",!1)})},ss=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Se(),n=JC(e),a=()=>{e instanceof yt&&e.privyErrorCode==="invalid_captcha"&&o(),r?.()};return(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)(_,{backFn:t}),(0,Tt.jsxs)(XC,{children:[(0,Tt.jsx)(ut,{children:(0,Tt.jsxs)("div",{children:[(0,Tt.jsx)(Ql,{color:"var(--privy-color-error)"}),n.icon]})}),(0,Tt.jsxs)(ew,{children:[(0,Tt.jsx)("h3",{children:n.title}),(0,Tt.jsx)("p",{children:n.detail})]}),(0,Tt.jsx)(F,{color:"var(--privy-color-error)",onClick:a,children:n.ctaText})]})]})},XC=cd.default.div`
1374
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var $y=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Ky=y(require("@heroicons/react/24/solid/XCircleIcon"));var tr=require("react/jsx-runtime"),jy=({error:e,onClose:t})=>(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(_,{closeable:!1}),(0,tr.jsx)(le,{}),e?(0,tr.jsxs)(mo,{children:[(0,tr.jsx)(Ky.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,tr.jsx)(Ve,{title:"Something went wrong",description:e})]}):(0,tr.jsxs)(mo,{children:[(0,tr.jsx)($y.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,tr.jsx)(Ve,{title:"Success"})]}),(0,tr.jsx)(F,{onClick:t,children:"Close"}),(0,tr.jsx)(ce,{}),(0,tr.jsx)(j,{})]});var Yy=require("react"),nw=(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}},Zy=()=>{let[e,t]=(0,Yy.useReducer)(nw,"creating");return{send:t,state:e}};var ma=require("react/jsx-runtime"),dc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=k(),{send:n,state:a}=Zy(),i=(0,fa.useCallback)(async()=>{a==="finalizing"&&await e(),n("next")},[a,n,e]);(0,fa.useEffect)(()=>{let c;return a==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),et)),()=>{c&&clearTimeout(c)}},[a,t.config.initiatedBy,t.onClose]);let s=(0,fa.useCallback)(()=>{n("back")},[n]),l=(0,fa.useCallback)(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return a==="creating"?(0,ma.jsx)(By,{...t,onSubmit:i,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?l:void 0}):a==="saving"?(0,ma.jsx)(zy,{...t,onSubmit:i,onBack:s}):a==="confirming"?(0,ma.jsx)(Ty,{...t,onSubmit:i,onBack:s}):a==="finalizing"?(0,ma.jsx)(Ry,{...t,onSubmit:i,onBack:s}):a==="done"?(0,ma.jsx)(jy,{...t,onSubmit:i}):null};var Jy=require("react/jsx-runtime"),Qy=()=>{let[e,t]=(0,ci.useState)(null),[r,o]=(0,ci.useState)(!1),[n,a]=(0,ci.useState)(null),[i,s]=(0,ci.useState)(""),{authenticated:l,getAccessToken:c,user:u}=G(),{walletProxy:h,refreshUser:m,closePrivyModal:v,createAnalyticsEvent:b}=R(),{app:g,navigate:S,data:A,onUserCloseViaDialogOrKeybindRef:E}=k(),{onSuccess:P,onFailure:W}=A.createWallet,D=Me(u),M=e?.recoveryMethod==="user-passcode",I=D?.recoveryMethod==="user-passcode";(0,ci.useEffect)(()=>{l||(S("LANDING"),W(new qs("User must be authenticated before setting a password on a Privy wallet")))},[l]);let H=()=>{if(n){W(n),v({shouldCallAuthOnSuccess:!1});return}if(!M){W(new ir("Exited before password was added to wallet")),v({shouldCallAuthOnSuccess:!1});return}P(e),v({shouldCallAuthOnSuccess:!1})};E.current=H;let $=async()=>{let O=await c();if(O&&D?.address&&i&&h)try{if(b({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:I}}),!(await h.setRecovery({accessToken:O,address:D.address,recoveryPassword:i,recoveryMethod:"user-passcode"})).address){a(new ir("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:I,reason:"error setting password"}});return}let N=await m(),nt=Me(N);if(!nt){a(new ir("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:I,reason:"wallet disconnected"}});return}t(nt),b({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:I}})}catch(K){console.warn(K),a(K instanceof Error?K:new Error("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:K}})}},J=async()=>{M?(P(e),v({shouldCallAuthOnSuccess:!1})):(o(!0),a(null),await $(),o(!1))};return(0,Jy.jsx)(dc,{appName:g?.name||"privy",config:{initiatedBy:"user",onCancel:H},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:i,isResettingPassword:I,onPasswordGenerate:()=>s(pc()),onPasswordChange:s,onSubmit:J,onClose:H})};var Xy=y(require("@heroicons/react/24/outline/UserCircleIcon")),eg=y(require("@heroicons/react/24/solid/LockClosedIcon"));var $t=require("react/jsx-runtime"),tg=()=>{let{closePrivyModal:e}=R(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{onSuccess:a,onFailure:i}=t.setWalletPassword,s=()=>{i(new ir("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=s,(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)(_,{onClose:s}),(0,$t.jsx)(le,{}),(0,$t.jsxs)(mo,{children:[(0,$t.jsxs)(ph,{children:[(0,$t.jsx)(Xy.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,$t.jsx)(dh,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,$t.jsx)(eg.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,$t.jsxs)(Ve,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,$t.jsx)("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),(0,$t.jsx)(F,{onClick:()=>{r({createWallet:{onFailure:i,onSuccess:a,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,$t.jsx)(ce,{}),(0,$t.jsx)(j,{})]})};var rg=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),og=y(require("@heroicons/react/24/outline/PhoneIcon")),pd=y(require("styled-components"));var Tt=require("react/jsx-runtime"),iw=e=>{let t=(0,Tt.jsx)(rg.default,{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:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof Ge&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,Tt.jsx)(og.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof yt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,Tt.jsx)(Xl,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,Tt.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,Tt.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:t};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof nr&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},ng=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=k();return(0,Tt.jsx)(ls,{error:r?.errorModalData?.error||new Error,backFn:!o||n===o?void 0:t,onClick:()=>e(o||"LANDING",!1)})},ls=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Pe(),n=iw(e),a=()=>{e instanceof yt&&e.privyErrorCode==="invalid_captcha"&&o(),r?.()};return(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)(_,{backFn:t}),(0,Tt.jsxs)(aw,{children:[(0,Tt.jsx)(ut,{children:(0,Tt.jsxs)("div",{children:[(0,Tt.jsx)(Jl,{color:"var(--privy-color-error)"}),n.icon]})}),(0,Tt.jsxs)(sw,{children:[(0,Tt.jsx)("h3",{children:n.title}),(0,Tt.jsx)("p",{children:n.detail})]}),(0,Tt.jsx)(F,{color:"var(--privy-color-error)",onClick:a,children:n.ctaText})]})]})},aw=pd.default.div`
1375
1375
  display: flex;
1376
1376
  flex-direction: column;
1377
1377
  align-items: center;
@@ -1379,11 +1379,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1379
1379
  gap: 24px;
1380
1380
  width: 100%;
1381
1381
  padding-bottom: 16px;
1382
- `,ew=cd.default.div`
1382
+ `,sw=pd.default.div`
1383
1383
  display: flex;
1384
1384
  flex-direction: column;
1385
1385
  gap: 8px;
1386
- `;var en=require("react"),cs=require("react-device-detect"),md=y(require("styled-components"));var ng=require("react"),ig=y(require("styled-components"));var pd=require("react/jsx-runtime"),dc=({style:e,color:t,...r})=>(0,pd.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:(0,pd.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var uc=require("react/jsx-runtime"),og=({color:e,...t})=>(0,uc.jsx)("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:(0,uc.jsx)("g",{children:(0,uc.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});var ls=require("react/jsx-runtime"),Rn=e=>{let[t,r]=(0,ng.useState)(!1);return(0,ls.jsxs)(tw,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,ls.jsx)(dc,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,ls.jsx)(og,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},tw=ig.default.button`
1386
+ `;var tn=require("react"),ps=require("react-device-detect"),fd=y(require("styled-components"));var ag=require("react"),sg=y(require("styled-components"));var dd=require("react/jsx-runtime"),uc=({style:e,color:t,...r})=>(0,dd.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:(0,dd.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var mc=require("react/jsx-runtime"),ig=({color:e,...t})=>(0,mc.jsx)("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:(0,mc.jsx)("g",{children:(0,mc.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});var cs=require("react/jsx-runtime"),Rn=e=>{let[t,r]=(0,ag.useState)(!1);return(0,cs.jsxs)(lw,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,cs.jsx)(uc,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,cs.jsx)(ig,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},lw=sg.default.button`
1387
1387
  display: flex;
1388
1388
  align-items: center;
1389
1389
  gap: 6px;
@@ -1421,7 +1421,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1421
1421
  width: 14px;
1422
1422
  height: 14px;
1423
1423
  }
1424
- `;var ag=require("react"),sg=y(require("styled-components")),lg=require("react/jsx-runtime"),mc=e=>{let[t,r]=(0,ag.useState)(!1);return(0,lg.jsx)(rw,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},rw=sg.default.a`
1424
+ `;var lg=require("react"),cg=y(require("styled-components")),pg=require("react/jsx-runtime"),fc=e=>{let[t,r]=(0,lg.useState)(!1);return(0,pg.jsx)(cw,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},cw=cg.default.a`
1425
1425
  display: flex;
1426
1426
  align-items: center;
1427
1427
  gap: 6px;
@@ -1459,7 +1459,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1459
1459
  width: 14px;
1460
1460
  height: 14px;
1461
1461
  }
1462
- `;var pg=y(require("qrcode")),dg=y(require("react")),ug=y(require("styled-components"));var dd=require("react/jsx-runtime"),cg=()=>(0,dd.jsx)("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:(0,dd.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var tt=require("react/jsx-runtime"),Wr=7,ud=(e,t,r,o,n)=>{for(let a=t;a<t+o;a++)for(let i=r;i<r+n;i++){let s=e?.[i];s&&s[a]&&(s[a]=0)}return e},ow=e=>{let t=pg.default.create(e,{errorCorrectionLevel:"high"}).modules,r=$u(Array.from(t.data),t.size);return r=ud(r,0,0,Wr,Wr),r=ud(r,r.length-Wr,0,Wr,Wr),r=ud(r,0,r.length-Wr,Wr,Wr),r},nw=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>(0,tt.jsx)(tt.Fragment,{children:[0,1,2].map(a=>(0,tt.jsx)("circle",{r:r*(Wr-a*2)/2,cx:e+r*Wr/2,cy:t+r*Wr/2,fill:a%2!==0?o:n},`finder-${e}-${t}-${a}`))}),iw=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Wr)*e,0],[0,(t-Wr)*e]];return(0,tt.jsx)(tt.Fragment,{children:n.map(([a,i])=>(0,tt.jsx)(nw,{x:a,y:i,cellSize:e,bgColor:r,fgColor:o},`finder-${a}-${i}`))})},aw=({matrix:e,cellSize:t,color:r})=>(0,tt.jsx)(tt.Fragment,{children:e.map((a,i)=>a.map((s,l)=>s?(0,tt.jsx)("rect",{height:t-.2*2,width:t-.2*2,x:i*t+t*(.2/2),y:l*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${i}-${l}`):(0,tt.jsx)(dg.default.Fragment,{},`circle-${i}-${l}`)))}),sw=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return(0,tt.jsx)(tt.Fragment,{});let a=t*(o||.15),i=Math.floor(t/2-a/2),s=Math.floor(t/2+a/2);(s-i)%2!==t%2&&(s+=1);let l=(s-i)*e,c=.1,u=l-l*c*2,h=r,m=i*e;return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)("rect",{x:i*e,y:i*e,width:l,height:l,fill:n}),(0,tt.jsx)(h,{x:m+l*c,y:m+l*c,height:u,width:u})]})},lw=e=>{let t=e.outputSize,r=ow(e.url),o=t/r.length;return(0,tt.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,tt.jsx)(aw,{matrix:r,cellSize:o,color:e.fgColor}),(0,tt.jsx)(iw,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,tt.jsx)(sw,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},cw=ug.default.div`
1462
+ `;var ug=y(require("qrcode")),mg=y(require("react")),fg=y(require("styled-components"));var ud=require("react/jsx-runtime"),dg=()=>(0,ud.jsx)("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:(0,ud.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var tt=require("react/jsx-runtime"),Ir=7,md=(e,t,r,o,n)=>{for(let a=t;a<t+o;a++)for(let i=r;i<r+n;i++){let s=e?.[i];s&&s[a]&&(s[a]=0)}return e},pw=e=>{let t=ug.default.create(e,{errorCorrectionLevel:"high"}).modules,r=ju(Array.from(t.data),t.size);return r=md(r,0,0,Ir,Ir),r=md(r,r.length-Ir,0,Ir,Ir),r=md(r,0,r.length-Ir,Ir,Ir),r},dw=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>(0,tt.jsx)(tt.Fragment,{children:[0,1,2].map(a=>(0,tt.jsx)("circle",{r:r*(Ir-a*2)/2,cx:e+r*Ir/2,cy:t+r*Ir/2,fill:a%2!==0?o:n},`finder-${e}-${t}-${a}`))}),uw=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Ir)*e,0],[0,(t-Ir)*e]];return(0,tt.jsx)(tt.Fragment,{children:n.map(([a,i])=>(0,tt.jsx)(dw,{x:a,y:i,cellSize:e,bgColor:r,fgColor:o},`finder-${a}-${i}`))})},mw=({matrix:e,cellSize:t,color:r})=>(0,tt.jsx)(tt.Fragment,{children:e.map((a,i)=>a.map((s,l)=>s?(0,tt.jsx)("rect",{height:t-.2*2,width:t-.2*2,x:i*t+t*(.2/2),y:l*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${i}-${l}`):(0,tt.jsx)(mg.default.Fragment,{},`circle-${i}-${l}`)))}),fw=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return(0,tt.jsx)(tt.Fragment,{});let a=t*(o||.15),i=Math.floor(t/2-a/2),s=Math.floor(t/2+a/2);(s-i)%2!==t%2&&(s+=1);let l=(s-i)*e,c=.1,u=l-l*c*2,h=r,m=i*e;return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)("rect",{x:i*e,y:i*e,width:l,height:l,fill:n}),(0,tt.jsx)(h,{x:m+l*c,y:m+l*c,height:u,width:u})]})},hw=e=>{let t=e.outputSize,r=pw(e.url),o=t/r.length;return(0,tt.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,tt.jsx)(mw,{matrix:r,cellSize:o,color:e.fgColor}),(0,tt.jsx)(uw,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,tt.jsx)(fw,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},yw=fg.default.div`
1463
1463
  display: flex;
1464
1464
  justify-content: center;
1465
1465
  align-items: center;
@@ -1474,7 +1474,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1474
1474
  border-color: ${e=>e.borderColor};
1475
1475
  border-radius: var(--privy-border-radius-md);
1476
1476
  }
1477
- `,fa=e=>{let{appearance:t}=Wt(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,a=t.palette.colorScheme==="dark"?r:o;return(0,tt.jsx)(cw,{size:n,bgColor:r,fgColor:o,borderColor:a,children:(0,tt.jsx)(lw,{url:e.url,logo:{element:e.squareLogoElement??cg},outputSize:n,bgColor:r,fgColor:o})})};var di=require("react/jsx-runtime"),Mo=({style:e,...t})=>(0,di.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,di.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,di.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,di.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,di.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var ae=require("react/jsx-runtime"),mg="#8a63d2",hg=1e3,pw=hg*2,dw=hg*120,yg=()=>{let{authenticated:e,logout:t,ready:r,user:o}=G(),{lastScreen:n,navigate:a,navigateBack:i,setModalData:s,app:l}=k(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:h,createAnalyticsEvent:m}=R(),[v,b]=(0,en.useState)(void 0),[g,P]=(0,en.useState)(!1),[A,E]=(0,en.useState)(!1),S=(0,en.useRef)([]),W=et,D=c(),M=D?.meta.connectUri;return(0,en.useEffect)(()=>{let I=Date.now(),H=setInterval(async()=>{let $=await D.pollForReady.execute(),J=Date.now()-I;if($){clearInterval(H),P(!0);try{await u(),E(!0)}catch(O){let K={retryable:!1,message:"Authentication failed"};if(O?.privyErrorCode==="allowlist_rejected"){a("ALLOWLIST_REJECTION_SCREEN");return}else if(O?.privyErrorCode==="max_accounts_reached"){console.error(new Hr(O).toString()),a("USER_LIMIT_REACHED_SCREEN");return}else if(O?.privyErrorCode==="user_does_not_exist"){a("ACCOUNT_NOT_FOUND_SCREEN");return}else O?.privyErrorCode==="linked_to_another_user"?K.detail="This account has already been linked to another user.":O?.privyErrorCode==="invalid_credentials"?(K.retryable=!0,K.detail="Something went wrong. Try again."):O?.privyErrorCode==="too_many_requests"&&(K.detail="Too many requests. Please wait before trying again.");b(K)}}else J>dw&&(clearInterval(H),b({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},pw);return()=>{clearInterval(H),S.current.forEach($=>clearTimeout($))}},[]),(0,en.useEffect)(()=>{if(r&&e&&A&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},W);return()=>clearTimeout(H)}A&&(hr(o,l?.embeddedWallets.createOnLogin)?S.current.push(setTimeout(()=>{s({createWallet:{onSuccess:()=>{},onFailure:H=>{console.error(H),m({eventName:"embedded_wallet_creation_failure_logout",payload:{error:H,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},W)):S.current.push(setTimeout(()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0}),W)))}},[A,r,e,o]),cs.isMobile||g?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(_,{backFn:n?i:void 0,onClose:h},"header"),(0,ae.jsx)(le,{}),cs.isIOS?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)(uw,{children:[(0,ae.jsx)(ut,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(wt,{success:A,fail:!!v}),(0,ae.jsx)(Mo,{style:{width:"38px",height:"38px"}})]})}),(0,ae.jsxs)(mt,{children:[(0,ae.jsx)(Ce,{children:v?v.message:"Sign in with Farcaster"}),(0,ae.jsx)(Ee,{children:v?v.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&(0,ae.jsx)(F,{onClick:I=>{I.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)(fg,{children:[(0,ae.jsx)(ut,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(wt,{success:A,fail:!!v}),(0,ae.jsx)(Mo,{style:{width:"38px",height:"38px"}})]})}),(0,ae.jsxs)(mt,{children:[(0,ae.jsx)(Ce,{children:v?v.message:"Signing in with Farcaster"}),(0,ae.jsx)(Ee,{children:v?v.detail:"This should only take a moment"}),(0,ae.jsx)(sr,{children:M&&cs.isMobile&&(0,ae.jsx)(mc,{text:"Take me to Warpcast",url:M,color:mg})})]})]})}),(0,ae.jsx)(Y,{})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(_,{backFn:n?i:void 0,onClose:h},"header"),(0,ae.jsx)(le,{}),(0,ae.jsx)(fg,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(Ce,{children:"Sign in with Farcaster"}),(0,ae.jsx)(Ee,{children:"Scan with your phone's camera to continue."}),(0,ae.jsx)(Zi,{children:M?(0,ae.jsx)(fa,{url:M,size:275,squareLogoElement:Mo}):(0,ae.jsx)(Mt,{})}),(0,ae.jsxs)(sr,{children:[(0,ae.jsx)(Ee,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&(0,ae.jsx)(Rn,{text:M,itemName:"link",color:mg})]})]})}),(0,ae.jsx)(Y,{})]})},fg=md.default.div`
1477
+ `,ha=e=>{let{appearance:t}=Mt(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,a=t.palette.colorScheme==="dark"?r:o;return(0,tt.jsx)(yw,{size:n,bgColor:r,fgColor:o,borderColor:a,children:(0,tt.jsx)(hw,{url:e.url,logo:{element:e.squareLogoElement??dg},outputSize:n,bgColor:r,fgColor:o})})};var pi=require("react/jsx-runtime"),Mo=({style:e,...t})=>(0,pi.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,pi.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,pi.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,pi.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,pi.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var ae=require("react/jsx-runtime"),hg="#8a63d2",gg=1e3,gw=gg*2,vw=gg*120,vg=()=>{let{authenticated:e,logout:t,ready:r,user:o}=G(),{lastScreen:n,navigate:a,navigateBack:i,setModalData:s,app:l}=k(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:h,createAnalyticsEvent:m}=R(),[v,b]=(0,tn.useState)(void 0),[g,S]=(0,tn.useState)(!1),[A,E]=(0,tn.useState)(!1),P=(0,tn.useRef)([]),W=et,D=c(),M=D?.meta.connectUri;return(0,tn.useEffect)(()=>{let I=Date.now(),H=setInterval(async()=>{let $=await D.pollForReady.execute(),J=Date.now()-I;if($){clearInterval(H),S(!0);try{await u(),E(!0)}catch(O){let K={retryable:!1,message:"Authentication failed"};if(O?.privyErrorCode==="allowlist_rejected"){a("ALLOWLIST_REJECTION_SCREEN");return}else if(O?.privyErrorCode==="max_accounts_reached"){console.error(new Br(O).toString()),a("USER_LIMIT_REACHED_SCREEN");return}else if(O?.privyErrorCode==="user_does_not_exist"){a("ACCOUNT_NOT_FOUND_SCREEN");return}else O?.privyErrorCode==="linked_to_another_user"?K.detail="This account has already been linked to another user.":O?.privyErrorCode==="invalid_credentials"?(K.retryable=!0,K.detail="Something went wrong. Try again."):O?.privyErrorCode==="too_many_requests"&&(K.detail="Too many requests. Please wait before trying again.");b(K)}}else J>vw&&(clearInterval(H),b({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},gw);return()=>{clearInterval(H),P.current.forEach($=>clearTimeout($))}},[]),(0,tn.useEffect)(()=>{if(r&&e&&A&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},W);return()=>clearTimeout(H)}A&&(hr(o,l?.embeddedWallets.createOnLogin)?P.current.push(setTimeout(()=>{s({createWallet:{onSuccess:()=>{},onFailure:H=>{console.error(H),m({eventName:"embedded_wallet_creation_failure_logout",payload:{error:H,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},W)):P.current.push(setTimeout(()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0}),W)))}},[A,r,e,o]),ps.isMobile||g?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(_,{backFn:n?i:void 0,onClose:h},"header"),(0,ae.jsx)(le,{}),ps.isIOS?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)(Cw,{children:[(0,ae.jsx)(ut,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(wt,{success:A,fail:!!v}),(0,ae.jsx)(Mo,{style:{width:"38px",height:"38px"}})]})}),(0,ae.jsxs)(mt,{children:[(0,ae.jsx)(we,{children:v?v.message:"Sign in with Farcaster"}),(0,ae.jsx)(Ee,{children:v?v.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&(0,ae.jsx)(F,{onClick:I=>{I.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)(yg,{children:[(0,ae.jsx)(ut,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(wt,{success:A,fail:!!v}),(0,ae.jsx)(Mo,{style:{width:"38px",height:"38px"}})]})}),(0,ae.jsxs)(mt,{children:[(0,ae.jsx)(we,{children:v?v.message:"Signing in with Farcaster"}),(0,ae.jsx)(Ee,{children:v?v.detail:"This should only take a moment"}),(0,ae.jsx)(lr,{children:M&&ps.isMobile&&(0,ae.jsx)(fc,{text:"Take me to Warpcast",url:M,color:hg})})]})]})}),(0,ae.jsx)(Y,{})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(_,{backFn:n?i:void 0,onClose:h},"header"),(0,ae.jsx)(le,{}),(0,ae.jsx)(yg,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(we,{children:"Sign in with Farcaster"}),(0,ae.jsx)(Ee,{children:"Scan with your phone's camera to continue."}),(0,ae.jsx)(Qi,{children:M?(0,ae.jsx)(ha,{url:M,size:275,squareLogoElement:Mo}):(0,ae.jsx)(Ot,{})}),(0,ae.jsxs)(lr,{children:[(0,ae.jsx)(Ee,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&(0,ae.jsx)(Rn,{text:M,itemName:"link",color:hg})]})]})}),(0,ae.jsx)(Y,{})]})},yg=fd.default.div`
1478
1478
  display: flex;
1479
1479
  flex-direction: column;
1480
1480
  align-items: center;
@@ -1482,14 +1482,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1482
1482
  margin-left: 27px;
1483
1483
  margin-right: 27px;
1484
1484
  gap: 24px;
1485
- `,uw=md.default.div`
1485
+ `,Cw=fd.default.div`
1486
1486
  display: flex;
1487
1487
  flex-direction: column;
1488
1488
  align-items: center;
1489
1489
  justify-content: center;
1490
1490
  gap: 24px;
1491
1491
  width: 100%;
1492
- `;var In=require("react"),ps=require("react-device-detect"),fd=y(require("styled-components"));var se=require("react/jsx-runtime"),gg="#8a63d2",Cg=1e3,mw=Cg*2,fw=Cg*300,wg=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=k(),{requestFarcasterSignerStatus:n,closePrivyModal:a}=R(),[i,s]=(0,In.useState)(void 0),[l,c]=(0,In.useState)(!1),[u,h]=(0,In.useState)(!1),m=(0,In.useRef)([]),v=et,b=r?.farcasterSigner;(0,In.useEffect)(()=>{let P=Date.now(),A=setInterval(async()=>{if(!b?.public_key){clearInterval(A),s({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}b.status==="approved"&&(clearInterval(A),c(!1),h(!0),m.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v)));let E=await n(b?.public_key),S=Date.now()-P;E.status==="approved"?(clearInterval(A),c(!1),h(!0),m.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v))):S>fw?(clearInterval(A),s({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):E.status==="revoked"&&(clearInterval(A),s({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},mw);return()=>{clearInterval(A),m.current.forEach(E=>clearTimeout(E))}},[]);let g=b?.status==="pending_approval"?b.signer_approval_url:void 0;return ps.isMobile||l?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(_,{backFn:e?t:void 0,onClose:a},"header"),(0,se.jsx)(le,{}),ps.isIOS?(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)(hw,{children:[(0,se.jsx)(ut,{children:(0,se.jsxs)("div",{children:[(0,se.jsx)(wt,{success:u,fail:!!i}),(0,se.jsx)(Mo,{style:{width:"38px",height:"38px"}})]})}),(0,se.jsxs)(mt,{children:[(0,se.jsx)(Ce,{children:i?i.message:"Add a signer to Farcaster"}),(0,se.jsx)(Ee,{children:i?i.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&(0,se.jsx)(F,{onClick:P=>{P.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)(vg,{children:[(0,se.jsx)(ut,{children:(0,se.jsxs)("div",{children:[(0,se.jsx)(wt,{success:u,fail:!!i}),(0,se.jsx)(Mo,{style:{width:"38px",height:"38px"}})]})}),(0,se.jsxs)(mt,{children:[(0,se.jsx)(Ce,{children:i?i.message:"Requesting signer from Farcaster"}),(0,se.jsx)(Ee,{children:i?i.detail:"This should only take a moment"}),(0,se.jsx)(sr,{children:g&&ps.isMobile&&(0,se.jsx)(mc,{text:"Take me to Warpcast",url:g,color:gg})})]})]})}),(0,se.jsx)(Y,{})]}):(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(_,{backFn:e?t:void 0,onClose:a},"header"),(0,se.jsx)(le,{}),(0,se.jsx)(vg,{children:(0,se.jsxs)("div",{children:[(0,se.jsx)(Ce,{children:"Add a signer to Farcaster"}),(0,se.jsxs)(Ee,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),(0,se.jsx)(Zi,{children:b?.status==="pending_approval"?(0,se.jsx)(fa,{url:b.signer_approval_url,size:275,squareLogoElement:Mo}):(0,se.jsx)(Mt,{})}),(0,se.jsxs)(sr,{children:[(0,se.jsx)(Ee,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),b?.status==="pending_approval"&&(0,se.jsx)(Rn,{text:b.signer_approval_url,itemName:"link",color:gg})]})]})}),(0,se.jsx)(Y,{})]})},vg=fd.default.div`
1492
+ `;var In=require("react"),ds=require("react-device-detect"),hd=y(require("styled-components"));var se=require("react/jsx-runtime"),Cg="#8a63d2",bg=1e3,ww=bg*2,bw=bg*300,Eg=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=k(),{requestFarcasterSignerStatus:n,closePrivyModal:a}=R(),[i,s]=(0,In.useState)(void 0),[l,c]=(0,In.useState)(!1),[u,h]=(0,In.useState)(!1),m=(0,In.useRef)([]),v=et,b=r?.farcasterSigner;(0,In.useEffect)(()=>{let S=Date.now(),A=setInterval(async()=>{if(!b?.public_key){clearInterval(A),s({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}b.status==="approved"&&(clearInterval(A),c(!1),h(!0),m.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v)));let E=await n(b?.public_key),P=Date.now()-S;E.status==="approved"?(clearInterval(A),c(!1),h(!0),m.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v))):P>bw?(clearInterval(A),s({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):E.status==="revoked"&&(clearInterval(A),s({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},ww);return()=>{clearInterval(A),m.current.forEach(E=>clearTimeout(E))}},[]);let g=b?.status==="pending_approval"?b.signer_approval_url:void 0;return ds.isMobile||l?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(_,{backFn:e?t:void 0,onClose:a},"header"),(0,se.jsx)(le,{}),ds.isIOS?(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)(Ew,{children:[(0,se.jsx)(ut,{children:(0,se.jsxs)("div",{children:[(0,se.jsx)(wt,{success:u,fail:!!i}),(0,se.jsx)(Mo,{style:{width:"38px",height:"38px"}})]})}),(0,se.jsxs)(mt,{children:[(0,se.jsx)(we,{children:i?i.message:"Add a signer to Farcaster"}),(0,se.jsx)(Ee,{children:i?i.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&(0,se.jsx)(F,{onClick:S=>{S.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)(wg,{children:[(0,se.jsx)(ut,{children:(0,se.jsxs)("div",{children:[(0,se.jsx)(wt,{success:u,fail:!!i}),(0,se.jsx)(Mo,{style:{width:"38px",height:"38px"}})]})}),(0,se.jsxs)(mt,{children:[(0,se.jsx)(we,{children:i?i.message:"Requesting signer from Farcaster"}),(0,se.jsx)(Ee,{children:i?i.detail:"This should only take a moment"}),(0,se.jsx)(lr,{children:g&&ds.isMobile&&(0,se.jsx)(fc,{text:"Take me to Warpcast",url:g,color:Cg})})]})]})}),(0,se.jsx)(Y,{})]}):(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(_,{backFn:e?t:void 0,onClose:a},"header"),(0,se.jsx)(le,{}),(0,se.jsx)(wg,{children:(0,se.jsxs)("div",{children:[(0,se.jsx)(we,{children:"Add a signer to Farcaster"}),(0,se.jsxs)(Ee,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),(0,se.jsx)(Qi,{children:b?.status==="pending_approval"?(0,se.jsx)(ha,{url:b.signer_approval_url,size:275,squareLogoElement:Mo}):(0,se.jsx)(Ot,{})}),(0,se.jsxs)(lr,{children:[(0,se.jsx)(Ee,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),b?.status==="pending_approval"&&(0,se.jsx)(Rn,{text:b.signer_approval_url,itemName:"link",color:Cg})]})]})}),(0,se.jsx)(Y,{})]})},wg=hd.default.div`
1493
1493
  display: flex;
1494
1494
  flex-direction: column;
1495
1495
  align-items: center;
@@ -1497,14 +1497,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1497
1497
  margin-left: 27px;
1498
1498
  margin-right: 27px;
1499
1499
  gap: 24px;
1500
- `,hw=fd.default.div`
1500
+ `,Ew=hd.default.div`
1501
1501
  display: flex;
1502
1502
  flex-direction: column;
1503
1503
  align-items: center;
1504
1504
  justify-content: center;
1505
1505
  gap: 24px;
1506
1506
  width: 100%;
1507
- `;var bg=y(require("@heroicons/react/24/outline/ClockIcon")),Eg=y(require("@heroicons/react/24/outline/EyeSlashIcon")),Tg=y(require("@heroicons/react/24/outline/LinkIcon")),vo=y(require("styled-components"));var ha=require("react/jsx-runtime"),fc=({size:e=61,...t})=>(0,ha.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,ha.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,ha.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,ha.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var $e=require("react/jsx-runtime"),hd=({title:e,desc:t,icon:r})=>(0,$e.jsxs)(bw,{children:[(0,$e.jsx)(Tw,{children:r}),(0,$e.jsxs)(Ew,{children:[(0,$e.jsx)(Cw,{children:e}),(0,$e.jsx)(ww,{children:t})]})]}),Pg=({app:e,signedUrl:t,onContinue:r})=>(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsxs)(gw,{children:[(0,$e.jsx)(fc,{size:"3.75rem"}),(0,$e.jsxs)(vw,{children:[e?.name," uses ",(0,$e.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,$e.jsxs)(Pw,{children:[(0,$e.jsx)(hd,{icon:(0,$e.jsx)(Tg.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,$e.jsxs)($e.Fragment,{children:["Connect a payment method (",(0,$e.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,$e.jsx)(hd,{icon:(0,$e.jsx)(bg.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,$e.jsx)(hd,{icon:(0,$e.jsx)(Eg.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,$e.jsx)(Sw,{className:"mobile-only"})]}),(0,$e.jsx)(yw,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,$e.jsx)(Vl,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),yw=vo.default.span`
1507
+ `;var Tg=y(require("@heroicons/react/24/outline/ClockIcon")),Sg=y(require("@heroicons/react/24/outline/EyeSlashIcon")),Pg=y(require("@heroicons/react/24/outline/LinkIcon")),go=y(require("styled-components"));var ya=require("react/jsx-runtime"),hc=({size:e=61,...t})=>(0,ya.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,ya.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,ya.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,ya.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var ze=require("react/jsx-runtime"),yd=({title:e,desc:t,icon:r})=>(0,ze.jsxs)(xw,{children:[(0,ze.jsx)(Rw,{children:r}),(0,ze.jsxs)(kw,{children:[(0,ze.jsx)(_w,{children:e}),(0,ze.jsx)(Aw,{children:t})]})]}),_g=({app:e,signedUrl:t,onContinue:r})=>(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsxs)(Sw,{children:[(0,ze.jsx)(hc,{size:"3.75rem"}),(0,ze.jsxs)(Pw,{children:[e?.name," uses ",(0,ze.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,ze.jsxs)(Iw,{children:[(0,ze.jsx)(yd,{icon:(0,ze.jsx)(Pg.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,ze.jsxs)(ze.Fragment,{children:["Connect a payment method (",(0,ze.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,ze.jsx)(yd,{icon:(0,ze.jsx)(Tg.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,ze.jsx)(yd,{icon:(0,ze.jsx)(Sg.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,ze.jsx)(Ww,{className:"mobile-only"})]}),(0,ze.jsx)(Tw,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,ze.jsx)(Gl,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),Tw=go.default.span`
1508
1508
  display: inline-block;
1509
1509
  color: var(--privy-color-foreground-3);
1510
1510
  text-align: center;
@@ -1513,13 +1513,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
1513
1513
  font-weight: 400;
1514
1514
  line-height: 140%; /* 0.875rem */
1515
1515
  margin-bottom: 0.25rem;
1516
- `,gw=vo.default.div`
1516
+ `,Sw=go.default.div`
1517
1517
  display: flex;
1518
1518
  flex-direction: column;
1519
1519
  align-items: center;
1520
1520
  justify-content: center;
1521
1521
  padding: 1.5rem 0;
1522
- `,vw=vo.default.span`
1522
+ `,Pw=go.default.span`
1523
1523
  color: var(--privy-color-foreground);
1524
1524
  text-align: center;
1525
1525
  font-size: 1.125rem;
@@ -1528,46 +1528,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
1528
1528
  margin: 1.5rem 0;
1529
1529
  text-align: center;
1530
1530
  max-width: 19.5rem;
1531
- `,Cw=vo.default.span`
1531
+ `,_w=go.default.span`
1532
1532
  color: var(--privy-color-foreground);
1533
1533
  font-size: 0.875rem;
1534
1534
  font-weight: 500;
1535
1535
  line-height: 1.225rem;
1536
1536
  width: 100%;
1537
- `,ww=vo.default.span`
1537
+ `,Aw=go.default.span`
1538
1538
  color: var(--privy-color-foreground-2);
1539
1539
  font-size: 0.875rem;
1540
1540
  font-weight: 400;
1541
1541
  line-height: 1.225rem;
1542
- `,bw=vo.default.div`
1542
+ `,xw=go.default.div`
1543
1543
  display: flex;
1544
1544
  align-items: flex-start;
1545
1545
  gap: 0.5rem;
1546
1546
  align-self: stretch;
1547
- `,Ew=vo.default.div`
1547
+ `,kw=go.default.div`
1548
1548
  display: flex;
1549
1549
  flex-direction: column;
1550
1550
  gap: 0.25rem;
1551
1551
  align-items: flex-start;
1552
1552
  text-align: left;
1553
1553
  flex: 1 0 0;
1554
- `,Tw=vo.default.div`
1554
+ `,Rw=go.default.div`
1555
1555
  padding-top: 2px;
1556
- `,Pw=vo.default.div`
1556
+ `,Iw=go.default.div`
1557
1557
  display: flex;
1558
1558
  flex-direction: column;
1559
1559
  gap: 1.25rem;
1560
1560
  margin: 0 0.5rem;
1561
- `,Sw=vo.default.div`
1561
+ `,Ww=go.default.div`
1562
1562
  margin: 30px 0;
1563
- `;var _g=require("ofetch"),ya=require("react");var hc="moonpay",Sg="sdk_fiat_on_ramp_completed_with_status";async function Ag(e,t,r,o,n=!1){let a=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},i=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...a,...i}})}async function _w(e,t){let r=t?um:dm,o=t?fm:mm;return(0,_g.ofetch)(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function xg(e,t=!1){let[r,o]=(0,ya.useState)(null),{createAnalyticsEvent:n}=R(),a=(0,ya.useRef)(0);return(0,ya.useEffect)(()=>{let i=setInterval(async()=>{if(e)try{let[s]=await _w(e,t),l=s.status==="waitingAuthorization"&&s.paymentMethod==="credit_debit_card"?"pending":s.status;o(l),["failed","completed","awaitingAuthorization"].includes(l)&&(n({eventName:Sg,payload:{status:l,provider:hc,paymentMethod:s.paymentMethod,cardPaymentType:s.cardPaymentType,currency:s.currency?.code,baseCurrencyAmount:s.baseCurrencyAmount,quoteCurrencyAmount:s.quoteCurrencyAmount,feeAmount:s.feeAmount,extraFeeAmount:s.extraFeeAmount,networkFeeAmount:s.networkFeeAmount}}),clearInterval(i))}catch(s){s.response?.status!==404&&(a.current+=1),a.current>=3&&(o("serviceFailure"),n({eventName:Sg,payload:{status:"serviceFailure",provider:hc}}),clearInterval(i))}},3e3);return()=>clearInterval(i)},[e,a]),r}var Wn=require("react/jsx-runtime"),kg=()=>{let{app:e,data:t,navigate:r}=k(),{createAnalyticsEvent:o}=R(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,Wn.jsxs)(Wn.Fragment,{children:[(0,Wn.jsx)(_,{title:"Fund account"},"header"),(0,Wn.jsx)(Pg,{app:e,signedUrl:n,onContinue:()=>{o({eventName:"sdk_fiat_on_ramp_started",payload:{provider:hc}}),r("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,Wn.jsx)(j,{protectedByPrivy:!0})]})};var Rg=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),Ig=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Wg=y(require("@heroicons/react/24/solid/XCircleIcon")),Mg=require("react"),yd=y(require("styled-components"));var Be=require("react/jsx-runtime"),Og=()=>{let{app:e,data:t}=k(),{closePrivyModal:r}=R(),{externalTransactionId:o}=t?.fiatOnRampStatus,n=xg(o||null,e.fiatOnRamp.useSandbox);return(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)(_,{title:"Fund account"},"header"),(0,Be.jsx)(xw,{status:n,onClickCta:r}),(0,Be.jsx)(j,{protectedByPrivy:!0})]})},Aw=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"failed":return{title:"Something went wrong!",body:(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,Be.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,Be.jsx)("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};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:""}}},xw=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,Mg.useMemo)(()=>Aw(e),[e]);return(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsxs)(Mw,{children:[(0,Be.jsx)(Iw,{status:e}),(0,Be.jsxs)(mt,{children:[(0,Be.jsx)("h3",{children:r}),(0,Be.jsx)(Ww,{children:o})]})]}),n&&(0,Be.jsx)(F,{onClick:t,children:n})]})},kw=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)",Rw=e=>{switch(e){case"serviceFailure":case"failed":return Wg.default;case"completed":return Ig.default;case"waitingAuthorization":return()=>(0,Be.jsx)(Rg.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},Iw=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return(0,Be.jsxs)("div",{style:{position:"relative"},children:[(0,Be.jsx)(Mt,{color:o,style:{position:"absolute"}}),(0,Be.jsx)(Bp,{color:o}),(0,Be.jsx)(fc,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=Rw(e),r=kw(e);return(0,Be.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,Be.jsx)(t,{width:"4rem",height:"4rem",color:r})})},Ww=yd.default.p`
1563
+ `;var xg=require("ofetch"),ga=require("react");var yc="moonpay",Ag="sdk_fiat_on_ramp_completed_with_status";async function kg(e,t,r,o,n=!1){let a=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},i=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...a,...i}})}async function Mw(e,t){let r=t?fm:mm,o=t?ym:hm;return(0,xg.ofetch)(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function Rg(e,t=!1){let[r,o]=(0,ga.useState)(null),{createAnalyticsEvent:n}=R(),a=(0,ga.useRef)(0);return(0,ga.useEffect)(()=>{let i=setInterval(async()=>{if(e)try{let[s]=await Mw(e,t),l=s.status==="waitingAuthorization"&&s.paymentMethod==="credit_debit_card"?"pending":s.status;o(l),["failed","completed","awaitingAuthorization"].includes(l)&&(n({eventName:Ag,payload:{status:l,provider:yc,paymentMethod:s.paymentMethod,cardPaymentType:s.cardPaymentType,currency:s.currency?.code,baseCurrencyAmount:s.baseCurrencyAmount,quoteCurrencyAmount:s.quoteCurrencyAmount,feeAmount:s.feeAmount,extraFeeAmount:s.extraFeeAmount,networkFeeAmount:s.networkFeeAmount}}),clearInterval(i))}catch(s){s.response?.status!==404&&(a.current+=1),a.current>=3&&(o("serviceFailure"),n({eventName:Ag,payload:{status:"serviceFailure",provider:yc}}),clearInterval(i))}},3e3);return()=>clearInterval(i)},[e,a]),r}var Wn=require("react/jsx-runtime"),Ig=()=>{let{app:e,data:t,navigate:r}=k(),{createAnalyticsEvent:o}=R(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,Wn.jsxs)(Wn.Fragment,{children:[(0,Wn.jsx)(_,{title:"Fund account"},"header"),(0,Wn.jsx)(_g,{app:e,signedUrl:n,onContinue:()=>{o({eventName:"sdk_fiat_on_ramp_started",payload:{provider:yc}}),r("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,Wn.jsx)(j,{})]})};var Wg=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),Mg=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Og=y(require("@heroicons/react/24/solid/XCircleIcon")),Lg=require("react"),gd=y(require("styled-components"));var Fe=require("react/jsx-runtime"),Ng=()=>{let{app:e,data:t}=k(),{closePrivyModal:r}=R(),{externalTransactionId:o}=t?.fiatOnRampStatus,n=Rg(o||null,e.fiatOnRamp.useSandbox);return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(_,{title:"Fund account"},"header"),(0,Fe.jsx)(Lw,{status:n,onClickCta:r}),(0,Fe.jsx)(j,{})]})},Ow=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"failed":return{title:"Something went wrong!",body:(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,Fe.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,Fe.jsx)("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};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:""}}},Lw=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,Lg.useMemo)(()=>Ow(e),[e]);return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)(Bw,{children:[(0,Fe.jsx)(Uw,{status:e}),(0,Fe.jsxs)(mt,{children:[(0,Fe.jsx)("h3",{children:r}),(0,Fe.jsx)(Fw,{children:o})]})]}),n&&(0,Fe.jsx)(F,{onClick:t,children:n})]})},Nw=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)",Dw=e=>{switch(e){case"serviceFailure":case"failed":return Og.default;case"completed":return Mg.default;case"waitingAuthorization":return()=>(0,Fe.jsx)(Wg.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},Uw=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return(0,Fe.jsxs)("div",{style:{position:"relative"},children:[(0,Fe.jsx)(Ot,{color:o,style:{position:"absolute"}}),(0,Fe.jsx)(Hp,{color:o}),(0,Fe.jsx)(hc,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=Dw(e),r=Nw(e);return(0,Fe.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,Fe.jsx)(t,{width:"4rem",height:"4rem",color:r})})},Fw=gd.default.p`
1564
1564
  font-size: 1rem;
1565
1565
  color: var(--privy-color-foreground-3);
1566
1566
  margin-bottom: 1rem;
1567
1567
  display: flex;
1568
1568
  flex-direction: column;
1569
1569
  gap: 1rem;
1570
- `,Mw=yd.default.div`
1570
+ `,Bw=gd.default.div`
1571
1571
  display: flex;
1572
1572
  flex-direction: column;
1573
1573
  align-items: center;
@@ -1575,7 +1575,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1575
1575
  margin-left: 1.75rem;
1576
1576
  margin-right: 1.75rem;
1577
1577
  padding: 2rem 0;
1578
- `;var Lg=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),Ng=y(require("styled-components"));var Mr=require("react/jsx-runtime"),Dg=()=>{let{closePrivyModal:e}=R();return(0,Mr.jsxs)(Mr.Fragment,{children:[(0,Mr.jsx)(_,{},"header"),(0,Mr.jsx)(Ow,{children:(0,Mr.jsx)(Lg.default,{style:{width:32,height:32}})}),(0,Mr.jsx)(Ro,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Mr.jsx)($r,{children:(0,Mr.jsx)(F,{onClick:()=>e(),children:"Close"})}),(0,Mr.jsx)(ce,{}),(0,Mr.jsx)(j,{protectedByPrivy:!0})]})},Ow=Ng.default.div`
1578
+ `;var Dg=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),Ug=y(require("styled-components"));var Wr=require("react/jsx-runtime"),Fg=()=>{let{closePrivyModal:e}=R();return(0,Wr.jsxs)(Wr.Fragment,{children:[(0,Wr.jsx)(_,{},"header"),(0,Wr.jsx)(Hw,{children:(0,Wr.jsx)(Dg.default,{style:{width:32,height:32}})}),(0,Wr.jsx)(Ro,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Wr.jsx)(zr,{children:(0,Wr.jsx)(F,{onClick:()=>e(),children:"Close"})}),(0,Wr.jsx)(ce,{}),(0,Wr.jsx)(j,{})]})},Hw=Ug.default.div`
1579
1579
  border-radius: 50%;
1580
1580
  height: 68px;
1581
1581
  width: 68px;
@@ -1585,18 +1585,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1585
1585
  background-color: var(--privy-color-accent);
1586
1586
  color: white;
1587
1587
  margin: 0 auto 24px auto;
1588
- `;var Bg=y(require("react-device-detect")),Hg=y(require("styled-components"));var yc=y(require("styled-components"));var gd=require("react/jsx-runtime"),Ug=({style:e,...t})=>(0,gd.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,gd.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var vc=require("react/jsx-runtime"),Fg=yc.default.div`
1588
+ `;var Vg=y(require("react-device-detect")),Gg=y(require("styled-components"));var gc=y(require("styled-components"));var vd=require("react/jsx-runtime"),Bg=({style:e,...t})=>(0,vd.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,vd.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var Cc=require("react/jsx-runtime"),Hg=gc.default.div`
1589
1589
  display: flex;
1590
1590
  flex-direction: column;
1591
1591
  justify-content: flex-start;
1592
1592
  gap: 4px;
1593
- `,vd=yc.default.div`
1593
+ `,Cd=gc.default.div`
1594
1594
  &&& {
1595
1595
  margin-left: 7px; /* TODO: This is a total hack */
1596
1596
  border-left: 2px solid var(--privy-color-foreground-4);
1597
1597
  height: 12px;
1598
1598
  }
1599
- `,gc=({children:e})=>(0,vc.jsxs)(Lw,{children:[(0,vc.jsx)(Ug,{style:{width:"16px",height:"16px"}}),e]}),Lw=yc.default.div`
1599
+ `,vc=({children:e})=>(0,Cc.jsxs)(Vw,{children:[(0,Cc.jsx)(Bg,{style:{width:"16px",height:"16px"}}),e]}),Vw=gc.default.div`
1600
1600
  display: flex;
1601
1601
  justify-content: flex-start;
1602
1602
  justify-items: center;
@@ -1614,15 +1614,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
1614
1614
  margin-bottom: auto;
1615
1615
  }
1616
1616
  }
1617
- `;var Qe=require("react/jsx-runtime"),Nw=()=>(0,Qe.jsxs)(Dw,{children:[(0,Qe.jsx)(ai,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,Qe.jsx)(sr,{children:(0,Qe.jsx)(_o,{style:{width:"152px",height:"152px"}})}),(0,Qe.jsxs)(Fg,{children:[(0,Qe.jsx)(gc,{children:(0,Qe.jsxs)("div",{children:[(0,Qe.jsx)("span",{children:"Install the "}),(0,Qe.jsx)("a",{href:Bg.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),(0,Qe.jsx)(vd,{}),(0,Qe.jsx)(gc,{children:"Set up your first wallet"}),(0,Qe.jsx)(vd,{}),(0,Qe.jsx)(gc,{children:"Store your recovery phrase in a safe place!"})]}),(0,Qe.jsx)(Ki,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),Vg=()=>{let{navigateBack:e}=k();return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(_,{backFn:e},"header"),(0,Qe.jsx)(le,{}),(0,Qe.jsx)(Nw,{}),(0,Qe.jsx)(ce,{}),(0,Qe.jsxs)(Y,{children:[(0,Qe.jsx)("span",{children:"Still not sure? "}),(0,Qe.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},Dw=(0,Hg.default)(sr)`
1617
+ `;var Qe=require("react/jsx-runtime"),Gw=()=>(0,Qe.jsxs)(qw,{children:[(0,Qe.jsx)(ii,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,Qe.jsx)(lr,{children:(0,Qe.jsx)(Po,{style:{width:"152px",height:"152px"}})}),(0,Qe.jsxs)(Hg,{children:[(0,Qe.jsx)(vc,{children:(0,Qe.jsxs)("div",{children:[(0,Qe.jsx)("span",{children:"Install the "}),(0,Qe.jsx)("a",{href:Vg.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),(0,Qe.jsx)(Cd,{}),(0,Qe.jsx)(vc,{children:"Set up your first wallet"}),(0,Qe.jsx)(Cd,{}),(0,Qe.jsx)(vc,{children:"Store your recovery phrase in a safe place!"})]}),(0,Qe.jsx)(ji,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),qg=()=>{let{navigateBack:e}=k();return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(_,{backFn:e},"header"),(0,Qe.jsx)(le,{}),(0,Qe.jsx)(Gw,{}),(0,Qe.jsx)(ce,{}),(0,Qe.jsxs)(Y,{children:[(0,Qe.jsx)("span",{children:"Still not sure? "}),(0,Qe.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},qw=(0,Gg.default)(lr)`
1618
1618
  gap: 30px;
1619
1619
 
1620
1620
  > :first-child > svg {
1621
1621
  margin-top: 20px;
1622
1622
  }
1623
- `;var n1=y(require("@heroicons/react/24/outline/UserCircleIcon")),fs=require("react"),i1=require("react-device-detect"),a1=y(require("styled-components"));var qg=y(require("@heroicons/react/24/outline/EnvelopeIcon")),zg=require("react");var Gg=y(require("@heroicons/react/24/outline/EnvelopeIcon")),ds=require("react"),Cd=y(require("styled-components"));var Co=require("react/jsx-runtime"),Cc=(0,ds.forwardRef)((e,t)=>{let[r,o]=(0,ds.useState)(""),[n,a]=(0,ds.useState)(!1),{authenticated:i}=G(),{initLoginWithEmail:s}=R(),{navigate:l,setModalData:c,currentScreen:u}=k(),{enabled:h,token:m}=Se(),v=el(r),b=n,g=n||!v,P=E=>{a(!0),s(r,E).then(()=>{l("AWAITING_PASSWORDLESS_CODE")}).catch(S=>{c({errorModalData:{error:S,previousScreen:u||"LANDING"}}),l("ERROR_SCREEN")}).finally(()=>{a(!1)})},A=()=>{h&&!m&&!i?(c({captchaModalData:{callback:E=>s(r,E),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),l("CAPTCHA_SCREEN")):P(m)};return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Uw,{children:(0,Co.jsxs)(Fw,{stacked:e.stacked,children:[(0,Co.jsx)(Gg.default,{}),(0,Co.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:E=>o(E.target.value),onKeyUp:E=>{E.key==="Enter"&&A()},value:r,autoComplete:"email"}),e.stacked?null:(0,Co.jsx)(ji,{isSubmitting:b,onClick:A,disabled:g,children:"Submit"})]})}),e.stacked?(0,Co.jsx)(F,{loadingText:null,loading:b,disabled:g,onClick:A,children:"Submit"}):null]})}),Uw=Cd.default.div`
1623
+ `;var a1=y(require("@heroicons/react/24/outline/UserCircleIcon")),hs=require("react"),s1=require("react-device-detect"),l1=y(require("styled-components"));var $g=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Kg=require("react");var zg=y(require("@heroicons/react/24/outline/EnvelopeIcon")),us=require("react"),wd=y(require("styled-components"));var vo=require("react/jsx-runtime"),wc=(0,us.forwardRef)((e,t)=>{let[r,o]=(0,us.useState)(""),[n,a]=(0,us.useState)(!1),{authenticated:i}=G(),{initLoginWithEmail:s}=R(),{navigate:l,setModalData:c,currentScreen:u}=k(),{enabled:h,token:m}=Pe(),v=tl(r),b=n,g=n||!v,S=E=>{a(!0),s(r,E).then(()=>{l("AWAITING_PASSWORDLESS_CODE")}).catch(P=>{c({errorModalData:{error:P,previousScreen:u||"LANDING"}}),l("ERROR_SCREEN")}).finally(()=>{a(!1)})},A=()=>{h&&!m&&!i?(c({captchaModalData:{callback:E=>s(r,E),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),l("CAPTCHA_SCREEN")):S(m)};return(0,vo.jsxs)(vo.Fragment,{children:[(0,vo.jsx)(zw,{children:(0,vo.jsxs)($w,{stacked:e.stacked,children:[(0,vo.jsx)(zg.default,{}),(0,vo.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:E=>o(E.target.value),onKeyUp:E=>{E.key==="Enter"&&A()},value:r,autoComplete:"email"}),e.stacked?null:(0,vo.jsx)(Yi,{isSubmitting:b,onClick:A,disabled:g,children:"Submit"})]})}),e.stacked?(0,vo.jsx)(F,{loadingText:null,loading:b,disabled:g,onClick:A,children:"Submit"}):null]})}),zw=wd.default.div`
1624
1624
  width: 100%;
1625
- `,Fw=Cd.default.label`
1625
+ `,$w=wd.default.label`
1626
1626
  display: block;
1627
1627
  position: relative;
1628
1628
  width: 100%;
@@ -1683,7 +1683,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1683
1683
  && > input::placeholder {
1684
1684
  color: var(--privy-color-foreground-3);
1685
1685
  }
1686
- `;var Oo=require("react/jsx-runtime"),wc=({isEditable:e,setIsEditable:t})=>{let r=(0,zg.useRef)(null);return(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(mo,{if:!e,children:(0,Oo.jsx)(Cc,{ref:r})}),(0,Oo.jsx)(mo,{if:e,children:(0,Oo.jsxs)(Ue,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Oo.jsx)(qg.default,{})," Continue with Email"]})})]})};var $g=require("react");var ga=require("react/jsx-runtime"),bc=()=>{let[e,t]=(0,$g.useState)(!1),{currentScreen:r,navigate:o,setModalData:n}=k(),{enabled:a,token:i}=Se(),{initLoginWithFarcaster:s}=R();return(0,ga.jsxs)(Ue,{onClick:async()=>{t(!0);try{a&&!i?(n({captchaModalData:{callback:c=>s(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await s(i),o("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,ga.jsx)(Mo,{})," Farcaster",e&&(0,ga.jsx)("span",{children:(0,ga.jsx)(ko,{})})]})};var Ec=y(require("styled-components"));var Kg=require("react/jsx-runtime"),Tc=()=>{let{enabled:e,token:t}=Se(),{navigate:r,setModalData:o}=k(),{initLoginWithPasskey:n}=R();return(0,Kg.jsx)(Hw,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:i=>n(i),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"})},Bw=Ec.css`
1686
+ `;var Oo=require("react/jsx-runtime"),bc=({isEditable:e,setIsEditable:t})=>{let r=(0,Kg.useRef)(null);return(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(uo,{if:!e,children:(0,Oo.jsx)(wc,{ref:r})}),(0,Oo.jsx)(uo,{if:e,children:(0,Oo.jsxs)(De,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Oo.jsx)($g.default,{})," Continue with Email"]})})]})};var jg=require("react");var va=require("react/jsx-runtime"),Ec=()=>{let[e,t]=(0,jg.useState)(!1),{currentScreen:r,navigate:o,setModalData:n}=k(),{enabled:a,token:i}=Pe(),{initLoginWithFarcaster:s}=R();return(0,va.jsxs)(De,{onClick:async()=>{t(!0);try{a&&!i?(n({captchaModalData:{callback:c=>s(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await s(i),o("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,va.jsx)(Mo,{})," Farcaster",e&&(0,va.jsx)("span",{children:(0,va.jsx)(xo,{})})]})};var Tc=y(require("styled-components"));var Yg=require("react/jsx-runtime"),Sc=()=>{let{enabled:e,token:t}=Pe(),{navigate:r,setModalData:o}=k(),{initLoginWithPasskey:n}=R();return(0,Yg.jsx)(jw,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:i=>n(i),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"})},Kw=Tc.css`
1687
1687
  && {
1688
1688
  width: 100%;
1689
1689
  font-size: 0.875rem;
@@ -1708,11 +1708,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1708
1708
  box-shadow: none;
1709
1709
  }
1710
1710
  }
1711
- `,Hw=Ec.default.button`
1712
- ${Bw}
1713
- `;var Xg=y(require("@heroicons/react/24/outline/PhoneIcon")),e1=require("react");var va=require("react"),wd=y(require("styled-components"));var jg=y(require("libphonenumber-js/examples.mobile.json")),Or=require("libphonenumber-js/min"),Sc=require("react/jsx-runtime");var us=(e,t)=>(0,Or.isPossiblePhoneNumber)(String(e),t),Pc=(e,t)=>`+${(0,Or.getCountryCallingCode)(t)} ${e}`,Yg=e=>`*${e.replaceAll("-","").slice(-4)}`,Zg=e=>new Or.AsYouType(e),Vw=(0,Or.getCountries)().map(e=>({code:e,callCode:(0,Or.getCountryCallingCode)(e)})),Qg=e=>{let t=(0,Or.getExampleNumber)(e,jg.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},Jg=({value:e,onChange:t})=>(0,Sc.jsx)("select",{value:e,onChange:t,children:Vw.map(r=>(0,Sc.jsxs)("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});var wo=require("react/jsx-runtime"),Ca=(0,va.forwardRef)((e,t)=>{let{app:r}=k(),[o,n]=(0,va.useState)(""),[a,i]=(0,va.useState)(r?.intl.defaultCountry??"US"),s=us(o,a),l=Zg(a),c=Qg(a),u=(0,Or.getCountryCallingCode)(a),h=!s,[m,v]=(0,va.useState)(!1),b=u.length,g=E=>{let S=E.target.value;i(S),n(""),e.onChange&&e.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:Pc(o,S),countryCode:S,isValid:us(o,a)})},P=E=>{try{let S=E.replace(/\D/g,""),W=o.replace(/\D/g,""),D=S===W?E:l.input(E);n(D),e.onChange&&e.onChange({rawPhoneNumber:D,qualifiedPhoneNumber:Pc(E,a),countryCode:a,isValid:us(E,a)})}catch(S){console.error("Error processing phone number:",S)}},A=()=>{v(!0);let E=Pc(o,a);e.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:E,countryCode:a,isValid:us(o,a)}).finally(()=>v(!1))};return(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(Gw,{children:(0,wo.jsxs)(qw,{callingCodeLength:b,stacked:e.stacked,children:[(0,wo.jsx)(Jg,{value:a,onChange:g}),(0,wo.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:E=>{P(E.target.value)},onKeyUp:E=>{E.key==="Enter"&&A()},value:o,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,wo.jsx)(ji,{isSubmitting:m,onClick:A,disabled:h,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,wo.jsx)(F,{loading:m,loadingText:null,onClick:A,disabled:h,children:"Submit"}):null]})}),Gw=wd.default.div`
1711
+ `,jw=Tc.default.button`
1712
+ ${Kw}
1713
+ `;var t1=y(require("@heroicons/react/24/outline/PhoneIcon")),r1=require("react");var Ca=require("react"),bd=y(require("styled-components"));var Zg=y(require("libphonenumber-js/examples.mobile.json")),Mr=require("libphonenumber-js/min"),_c=require("react/jsx-runtime");var ms=(e,t)=>(0,Mr.isPossiblePhoneNumber)(String(e),t),Pc=(e,t)=>`+${(0,Mr.getCountryCallingCode)(t)} ${e}`,Qg=e=>`*${e.replaceAll("-","").slice(-4)}`,Jg=e=>new Mr.AsYouType(e),Yw=(0,Mr.getCountries)().map(e=>({code:e,callCode:(0,Mr.getCountryCallingCode)(e)})),Xg=e=>{let t=(0,Mr.getExampleNumber)(e,Zg.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},e1=({value:e,onChange:t})=>(0,_c.jsx)("select",{value:e,onChange:t,children:Yw.map(r=>(0,_c.jsxs)("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});var Co=require("react/jsx-runtime"),wa=(0,Ca.forwardRef)((e,t)=>{let{app:r}=k(),[o,n]=(0,Ca.useState)(""),[a,i]=(0,Ca.useState)(r?.intl.defaultCountry??"US"),s=ms(o,a),l=Jg(a),c=Xg(a),u=(0,Mr.getCountryCallingCode)(a),h=!s,[m,v]=(0,Ca.useState)(!1),b=u.length,g=E=>{let P=E.target.value;i(P),n(""),e.onChange&&e.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:Pc(o,P),countryCode:P,isValid:ms(o,a)})},S=E=>{try{let P=E.replace(/\D/g,""),W=o.replace(/\D/g,""),D=P===W?E:l.input(E);n(D),e.onChange&&e.onChange({rawPhoneNumber:D,qualifiedPhoneNumber:Pc(E,a),countryCode:a,isValid:ms(E,a)})}catch(P){console.error("Error processing phone number:",P)}},A=()=>{v(!0);let E=Pc(o,a);e.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:E,countryCode:a,isValid:ms(o,a)}).finally(()=>v(!1))};return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Zw,{children:(0,Co.jsxs)(Qw,{callingCodeLength:b,stacked:e.stacked,children:[(0,Co.jsx)(e1,{value:a,onChange:g}),(0,Co.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:E=>{S(E.target.value)},onKeyUp:E=>{E.key==="Enter"&&A()},value:o,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,Co.jsx)(Yi,{isSubmitting:m,onClick:A,disabled:h,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,Co.jsx)(F,{loading:m,loadingText:null,onClick:A,disabled:h,children:"Submit"}):null]})}),Zw=bd.default.div`
1714
1714
  width: 100%;
1715
- `,qw=wd.default.label`
1715
+ `,Qw=bd.default.label`
1716
1716
  --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
1717
1717
  --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
1718
1718
  display: block;
@@ -1799,11 +1799,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1799
1799
  && > input::placeholder {
1800
1800
  color: var(--privy-color-foreground-3);
1801
1801
  }
1802
- `;var Lo=require("react/jsx-runtime"),_c=({isEditable:e,setIsEditable:t})=>{let r=(0,e1.useRef)(null),{authenticated:o}=G(),{navigate:n,setModalData:a,currentScreen:i}=k(),{initLoginWithSms:s}=R(),{enabled:l,token:c}=Se();async function u({qualifiedPhoneNumber:h}){if(l&&!c&&!o)a({captchaModalData:{callback:m=>s(h,m),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await s(h,c),n("AWAITING_PASSWORDLESS_CODE")}catch(m){a({errorModalData:{error:m,previousScreen:i||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Lo.jsxs)(Lo.Fragment,{children:[(0,Lo.jsx)(mo,{if:!e,children:(0,Lo.jsx)(Ca,{ref:r,onSubmit:u})}),(0,Lo.jsx)(mo,{if:e,children:(0,Lo.jsxs)(Ue,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Lo.jsx)(Xg.default,{})," Continue with SMS"]})})]})};var t1=require("react");var Qr=require("react/jsx-runtime"),zw={apple:{logo:(0,Qr.jsx)(ul,{}),displayName:"Apple"},discord:{logo:(0,Qr.jsx)(ml,{}),displayName:"Discord"},github:{logo:(0,Qr.jsx)(fl,{}),displayName:"GitHub"},google:{logo:(0,Qr.jsx)(hl,{}),displayName:"Google"},linkedin:{logo:(0,Qr.jsx)(gl,{}),displayName:"LinkedIn"},spotify:{logo:(0,Qr.jsx)(vl,{}),displayName:"Spotify"},instagram:{logo:(0,Qr.jsx)(yl,{}),displayName:"Instagram"},twitter:{logo:(0,Qr.jsx)(wl,{}),displayName:"Twitter"},tiktok:{logo:(0,Qr.jsx)(Cl,{}),displayName:"TikTok"}},Dt=({provider:e})=>{let{enabled:t,token:r}=Se(),{navigate:o,setModalData:n}=k(),[a,i]=(0,t1.useState)(!1),{initLoginWithOAuth:s}=R(),{displayName:l,logo:c}=zw[e];return(0,Qr.jsxs)(Ue,{onClick:()=>{i(!0),t&&!r?(n({captchaModalData:{callback:h=>s(e,h),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):s(e)},disabled:a,children:[c," ",l]})};var r1=require("react");var Jr=require("react/jsx-runtime");function Ac(e){return(0,Jr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[(0,Jr.jsx)("defs",{children:(0,Jr.jsxs)("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[(0,Jr.jsx)("stop",{offset:"0",stopColor:"#1d93d2"}),(0,Jr.jsx)("stop",{offset:"1",stopColor:"#38b0e3"})]})}),(0,Jr.jsx)("title",{children:"Telegram_logo"}),(0,Jr.jsx)("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),(0,Jr.jsx)("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),(0,Jr.jsx)("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),(0,Jr.jsx)("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}var kc=require("react/jsx-runtime"),xc=()=>{let{enabled:e,token:t}=Se(),{navigate:r,setModalData:o}=k(),[n,a]=(0,r1.useState)(!1),{initLoginWithTelegram:i}=R();async function s(c){try{await i(c),r("TELEGRAM_AUTH_SCREEN")}catch(u){console.error(u),a(!1)}}async function l(){if(a(!0),e&&!t){o({captchaModalData:{callback:s,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await s()}return(0,kc.jsxs)(Ue,{onClick:l,disabled:n,children:[(0,kc.jsx)(Ac,{})," Telegram"]})};var o1=y(require("@heroicons/react/24/outline/ChevronRightIcon"));var ms=require("react/jsx-runtime"),Rc=({onClick:e,text:t,icon:r})=>(0,ms.jsxs)(Ue,{onClick:e,children:[r,(0,ms.jsx)(bn,{children:t}),(0,ms.jsx)(o1.default,{})]});var We=require("react/jsx-runtime"),Wc=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=R(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{appearance:{palette:{colorScheme:a}}}=Wt(),i=o.loginMethodsAndOrder?.primary??[],s=o.loginMethodsAndOrder?.overflow??[],l=[...i,...s],c=o.loginMethods.passkey,[u,h]=(0,fs.useState)("default"),[m,v]=(0,fs.useState)("email");(0,fs.useEffect)(()=>{let I=l.indexOf("sms"),H=l.indexOf("email");I>-1&&I<H&&v("sms")},[i,s]);let b=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{h("default")},150)};n.current=b;let g=I=>I==="email"?(0,We.jsx)(wc,{isEditable:m==="email",setIsEditable:()=>{v("email")}},I):I==="sms"?(0,We.jsx)(_c,{isEditable:m==="sms",setIsEditable:()=>{v("sms")}},I):I==="apple"?(0,We.jsx)(Dt,{provider:"apple"},I):I==="discord"?(0,We.jsx)(Dt,{provider:"discord"},I):I==="farcaster"?(0,We.jsx)(bc,{},I):I==="github"?(0,We.jsx)(Dt,{provider:"github"},I):I==="google"?(0,We.jsx)(Dt,{provider:"google"},I):I==="linkedin"?(0,We.jsx)(Dt,{provider:"linkedin"},I):I==="tiktok"?(0,We.jsx)(Dt,{provider:"tiktok"},I):I==="twitter"&&(!i1.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)?(0,We.jsx)(Dt,{provider:"twitter"},I):I==="telegram"?(0,We.jsx)(xc,{},I):Xa([I],r,e,l,o.externalWallets.walletConnect.enabled),P=i.map(g).flat(),A=s.map(g).flat(),E=[...P,...A],S=$w({primary:P.length,overflow:A.length}),[W,D]=zu(E,S),M=u==="default"?void 0:()=>{h("default")};return(0,We.jsxs)(We.Fragment,{children:[(0,We.jsx)(_,{title:o.appearance.landingHeader,onClose:b,backFn:M}),u==="default"&&(0,We.jsx)(Kw,{}),u==="default"&&(typeof o.appearance.loginMessage=="string"?(0,We.jsx)(ql,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,We.jsx)(Gl,{style:{overflow:"hidden"},children:(0,We.jsxs)(Zf,{colorScheme:a,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[u==="default"&&(0,We.jsxs)(We.Fragment,{children:[...W,D.length>0&&(0,We.jsx)(Rc,{text:"More options",icon:(0,We.jsx)(n1.default,{}),onClick:()=>h("overflow")})]}),u==="overflow"&&(0,We.jsxs)(We.Fragment,{children:[...D]}),c&&u==="default"&&(0,We.jsx)(Tc,{})]})}),o&&(0,We.jsx)(Yi,{app:o}),(0,We.jsx)(j,{protectedByPrivy:!0})]})},Ic=5,$w=({primary:e,overflow:t})=>e<Ic?e:e===Ic&&t===0?Ic:Ic-1,Kw=(0,a1.default)(Xi)`
1802
+ `;var Lo=require("react/jsx-runtime"),Ac=({isEditable:e,setIsEditable:t})=>{let r=(0,r1.useRef)(null),{authenticated:o}=G(),{navigate:n,setModalData:a,currentScreen:i}=k(),{initLoginWithSms:s}=R(),{enabled:l,token:c}=Pe();async function u({qualifiedPhoneNumber:h}){if(l&&!c&&!o)a({captchaModalData:{callback:m=>s(h,m),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await s(h,c),n("AWAITING_PASSWORDLESS_CODE")}catch(m){a({errorModalData:{error:m,previousScreen:i||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Lo.jsxs)(Lo.Fragment,{children:[(0,Lo.jsx)(uo,{if:!e,children:(0,Lo.jsx)(wa,{ref:r,onSubmit:u})}),(0,Lo.jsx)(uo,{if:e,children:(0,Lo.jsxs)(De,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Lo.jsx)(t1.default,{})," Continue with SMS"]})})]})};var o1=require("react");var Zr=require("react/jsx-runtime"),Jw={apple:{logo:(0,Zr.jsx)(ml,{}),displayName:"Apple"},discord:{logo:(0,Zr.jsx)(fl,{}),displayName:"Discord"},github:{logo:(0,Zr.jsx)(hl,{}),displayName:"GitHub"},google:{logo:(0,Zr.jsx)(yl,{}),displayName:"Google"},linkedin:{logo:(0,Zr.jsx)(vl,{}),displayName:"LinkedIn"},spotify:{logo:(0,Zr.jsx)(Cl,{}),displayName:"Spotify"},instagram:{logo:(0,Zr.jsx)(gl,{}),displayName:"Instagram"},twitter:{logo:(0,Zr.jsx)(bl,{}),displayName:"Twitter"},tiktok:{logo:(0,Zr.jsx)(wl,{}),displayName:"TikTok"}},Ut=({provider:e})=>{let{enabled:t,token:r}=Pe(),{navigate:o,setModalData:n}=k(),[a,i]=(0,o1.useState)(!1),{initLoginWithOAuth:s}=R(),{displayName:l,logo:c}=Jw[e];return(0,Zr.jsxs)(De,{onClick:()=>{i(!0),t&&!r?(n({captchaModalData:{callback:h=>s(e,h),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):s(e)},disabled:a,children:[c," ",l]})};var n1=require("react");var Qr=require("react/jsx-runtime");function xc(e){return(0,Qr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[(0,Qr.jsx)("defs",{children:(0,Qr.jsxs)("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[(0,Qr.jsx)("stop",{offset:"0",stopColor:"#1d93d2"}),(0,Qr.jsx)("stop",{offset:"1",stopColor:"#38b0e3"})]})}),(0,Qr.jsx)("title",{children:"Telegram_logo"}),(0,Qr.jsx)("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),(0,Qr.jsx)("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),(0,Qr.jsx)("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),(0,Qr.jsx)("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}var Rc=require("react/jsx-runtime"),kc=()=>{let{enabled:e,token:t}=Pe(),{navigate:r,setModalData:o}=k(),[n,a]=(0,n1.useState)(!1),{initLoginWithTelegram:i}=R();async function s(c){try{await i(c),r("TELEGRAM_AUTH_SCREEN")}catch(u){console.error(u),a(!1)}}async function l(){if(a(!0),e&&!t){o({captchaModalData:{callback:s,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await s()}return(0,Rc.jsxs)(De,{onClick:l,disabled:n,children:[(0,Rc.jsx)(xc,{})," Telegram"]})};var i1=y(require("@heroicons/react/24/outline/ChevronRightIcon"));var fs=require("react/jsx-runtime"),Ic=({onClick:e,text:t,icon:r})=>(0,fs.jsxs)(De,{onClick:e,children:[r,(0,fs.jsx)(bn,{children:t}),(0,fs.jsx)(i1.default,{})]});var Ie=require("react/jsx-runtime"),Mc=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=R(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{appearance:{palette:{colorScheme:a}}}=Mt(),i=o.loginMethodsAndOrder?.primary??[],s=o.loginMethodsAndOrder?.overflow??[],l=[...i,...s],c=o.loginMethods.passkey,[u,h]=(0,hs.useState)("default"),[m,v]=(0,hs.useState)("email");(0,hs.useEffect)(()=>{let I=l.indexOf("sms"),H=l.indexOf("email");I>-1&&I<H&&v("sms")},[i,s]);let b=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{h("default")},150)};n.current=b;let g=I=>I==="email"?(0,Ie.jsx)(bc,{isEditable:m==="email",setIsEditable:()=>{v("email")}},I):I==="sms"?(0,Ie.jsx)(Ac,{isEditable:m==="sms",setIsEditable:()=>{v("sms")}},I):I==="apple"?(0,Ie.jsx)(Ut,{provider:"apple"},I):I==="discord"?(0,Ie.jsx)(Ut,{provider:"discord"},I):I==="farcaster"?(0,Ie.jsx)(Ec,{},I):I==="github"?(0,Ie.jsx)(Ut,{provider:"github"},I):I==="google"?(0,Ie.jsx)(Ut,{provider:"google"},I):I==="linkedin"?(0,Ie.jsx)(Ut,{provider:"linkedin"},I):I==="tiktok"?(0,Ie.jsx)(Ut,{provider:"tiktok"},I):I==="twitter"&&(!s1.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)?(0,Ie.jsx)(Ut,{provider:"twitter"},I):I==="telegram"?(0,Ie.jsx)(kc,{},I):es([I],r,e,l,o.externalWallets.walletConnect.enabled),S=i.map(g).flat(),A=s.map(g).flat(),E=[...S,...A],P=Xw({primary:S.length,overflow:A.length}),[W,D]=Ku(E,P),M=u==="default"?void 0:()=>{h("default")};return(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)(_,{title:o.appearance.landingHeader,onClose:b,backFn:M}),u==="default"&&(0,Ie.jsx)(e4,{}),u==="default"&&(typeof o.appearance.loginMessage=="string"?(0,Ie.jsx)(zl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,Ie.jsx)(ql,{style:{overflow:"hidden"},children:(0,Ie.jsxs)(Jf,{colorScheme:a,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[u==="default"&&(0,Ie.jsxs)(Ie.Fragment,{children:[...W,D.length>0&&(0,Ie.jsx)(Ic,{text:"More options",icon:(0,Ie.jsx)(a1.default,{}),onClick:()=>h("overflow")})]}),u==="overflow"&&(0,Ie.jsxs)(Ie.Fragment,{children:[...D]}),c&&u==="default"&&(0,Ie.jsx)(Sc,{})]})}),o&&(0,Ie.jsx)(Zi,{app:o}),(0,Ie.jsx)(j,{})]})},Wc=5,Xw=({primary:e,overflow:t})=>e<Wc?e:e===Wc&&t===0?Wc:Wc-1,e4=(0,l1.default)(ea)`
1803
1803
  margin-bottom: 16px;
1804
- `;var d1=y(require("@heroicons/react/24/outline/EnvelopeIcon")),u1=y(require("@heroicons/react/24/outline/PhoneIcon")),m1=y(require("@heroicons/react/24/outline/UserCircleIcon")),hs=require("react"),f1=require("react-device-detect"),h1=y(require("styled-components"));var tn=require("react/jsx-runtime"),s1=({...e})=>(0,tn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,tn.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,tn.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,tn.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,tn.jsx)("defs",{children:(0,tn.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,tn.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var l1=y(require("@heroicons/react/24/outline/ChevronRightIcon")),c1=y(require("@heroicons/react/24/outline/WalletIcon"));var wa=require("react/jsx-runtime"),p1=({onClick:e,text:t})=>(0,wa.jsxs)(Ue,{onClick:e,children:[(0,wa.jsx)(c1.default,{}),(0,wa.jsx)(bn,{children:t}),(0,wa.jsx)(l1.default,{})]});var fe=require("react/jsx-runtime"),Mc=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=R(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{email:a,sms:i,google:s,twitter:l,discord:c,github:u,spotify:h,instagram:m,tiktok:v,linkedin:b,apple:g,wallet:P,farcaster:A,passkey:E,telegram:S}=o?.loginMethods??{},W=o?.appearance.loginGroupPriority||"web2-first",D=o?.appearance.hideDirectWeb2Inputs,[M,I]=(0,hs.useState)("default"),[H,$]=(0,hs.useState)(a?"email":"sms");(0,hs.useEffect)(()=>{$(a?"email":"sms")},[a]);let J=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{I("default")},150)};n.current=J;let O=[a&&(0,fe.jsx)(wc,{isEditable:H==="email",setIsEditable:()=>{$("email")}}),i&&(0,fe.jsx)(_c,{isEditable:H==="sms",setIsEditable:()=>{$("sms")}})].filter(Boolean),K=[s&&(0,fe.jsx)(Dt,{provider:"google"}),l&&(!f1.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,fe.jsx)(Dt,{provider:"twitter"}),c&&(0,fe.jsx)(Dt,{provider:"discord"}),u&&(0,fe.jsx)(Dt,{provider:"github"}),h&&(0,fe.jsx)(Dt,{provider:"spotify"}),m&&(0,fe.jsx)(Dt,{provider:"instagram"}),v&&(0,fe.jsx)(Dt,{provider:"tiktok"}),b&&(0,fe.jsx)(Dt,{provider:"linkedin"}),g&&(0,fe.jsx)(Dt,{provider:"apple"}),A&&(0,fe.jsx)(bc,{}),S&&(0,fe.jsx)(xc,{})].filter(Boolean),N=Xa(o.appearance.walletList,r,e,o.appearance.walletList,o.externalWallets.walletConnect.enabled),nt=M==="default"?void 0:()=>{I("default")},ht=Yw({priority:W,email:a,sms:i,social:K}),Xe=Zw({priority:W,email:a,sms:i,social:K}),we=Qw({priority:W,email:a,sms:i,social:K}),ne=(0,fe.jsx)(p1,{text:we,onClick:()=>I("web3-overflow")}),Ne=(0,fe.jsx)(Rc,{text:ht,icon:Xe,onClick:()=>I("web2-overflow")}),He=D?0:1;return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(_,{title:o.appearance.landingHeader,onClose:J,backFn:nt}),M==="default"&&(0,fe.jsx)(jw,{}),M==="default"&&(typeof o.appearance.loginMessage=="string"?(0,fe.jsx)(ql,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,fe.jsx)(Gl,{style:{overflow:"hidden",padding:2},children:(0,fe.jsxs)(uo,{children:[M==="default"&&W==="web2-first"&&(0,fe.jsxs)(fe.Fragment,{children:[...O,...K.length+O.length>4?K.slice(0,3-O.length):K,O.length+K.length>4&&Ne,P&&ne]}),M==="default"&&W==="web3-first"&&(0,fe.jsxs)(fe.Fragment,{children:[P&&(0,fe.jsxs)(fe.Fragment,{children:[...N.length>4?N.slice(0,3):N,N.length>4&&ne]}),O.length+K.length>He&&Ne,O.length+K.length===He&&O.length?O[0]:null,O.length+K.length===He&&K.length?K[0]:null]}),M==="web2-overflow"&&(0,fe.jsxs)(fe.Fragment,{children:[...W==="web3-first"?O:[],...K]}),...M==="web3-overflow"?N:[],E&&M==="default"&&(0,fe.jsx)(Tc,{})]})}),o&&(0,fe.jsx)(Yi,{app:o}),(0,fe.jsx)(j,{protectedByPrivy:!0})]})},jw=(0,h1.default)(Xi)`
1804
+ `;var m1=y(require("@heroicons/react/24/outline/EnvelopeIcon")),f1=y(require("@heroicons/react/24/outline/PhoneIcon")),h1=y(require("@heroicons/react/24/outline/UserCircleIcon")),ys=require("react"),y1=require("react-device-detect"),g1=y(require("styled-components"));var rn=require("react/jsx-runtime"),c1=({...e})=>(0,rn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,rn.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,rn.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,rn.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,rn.jsx)("defs",{children:(0,rn.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,rn.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var p1=y(require("@heroicons/react/24/outline/ChevronRightIcon")),d1=y(require("@heroicons/react/24/outline/WalletIcon"));var ba=require("react/jsx-runtime"),u1=({onClick:e,text:t})=>(0,ba.jsxs)(De,{onClick:e,children:[(0,ba.jsx)(d1.default,{}),(0,ba.jsx)(bn,{children:t}),(0,ba.jsx)(p1.default,{})]});var fe=require("react/jsx-runtime"),Oc=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=R(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{email:a,sms:i,google:s,twitter:l,discord:c,github:u,spotify:h,instagram:m,tiktok:v,linkedin:b,apple:g,wallet:S,farcaster:A,passkey:E,telegram:P}=o?.loginMethods??{},W=o?.appearance.loginGroupPriority||"web2-first",D=o?.appearance.hideDirectWeb2Inputs,[M,I]=(0,ys.useState)("default"),[H,$]=(0,ys.useState)(a?"email":"sms");(0,ys.useEffect)(()=>{$(a?"email":"sms")},[a]);let J=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{I("default")},150)};n.current=J;let O=[a&&(0,fe.jsx)(bc,{isEditable:H==="email",setIsEditable:()=>{$("email")}}),i&&(0,fe.jsx)(Ac,{isEditable:H==="sms",setIsEditable:()=>{$("sms")}})].filter(Boolean),K=[s&&(0,fe.jsx)(Ut,{provider:"google"}),l&&(!y1.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,fe.jsx)(Ut,{provider:"twitter"}),c&&(0,fe.jsx)(Ut,{provider:"discord"}),u&&(0,fe.jsx)(Ut,{provider:"github"}),h&&(0,fe.jsx)(Ut,{provider:"spotify"}),m&&(0,fe.jsx)(Ut,{provider:"instagram"}),v&&(0,fe.jsx)(Ut,{provider:"tiktok"}),b&&(0,fe.jsx)(Ut,{provider:"linkedin"}),g&&(0,fe.jsx)(Ut,{provider:"apple"}),A&&(0,fe.jsx)(Ec,{}),P&&(0,fe.jsx)(kc,{})].filter(Boolean),N=es(o.appearance.walletList,r,e,o.appearance.walletList,o.externalWallets.walletConnect.enabled),nt=M==="default"?void 0:()=>{I("default")},ht=r4({priority:W,email:a,sms:i,social:K}),Xe=o4({priority:W,email:a,sms:i,social:K}),be=n4({priority:W,email:a,sms:i,social:K}),ne=(0,fe.jsx)(u1,{text:be,onClick:()=>I("web3-overflow")}),Le=(0,fe.jsx)(Ic,{text:ht,icon:Xe,onClick:()=>I("web2-overflow")}),Be=D?0:1;return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(_,{title:o.appearance.landingHeader,onClose:J,backFn:nt}),M==="default"&&(0,fe.jsx)(t4,{}),M==="default"&&(typeof o.appearance.loginMessage=="string"?(0,fe.jsx)(zl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,fe.jsx)(ql,{style:{overflow:"hidden",padding:2},children:(0,fe.jsxs)(po,{children:[M==="default"&&W==="web2-first"&&(0,fe.jsxs)(fe.Fragment,{children:[...O,...K.length+O.length>4?K.slice(0,3-O.length):K,O.length+K.length>4&&Le,S&&ne]}),M==="default"&&W==="web3-first"&&(0,fe.jsxs)(fe.Fragment,{children:[S&&(0,fe.jsxs)(fe.Fragment,{children:[...N.length>4?N.slice(0,3):N,N.length>4&&ne]}),O.length+K.length>Be&&Le,O.length+K.length===Be&&O.length?O[0]:null,O.length+K.length===Be&&K.length?K[0]:null]}),M==="web2-overflow"&&(0,fe.jsxs)(fe.Fragment,{children:[...W==="web3-first"?O:[],...K]}),...M==="web3-overflow"?N:[],E&&M==="default"&&(0,fe.jsx)(Sc,{})]})}),o&&(0,fe.jsx)(Zi,{app:o}),(0,fe.jsx)(j,{})]})},t4=(0,g1.default)(ea)`
1805
1805
  margin-bottom: 16px;
1806
- `,Yw=({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",Zw=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,fe.jsx)(m1.default,{}):t&&r?(0,fe.jsx)(s1,{}):t?(0,fe.jsx)(d1.default,{}):r?(0,fe.jsx)(u1.default,{}):null,Qw=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var bd=require("react/jsx-runtime"),y1=()=>{let{app:e}=k();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,bd.jsx)(Wc,{connectOnly:!0}):(0,bd.jsx)(Mc,{connectOnly:!0})};var Ed=require("react/jsx-runtime"),g1=()=>{let{app:e}=k();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Ed.jsx)(Wc,{connectOnly:!1}):(0,Ed.jsx)(Mc,{connectOnly:!1})};var v1=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Lr=require("react/jsx-runtime"),C1=()=>{let{app:e}=k();return(0,Lr.jsxs)(Lr.Fragment,{children:[(0,Lr.jsx)(_,{},"header"),(0,Lr.jsx)(le,{}),(0,Lr.jsx)(Ge,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Lr.jsx)(v1.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Lr.jsx)($r,{children:(0,Lr.jsx)(Cc,{stacked:!0})}),(0,Lr.jsx)(ce,{}),(0,Lr.jsx)(j,{protectedByPrivy:!0})]})};var E1=y(require("@heroicons/react/24/outline/ClockIcon")),T1=y(require("@heroicons/react/24/outline/TrashIcon")),P1=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),S1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),_1=y(require("@heroicons/react/24/solid/LockClosedIcon")),Mn=require("react"),tr=y(require("styled-components"));var Td=require("react/jsx-runtime"),ui=({style:e,...t})=>(0,Td.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,Td.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var Le=require("react/jsx-runtime"),mi=({style:e,...t})=>(0,Le.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Le.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,Le.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,Le.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,Le.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,Le.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,Le.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,Le.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,Le.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,Le.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,Le.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,Le.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,Le.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,Le.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,Le.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,Le.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,Le.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,Le.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,Le.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,Le.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,Le.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,Le.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,Le.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,Le.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,Le.jsx)("defs",{children:(0,Le.jsx)("clipPath",{id:"clip0_113_33841",children:(0,Le.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var Z=require("react/jsx-runtime"),w1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,a]=(0,Mn.useState)([]),i=t?e.length:2,s=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",l=async c=>{a(u=>u.concat([c])),await r(c),a(u=>u.filter(h=>h!==c))};return(0,Z.jsxs)("div",{children:[(0,Z.jsx)(n4,{children:"Your passkeys"}),(0,Z.jsxs)(x1,{children:[e.slice(0,i).map(c=>(0,Z.jsxs)(s4,{children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)(i4,{children:s(c)}),(0,Z.jsxs)(a4,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),(0,Z.jsx)(c4,{disabled:n.includes(c.credentialId),onClick:()=>l(c.credentialId),children:n.includes(c.credentialId)?(0,Z.jsx)(ko,{}):(0,Z.jsx)(T1.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,Z.jsx)(t4,{onClick:o,children:"View all"})]})]})},Jw=()=>(0,Z.jsxs)(x1,{children:[(0,Z.jsxs)(vr,{children:[(0,Z.jsx)(gr,{children:(0,Z.jsx)(P1.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,Z.jsxs)(vr,{children:[(0,Z.jsx)(gr,{children:(0,Z.jsx)(_1.default,{})}),"More secure than a password."]}),(0,Z.jsxs)(vr,{children:[(0,Z.jsx)(gr,{children:(0,Z.jsx)(E1.default,{})}),"Takes seconds to set up and use."]})]}),A1=()=>{let{user:e,unlinkPasskey:t}=G(),{linkWithPasskey:r,closePrivyModal:o}=R(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[a,i]=(0,Mn.useState)(!1),[s,l]=(0,Mn.useState)(""),[c,u]=(0,Mn.useState)(!1),[h,m]=(0,Mn.useState)(!1);(0,Mn.useEffect)(()=>{n.length===0&&m(!1)},[n.length]);let v=()=>{i(!0),r().then(()=>u(!0)).catch(g=>{if(g instanceof yt){if(g.privyErrorCode==="cannot_link_more_of_type"){l("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){l("Passkey request timed out or rejected by user.");return}}l("Unknown error occurred.")}).finally(()=>{i(!1)})},b=async g=>(i(!0),await t(g).then(()=>u(!0)).catch(P=>{if(P instanceof yt&&P.privyErrorCode==="missing_or_invalid_mfa"){l("Cannot unlink a passkey enrolled in MFA");return}l("Unknown error occurred.")}).finally(()=>{i(!1)}));return c?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{onClose:()=>o()},"header"),(0,Z.jsx)(Ve,{children:(0,Z.jsx)(lt,{status:"success",children:(0,Z.jsx)(S1.default,{})})}),(0,Z.jsx)(b1,{children:"Passkey added"}),(0,Z.jsx)(r4,{children:"From now on, you can use your passkey to log in."}),(0,Z.jsx)(Jt,{children:(0,Z.jsx)(F,{onClick:()=>o(),children:"Done"})}),(0,Z.jsx)(Y,{})]}):h?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{backFn:()=>m(!1),onClose:()=>o()},"header"),(0,Z.jsx)(w1,{passkeys:n,expanded:h,onUnlink:b,onExpand:()=>m(!0)}),(0,Z.jsx)(Y,{})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{onClose:()=>o()},"header"),(0,Z.jsx)(Ve,{children:(0,Z.jsxs)(Oc,{children:[(0,Z.jsx)(ui,{}),(0,Z.jsx)(mi,{})]})}),(0,Z.jsx)(b1,{children:"Secure your account with a passkey"}),(0,Z.jsx)(o4,{}),n.length===0?(0,Z.jsx)(Jw,{}):(0,Z.jsx)(w1,{passkeys:n,expanded:h,onUnlink:b,onExpand:()=>m(!0)}),(0,Z.jsxs)(Jt,{style:{marginTop:"12px"},children:[s&&(0,Z.jsx)(Xw,{fail:!0,children:s}),(0,Z.jsx)(F,{onClick:v,loading:a,children:"Add new passkey"})]}),(0,Z.jsx)(Y,{})]})},Oc=tr.default.div`
1806
+ `,r4=({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",o4=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,fe.jsx)(h1.default,{}):t&&r?(0,fe.jsx)(c1,{}):t?(0,fe.jsx)(m1.default,{}):r?(0,fe.jsx)(f1.default,{}):null,n4=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var Ed=require("react/jsx-runtime"),v1=()=>{let{app:e}=k();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Ed.jsx)(Mc,{connectOnly:!0}):(0,Ed.jsx)(Oc,{connectOnly:!0})};var Td=require("react/jsx-runtime"),C1=()=>{let{app:e}=k();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Td.jsx)(Mc,{connectOnly:!1}):(0,Td.jsx)(Oc,{connectOnly:!1})};var w1=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Or=require("react/jsx-runtime"),b1=()=>{let{app:e}=k();return(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsx)(_,{},"header"),(0,Or.jsx)(le,{}),(0,Or.jsx)(Ve,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Or.jsx)(w1.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Or.jsx)(zr,{children:(0,Or.jsx)(wc,{stacked:!0})}),(0,Or.jsx)(ce,{}),(0,Or.jsx)(j,{})]})};var S1=y(require("@heroicons/react/24/outline/ClockIcon")),P1=y(require("@heroicons/react/24/outline/TrashIcon")),_1=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),A1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),x1=y(require("@heroicons/react/24/solid/LockClosedIcon")),Mn=require("react"),rr=y(require("styled-components"));var Sd=require("react/jsx-runtime"),di=({style:e,...t})=>(0,Sd.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,Sd.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var Oe=require("react/jsx-runtime"),ui=({style:e,...t})=>(0,Oe.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Oe.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,Oe.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,Oe.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,Oe.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,Oe.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,Oe.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,Oe.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,Oe.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,Oe.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,Oe.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,Oe.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,Oe.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,Oe.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,Oe.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,Oe.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,Oe.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,Oe.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,Oe.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,Oe.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,Oe.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,Oe.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,Oe.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,Oe.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,Oe.jsx)("defs",{children:(0,Oe.jsx)("clipPath",{id:"clip0_113_33841",children:(0,Oe.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var Z=require("react/jsx-runtime"),E1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,a]=(0,Mn.useState)([]),i=t?e.length:2,s=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",l=async c=>{a(u=>u.concat([c])),await r(c),a(u=>u.filter(h=>h!==c))};return(0,Z.jsxs)("div",{children:[(0,Z.jsx)(d4,{children:"Your passkeys"}),(0,Z.jsxs)(R1,{children:[e.slice(0,i).map(c=>(0,Z.jsxs)(f4,{children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)(u4,{children:s(c)}),(0,Z.jsxs)(m4,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),(0,Z.jsx)(y4,{disabled:n.includes(c.credentialId),onClick:()=>l(c.credentialId),children:n.includes(c.credentialId)?(0,Z.jsx)(xo,{}):(0,Z.jsx)(P1.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,Z.jsx)(l4,{onClick:o,children:"View all"})]})]})},i4=()=>(0,Z.jsxs)(R1,{children:[(0,Z.jsxs)(vr,{children:[(0,Z.jsx)(gr,{children:(0,Z.jsx)(_1.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,Z.jsxs)(vr,{children:[(0,Z.jsx)(gr,{children:(0,Z.jsx)(x1.default,{})}),"More secure than a password."]}),(0,Z.jsxs)(vr,{children:[(0,Z.jsx)(gr,{children:(0,Z.jsx)(S1.default,{})}),"Takes seconds to set up and use."]})]}),k1=()=>{let{user:e,unlinkPasskey:t}=G(),{linkWithPasskey:r,closePrivyModal:o}=R(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[a,i]=(0,Mn.useState)(!1),[s,l]=(0,Mn.useState)(""),[c,u]=(0,Mn.useState)(!1),[h,m]=(0,Mn.useState)(!1);(0,Mn.useEffect)(()=>{n.length===0&&m(!1)},[n.length]);let v=()=>{i(!0),r().then(()=>u(!0)).catch(g=>{if(g instanceof yt){if(g.privyErrorCode==="cannot_link_more_of_type"){l("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){l("Passkey request timed out or rejected by user.");return}}l("Unknown error occurred.")}).finally(()=>{i(!1)})},b=async g=>(i(!0),await t(g).then(()=>u(!0)).catch(S=>{if(S instanceof yt&&S.privyErrorCode==="missing_or_invalid_mfa"){l("Cannot unlink a passkey enrolled in MFA");return}l("Unknown error occurred.")}).finally(()=>{i(!1)}));return c?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{onClose:()=>o()},"header"),(0,Z.jsx)(He,{children:(0,Z.jsx)(lt,{status:"success",children:(0,Z.jsx)(A1.default,{})})}),(0,Z.jsx)(T1,{children:"Passkey added"}),(0,Z.jsx)(c4,{children:"From now on, you can use your passkey to log in."}),(0,Z.jsx)(Xt,{children:(0,Z.jsx)(F,{onClick:()=>o(),children:"Done"})}),(0,Z.jsx)(Y,{})]}):h?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{backFn:()=>m(!1),onClose:()=>o()},"header"),(0,Z.jsx)(E1,{passkeys:n,expanded:h,onUnlink:b,onExpand:()=>m(!0)}),(0,Z.jsx)(Y,{})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{onClose:()=>o()},"header"),(0,Z.jsx)(He,{children:(0,Z.jsxs)(Lc,{children:[(0,Z.jsx)(di,{}),(0,Z.jsx)(ui,{})]})}),(0,Z.jsx)(T1,{children:"Secure your account with a passkey"}),(0,Z.jsx)(p4,{}),n.length===0?(0,Z.jsx)(i4,{}):(0,Z.jsx)(E1,{passkeys:n,expanded:h,onUnlink:b,onExpand:()=>m(!0)}),(0,Z.jsxs)(Xt,{style:{marginTop:"12px"},children:[s&&(0,Z.jsx)(a4,{fail:!0,children:s}),(0,Z.jsx)(F,{onClick:v,loading:a,children:"Add new passkey"})]}),(0,Z.jsx)(Y,{})]})},Lc=rr.default.div`
1807
1807
  display: flex;
1808
1808
  align-items: center;
1809
1809
  justify-content: center;
@@ -1819,7 +1819,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1819
1819
  stroke: var(--privy-color-accent) !important;
1820
1820
  fill: var(--privy-color-accent) !important;
1821
1821
  }
1822
- `,Xw=tr.default.div`
1822
+ `,a4=rr.default.div`
1823
1823
  line-height: 20px;
1824
1824
  height: 20px;
1825
1825
  font-size: 13px;
@@ -1827,7 +1827,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1827
1827
  display: flex;
1828
1828
  justify-content: flex-beginngin;
1829
1829
  width: 100%;
1830
- `,e4=tr.css`
1830
+ `,s4=rr.css`
1831
1831
  && {
1832
1832
  width: 100%;
1833
1833
  font-size: 0.875rem;
@@ -1852,9 +1852,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1852
1852
  box-shadow: none;
1853
1853
  }
1854
1854
  }
1855
- `,t4=tr.default.button`
1856
- ${e4}
1857
- `,x1=tr.default.div`
1855
+ `,l4=rr.default.button`
1856
+ ${s4}
1857
+ `,R1=rr.default.div`
1858
1858
  display: flex;
1859
1859
  flex-direction: column;
1860
1860
  align-items: stretch;
@@ -1862,18 +1862,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1862
1862
  padding: 0.5rem 0rem 0rem;
1863
1863
  flex-grow: 1;
1864
1864
  width: 100%;
1865
- `,b1=tr.default.div`
1865
+ `,T1=rr.default.div`
1866
1866
  font-size: 18px;
1867
1867
  line-height: 18px;
1868
1868
  text-align: center;
1869
1869
  font-weight: 600;
1870
- `,r4=tr.default.div`
1870
+ `,c4=rr.default.div`
1871
1871
  font-size: 0.875rem;
1872
1872
  text-align: center;
1873
1873
  margin-top: 10px;
1874
- `,o4=tr.default.div`
1874
+ `,p4=rr.default.div`
1875
1875
  height: 32px;
1876
- `,n4=tr.default.div`
1876
+ `,d4=rr.default.div`
1877
1877
  line-height: 20px;
1878
1878
  height: 20px;
1879
1879
  font-size: 1em;
@@ -1881,18 +1881,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1881
1881
  display: flex;
1882
1882
  justify-content: flex-beginning;
1883
1883
  width: 100%;
1884
- `,i4=tr.default.div`
1884
+ `,u4=rr.default.div`
1885
1885
  font-size: 1em;
1886
1886
  line-height: 1.3em;
1887
1887
  font-weight: 500;
1888
1888
  color: var(--privy-color-foreground-2);
1889
1889
  padding: 0.2em 0;
1890
- `,a4=tr.default.div`
1890
+ `,m4=rr.default.div`
1891
1891
  font-size: 0.875rem;
1892
1892
  line-height: 1rem;
1893
1893
  color: #64668b;
1894
1894
  padding: 0.2em 0;
1895
- `,s4=tr.default.div`
1895
+ `,f4=rr.default.div`
1896
1896
  display: flex;
1897
1897
  align-items: center;
1898
1898
  justify-content: space-between;
@@ -1905,7 +1905,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1905
1905
  border: 1px solid #e2e3f0 !important;
1906
1906
  width: 100%;
1907
1907
  height: 5em;
1908
- `,l4=tr.css`
1908
+ `,h4=rr.css`
1909
1909
  :focus,
1910
1910
  :hover,
1911
1911
  :active {
@@ -1922,9 +1922,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1922
1922
  svg:hover {
1923
1923
  color: var(--privy-color-foreground-3);
1924
1924
  }
1925
- `,c4=tr.default.button`
1926
- ${l4}
1927
- `;var k1=y(require("@heroicons/react/24/outline/PhoneIcon"));var Nr=require("react/jsx-runtime"),R1=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=k(),{initLoginWithSms:a}=R();async function i({qualifiedPhoneNumber:s}){try{await a(s),o("AWAITING_PASSWORDLESS_CODE")}catch(l){n({errorModalData:{error:l,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return(0,Nr.jsxs)(Nr.Fragment,{children:[(0,Nr.jsx)(_,{},"header"),(0,Nr.jsx)(le,{}),(0,Nr.jsx)(Ge,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Nr.jsx)(k1.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Nr.jsx)($r,{children:(0,Nr.jsx)(Ca,{stacked:!0,onSubmit:i})}),(0,Nr.jsx)(ce,{}),(0,Nr.jsx)(j,{protectedByPrivy:!0})]})};var No=require("react/jsx-runtime"),I1=()=>{let{linkingOrConnectingHint:e}=R(),{app:t}=k(),r=e?`Link the wallet with address ${Vr(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,No.jsxs)(No.Fragment,{children:[(0,No.jsx)(_,{},"header"),(0,No.jsx)(Ro,{title:"Link your wallet",description:r}),(0,No.jsx)(uo,{children:(0,No.jsx)(Ji,{connectOnly:!1})}),(0,No.jsx)(j,{protectedByPrivy:!0})]})};var ys=require("react/jsx-runtime"),W1=({style:e,...t})=>(0,ys.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,ys.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,ys.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var Er=require("react/jsx-runtime"),M1=()=>{let{closePrivyModal:e}=R(),{navigate:t}=k();return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(_,{},"header"),(0,Er.jsx)(le,{}),(0,Er.jsx)(W1,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Er.jsx)(Ro,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Er.jsxs)($r,{children:[(0,Er.jsx)(F,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Er.jsx)(co,{onClick:()=>e(),children:"Cancel"})]}),(0,Er.jsx)(ce,{}),(0,Er.jsx)(j,{protectedByPrivy:!0})]})};var a2=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),s2=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),l2=y(require("@heroicons/react/24/solid/IdentificationIcon")),c2=y(require("@heroicons/react/24/solid/PhoneIcon")),p2=y(require("@heroicons/react/24/solid/QuestionMarkCircleIcon")),xd=y(require("@heroicons/react/24/solid/ShieldCheckIcon")),rn=require("react");var O1=require("react");function ba(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=(0,O1.useContext)(xe);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}var L1=require("react");function Xr(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:a,unenroll:i,enrollInMfa:s}=(0,L1.useContext)(xe);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:a,unenrollWithSms:()=>i("sms"),unenrollWithTotp:()=>i("totp"),unenrollWithPasskey:()=>i("passkey"),showMfaEnrollmentModal:()=>s(!0),closeMfaEnrollmentModal:()=>s(!1)}}var N1=y(require("styled-components")),gs=require("react/jsx-runtime"),D1=e=>(0,gs.jsxs)(p4,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,gs.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,gs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),p4=N1.default.svg`
1925
+ `,y4=rr.default.button`
1926
+ ${h4}
1927
+ `;var I1=y(require("@heroicons/react/24/outline/PhoneIcon"));var Lr=require("react/jsx-runtime"),W1=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=k(),{initLoginWithSms:a}=R();async function i({qualifiedPhoneNumber:s}){try{await a(s),o("AWAITING_PASSWORDLESS_CODE")}catch(l){n({errorModalData:{error:l,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return(0,Lr.jsxs)(Lr.Fragment,{children:[(0,Lr.jsx)(_,{},"header"),(0,Lr.jsx)(le,{}),(0,Lr.jsx)(Ve,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Lr.jsx)(I1.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Lr.jsx)(zr,{children:(0,Lr.jsx)(wa,{stacked:!0,onSubmit:i})}),(0,Lr.jsx)(ce,{}),(0,Lr.jsx)(j,{})]})};var No=require("react/jsx-runtime"),M1=()=>{let{linkingOrConnectingHint:e}=R(),{app:t}=k(),r=e?`Link the wallet with address ${Hr(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,No.jsxs)(No.Fragment,{children:[(0,No.jsx)(_,{},"header"),(0,No.jsx)(Ro,{title:"Link your wallet",description:r}),(0,No.jsx)(po,{children:(0,No.jsx)(Xi,{connectOnly:!1})}),(0,No.jsx)(j,{})]})};var gs=require("react/jsx-runtime"),O1=({style:e,...t})=>(0,gs.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,gs.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,gs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var Er=require("react/jsx-runtime"),L1=()=>{let{closePrivyModal:e}=R(),{navigate:t}=k();return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(_,{},"header"),(0,Er.jsx)(le,{}),(0,Er.jsx)(O1,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Er.jsx)(Ro,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Er.jsxs)(zr,{children:[(0,Er.jsx)(F,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Er.jsx)(lo,{onClick:()=>e(),children:"Cancel"})]}),(0,Er.jsx)(ce,{}),(0,Er.jsx)(j,{})]})};var l2=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),c2=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),p2=y(require("@heroicons/react/24/solid/IdentificationIcon")),d2=y(require("@heroicons/react/24/solid/PhoneIcon")),u2=y(require("@heroicons/react/24/solid/QuestionMarkCircleIcon")),kd=y(require("@heroicons/react/24/solid/ShieldCheckIcon")),on=require("react");var N1=require("react");function Ea(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=(0,N1.useContext)(Ae);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}var D1=require("react");function Jr(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:a,unenroll:i,enrollInMfa:s}=(0,D1.useContext)(Ae);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:a,unenrollWithSms:()=>i("sms"),unenrollWithTotp:()=>i("totp"),unenrollWithPasskey:()=>i("passkey"),showMfaEnrollmentModal:()=>s(!0),closeMfaEnrollmentModal:()=>s(!1)}}var U1=y(require("styled-components")),vs=require("react/jsx-runtime"),F1=e=>(0,vs.jsxs)(g4,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,vs.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,vs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),g4=U1.default.svg`
1928
1928
  height: 90px;
1929
1929
  width: 90px;
1930
1930
 
@@ -1935,7 +1935,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1935
1935
  > path {
1936
1936
  fill: white;
1937
1937
  }
1938
- `;var Lc=y(require("@heroicons/react/20/solid/CheckIcon")),U1=y(require("@heroicons/react/24/outline/ChevronRightIcon")),F1=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),B1=y(require("@heroicons/react/24/outline/FingerPrintIcon")),H1=y(require("@heroicons/react/24/outline/PhoneIcon")),Nc=y(require("@heroicons/react/24/outline/TrashIcon")),V1=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var oe=require("react/jsx-runtime"),G1=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:a,error:i,onClose:s,onBackToIntro:l,handleSelectMethod:c,setRemovingMfaMethod:u})=>{let h=t.reduce((v,b)=>({...v,[b]:!0}),{}),m=r.reduce((v,b)=>({...v,[b]:!0}),{});return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(_,{backFn:e?l:void 0,onClose:s},"header"),(0,oe.jsx)(Ve,{children:(0,oe.jsx)(lt,{children:(0,oe.jsx)(V1.default,{})})}),(0,oe.jsx)(Ce,{children:"Choose a verification method"}),t.length>0?(0,oe.jsx)(Ee,{children:"To add or delete verification methods, verification is required."}):(0,oe.jsx)(Ee,{children:"How would you like to verify your identity? You can change this later."}),i&&(0,oe.jsx)(Zl,{style:{marginTop:"1.25rem"},children:i.message}),(0,oe.jsxs)(zl,{children:[(m.totp||h.totp)&&(0,oe.jsxs)($l,{children:[(0,oe.jsx)(Ue,{style:{justifyContent:"center"},disabled:h.totp||n,onClick:()=>c("totp"),children:n?(0,oe.jsx)(Mt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,oe.jsxs)(Yl,{children:[(0,oe.jsxs)(jl,{children:[(0,oe.jsx)(F1.default,{}),"Authenticator App"]}),h.totp?(0,oe.jsxs)(ii,{children:[(0,oe.jsx)(Lc.default,{}),"Added"]}):(0,oe.jsx)(ii,{children:"Recommended"})]})}),h.totp&&(0,oe.jsx)(Kl,{onClick:()=>u("totp"),children:(0,oe.jsx)(Nc.default,{})})]},"totp"),(m.sms||h.sms)&&(0,oe.jsxs)($l,{children:[(0,oe.jsx)(Ue,{disabled:h.sms||o,onClick:()=>c("sms"),children:(0,oe.jsxs)(Yl,{children:[(0,oe.jsxs)(jl,{children:[(0,oe.jsx)(H1.default,{}),"SMS"]}),h.sms&&(0,oe.jsxs)(ii,{children:[(0,oe.jsx)(Lc.default,{}),"Added"]}),o&&(0,oe.jsx)(ii,{children:"Disabled"})]})}),h.sms&&(0,oe.jsx)(Kl,{onClick:()=>u("sms"),children:(0,oe.jsx)(Nc.default,{})})]},"sms"),(m.passkey||h.passkey)&&(0,oe.jsxs)($l,{children:[(0,oe.jsx)(Ue,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:h.passkey||a,children:a?(0,oe.jsx)(Mt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,oe.jsxs)(Yl,{children:[(0,oe.jsxs)(jl,{children:[(0,oe.jsx)(B1.default,{}),"Passkey"]}),h.passkey?(0,oe.jsxs)(ii,{children:[(0,oe.jsx)(Lc.default,{}),"Added"]}):(0,oe.jsx)(ii,{isAccent:!0,children:(0,oe.jsx)(U1.default,{})})]})}),h.passkey&&(0,oe.jsx)(Kl,{onClick:()=>u("passkey"),children:(0,oe.jsx)(Nc.default,{})})]},"passkey")]}),(0,oe.jsx)(Y,{})]})};var z1=y(require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon")),$1=y(require("@heroicons/react/24/outline/ClockIcon")),K1=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),j1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),On=require("react"),vs=y(require("styled-components"));var Q=require("react/jsx-runtime"),Y1=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=G(),{data:n}=k(),{initLinkWithPasskey:a,linkWithPasskey:i}=R(),{initEnrollmentWithPasskey:s,submitEnrollmentWithPasskey:l}=Xr(),[c,u]=(0,On.useState)(!1),[h,m]=(0,On.useState)(!1),[v,b]=(0,On.useState)(!1),[g,P]=(0,On.useState)(null),A=(0,On.useMemo)(()=>o?.linkedAccounts.filter(D=>D.type==="passkey")??[],[o]),E=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},S=async D=>{u(!0);try{await s(),await l({credentialIds:D}),b(!0)}catch(M){P(M)}finally{u(!1)}},W=async()=>{m(!0),P(null);try{await a();let M=(await i())?.linkedAccounts.filter(I=>I.type==="passkey").map(I=>I.credentialId)??[];await S(M)}catch(D){P(D)}finally{m(!1)}};return A.length===0||h?(0,Q.jsx)(d4,{onReset:r,onClose:t,onClick:W,isCreating:h}):v?(0,Q.jsx)(m4,{onClick:E,onClose:E}):g?(0,Q.jsx)(ss,{error:g,backFn:()=>P(null),onClick:()=>P(null)}):(0,Q.jsx)(u4,{passkeys:A,isSubmitting:c,isCreating:h,onReset:r,onClose:t,onSubmitEnrollment:()=>S(A.map(D=>D.credentialId)),onAddPasskey:W})},d4=({onReset:e,onClose:t,onClick:r,isCreating:o})=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_,{backFn:e,onClose:t},"header"),(0,Q.jsx)(Ve,{children:(0,Q.jsxs)(Oc,{children:[(0,Q.jsx)(ui,{}),(0,Q.jsx)(mi,{})]})}),(0,Q.jsx)(Ce,{children:"Set up passkey verification"}),(0,Q.jsxs)(ni,{children:[(0,Q.jsxs)(vr,{children:[(0,Q.jsx)(gr,{children:(0,Q.jsx)(K1.default,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),(0,Q.jsxs)(vr,{children:[(0,Q.jsx)(gr,{children:(0,Q.jsx)($1.default,{})}),"Takes seconds to set up and use"]}),(0,Q.jsxs)(vr,{children:[(0,Q.jsx)(gr,{children:(0,Q.jsx)(z1.default,{})}),"Use your passkey to verify transactions and login to your account"]})]}),(0,Q.jsx)(F,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),(0,Q.jsx)(Y,{})]}),u4=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:a,isCreating:i})=>{let[s,l]=(0,On.useState)(!1),c=s?n.length:n.length>3?2:3;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_,{backFn:s?()=>l(!1):e,onClose:t},"header"),!s&&(0,Q.jsx)(Ve,{children:(0,Q.jsxs)(Oc,{children:[(0,Q.jsx)(ui,{}),(0,Q.jsx)(mi,{})]})}),(0,Q.jsx)(Ce,{children:"Enable your passkeys for verification"}),(0,Q.jsxs)(ni,{children:[n.slice(0,c).map(u=>(0,Q.jsxs)(f4,{children:[(0,Q.jsx)(h4,{children:g4(u)}),(0,Q.jsxs)(y4,{children:["Last used: ",u.latestVerifiedAt?.toLocaleString()]})]},u.credentialId)),!s&&n.length>3&&(0,Q.jsx)(q1,{onClick:()=>l(!0),children:"View All"})]}),(0,Q.jsx)(F,{style:{marginTop:"1.5rem"},onClick:o,loading:a,children:"Enable passkeys"}),n.length<5&&(0,Q.jsx)(q1,{style:{marginTop:"0.5rem"},onClick:r,disabled:i,children:i?(0,Q.jsx)(Mt,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),(0,Q.jsx)(Y,{})]})},m4=({onClick:e,onClose:t})=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_,{onClose:t},"header"),(0,Q.jsx)(Ve,{children:(0,Q.jsx)(lt,{status:"success",children:(0,Q.jsx)(j1.default,{})})}),(0,Q.jsx)(Ce,{children:"Passkey verification added"}),(0,Q.jsx)(Ee,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),(0,Q.jsx)(Jt,{children:(0,Q.jsx)(F,{onClick:e,children:"Done"})}),(0,Q.jsx)(Y,{})]}),f4=vs.default.div`
1938
+ `;var Nc=y(require("@heroicons/react/20/solid/CheckIcon")),B1=y(require("@heroicons/react/24/outline/ChevronRightIcon")),H1=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),V1=y(require("@heroicons/react/24/outline/FingerPrintIcon")),G1=y(require("@heroicons/react/24/outline/PhoneIcon")),Dc=y(require("@heroicons/react/24/outline/TrashIcon")),q1=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var oe=require("react/jsx-runtime"),z1=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:a,error:i,onClose:s,onBackToIntro:l,handleSelectMethod:c,setRemovingMfaMethod:u})=>{let h=t.reduce((v,b)=>({...v,[b]:!0}),{}),m=r.reduce((v,b)=>({...v,[b]:!0}),{});return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(_,{backFn:e?l:void 0,onClose:s},"header"),(0,oe.jsx)(He,{children:(0,oe.jsx)(lt,{children:(0,oe.jsx)(q1.default,{})})}),(0,oe.jsx)(we,{children:"Choose a verification method"}),t.length>0?(0,oe.jsx)(Ee,{children:"To add or delete verification methods, verification is required."}):(0,oe.jsx)(Ee,{children:"How would you like to verify your identity? You can change this later."}),i&&(0,oe.jsx)(Ql,{style:{marginTop:"1.25rem"},children:i.message}),(0,oe.jsxs)($l,{children:[(m.totp||h.totp)&&(0,oe.jsxs)(Kl,{children:[(0,oe.jsx)(De,{style:{justifyContent:"center"},disabled:h.totp||n,onClick:()=>c("totp"),children:n?(0,oe.jsx)(Ot,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,oe.jsxs)(Zl,{children:[(0,oe.jsxs)(Yl,{children:[(0,oe.jsx)(H1.default,{}),"Authenticator App"]}),h.totp?(0,oe.jsxs)(ni,{children:[(0,oe.jsx)(Nc.default,{}),"Added"]}):(0,oe.jsx)(ni,{children:"Recommended"})]})}),h.totp&&(0,oe.jsx)(jl,{onClick:()=>u("totp"),children:(0,oe.jsx)(Dc.default,{})})]},"totp"),(m.sms||h.sms)&&(0,oe.jsxs)(Kl,{children:[(0,oe.jsx)(De,{disabled:h.sms||o,onClick:()=>c("sms"),children:(0,oe.jsxs)(Zl,{children:[(0,oe.jsxs)(Yl,{children:[(0,oe.jsx)(G1.default,{}),"SMS"]}),h.sms&&(0,oe.jsxs)(ni,{children:[(0,oe.jsx)(Nc.default,{}),"Added"]}),o&&(0,oe.jsx)(ni,{children:"Disabled"})]})}),h.sms&&(0,oe.jsx)(jl,{onClick:()=>u("sms"),children:(0,oe.jsx)(Dc.default,{})})]},"sms"),(m.passkey||h.passkey)&&(0,oe.jsxs)(Kl,{children:[(0,oe.jsx)(De,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:h.passkey||a,children:a?(0,oe.jsx)(Ot,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,oe.jsxs)(Zl,{children:[(0,oe.jsxs)(Yl,{children:[(0,oe.jsx)(V1.default,{}),"Passkey"]}),h.passkey?(0,oe.jsxs)(ni,{children:[(0,oe.jsx)(Nc.default,{}),"Added"]}):(0,oe.jsx)(ni,{isAccent:!0,children:(0,oe.jsx)(B1.default,{})})]})}),h.passkey&&(0,oe.jsx)(jl,{onClick:()=>u("passkey"),children:(0,oe.jsx)(Dc.default,{})})]},"passkey")]}),(0,oe.jsx)(Y,{})]})};var K1=y(require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon")),j1=y(require("@heroicons/react/24/outline/ClockIcon")),Y1=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),Z1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),On=require("react"),Cs=y(require("styled-components"));var Q=require("react/jsx-runtime"),Q1=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=G(),{data:n}=k(),{initLinkWithPasskey:a,linkWithPasskey:i}=R(),{initEnrollmentWithPasskey:s,submitEnrollmentWithPasskey:l}=Jr(),[c,u]=(0,On.useState)(!1),[h,m]=(0,On.useState)(!1),[v,b]=(0,On.useState)(!1),[g,S]=(0,On.useState)(null),A=(0,On.useMemo)(()=>o?.linkedAccounts.filter(D=>D.type==="passkey")??[],[o]),E=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},P=async D=>{u(!0);try{await s(),await l({credentialIds:D}),b(!0)}catch(M){S(M)}finally{u(!1)}},W=async()=>{m(!0),S(null);try{await a();let M=(await i())?.linkedAccounts.filter(I=>I.type==="passkey").map(I=>I.credentialId)??[];await P(M)}catch(D){S(D)}finally{m(!1)}};return A.length===0||h?(0,Q.jsx)(v4,{onReset:r,onClose:t,onClick:W,isCreating:h}):v?(0,Q.jsx)(w4,{onClick:E,onClose:E}):g?(0,Q.jsx)(ls,{error:g,backFn:()=>S(null),onClick:()=>S(null)}):(0,Q.jsx)(C4,{passkeys:A,isSubmitting:c,isCreating:h,onReset:r,onClose:t,onSubmitEnrollment:()=>P(A.map(D=>D.credentialId)),onAddPasskey:W})},v4=({onReset:e,onClose:t,onClick:r,isCreating:o})=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_,{backFn:e,onClose:t},"header"),(0,Q.jsx)(He,{children:(0,Q.jsxs)(Lc,{children:[(0,Q.jsx)(di,{}),(0,Q.jsx)(ui,{})]})}),(0,Q.jsx)(we,{children:"Set up passkey verification"}),(0,Q.jsxs)(oi,{children:[(0,Q.jsxs)(vr,{children:[(0,Q.jsx)(gr,{children:(0,Q.jsx)(Y1.default,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),(0,Q.jsxs)(vr,{children:[(0,Q.jsx)(gr,{children:(0,Q.jsx)(j1.default,{})}),"Takes seconds to set up and use"]}),(0,Q.jsxs)(vr,{children:[(0,Q.jsx)(gr,{children:(0,Q.jsx)(K1.default,{})}),"Use your passkey to verify transactions and login to your account"]})]}),(0,Q.jsx)(F,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),(0,Q.jsx)(Y,{})]}),C4=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:a,isCreating:i})=>{let[s,l]=(0,On.useState)(!1),c=s?n.length:n.length>3?2:3;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_,{backFn:s?()=>l(!1):e,onClose:t},"header"),!s&&(0,Q.jsx)(He,{children:(0,Q.jsxs)(Lc,{children:[(0,Q.jsx)(di,{}),(0,Q.jsx)(ui,{})]})}),(0,Q.jsx)(we,{children:"Enable your passkeys for verification"}),(0,Q.jsxs)(oi,{children:[n.slice(0,c).map(u=>(0,Q.jsxs)(b4,{children:[(0,Q.jsx)(E4,{children:S4(u)}),(0,Q.jsxs)(T4,{children:["Last used: ",u.latestVerifiedAt?.toLocaleString()]})]},u.credentialId)),!s&&n.length>3&&(0,Q.jsx)($1,{onClick:()=>l(!0),children:"View All"})]}),(0,Q.jsx)(F,{style:{marginTop:"1.5rem"},onClick:o,loading:a,children:"Enable passkeys"}),n.length<5&&(0,Q.jsx)($1,{style:{marginTop:"0.5rem"},onClick:r,disabled:i,children:i?(0,Q.jsx)(Ot,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),(0,Q.jsx)(Y,{})]})},w4=({onClick:e,onClose:t})=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_,{onClose:t},"header"),(0,Q.jsx)(He,{children:(0,Q.jsx)(lt,{status:"success",children:(0,Q.jsx)(Z1.default,{})})}),(0,Q.jsx)(we,{children:"Passkey verification added"}),(0,Q.jsx)(Ee,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),(0,Q.jsx)(Xt,{children:(0,Q.jsx)(F,{onClick:e,children:"Done"})}),(0,Q.jsx)(Y,{})]}),b4=Cs.default.div`
1939
1939
  && {
1940
1940
  padding: 0.75rem 1rem;
1941
1941
  text-align: left;
@@ -1943,19 +1943,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
1943
1943
  border: 1px solid var(--privy-color-foreground-4);
1944
1944
  width: 100%;
1945
1945
  }
1946
- `,h4=vs.default.div`
1946
+ `,E4=Cs.default.div`
1947
1947
  font-size: 0.875rem;
1948
1948
  line-height: 1.375rem;
1949
1949
  font-weight: 500;
1950
1950
 
1951
1951
  color: var(--privy-color-foreground-1);
1952
- `,y4=vs.default.div`
1952
+ `,T4=Cs.default.div`
1953
1953
  font-size: 0.75rem;
1954
1954
  font-weight: 400;
1955
1955
  line-height: 1.125rem;
1956
1956
 
1957
1957
  color: var(--privy-color-foreground-2);
1958
- `,g4=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",q1=vs.default.button`
1958
+ `,S4=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",$1=Cs.default.button`
1959
1959
  && {
1960
1960
  width: 100%;
1961
1961
  font-size: 0.875rem;
@@ -1980,7 +1980,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1980
1980
  box-shadow: none;
1981
1981
  }
1982
1982
  }
1983
- `;var J1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),_d=y(require("@heroicons/react/24/solid/PhoneIcon")),ws=require("react");var Dc=require("react"),Q1=require("react-device-detect"),Sd=y(require("styled-components")),Do=require("react/jsx-runtime"),Cs=6,v4=new Array(Cs).fill("");function C4(e){return e.replace(/\s+/g,"")}function Pd(e){return/^[0-9]{1}$/.test(e)}function Z1(e){return e.length===Cs&&e.every(Pd)}function w4(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var fi=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,a]=(0,Dc.useState)(v4),[i,s]=(0,Dc.useState)(null),[l,c]=(0,Dc.useState)(null),u=async b=>{b.preventDefault();let g=C4(b.currentTarget.value);if(g==="")return;let P=w4(n,Pd),A=g.split(""),E=!A.every(Pd),S=A.length+P>Cs;if(E){s("Passcode can only be numbers"),c(1);return}if(S){s("Passcode must be exactly 6 numbers"),c(1);return}s(null),c(null);let W=Number(b.currentTarget.name?.charAt(4)),D=[...g||[""]].slice(0,Cs-W),M=[...n.slice(0,W),...D,...n.slice(W+D.length)];a(M);let I=D.length,H=Math.min(Math.max(W+I,0),Cs-1);if(document.querySelector(`input[name=pin-${H}]`)?.focus(),Z1(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${H}]`)?.blur()}catch(J){c(1),s(J.message)}else try{await e(null)}catch(J){c(1),s(J.message)}},h=b=>{l===1&&(s(null),c(null));let g=[...n.slice(0,b),"",...n.slice(b+1)];a(g),b>0&&document.querySelector(`input[name=pin-${b-1}]`)?.focus(),Z1(g)?e(g.join("")):e(null)},v=o?"success":!!(r||i)?"fail":"";return(0,Do.jsx)(Do.Fragment,{children:(0,Do.jsxs)(b4,{children:[(0,Do.jsx)("div",{children:n.map((b,g)=>(0,Do.jsx)("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:u,onKeyUp:P=>{P.key==="Backspace"&&h(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:v,autoComplete:Q1.isMobile?"one-time-code":"off",disabled:t},g))}),(0,Do.jsx)("div",{children:(0,Do.jsx)(E4,{fail:!!r||!!i,children:r||i})})]})})},b4=Sd.default.div`
1983
+ `;var e2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Ad=y(require("@heroicons/react/24/solid/PhoneIcon")),bs=require("react");var Uc=require("react"),X1=require("react-device-detect"),_d=y(require("styled-components")),Do=require("react/jsx-runtime"),ws=6,P4=new Array(ws).fill("");function _4(e){return e.replace(/\s+/g,"")}function Pd(e){return/^[0-9]{1}$/.test(e)}function J1(e){return e.length===ws&&e.every(Pd)}function A4(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var mi=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,a]=(0,Uc.useState)(P4),[i,s]=(0,Uc.useState)(null),[l,c]=(0,Uc.useState)(null),u=async b=>{b.preventDefault();let g=_4(b.currentTarget.value);if(g==="")return;let S=A4(n,Pd),A=g.split(""),E=!A.every(Pd),P=A.length+S>ws;if(E){s("Passcode can only be numbers"),c(1);return}if(P){s("Passcode must be exactly 6 numbers"),c(1);return}s(null),c(null);let W=Number(b.currentTarget.name?.charAt(4)),D=[...g||[""]].slice(0,ws-W),M=[...n.slice(0,W),...D,...n.slice(W+D.length)];a(M);let I=D.length,H=Math.min(Math.max(W+I,0),ws-1);if(document.querySelector(`input[name=pin-${H}]`)?.focus(),J1(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${H}]`)?.blur()}catch(J){c(1),s(J.message)}else try{await e(null)}catch(J){c(1),s(J.message)}},h=b=>{l===1&&(s(null),c(null));let g=[...n.slice(0,b),"",...n.slice(b+1)];a(g),b>0&&document.querySelector(`input[name=pin-${b-1}]`)?.focus(),J1(g)?e(g.join("")):e(null)},v=o?"success":!!(r||i)?"fail":"";return(0,Do.jsx)(Do.Fragment,{children:(0,Do.jsxs)(x4,{children:[(0,Do.jsx)("div",{children:n.map((b,g)=>(0,Do.jsx)("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:u,onKeyUp:S=>{S.key==="Backspace"&&h(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:v,autoComplete:X1.isMobile?"one-time-code":"off",disabled:t},g))}),(0,Do.jsx)("div",{children:(0,Do.jsx)(k4,{fail:!!r||!!i,children:r||i})})]})})},x4=_d.default.div`
1984
1984
  display: flex;
1985
1985
  flex-direction: column;
1986
1986
  width: 100%;
@@ -2048,7 +2048,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2048
2048
  transform: translate(1px, 0px);
2049
2049
  }
2050
2050
  }
2051
- `,E4=Sd.default.div`
2051
+ `,k4=_d.default.div`
2052
2052
  line-height: 20px;
2053
2053
  font-size: 13px;
2054
2054
  display: flex;
@@ -2056,7 +2056,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2056
2056
  width: 100%;
2057
2057
 
2058
2058
  color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
2059
- `;var ye=require("react/jsx-runtime"),X1=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,ws.useState)(""),[a,i]=(0,ws.useState)(!1),[s,l]=(0,ws.useState)(null),[c,u]=(0,ws.useState)("enroll"),{initEnrollmentWithSms:h,submitEnrollmentWithSms:m}=Xr(),{app:v,data:b}=k();function g(){b?.mfaEnrollmentFlow?.onSuccess(),e()}async function P({qualifiedPhoneNumber:S}){try{await h({phoneNumber:S}),n(S),u("verify")}catch(W){l(W)}}async function A(S){try{if(!S)return;await m({phoneNumber:o,mfaCode:S}),i(!0)}catch(W){throw rc(W)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Pn(W)?new Error("The code you entered is not valid"):Tn(W)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):oc(W)?new Error("Verification canceled"):new Error("Unknown error")}}function E(){c==="verify"?u("enroll"):t()}return s?(0,ye.jsx)(ss,{error:s,backFn:()=>l(null),onClick:()=>l(null)}):c==="enroll"?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(_,{backFn:t,onClose:r},"header"),(0,ye.jsx)(Ve,{children:(0,ye.jsx)(lt,{children:(0,ye.jsx)(_d.default,{})})}),(0,ye.jsx)(Ce,{children:"Set up SMS verification"}),(0,ye.jsx)(Ee,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,ye.jsxs)(zr,{children:[(0,ye.jsx)(Ca,{onSubmit:P}),(0,ye.jsxs)(eh,{children:["By providing your mobile number, you agree to receive text messages from ",v?.name,". Some carrier charges may apply"]})]}),(0,ye.jsx)(Y,{})]}):a?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(_,{onClose:g},"header"),(0,ye.jsx)(Ve,{children:(0,ye.jsx)(lt,{status:"success",children:(0,ye.jsx)(J1.default,{})})}),(0,ye.jsx)(Ce,{children:"SMS verification added"}),(0,ye.jsx)(Ee,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,ye.jsx)(Jt,{children:(0,ye.jsx)(F,{onClick:g,children:"Done"})}),(0,ye.jsx)(Y,{})]}):(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(_,{backFn:E,onClose:r},"header"),(0,ye.jsx)(Ve,{children:(0,ye.jsx)(lt,{children:(0,ye.jsx)(_d.default,{})})}),(0,ye.jsx)(Ce,{children:"Enter enrollment code"}),(0,ye.jsxs)(zr,{children:[(0,ye.jsx)(fi,{onChange:A}),(0,ye.jsxs)(Ee,{children:["To continue, enter the 6-digit code sent to ",(0,ye.jsx)("strong",{children:Yg(o)})]})]}),(0,ye.jsx)(Y,{})]})};var o2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),n2=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Ad=require("react");var e2=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var r2=require("react/jsx-runtime");var t2=({size:e,authUrl:t})=>(0,r2.jsx)(fa,{url:t,squareLogoElement:e2.default,size:e,fgColor:"#1F1F1F"});var ge=require("react/jsx-runtime"),i2=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,a]=(0,Ad.useState)("enroll"),[i,s]=(0,Ad.useState)(!1),{submitEnrollmentWithTotp:l}=Xr(),{data:c}=k();function u(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function h(){a("verify")}async function m(b){try{if(!b)return;await l({mfaCode:b}),s(!0)}catch(g){throw rc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Pn(g)?new Error("The code you entered is not valid"):Tn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):oc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function v(){n==="verify"?a("enroll"):r()}return n==="enroll"?(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(_,{backFn:r,onClose:t},"header"),(0,ge.jsx)(Ce,{children:"Scan QR code"}),(0,ge.jsx)(Ee,{children:"Open your authenticator app and scan the QR code to continue."}),(0,ge.jsx)(Zi,{children:(0,ge.jsx)(t2,{authUrl:o.authUrl,size:200})}),(0,ge.jsxs)(Jt,{children:[(0,ge.jsx)(sr,{children:(0,ge.jsx)(Rn,{itemName:"secret",text:o.secret})}),(0,ge.jsx)(F,{onClick:h,children:"Continue"})]}),(0,ge.jsx)(Y,{})]}):i?(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(_,{onClose:u},"header"),(0,ge.jsx)(Ve,{children:(0,ge.jsx)(lt,{status:"success",children:(0,ge.jsx)(o2.default,{})})}),(0,ge.jsx)(Ce,{children:"Authenticator app verification added"}),(0,ge.jsx)(Ee,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,ge.jsx)(Jt,{children:(0,ge.jsx)(F,{onClick:u,children:"Done"})}),(0,ge.jsx)(Y,{})]}):(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(_,{backFn:v,onClose:t},"header"),(0,ge.jsx)(Ve,{children:(0,ge.jsx)(lt,{children:(0,ge.jsx)(n2.default,{})})}),(0,ge.jsx)(Ce,{children:"Enter enrollment code"}),(0,ge.jsx)(zr,{children:(0,ge.jsx)(fi,{onChange:m})}),(0,ge.jsxs)(Ee,{children:["To continue, enter the 6-digit code generated from your ",(0,ge.jsx)("strong",{children:"authenticator app"})]}),(0,ge.jsx)(Y,{})]})};var V=require("react/jsx-runtime"),d2=()=>{let{user:e,enrollInMfa:t}=G(),[r,o]=(0,rn.useState)(null),{unenrollWithSms:n,unenrollWithTotp:a,unenrollWithPasskey:i}=Xr(),{app:s,ready:l,data:c,onUserCloseViaDialogOrKeybindRef:u}=k(),{closePrivyModal:h}=R(),{promptMfa:m}=ba(),{initEnrollmentWithTotp:v}=Xr(),[b,g]=(0,rn.useState)(!1),[P,A]=(0,rn.useState)(null),[E,S]=(0,rn.useState)(null),W=()=>{h({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),A(null)},500)},{initEnrollmentWithPasskey:D,submitEnrollmentWithPasskey:M}=Xr(),[I,H]=(0,rn.useState)(!1),[$,J]=(0,rn.useState)(null);u.current=W;let O=e?.mfaMethods.includes("sms"),K=!!e?.phone,N=e?.mfaMethods.includes("totp"),nt=e?.mfaMethods.includes("passkey"),ht=O||N||nt,Xe=e?.linkedAccounts.filter(ve=>ve.type==="passkey").map(ve=>ve.credentialId)??[];(0,rn.useEffect)(()=>{ht&&g(!0)},[ht]);function we(){o(null),A(null)}function ne(){g(!1)}async function Ne(){H(!0);try{await D(),await M({credentialIds:Xe})}catch(ve){J(ve)}finally{H(!1)}}async function He(ve){if(await m().catch(J),ve==="totp"){A(ve),S(null),v().then(Eo=>{S(Eo)}).catch(()=>{S(null),we()});return}if(ve==="passkey"&&Xe.length===1)return await Ne();A(ve)}if(!l||!e||!s)return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{onClose:W},"header"),(0,V.jsx)(Ve,{children:(0,V.jsx)(D1,{})}),(0,V.jsx)(zr,{children:(0,V.jsx)(Mt,{})}),(0,V.jsx)(Y,{})]});async function Yt(){o(null);try{await n()}catch{o(null)}}async function Fr(){o(null);try{await a()}catch{o(null)}}async function pr(){o(null);try{await m(),await i()}catch{o(null)}}if(r==="sms")return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{backFn:we,onClose:W},"header"),(0,V.jsx)(Ve,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(c2.default,{})})}),(0,V.jsx)(Ce,{children:"Remove SMS verification?"}),(0,V.jsxs)(Ee,{children:["MFA adds an extra layer of security to your ",s?.name," account. Make sure you have other methods to secure your account."]}),(0,V.jsx)(Jt,{children:(0,V.jsx)(F,{warn:!0,onClick:Yt,children:"Remove SMS for MFA"})}),(0,V.jsx)(Y,{})]});if(r==="totp")return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{backFn:we,onClose:W},"header"),(0,V.jsx)(Ve,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(s2.default,{})})}),(0,V.jsx)(Ce,{children:"Remove Authenticator App verification?"}),(0,V.jsxs)(Ee,{children:["MFA adds an extra layer of security to your ",s?.name," account. Make sure you have other methods to secure your account."]}),(0,V.jsx)(Jt,{children:(0,V.jsx)(F,{warn:!0,onClick:Fr,children:"Remove Authenticator App for MFA"})}),(0,V.jsx)(Y,{})]});if(r==="passkey")return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{backFn:we,onClose:W},"header"),(0,V.jsx)(Ve,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(p2.default,{})})}),(0,V.jsx)(Ce,{children:"Are you sure you want to remove passkey verification?"}),(0,V.jsx)(Ee,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),(0,V.jsx)(Jt,{children:(0,V.jsx)(F,{warn:!0,onClick:pr,children:"Yes, remove"})}),(0,V.jsx)(Y,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!ht)return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{onClose:W},"header"),(0,V.jsx)(Ve,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(xd.default,{})})}),(0,V.jsx)(Ce,{children:"Add more security"}),(0,V.jsxs)(Ee,{children:[s?.name," does not have any verification methods enabled."]}),(0,V.jsx)(Jt,{children:(0,V.jsx)(F,{onClick:W,children:"Close"})}),(0,V.jsx)(Y,{})]});let kt=!ht&&!b;return kt?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{onClose:W},"header"),(0,V.jsx)(Ve,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(xd.default,{})})}),(0,V.jsx)(Ce,{children:"Transaction Protection"}),(0,V.jsx)(Ee,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,V.jsxs)(ni,{children:[(0,V.jsxs)(vr,{children:[(0,V.jsx)(gr,{children:(0,V.jsx)(a2.default,{})}),"Enable 2-Step verification for your ",s?.name," wallet."]}),(0,V.jsxs)(vr,{children:[(0,V.jsx)(gr,{children:(0,V.jsx)(l2.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,V.jsxs)(Jt,{children:[(0,V.jsx)(F,{onClick:()=>g(!0),children:"Continue"}),(0,V.jsx)(co,{onClick:W,children:"Not now"})]}),(0,V.jsx)(Y,{})]}):P==="sms"?(0,V.jsx)(X1,{onComplete:W,onReset:we,onClose:W}):P==="totp"&&E?(0,V.jsx)(i2,{onComplete:W,onClose:W,onReset:we,totpInfo:E}):P==="passkey"?(0,V.jsx)(Y1,{onComplete:W,onReset:we,onClose:W}):(0,V.jsx)(G1,{showIntro:kt,userMfaMethods:e.mfaMethods,appMfaMethods:s.mfa.methods,userHasAuthSms:K,onBackToIntro:ne,handleSelectMethod:He,isTotpLoading:P==="totp"&&!E,isPasskeyLoading:I,error:$,onClose:W,setRemovingMfaMethod:o})};var H2=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),V2=y(require("@heroicons/react/24/outline/FingerPrintIcon")),G2=y(require("@heroicons/react/24/outline/PhoneIcon")),q2=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),z2=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),$2=y(require("@heroicons/react/24/solid/PhoneIcon")),Nn=require("react");var yi=require("react"),N2=y(require("styled-components")),zc=require("@privy-io/js-sdk-core");var Ld=y(require("styled-components"));var kd=y(require("styled-components")),bs=require("react/jsx-runtime"),Uc=({label:e,children:t,valueStyles:r})=>(0,bs.jsxs)(T4,{children:[(0,bs.jsx)("div",{children:e}),(0,bs.jsx)(P4,{style:{...r},children:t})]}),T4=kd.default.div`
2059
+ `;var ye=require("react/jsx-runtime"),t2=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,bs.useState)(""),[a,i]=(0,bs.useState)(!1),[s,l]=(0,bs.useState)(null),[c,u]=(0,bs.useState)("enroll"),{initEnrollmentWithSms:h,submitEnrollmentWithSms:m}=Jr(),{app:v,data:b}=k();function g(){b?.mfaEnrollmentFlow?.onSuccess(),e()}async function S({qualifiedPhoneNumber:P}){try{await h({phoneNumber:P}),n(P),u("verify")}catch(W){l(W)}}async function A(P){try{if(!P)return;await m({phoneNumber:o,mfaCode:P}),i(!0)}catch(W){throw oc(W)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Sn(W)?new Error("The code you entered is not valid"):Tn(W)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):nc(W)?new Error("Verification canceled"):new Error("Unknown error")}}function E(){c==="verify"?u("enroll"):t()}return s?(0,ye.jsx)(ls,{error:s,backFn:()=>l(null),onClick:()=>l(null)}):c==="enroll"?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(_,{backFn:t,onClose:r},"header"),(0,ye.jsx)(He,{children:(0,ye.jsx)(lt,{children:(0,ye.jsx)(Ad.default,{})})}),(0,ye.jsx)(we,{children:"Set up SMS verification"}),(0,ye.jsx)(Ee,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,ye.jsxs)(qr,{children:[(0,ye.jsx)(wa,{onSubmit:S}),(0,ye.jsxs)(rh,{children:["By providing your mobile number, you agree to receive text messages from ",v?.name,". Some carrier charges may apply"]})]}),(0,ye.jsx)(Y,{})]}):a?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(_,{onClose:g},"header"),(0,ye.jsx)(He,{children:(0,ye.jsx)(lt,{status:"success",children:(0,ye.jsx)(e2.default,{})})}),(0,ye.jsx)(we,{children:"SMS verification added"}),(0,ye.jsx)(Ee,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,ye.jsx)(Xt,{children:(0,ye.jsx)(F,{onClick:g,children:"Done"})}),(0,ye.jsx)(Y,{})]}):(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(_,{backFn:E,onClose:r},"header"),(0,ye.jsx)(He,{children:(0,ye.jsx)(lt,{children:(0,ye.jsx)(Ad.default,{})})}),(0,ye.jsx)(we,{children:"Enter enrollment code"}),(0,ye.jsxs)(qr,{children:[(0,ye.jsx)(mi,{onChange:A}),(0,ye.jsxs)(Ee,{children:["To continue, enter the 6-digit code sent to ",(0,ye.jsx)("strong",{children:Qg(o)})]})]}),(0,ye.jsx)(Y,{})]})};var i2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),a2=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),xd=require("react");var r2=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var n2=require("react/jsx-runtime");var o2=({size:e,authUrl:t})=>(0,n2.jsx)(ha,{url:t,squareLogoElement:r2.default,size:e,fgColor:"#1F1F1F"});var ge=require("react/jsx-runtime"),s2=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,a]=(0,xd.useState)("enroll"),[i,s]=(0,xd.useState)(!1),{submitEnrollmentWithTotp:l}=Jr(),{data:c}=k();function u(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function h(){a("verify")}async function m(b){try{if(!b)return;await l({mfaCode:b}),s(!0)}catch(g){throw oc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Sn(g)?new Error("The code you entered is not valid"):Tn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):nc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function v(){n==="verify"?a("enroll"):r()}return n==="enroll"?(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(_,{backFn:r,onClose:t},"header"),(0,ge.jsx)(we,{children:"Scan QR code"}),(0,ge.jsx)(Ee,{children:"Open your authenticator app and scan the QR code to continue."}),(0,ge.jsx)(Qi,{children:(0,ge.jsx)(o2,{authUrl:o.authUrl,size:200})}),(0,ge.jsxs)(Xt,{children:[(0,ge.jsx)(lr,{children:(0,ge.jsx)(Rn,{itemName:"secret",text:o.secret})}),(0,ge.jsx)(F,{onClick:h,children:"Continue"})]}),(0,ge.jsx)(Y,{})]}):i?(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(_,{onClose:u},"header"),(0,ge.jsx)(He,{children:(0,ge.jsx)(lt,{status:"success",children:(0,ge.jsx)(i2.default,{})})}),(0,ge.jsx)(we,{children:"Authenticator app verification added"}),(0,ge.jsx)(Ee,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,ge.jsx)(Xt,{children:(0,ge.jsx)(F,{onClick:u,children:"Done"})}),(0,ge.jsx)(Y,{})]}):(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(_,{backFn:v,onClose:t},"header"),(0,ge.jsx)(He,{children:(0,ge.jsx)(lt,{children:(0,ge.jsx)(a2.default,{})})}),(0,ge.jsx)(we,{children:"Enter enrollment code"}),(0,ge.jsx)(qr,{children:(0,ge.jsx)(mi,{onChange:m})}),(0,ge.jsxs)(Ee,{children:["To continue, enter the 6-digit code generated from your ",(0,ge.jsx)("strong",{children:"authenticator app"})]}),(0,ge.jsx)(Y,{})]})};var V=require("react/jsx-runtime"),m2=()=>{let{user:e,enrollInMfa:t}=G(),[r,o]=(0,on.useState)(null),{unenrollWithSms:n,unenrollWithTotp:a,unenrollWithPasskey:i}=Jr(),{app:s,ready:l,data:c,onUserCloseViaDialogOrKeybindRef:u}=k(),{closePrivyModal:h}=R(),{promptMfa:m}=Ea(),{initEnrollmentWithTotp:v}=Jr(),[b,g]=(0,on.useState)(!1),[S,A]=(0,on.useState)(null),[E,P]=(0,on.useState)(null),W=()=>{h({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),A(null)},500)},{initEnrollmentWithPasskey:D,submitEnrollmentWithPasskey:M}=Jr(),[I,H]=(0,on.useState)(!1),[$,J]=(0,on.useState)(null);u.current=W;let O=e?.mfaMethods.includes("sms"),K=!!e?.phone,N=e?.mfaMethods.includes("totp"),nt=e?.mfaMethods.includes("passkey"),ht=O||N||nt,Xe=e?.linkedAccounts.filter(ve=>ve.type==="passkey").map(ve=>ve.credentialId)??[];(0,on.useEffect)(()=>{ht&&g(!0)},[ht]);function be(){o(null),A(null)}function ne(){g(!1)}async function Le(){H(!0);try{await D(),await M({credentialIds:Xe})}catch(ve){J(ve)}finally{H(!1)}}async function Be(ve){if(await m().catch(J),ve==="totp"){A(ve),P(null),v().then(bo=>{P(bo)}).catch(()=>{P(null),be()});return}if(ve==="passkey"&&Xe.length===1)return await Le();A(ve)}if(!l||!e||!s)return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{onClose:W},"header"),(0,V.jsx)(He,{children:(0,V.jsx)(F1,{})}),(0,V.jsx)(qr,{children:(0,V.jsx)(Ot,{})}),(0,V.jsx)(Y,{})]});async function Zt(){o(null);try{await n()}catch{o(null)}}async function Ur(){o(null);try{await a()}catch{o(null)}}async function dr(){o(null);try{await m(),await i()}catch{o(null)}}if(r==="sms")return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{backFn:be,onClose:W},"header"),(0,V.jsx)(He,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(d2.default,{})})}),(0,V.jsx)(we,{children:"Remove SMS verification?"}),(0,V.jsxs)(Ee,{children:["MFA adds an extra layer of security to your ",s?.name," account. Make sure you have other methods to secure your account."]}),(0,V.jsx)(Xt,{children:(0,V.jsx)(F,{warn:!0,onClick:Zt,children:"Remove SMS for MFA"})}),(0,V.jsx)(Y,{})]});if(r==="totp")return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{backFn:be,onClose:W},"header"),(0,V.jsx)(He,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(c2.default,{})})}),(0,V.jsx)(we,{children:"Remove Authenticator App verification?"}),(0,V.jsxs)(Ee,{children:["MFA adds an extra layer of security to your ",s?.name," account. Make sure you have other methods to secure your account."]}),(0,V.jsx)(Xt,{children:(0,V.jsx)(F,{warn:!0,onClick:Ur,children:"Remove Authenticator App for MFA"})}),(0,V.jsx)(Y,{})]});if(r==="passkey")return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{backFn:be,onClose:W},"header"),(0,V.jsx)(He,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(u2.default,{})})}),(0,V.jsx)(we,{children:"Are you sure you want to remove passkey verification?"}),(0,V.jsx)(Ee,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),(0,V.jsx)(Xt,{children:(0,V.jsx)(F,{warn:!0,onClick:dr,children:"Yes, remove"})}),(0,V.jsx)(Y,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!ht)return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{onClose:W},"header"),(0,V.jsx)(He,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(kd.default,{})})}),(0,V.jsx)(we,{children:"Add more security"}),(0,V.jsxs)(Ee,{children:[s?.name," does not have any verification methods enabled."]}),(0,V.jsx)(Xt,{children:(0,V.jsx)(F,{onClick:W,children:"Close"})}),(0,V.jsx)(Y,{})]});let kt=!ht&&!b;return kt?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{onClose:W},"header"),(0,V.jsx)(He,{children:(0,V.jsx)(lt,{children:(0,V.jsx)(kd.default,{})})}),(0,V.jsx)(we,{children:"Transaction Protection"}),(0,V.jsx)(Ee,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,V.jsxs)(oi,{children:[(0,V.jsxs)(vr,{children:[(0,V.jsx)(gr,{children:(0,V.jsx)(l2.default,{})}),"Enable 2-Step verification for your ",s?.name," wallet."]}),(0,V.jsxs)(vr,{children:[(0,V.jsx)(gr,{children:(0,V.jsx)(p2.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,V.jsxs)(Xt,{children:[(0,V.jsx)(F,{onClick:()=>g(!0),children:"Continue"}),(0,V.jsx)(lo,{onClick:W,children:"Not now"})]}),(0,V.jsx)(Y,{})]}):S==="sms"?(0,V.jsx)(t2,{onComplete:W,onReset:be,onClose:W}):S==="totp"&&E?(0,V.jsx)(s2,{onComplete:W,onClose:W,onReset:be,totpInfo:E}):S==="passkey"?(0,V.jsx)(Q1,{onComplete:W,onReset:be,onClose:W}):(0,V.jsx)(z1,{showIntro:kt,userMfaMethods:e.mfaMethods,appMfaMethods:s.mfa.methods,userHasAuthSms:K,onBackToIntro:ne,handleSelectMethod:Be,isTotpLoading:S==="totp"&&!E,isPasskeyLoading:I,error:$,onClose:W,setRemovingMfaMethod:o})};var G2=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),q2=y(require("@heroicons/react/24/outline/FingerPrintIcon")),z2=y(require("@heroicons/react/24/outline/PhoneIcon")),$2=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),K2=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),j2=y(require("@heroicons/react/24/solid/PhoneIcon")),Nn=require("react");var hi=require("react"),U2=y(require("styled-components")),$c=require("@privy-io/js-sdk-core");var Nd=y(require("styled-components"));var Rd=y(require("styled-components")),Es=require("react/jsx-runtime"),Fc=({label:e,children:t,valueStyles:r})=>(0,Es.jsxs)(R4,{children:[(0,Es.jsx)("div",{children:e}),(0,Es.jsx)(I4,{style:{...r},children:t})]}),R4=Rd.default.div`
2060
2060
  display: flex;
2061
2061
  align-items: center;
2062
2062
  justify-content: space-between;
@@ -2071,7 +2071,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2071
2071
  color: var(--privy-color-foreground-2);
2072
2072
  text-align: right;
2073
2073
  }
2074
- `,P4=kd.default.div`
2074
+ `,I4=Rd.default.div`
2075
2075
  font-size: 14px;
2076
2076
  line-height: 100%;
2077
2077
  display: flex;
@@ -2080,28 +2080,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
2080
2080
  border-radius: var(--privy-border-radius-full);
2081
2081
  background-color: var(--privy-color-background-2);
2082
2082
  padding: 4px 8px;
2083
- `;var Ts=y(require("styled-components"));var u2=require("@ethersproject/bignumber"),Rd=require("@ethersproject/units"),m2=require("@privy-io/js-sdk-core");var Es=(e,t)=>{let r=(t*parseFloat((0,Rd.formatEther)(e))).toFixed(2);return r!=="0.00"?`$${r}`:"<$0.01"},Uo=(e,t,r=6,o=!1)=>{let a=parseFloat((0,Rd.formatEther)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${a} ${t}`:`${a==="0"?"<0.001":a} ${t}`},Id=e=>e.map(m2.QuantityToBigNumber).reduce((t,r)=>t.add(r),u2.BigNumber.from(0)).toHexString(),f2=(e,t)=>{let{chains:r}=R(),o=`https://etherscan.io/address/${t}`,n=`${Qu(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n};var Fo=require("react/jsx-runtime"),h2=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Id(e),n=t?Es(o,t):void 0,a=Uo(o,r);return(0,Fo.jsx)(y2,{children:n||a})},Wd=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Id(e),n=t?Es(o,t):void 0,a=Uo(o,r);return(0,Fo.jsx)(y2,{children:n?(0,Fo.jsxs)(Fo.Fragment,{children:[(0,Fo.jsx)(S4,{children:"USD"}),n==="<$0.01"?(0,Fo.jsxs)(A4,{children:[(0,Fo.jsx)(_4,{children:"<"}),"$0.01"]}):n]}):a})},y2=Ts.default.span`
2083
+ `;var Ss=y(require("styled-components"));var f2=require("@ethersproject/bignumber"),Id=require("@ethersproject/units"),h2=require("@privy-io/js-sdk-core");var Ts=(e,t)=>{let r=(t*parseFloat((0,Id.formatEther)(e))).toFixed(2);return r!=="0.00"?`$${r}`:"<$0.01"},Uo=(e,t,r=6,o=!1)=>{let a=parseFloat((0,Id.formatEther)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${a} ${t}`:`${a==="0"?"<0.001":a} ${t}`},Wd=e=>e.map(h2.QuantityToBigNumber).reduce((t,r)=>t.add(r),f2.BigNumber.from(0)).toHexString(),y2=(e,t)=>{let{chains:r}=R(),o=`https://etherscan.io/address/${t}`,n=`${Xu(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n};var Fo=require("react/jsx-runtime"),g2=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Wd(e),n=t?Ts(o,t):void 0,a=Uo(o,r);return(0,Fo.jsx)(v2,{children:n||a})},Md=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Wd(e),n=t?Ts(o,t):void 0,a=Uo(o,r);return(0,Fo.jsx)(v2,{children:n?(0,Fo.jsxs)(Fo.Fragment,{children:[(0,Fo.jsx)(W4,{children:"USD"}),n==="<$0.01"?(0,Fo.jsxs)(O4,{children:[(0,Fo.jsx)(M4,{children:"<"}),"$0.01"]}):n]}):a})},v2=Ss.default.span`
2084
2084
  font-size: 14px;
2085
2085
  line-height: 140%;
2086
2086
  display: flex;
2087
2087
  gap: 4px;
2088
2088
  align-items: center;
2089
- `,S4=Ts.default.span`
2089
+ `,W4=Ss.default.span`
2090
2090
  font-size: 12px;
2091
2091
  line-height: 12px;
2092
2092
  color: var(--privy-color-foreground-3);
2093
- `,_4=Ts.default.span`
2093
+ `,M4=Ss.default.span`
2094
2094
  font-size: 10px;
2095
- `,A4=Ts.default.span`
2095
+ `,O4=Ss.default.span`
2096
2096
  display: flex;
2097
2097
  align-items: center;
2098
- `;var Fc=y(require("styled-components")),Md=require("@privy-io/js-sdk-core");var Tr=require("react/jsx-runtime"),g2=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,Tr.jsxs)(Yp,{style:{paddingBottom:"12px"},children:[(0,Tr.jsxs)(C2,{children:[(0,Tr.jsx)(b2,{children:"Est. Fees"}),(0,Tr.jsx)("div",{children:(0,Tr.jsx)(Wd,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,Tr.jsx)(w2,{children:`${Uo(e,r)}`})]}),v2=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=(0,Md.QuantityToBigNumber)(e.value||0).add((0,Md.QuantityToBigNumber)(t)).toHexString();return(0,Tr.jsxs)(Yp,{children:[(0,Tr.jsxs)(C2,{children:[(0,Tr.jsx)(b2,{children:"Total (including fees)"}),(0,Tr.jsx)("div",{children:(0,Tr.jsx)(Wd,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&(0,Tr.jsx)(w2,{children:Uo(n,o)})]})},C2=Fc.default.div`
2098
+ `;var Bc=y(require("styled-components")),Od=require("@privy-io/js-sdk-core");var Tr=require("react/jsx-runtime"),C2=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,Tr.jsxs)(Zp,{style:{paddingBottom:"12px"},children:[(0,Tr.jsxs)(b2,{children:[(0,Tr.jsx)(T2,{children:"Est. Fees"}),(0,Tr.jsx)("div",{children:(0,Tr.jsx)(Md,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,Tr.jsx)(E2,{children:`${Uo(e,r)}`})]}),w2=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=(0,Od.QuantityToBigNumber)(e.value||0).add((0,Od.QuantityToBigNumber)(t)).toHexString();return(0,Tr.jsxs)(Zp,{children:[(0,Tr.jsxs)(b2,{children:[(0,Tr.jsx)(T2,{children:"Total (including fees)"}),(0,Tr.jsx)("div",{children:(0,Tr.jsx)(Md,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&(0,Tr.jsx)(E2,{children:Uo(n,o)})]})},b2=Bc.default.div`
2099
2099
  display: flex;
2100
2100
  flex-direction: row;
2101
2101
  justify-content: space-between;
2102
2102
  align-items: center;
2103
2103
  padding-top: 4px;
2104
- `,w2=Fc.default.div`
2104
+ `,E2=Bc.default.div`
2105
2105
  display: flex;
2106
2106
  flex-direction: row;
2107
2107
  height: 12px;
@@ -2110,23 +2110,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
2110
2110
  line-height: 12px;
2111
2111
  color: var(--privy-color-foreground-3);
2112
2112
  font-weight: 400;
2113
- `,b2=Fc.default.div`
2113
+ `,T2=Bc.default.div`
2114
2114
  font-size: 14px;
2115
2115
  line-height: 22.4px;
2116
2116
  font-weight: 400;
2117
- `;var E2=y(require("@heroicons/react/24/outline/ChevronDownIcon")),Bo=require("react"),on=y(require("styled-components"));var Bc=require("react"),Ea=(0,Bc.createContext)(void 0);var Ps=(0,Bc.createContext)(void 0);var $t=require("react/jsx-runtime"),T2=({defaultValue:e,children:t})=>{let[r,o]=(0,Bo.useState)(e||null),n=a=>{o(r===a?null:a)};return(0,$t.jsx)(Ea.Provider,{value:{activePanel:r,togglePanel:n},children:(0,$t.jsx)(x4,{children:t})})},P2=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=(0,Bo.useContext)(Ea),n=r===e;return(0,$t.jsx)(Ps.Provider,{value:{onToggle:()=>o(e),value:e},children:(0,$t.jsx)(W4,{isActive:n,"data-open":n,children:t})})},S2=({children:e})=>{let{activePanel:t}=(0,Bo.useContext)(Ea),{onToggle:r,value:o}=(0,Bo.useContext)(Ps),n=t===o;return(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsxs)(k4,{onClick:r,"data-open":n,children:[(0,$t.jsx)(I4,{children:e}),(0,$t.jsx)(O4,{isactive:n,children:(0,$t.jsx)(E2.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,$t.jsx)(R4,{})]})},_2=({children:e})=>{let{activePanel:t}=(0,Bo.useContext)(Ea),{value:r}=(0,Bo.useContext)(Ps);return(0,$t.jsx)(M4,{"data-open":t===r,children:(0,$t.jsx)(x2,{children:e})})},A2=({children:e})=>{let{activePanel:t}=(0,Bo.useContext)(Ea),{value:r}=(0,Bo.useContext)(Ps);return(0,$t.jsx)(x2,{children:typeof e=="function"?e({isActive:t===r}):e})},x4=on.default.div`
2117
+ `;var S2=y(require("@heroicons/react/24/outline/ChevronDownIcon")),Bo=require("react"),nn=y(require("styled-components"));var Hc=require("react"),Ta=(0,Hc.createContext)(void 0);var Ps=(0,Hc.createContext)(void 0);var Kt=require("react/jsx-runtime"),P2=({defaultValue:e,children:t})=>{let[r,o]=(0,Bo.useState)(e||null),n=a=>{o(r===a?null:a)};return(0,Kt.jsx)(Ta.Provider,{value:{activePanel:r,togglePanel:n},children:(0,Kt.jsx)(L4,{children:t})})},_2=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=(0,Bo.useContext)(Ta),n=r===e;return(0,Kt.jsx)(Ps.Provider,{value:{onToggle:()=>o(e),value:e},children:(0,Kt.jsx)(F4,{isActive:n,"data-open":n,children:t})})},A2=({children:e})=>{let{activePanel:t}=(0,Bo.useContext)(Ta),{onToggle:r,value:o}=(0,Bo.useContext)(Ps),n=t===o;return(0,Kt.jsxs)(Kt.Fragment,{children:[(0,Kt.jsxs)(N4,{onClick:r,"data-open":n,children:[(0,Kt.jsx)(U4,{children:e}),(0,Kt.jsx)(H4,{isactive:n,children:(0,Kt.jsx)(S2.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,Kt.jsx)(D4,{})]})},x2=({children:e})=>{let{activePanel:t}=(0,Bo.useContext)(Ta),{value:r}=(0,Bo.useContext)(Ps);return(0,Kt.jsx)(B4,{"data-open":t===r,children:(0,Kt.jsx)(R2,{children:e})})},k2=({children:e})=>{let{activePanel:t}=(0,Bo.useContext)(Ta),{value:r}=(0,Bo.useContext)(Ps);return(0,Kt.jsx)(R2,{children:typeof e=="function"?e({isActive:t===r}):e})},L4=nn.default.div`
2118
2118
  display: flex;
2119
2119
  flex-direction: column;
2120
2120
  width: 100%;
2121
2121
  gap: 8px;
2122
- `,k4=on.default.div`
2122
+ `,N4=nn.default.div`
2123
2123
  display: flex;
2124
2124
  justify-content: space-between;
2125
2125
  align-items: center;
2126
2126
  width: 100%;
2127
2127
  cursor: pointer;
2128
2128
  padding-bottom: 8px;
2129
- `,R4=on.default.div`
2129
+ `,D4=nn.default.div`
2130
2130
  width: 100%;
2131
2131
 
2132
2132
  && {
@@ -2134,13 +2134,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2134
2134
  border-color: var(--privy-color-foreground-4);
2135
2135
  }
2136
2136
  padding-bottom: 12px;
2137
- `,I4=on.default.div`
2137
+ `,U4=nn.default.div`
2138
2138
  font-size: 14px;
2139
2139
  font-weight: 500;
2140
2140
  line-height: 19.6px;
2141
2141
  width: 100%;
2142
2142
  padding-right: 8px;
2143
- `,W4=on.default.div`
2143
+ `,F4=nn.default.div`
2144
2144
  display: flex;
2145
2145
  flex-direction: column;
2146
2146
  width: 100%;
@@ -2152,7 +2152,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2152
2152
  border-color: var(--privy-color-foreground-4);
2153
2153
  border-radius: var(--privy-border-radius-md);
2154
2154
  }
2155
- `,M4=on.default.div`
2155
+ `,B4=nn.default.div`
2156
2156
  position: relative;
2157
2157
  overflow: hidden;
2158
2158
  transition: max-height 25ms ease-out;
@@ -2164,38 +2164,38 @@ You will need this password to access your ${e} wallet on a new device. Please k
2164
2164
  &[data-open='false'] {
2165
2165
  max-height: 0;
2166
2166
  }
2167
- `,x2=on.default.div`
2167
+ `,R2=nn.default.div`
2168
2168
  display: flex;
2169
2169
  flex-direction: column;
2170
2170
  gap: 12px;
2171
2171
  flex: 1 1 auto;
2172
2172
  min-height: 1px;
2173
- `,O4=on.default.div`
2173
+ `,H4=nn.default.div`
2174
2174
  transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2175
- `;var k2=y(require("styled-components"));var R2=require("react/jsx-runtime"),Od=({walletAddress:e,chainId:t=$o})=>(0,R2.jsx)(L4,{href:f2(t,e),target:"_blank",children:Vr(e)}),L4=k2.default.a`
2175
+ `;var I2=y(require("styled-components"));var W2=require("react/jsx-runtime"),Ld=({walletAddress:e,chainId:t=$o})=>(0,W2.jsx)(V4,{href:y2(t,e),target:"_blank",children:Hr(e)}),V4=I2.default.a`
2176
2176
  &:hover {
2177
2177
  text-decoration: underline;
2178
2178
  }
2179
- `;var Ut=require("react/jsx-runtime"),Ta=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:a,tokenSymbol:i})=>{let s=r?.value||0,l=Wt();return(0,Ut.jsx)(T2,{...l.render.standalone?{defaultValue:"details"}:{},children:(0,Ut.jsxs)(P2,{value:"details",children:[(0,Ut.jsx)(S2,{children:(0,Ut.jsxs)(N4,{children:[(0,Ut.jsx)("div",{children:o?.title||o?.actionDescription||"Details"}),(0,Ut.jsx)(D4,{children:(0,Ut.jsx)(h2,{weiQuantities:[s],tokenPrice:n,tokenSymbol:i})})]})}),(0,Ut.jsxs)(_2,{children:[(0,Ut.jsx)(Uc,{label:"From",children:(0,Ut.jsx)(Od,{walletAddress:e,chainId:r.chainId||$o})}),(0,Ut.jsx)(Uc,{label:"To",children:(0,Ut.jsx)(Od,{walletAddress:t,chainId:r.chainId||$o})}),o&&o.action&&(0,Ut.jsx)(Uc,{label:"Action",children:o.action}),a&&(0,Ut.jsx)(g2,{transactionData:r,gas:a,tokenPrice:n,tokenSymbol:i})]}),(0,Ut.jsx)(A2,{children:({isActive:c})=>(0,Ut.jsx)(v2,{transactionData:r,displayFee:c,gas:a||"0x0",tokenPrice:n,tokenSymbol:i})})]})})},N4=Ld.default.div`
2179
+ `;var Ft=require("react/jsx-runtime"),Sa=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:a,tokenSymbol:i})=>{let s=r?.value||0,l=Mt();return(0,Ft.jsx)(P2,{...l.render.standalone?{defaultValue:"details"}:{},children:(0,Ft.jsxs)(_2,{value:"details",children:[(0,Ft.jsx)(A2,{children:(0,Ft.jsxs)(G4,{children:[(0,Ft.jsx)("div",{children:o?.title||o?.actionDescription||"Details"}),(0,Ft.jsx)(q4,{children:(0,Ft.jsx)(g2,{weiQuantities:[s],tokenPrice:n,tokenSymbol:i})})]})}),(0,Ft.jsxs)(x2,{children:[(0,Ft.jsx)(Fc,{label:"From",children:(0,Ft.jsx)(Ld,{walletAddress:e,chainId:r.chainId||$o})}),(0,Ft.jsx)(Fc,{label:"To",children:(0,Ft.jsx)(Ld,{walletAddress:t,chainId:r.chainId||$o})}),o&&o.action&&(0,Ft.jsx)(Fc,{label:"Action",children:o.action}),a&&(0,Ft.jsx)(C2,{transactionData:r,gas:a,tokenPrice:n,tokenSymbol:i})]}),(0,Ft.jsx)(k2,{children:({isActive:c})=>(0,Ft.jsx)(w2,{transactionData:r,displayFee:c,gas:a||"0x0",tokenPrice:n,tokenSymbol:i})})]})})},G4=Nd.default.div`
2180
2180
  display: flex;
2181
2181
  flex-direction: row;
2182
2182
  justify-content: space-between;
2183
- `,D4=Ld.default.div`
2183
+ `,q4=Nd.default.div`
2184
2184
  flex-shrink: 0;
2185
2185
  padding-left: 8px;
2186
- `;var Ss=y(require("styled-components"));var I2=y(require("styled-components")),Hc=I2.default.img`
2186
+ `;var _s=y(require("styled-components"));var M2=y(require("styled-components")),Vc=M2.default.img`
2187
2187
  && {
2188
2188
  height: ${e=>e.size==="sm"?"65px":"140px"};
2189
2189
  width: ${e=>e.size==="sm"?"65px":"140px"};
2190
2190
  border-radius: 16px;
2191
2191
  margin-bottom: 12px;
2192
2192
  }
2193
- `;var Ln=require("react/jsx-runtime"),Nd=({description:e,contractInfo:t})=>(0,Ln.jsxs)(U4,{children:[t.imgUrl&&(0,Ln.jsx)(Hc,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&(0,Ln.jsx)(F4,{children:(0,Ln.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&(0,Ln.jsx)(B4,{children:t.name}),(0,Ln.jsx)(H4,{children:e||t.actionText})]}),U4=Ss.default.div`
2193
+ `;var Ln=require("react/jsx-runtime"),Dd=({description:e,contractInfo:t})=>(0,Ln.jsxs)(z4,{children:[t.imgUrl&&(0,Ln.jsx)(Vc,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&(0,Ln.jsx)($4,{children:(0,Ln.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&(0,Ln.jsx)(K4,{children:t.name}),(0,Ln.jsx)(j4,{children:e||t.actionText})]}),z4=_s.default.div`
2194
2194
  display: flex;
2195
2195
  flex-direction: column;
2196
2196
  align-items: center;
2197
2197
  margin-bottom: 24px;
2198
- `,F4=Ss.default.div`
2198
+ `,$4=_s.default.div`
2199
2199
  font-size: 12px;
2200
2200
  line-height: 12px;
2201
2201
  padding: 7px;
@@ -2210,7 +2210,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2210
2210
  text-decoration: underline;
2211
2211
  }
2212
2212
  }
2213
- `,B4=Ss.default.div`
2213
+ `,K4=_s.default.div`
2214
2214
  margin-top: 8px;
2215
2215
 
2216
2216
  font-size: 18px;
@@ -2219,7 +2219,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2219
2219
  overflow: hidden;
2220
2220
  white-space: nowrap;
2221
2221
  text-overflow: ellipsis;
2222
- `,H4=Ss.default.div`
2222
+ `,j4=_s.default.div`
2223
2223
  margin-top: 12px;
2224
2224
  font-size: 14px;
2225
2225
  line-height: 22px;
@@ -2227,7 +2227,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2227
2227
  color: var(--privy-color-foreground-1);
2228
2228
  overflow: hidden;
2229
2229
  text-overflow: ellipsis;
2230
- `;var W2=y(require("@heroicons/react/24/outline/WalletIcon")),Vc=y(require("styled-components"));var hi=require("react/jsx-runtime"),M2=({address:e,txn:t,balance:r,hasFunds:o})=>{let n=!!r,{nativeTokenSymbolForChainId:a}=R(),i=a(t.chainId)||"ETH";return(0,hi.jsxs)(V4,{children:[(0,hi.jsxs)(G4,{children:[(0,hi.jsx)(W2.default,{strokeWidth:"2",width:"16px",height:"16px"}),(0,hi.jsx)("div",{children:Vr(e)})]}),(0,hi.jsxs)(q4,{displayBalanceColor:n,hasFunds:o,children:[r?Uo(r,i,6,!0):0," available"]})]})},V4=Vc.default.div`
2230
+ `;var O2=y(require("@heroicons/react/24/outline/WalletIcon")),Gc=y(require("styled-components"));var fi=require("react/jsx-runtime"),L2=({address:e,txn:t,balance:r,hasFunds:o})=>{let n=!!r,{nativeTokenSymbolForChainId:a}=R(),i=a(t.chainId)||"ETH";return(0,fi.jsxs)(Y4,{children:[(0,fi.jsxs)(Z4,{children:[(0,fi.jsx)(O2.default,{strokeWidth:"2",width:"16px",height:"16px"}),(0,fi.jsx)("div",{children:Hr(e)})]}),(0,fi.jsxs)(Q4,{displayBalanceColor:n,hasFunds:o,children:[r?Uo(r,i,6,!0):0," available"]})]})},Y4=Gc.default.div`
2231
2231
  display: flex;
2232
2232
  flex-direction: row;
2233
2233
  justify-content: space-between;
@@ -2240,12 +2240,12 @@ You will need this password to access your ${e} wallet on a new device. Please k
2240
2240
  border: 1px solid var(--privy-color-foreground-4);
2241
2241
  border-radius: var(--privy-border-radius-md);
2242
2242
  }
2243
- `,G4=Vc.default.div`
2243
+ `,Z4=Gc.default.div`
2244
2244
  display: flex;
2245
2245
  flex-direction: row;
2246
2246
  align-items: center;
2247
2247
  gap: 8px;
2248
- `,q4=Vc.default.div`
2248
+ `,Q4=Gc.default.div`
2249
2249
  display: flex;
2250
2250
  align-items: center;
2251
2251
  justify-content: center;
@@ -2255,34 +2255,34 @@ You will need this password to access your ${e} wallet on a new device. Please k
2255
2255
  background-color: var(--privy-color-background-2);
2256
2256
  padding: 5px 8px;
2257
2257
  color: ${e=>e.displayBalanceColor?e.hasFunds?"var(--privy-color-success-dark)":"var(--privy-color-error)":"inherit"};
2258
- `;var _s=y(require("styled-components"));var eo=require("react/jsx-runtime"),L2=({description:e,txn:t,tokenSymbol:r,tokenPrice:o})=>{let n=t.value||0,a=o?Es(n,o):void 0,i=Uo(n,r);return(0,eo.jsxs)(z4,{children:[a?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(O2,{children:a}),(0,eo.jsx)($4,{children:i})]}):(0,eo.jsx)(eo.Fragment,{children:(0,eo.jsx)(O2,{children:i})}),(0,eo.jsx)(K4,{children:e})]})},z4=_s.default.div`
2258
+ `;var As=y(require("styled-components"));var Xr=require("react/jsx-runtime"),D2=({description:e,txn:t,tokenSymbol:r,tokenPrice:o})=>{let n=t.value||0,a=o?Ts(n,o):void 0,i=Uo(n,r);return(0,Xr.jsxs)(J4,{children:[a?(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsx)(N2,{children:a}),(0,Xr.jsx)(X4,{children:i})]}):(0,Xr.jsx)(Xr.Fragment,{children:(0,Xr.jsx)(N2,{children:i})}),(0,Xr.jsx)(e5,{children:e})]})},J4=As.default.div`
2259
2259
  display: flex;
2260
2260
  flex-direction: column;
2261
2261
  align-items: center;
2262
2262
  margin-bottom: 20px;
2263
- `,O2=_s.default.h2`
2263
+ `,N2=As.default.h2`
2264
2264
  && {
2265
2265
  font-size: 48px;
2266
2266
  line-height: 48px;
2267
2267
  margin: 8px auto;
2268
2268
  }
2269
- `,$4=_s.default.p`
2269
+ `,X4=As.default.p`
2270
2270
  margin-bottom: 12px;
2271
2271
  && {
2272
2272
  font-size: 17px;
2273
2273
  line-height: 17px;
2274
2274
  color: var(--privy-color-foreground-3);
2275
2275
  }
2276
- `,K4=_s.default.div`
2276
+ `,e5=As.default.div`
2277
2277
  font-size: 16px;
2278
2278
  line-height: 22.4px;
2279
2279
  font-weight: 400;
2280
2280
  overflow: hidden;
2281
2281
  text-overflow: ellipsis;
2282
- `;var Pa=require("react");var Gc=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=R(),[n,a]=(0,Pa.useState)(!0),[i,s]=(0,Pa.useState)(void 0),[l,c]=(0,Pa.useState)(void 0);return(0,Pa.useEffect)(()=>{let u=e.chainId||$o,h=o.find(v=>v.id===Number(u));if(!h)throw new he(`Unsupported chain: ${u}`);(async()=>{if(!t){a(!1);return}try{a(!0);let v=await r(h);v?c(v):s(new Error(`Unable to fetch token price on chain id ${h.id}`))}catch(v){s(v)}finally{a(!1)}})()},[e.chainId]),{tokenPrice:l,isTokenPriceLoading:n,tokenPriceError:i}};var qc=require("react"),Dd=(0,qc.createContext)(null);function Sa(){let e=(0,qc.useContext)(Dd);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var Ud=require("react/jsx-runtime"),As=({pendingTransaction:e})=>{let{getAccessToken:t}=G(),{wallets:r}=Sa(),{walletProxy:o,rpcConfig:n,chains:a,appId:i,nativeTokenSymbolForChainId:s}=R(),[l,c]=(0,yi.useState)(null),[u,h]=(0,yi.useState)(e),{tokenPrice:m}=Gc(u),v=s(e.chainId)||"ETH",b=(0,yi.useMemo)(()=>r.find(g=>g.walletClientType==="privy"),[r]);return(0,yi.useEffect)(()=>{async function g(){if(!await t()||!o||!b)return u;let A=zo(u.chainId,a,n,{appId:i}),E=await(0,zc.populateTransactionRequest)(b.address,u,A),{totalGasEstimate:S}=await(0,zc.calculateTotalGasEstimate)(E,A);return c(S.toHexString()),E}g().then(h).catch(console.error)},[o]),b?(0,Ud.jsx)(j4,{children:(0,Ud.jsx)(Ta,{from:b.address,to:u.to,txn:u,gas:l??void 0,tokenPrice:m,tokenSymbol:v})}):null},j4=N2.default.div`
2282
+ `;var Pa=require("react");var qc=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=R(),[n,a]=(0,Pa.useState)(!0),[i,s]=(0,Pa.useState)(void 0),[l,c]=(0,Pa.useState)(void 0);return(0,Pa.useEffect)(()=>{let u=e.chainId||$o,h=o.find(v=>v.id===Number(u));if(!h)throw new he(`Unsupported chain: ${u}`);(async()=>{if(!t){a(!1);return}try{a(!0);let v=await r(h);v?c(v):s(new Error(`Unable to fetch token price on chain id ${h.id}`))}catch(v){s(v)}finally{a(!1)}})()},[e.chainId]),{tokenPrice:l,isTokenPriceLoading:n,tokenPriceError:i}};var zc=require("react"),Ud=(0,zc.createContext)(null);function _a(){let e=(0,zc.useContext)(Ud);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var Fd=require("react/jsx-runtime"),xs=({pendingTransaction:e})=>{let{getAccessToken:t}=G(),{wallets:r}=_a(),{walletProxy:o,rpcConfig:n,chains:a,appId:i,nativeTokenSymbolForChainId:s}=R(),[l,c]=(0,hi.useState)(null),[u,h]=(0,hi.useState)(e),{tokenPrice:m}=qc(u),v=s(e.chainId)||"ETH",b=(0,hi.useMemo)(()=>r.find(g=>g.walletClientType==="privy"),[r]);return(0,hi.useEffect)(()=>{async function g(){if(!await t()||!o||!b)return u;let A=zo(u.chainId,a,n,{appId:i}),E=await(0,$c.populateTransactionRequest)(b.address,u,A),{totalGasEstimate:P}=await(0,$c.calculateTotalGasEstimate)(E,A);return c(P.toHexString()),E}g().then(h).catch(console.error)},[o]),b?(0,Fd.jsx)(t5,{children:(0,Fd.jsx)(Sa,{from:b.address,to:u.to,txn:u,gas:l??void 0,tokenPrice:m,tokenSymbol:v})}):null},t5=U2.default.div`
2283
2283
  width: 100%;
2284
2284
  padding: 1rem 0;
2285
- `;var D2=y(require("@heroicons/react/24/outline/CalendarIcon")),U2=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),F2=y(require("@heroicons/react/24/outline/ShieldCheckIcon"));var Ke=require("react/jsx-runtime"),B2=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:a,submitSuccess:i})=>{let{pendingTransaction:s}=R();return(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(_,{onClose:r},"header"),(0,Ke.jsx)(ut,{children:(0,Ke.jsxs)("div",{children:[(0,Ke.jsx)(wt,{success:i,fail:!!t}),t?(0,Ke.jsx)(U2.default,{style:{width:"38px",height:"38px"}}):(0,Ke.jsx)(ui,{style:{width:"38px",height:"38px"}})]})}),(0,Ke.jsx)(Ce,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),(0,Ke.jsxs)(ni,{children:[(0,Ke.jsxs)(vr,{children:[(0,Ke.jsx)(gr,{children:(0,Ke.jsx)(F2.default,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),(0,Ke.jsxs)(vr,{children:[(0,Ke.jsx)(gr,{children:(0,Ke.jsx)(D2.default,{})}),"You last added a passkey on"," ",a?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),s&&(0,Ke.jsx)(zr,{children:(0,Ke.jsx)(As,{pendingTransaction:s})}),t&&(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(Zl,{style:{marginTop:"1.25rem"},children:t.message}),(0,Ke.jsx)(F,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&(0,Ke.jsx)(Ja,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),(0,Ke.jsx)(Y,{})]})};var te=require("react/jsx-runtime"),Fd=({open:e,onClose:t})=>{let{user:r}=G(),[o,n]=(0,Nn.useState)(null),{init:a,cancel:i,submit:s}=ba(),[l,c]=(0,Nn.useState)(!1),[u,h]=(0,Nn.useState)(!1),[m,v]=(0,Nn.useState)(null),[b,g]=(0,Nn.useState)(null);(0,Nn.useEffect)(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?E(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let P=D=>tc(D)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Pn(D)?(c(!1),new Error("The code you entered is not valid")):Tn(D)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(D),c(!1),new Error("Something went wrong."));async function A(D){g(null);try{if(!D||!o)return;await s(o,D),h(!0),c(!1),t()}catch(M){throw P(M)}}async function E(D){if(D==="passkey"){try{n(D);let M=await a(D);if(!M)throw new Error("something went wrong");v(M),await s(D,M),h(!0),c(!1),t()}catch(M){g(P(M))}return}try{n(D),await a(D)}catch(M){console.error(M)}}let S=()=>{n(null),g(null),i(),t()},W=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let D=r.linkedAccounts.filter(M=>M.type==="passkey"&&M.enrolledInMfa).sort((M,I)=>I.firstVerifiedAt.valueOf()-M.firstVerifiedAt.valueOf())[0];return(0,te.jsx)(B2,{account:D,selectedMethod:o,submitSuccess:u,hasBlockingError:l,error:b,onClose:S,onBack:W,handleSubmit:()=>A(m).catch(g)})}return o?(0,te.jsx)(Y4,{submitSuccess:u,hasBlockingError:l,handleSubmitCode:A,selectedMethod:o,onClose:S,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(_,{onClose:S},"header"),(0,te.jsx)(Ve,{children:(0,te.jsx)(lt,{children:(0,te.jsx)(q2.default,{})})}),(0,te.jsx)(Ce,{children:"Verify your identity"}),(0,te.jsx)(Ee,{children:"Choose a verification method"}),(0,te.jsxs)(zl,{children:[r.mfaMethods.includes("totp")&&(0,te.jsxs)(Ue,{onClick:()=>E("totp"),children:[(0,te.jsx)(H2.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,te.jsxs)(Ue,{onClick:()=>E("sms"),children:[(0,te.jsx)(G2.default,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&(0,te.jsxs)(Ue,{onClick:()=>E("passkey"),children:[(0,te.jsx)(V2.default,{}),"Passkey"]},"passkey")]}),(0,te.jsx)(Y,{})]})},Y4=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:a})=>{let{app:i}=k(),{pendingTransaction:s}=R();switch(e){case"sms":return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(_,{onClose:o},"header"),(0,te.jsx)(Ve,{children:(0,te.jsx)(lt,{children:(0,te.jsx)($2.default,{})})}),(0,te.jsx)(Ce,{children:"Enter verification code"}),(0,te.jsxs)(zr,{children:[(0,te.jsx)(fi,{success:t,disabled:r,onChange:a}),(0,te.jsxs)(Ee,{children:["To continue, please enter the 6-digit code sent to your ",(0,te.jsx)("strong",{children:"mobile device"})]}),s&&(0,te.jsx)(As,{pendingTransaction:s})]}),n&&(0,te.jsx)(Ja,{theme:i?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,te.jsx)(co,{onClick:o,children:"Not now"}),(0,te.jsx)(Y,{})]});case"totp":return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(_,{onClose:o},"header"),(0,te.jsx)(Ve,{children:(0,te.jsx)(lt,{children:(0,te.jsx)(z2.default,{})})}),(0,te.jsx)(Ce,{children:"Enter verification code"}),(0,te.jsxs)(zr,{children:[(0,te.jsx)(fi,{success:t,disabled:r,onChange:a}),(0,te.jsxs)(Ee,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,te.jsx)("strong",{children:"authenticator app"})]}),s&&(0,te.jsx)(As,{pendingTransaction:s})]}),n&&(0,te.jsx)(Ja,{theme:i?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,te.jsx)(co,{onClick:o,children:"Not now"}),(0,te.jsx)(Y,{})]});default:return null}};var _a=require("react"),K2=y(require("styled-components"));var Ft=require("react/jsx-runtime"),j2=()=>{let{authenticated:e,logout:t,ready:r,user:o}=G(),{app:n,setModalData:a,navigate:i,resetNavigation:s}=k(),{getAuthMeta:l,initLoginWithOAuth:c,loginWithOAuth:u,updateWallets:h,setReadyToTrue:m,closePrivyModal:v,createAnalyticsEvent:b}=R(),[g,P]=(0,_a.useState)(!1),[A,E]=(0,_a.useState)(void 0),S=l()?.provider||"google",{name:W,component:D}=Ga(S),M=$i(),I=et;(0,_a.useEffect)(()=>{u(S).then(J=>{P(!0),m(!0),J&&M("login","onOAuthLoginComplete",J)}).catch(J=>{if(m(!1),J?.privyErrorCode==="allowlist_rejected"){E(void 0),s(),i("ALLOWLIST_REJECTION_SCREEN");return}if(J?.privyErrorCode==="max_accounts_reached"){console.error(new Hr(J).toString()),E(void 0),s(),i("USER_LIMIT_REACHED_SCREEN");return}if(J?.privyErrorCode==="user_does_not_exist"){E(void 0),s(),i("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:O,detail:K}=Tm(J,S);E({retryable:O,detail:K,message:"Authentication failed"})}).finally(()=>{Qn()})},[W,S]),(0,_a.useEffect)(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let O=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},I);return()=>clearTimeout(O)}if(hr(o,n?.embeddedWallets?.createOnLogin)){let O=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:K=>{console.error(K),b({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,provider:S,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},I);return()=>clearTimeout(O)}else{let O=setTimeout(()=>v({shouldCallAuthOnSuccess:!0,isSuccess:!0}),I);return h(),()=>clearTimeout(O)}}},[r,e,g,o]);let H=g?`Successfully connected with ${W}`:A?A.message:`Verifying connection to ${W}`,$="";return g?$="You\u2019re good to go!":A?$=A.detail:$="Just a few moments more",(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsx)(_,{}),(0,Ft.jsx)(le,{}),(0,Ft.jsxs)(Z4,{children:[(0,Ft.jsx)(ut,{children:(0,Ft.jsxs)("div",{children:[(0,Ft.jsx)(wt,{success:g,fail:!!A}),(0,Ft.jsx)(D,{style:{width:"38px",height:"38px"}})]})}),(0,Ft.jsxs)(mt,{children:[(0,Ft.jsx)("h3",{children:H}),(0,Ft.jsx)("p",{children:$})]}),A&&A?.retryable?(0,Ft.jsx)(Ki,{onClick:()=>{Qn(),c(S),E(void 0)},disabled:!g&&!A?.retryable,children:"Retry"}):null]}),(0,Ft.jsx)(ce,{}),(0,Ft.jsx)(Y,{})]})},Z4=K2.default.div`
2285
+ `;var F2=y(require("@heroicons/react/24/outline/CalendarIcon")),B2=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),H2=y(require("@heroicons/react/24/outline/ShieldCheckIcon"));var $e=require("react/jsx-runtime"),V2=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:a,submitSuccess:i})=>{let{pendingTransaction:s}=R();return(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)(_,{onClose:r},"header"),(0,$e.jsx)(ut,{children:(0,$e.jsxs)("div",{children:[(0,$e.jsx)(wt,{success:i,fail:!!t}),t?(0,$e.jsx)(B2.default,{style:{width:"38px",height:"38px"}}):(0,$e.jsx)(di,{style:{width:"38px",height:"38px"}})]})}),(0,$e.jsx)(we,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),(0,$e.jsxs)(oi,{children:[(0,$e.jsxs)(vr,{children:[(0,$e.jsx)(gr,{children:(0,$e.jsx)(H2.default,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),(0,$e.jsxs)(vr,{children:[(0,$e.jsx)(gr,{children:(0,$e.jsx)(F2.default,{})}),"You last added a passkey on"," ",a?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),s&&(0,$e.jsx)(qr,{children:(0,$e.jsx)(xs,{pendingTransaction:s})}),t&&(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)(Ql,{style:{marginTop:"1.25rem"},children:t.message}),(0,$e.jsx)(F,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&(0,$e.jsx)(Xa,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),(0,$e.jsx)(Y,{})]})};var te=require("react/jsx-runtime"),Bd=({open:e,onClose:t})=>{let{user:r}=G(),[o,n]=(0,Nn.useState)(null),{init:a,cancel:i,submit:s}=Ea(),[l,c]=(0,Nn.useState)(!1),[u,h]=(0,Nn.useState)(!1),[m,v]=(0,Nn.useState)(null),[b,g]=(0,Nn.useState)(null);(0,Nn.useEffect)(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?E(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let S=D=>rc(D)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Sn(D)?(c(!1),new Error("The code you entered is not valid")):Tn(D)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(D),c(!1),new Error("Something went wrong."));async function A(D){g(null);try{if(!D||!o)return;await s(o,D),h(!0),c(!1),t()}catch(M){throw S(M)}}async function E(D){if(D==="passkey"){try{n(D);let M=await a(D);if(!M)throw new Error("something went wrong");v(M),await s(D,M),h(!0),c(!1),t()}catch(M){g(S(M))}return}try{n(D),await a(D)}catch(M){console.error(M)}}let P=()=>{n(null),g(null),i(),t()},W=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let D=r.linkedAccounts.filter(M=>M.type==="passkey"&&M.enrolledInMfa).sort((M,I)=>I.firstVerifiedAt.valueOf()-M.firstVerifiedAt.valueOf())[0];return(0,te.jsx)(V2,{account:D,selectedMethod:o,submitSuccess:u,hasBlockingError:l,error:b,onClose:P,onBack:W,handleSubmit:()=>A(m).catch(g)})}return o?(0,te.jsx)(r5,{submitSuccess:u,hasBlockingError:l,handleSubmitCode:A,selectedMethod:o,onClose:P,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(_,{onClose:P},"header"),(0,te.jsx)(He,{children:(0,te.jsx)(lt,{children:(0,te.jsx)($2.default,{})})}),(0,te.jsx)(we,{children:"Verify your identity"}),(0,te.jsx)(Ee,{children:"Choose a verification method"}),(0,te.jsxs)($l,{children:[r.mfaMethods.includes("totp")&&(0,te.jsxs)(De,{onClick:()=>E("totp"),children:[(0,te.jsx)(G2.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,te.jsxs)(De,{onClick:()=>E("sms"),children:[(0,te.jsx)(z2.default,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&(0,te.jsxs)(De,{onClick:()=>E("passkey"),children:[(0,te.jsx)(q2.default,{}),"Passkey"]},"passkey")]}),(0,te.jsx)(Y,{})]})},r5=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:a})=>{let{app:i}=k(),{pendingTransaction:s}=R();switch(e){case"sms":return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(_,{onClose:o},"header"),(0,te.jsx)(He,{children:(0,te.jsx)(lt,{children:(0,te.jsx)(j2.default,{})})}),(0,te.jsx)(we,{children:"Enter verification code"}),(0,te.jsxs)(qr,{children:[(0,te.jsx)(mi,{success:t,disabled:r,onChange:a}),(0,te.jsxs)(Ee,{children:["To continue, please enter the 6-digit code sent to your ",(0,te.jsx)("strong",{children:"mobile device"})]}),s&&(0,te.jsx)(xs,{pendingTransaction:s})]}),n&&(0,te.jsx)(Xa,{theme:i?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,te.jsx)(lo,{onClick:o,children:"Not now"}),(0,te.jsx)(Y,{})]});case"totp":return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(_,{onClose:o},"header"),(0,te.jsx)(He,{children:(0,te.jsx)(lt,{children:(0,te.jsx)(K2.default,{})})}),(0,te.jsx)(we,{children:"Enter verification code"}),(0,te.jsxs)(qr,{children:[(0,te.jsx)(mi,{success:t,disabled:r,onChange:a}),(0,te.jsxs)(Ee,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,te.jsx)("strong",{children:"authenticator app"})]}),s&&(0,te.jsx)(xs,{pendingTransaction:s})]}),n&&(0,te.jsx)(Xa,{theme:i?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,te.jsx)(lo,{onClick:o,children:"Not now"}),(0,te.jsx)(Y,{})]});default:return null}};var Aa=require("react"),Y2=y(require("styled-components"));var Bt=require("react/jsx-runtime"),Z2=()=>{let{authenticated:e,logout:t,ready:r,user:o}=G(),{app:n,setModalData:a,navigate:i,resetNavigation:s}=k(),{getAuthMeta:l,initLoginWithOAuth:c,loginWithOAuth:u,updateWallets:h,setReadyToTrue:m,closePrivyModal:v,createAnalyticsEvent:b}=R(),[g,S]=(0,Aa.useState)(!1),[A,E]=(0,Aa.useState)(void 0),P=l()?.provider||"google",{name:W,component:D}=qa(P),M=Ki(),I=et;(0,Aa.useEffect)(()=>{u(P).then(J=>{S(!0),m(!0),J&&M("login","onOAuthLoginComplete",J)}).catch(J=>{if(m(!1),J?.privyErrorCode==="allowlist_rejected"){E(void 0),s(),i("ALLOWLIST_REJECTION_SCREEN");return}if(J?.privyErrorCode==="max_accounts_reached"){console.error(new Br(J).toString()),E(void 0),s(),i("USER_LIMIT_REACHED_SCREEN");return}if(J?.privyErrorCode==="user_does_not_exist"){E(void 0),s(),i("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:O,detail:K}=Pm(J,P);E({retryable:O,detail:K,message:"Authentication failed"})}).finally(()=>{Qn()})},[W,P]),(0,Aa.useEffect)(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let O=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},I);return()=>clearTimeout(O)}if(hr(o,n?.embeddedWallets?.createOnLogin)){let O=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:K=>{console.error(K),b({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,provider:P,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},I);return()=>clearTimeout(O)}else{let O=setTimeout(()=>v({shouldCallAuthOnSuccess:!0,isSuccess:!0}),I);return h(),()=>clearTimeout(O)}}},[r,e,g,o]);let H=g?`Successfully connected with ${W}`:A?A.message:`Verifying connection to ${W}`,$="";return g?$="You\u2019re good to go!":A?$=A.detail:$="Just a few moments more",(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(_,{}),(0,Bt.jsx)(le,{}),(0,Bt.jsxs)(o5,{children:[(0,Bt.jsx)(ut,{children:(0,Bt.jsxs)("div",{children:[(0,Bt.jsx)(wt,{success:g,fail:!!A}),(0,Bt.jsx)(D,{style:{width:"38px",height:"38px"}})]})}),(0,Bt.jsxs)(mt,{children:[(0,Bt.jsx)("h3",{children:H}),(0,Bt.jsx)("p",{children:$})]}),A&&A?.retryable?(0,Bt.jsx)(ji,{onClick:()=>{Qn(),c(P),E(void 0)},disabled:!g&&!A?.retryable,children:"Retry"}):null]}),(0,Bt.jsx)(ce,{}),(0,Bt.jsx)(Y,{})]})},o5=Y2.default.div`
2286
2286
  display: flex;
2287
2287
  flex-direction: column;
2288
2288
  align-items: center;
@@ -2290,17 +2290,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
2290
2290
  margin-left: 27px;
2291
2291
  margin-right: 27px;
2292
2292
  gap: 24px;
2293
- `;var nn=require("react"),Bd=y(require("styled-components"));var Kt=require("react/jsx-runtime"),Y2=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=k(),{loginWithPasskey:o,closePrivyModal:n}=R(),a=et,[i,s]=(0,nn.useState)("loading"),[l,c]=(0,nn.useState)(null),u=(0,nn.useRef)([]),h=P=>{u.current=[P,...u.current]};(0,nn.useEffect)(()=>()=>{u.current.forEach(P=>clearTimeout(P)),u.current=[]},[]);let m=()=>{switch(i){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},v=()=>{switch(i){case"loading":return`Please follow prompts to verify your passkey.
2293
+ `;var an=require("react"),Hd=y(require("styled-components"));var jt=require("react/jsx-runtime"),Q2=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=k(),{loginWithPasskey:o,closePrivyModal:n}=R(),a=et,[i,s]=(0,an.useState)("loading"),[l,c]=(0,an.useState)(null),u=(0,an.useRef)([]),h=S=>{u.current=[S,...u.current]};(0,an.useEffect)(()=>()=>{u.current.forEach(S=>clearTimeout(S)),u.current=[]},[]);let m=()=>{switch(i){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},v=()=>{switch(i){case"loading":return`Please follow prompts to verify your passkey.
2294
2294
  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(l instanceof yt){if(l.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(l.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
2295
2295
  You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
2296
- You will have to sign up with another method first to register a passkey for your account.`}},b=()=>{switch(i){case"loading":case"success":return(0,Kt.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return(0,Kt.jsx)(F,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{s("loading");try{await o(),s("success")}catch(P){c(P),s("error")}};return(0,nn.useEffect)(()=>{i==="success"&&h(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},a))},[i]),(0,nn.useEffect)(()=>{g()},[]),(0,Kt.jsxs)(Kt.Fragment,{children:[(0,Kt.jsx)(_,{backFn:!e||t===e?void 0:r}),(0,Kt.jsxs)(Q4,{children:[(0,Kt.jsx)(ut,{children:(0,Kt.jsxs)("div",{children:[(0,Kt.jsx)(wt,{success:i==="success",fail:i==="error"}),(0,Kt.jsx)(mi,{style:{width:"38px",height:"38px"}})]})}),(0,Kt.jsxs)(mt,{children:[(0,Kt.jsx)("h3",{children:m()}),(0,Kt.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:v()})]}),b()]}),(0,Kt.jsx)(Y,{})]})},Q4=Bd.default.div`
2296
+ You will have to sign up with another method first to register a passkey for your account.`}},b=()=>{switch(i){case"loading":case"success":return(0,jt.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return(0,jt.jsx)(F,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{s("loading");try{await o(),s("success")}catch(S){c(S),s("error")}};return(0,an.useEffect)(()=>{i==="success"&&h(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},a))},[i]),(0,an.useEffect)(()=>{g()},[]),(0,jt.jsxs)(jt.Fragment,{children:[(0,jt.jsx)(_,{backFn:!e||t===e?void 0:r}),(0,jt.jsxs)(n5,{children:[(0,jt.jsx)(ut,{children:(0,jt.jsxs)("div",{children:[(0,jt.jsx)(wt,{success:i==="success",fail:i==="error"}),(0,jt.jsx)(ui,{style:{width:"38px",height:"38px"}})]})}),(0,jt.jsxs)(mt,{children:[(0,jt.jsx)("h3",{children:m()}),(0,jt.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:v()})]}),b()]}),(0,jt.jsx)(Y,{})]})},n5=Hd.default.div`
2297
2297
  display: flex;
2298
2298
  flex-direction: column;
2299
2299
  align-items: center;
2300
2300
  justify-content: center;
2301
2301
  gap: 24px;
2302
2302
  width: 100%;
2303
- `,$L=Bd.default.div`
2303
+ `,QL=Hd.default.div`
2304
2304
  display: flex;
2305
2305
  align-items: center;
2306
2306
  justify-content: center;
@@ -2316,9 +2316,9 @@ You will have to sign up with another method first to register a passkey for you
2316
2316
  stroke: var(--privy-color-accent) !important;
2317
2317
  fill: var(--privy-color-accent) !important;
2318
2318
  }
2319
- `;var xs=require("react"),J2=y(require("styled-components"));var Z2=require("react-device-detect");var Q2=(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(!fn()&&Z2.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};var cr=require("react/jsx-runtime"),X2=()=>{let{forkSession:e,ready:t,authenticated:r}=G(),[o,n]=(0,xs.useState)(""),[a,i]=(0,xs.useState)(!1);(0,xs.useEffect)(()=>{t&&r&&e().then(n)},[t,r]);let s=Q2(o,!a),l={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&&(l.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",l.footnote="Once you're done, you can always return here and refresh to view your updated account."),a&&(l.title="Still here?",l.description="You may need to install the Phantom mobile app.",l.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,cr.jsxs)(cr.Fragment,{children:[(0,cr.jsx)(_,{},"header"),(0,cr.jsx)(le,{}),(0,cr.jsx)(Ro,{title:l.title,description:l.description}),(0,cr.jsxs)($r,{children:[(0,cr.jsx)(J4,{children:(0,cr.jsx)(_o,{style:{width:"72px",height:"72px"}})}),(0,cr.jsx)(Vl,{href:s,onClick:()=>{setTimeout(()=>i(!0),1e3)},loading:t&&!s,children:a?"Go to App Store":"Continue"}),l.footnote?(0,cr.jsx)("p",{children:l.footnote}):null]}),(0,cr.jsx)(ce,{}),(0,cr.jsx)(j,{protectedByPrivy:!0})]})},J4=(0,J2.default)(sr)`
2319
+ `;var ks=require("react"),ev=y(require("styled-components"));var J2=require("react-device-detect");var X2=(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(!fn()&&J2.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};var pr=require("react/jsx-runtime"),tv=()=>{let{forkSession:e,ready:t,authenticated:r}=G(),[o,n]=(0,ks.useState)(""),[a,i]=(0,ks.useState)(!1);(0,ks.useEffect)(()=>{t&&r&&e().then(n)},[t,r]);let s=X2(o,!a),l={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&&(l.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",l.footnote="Once you're done, you can always return here and refresh to view your updated account."),a&&(l.title="Still here?",l.description="You may need to install the Phantom mobile app.",l.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,pr.jsxs)(pr.Fragment,{children:[(0,pr.jsx)(_,{},"header"),(0,pr.jsx)(le,{}),(0,pr.jsx)(Ro,{title:l.title,description:l.description}),(0,pr.jsxs)(zr,{children:[(0,pr.jsx)(i5,{children:(0,pr.jsx)(Po,{style:{width:"72px",height:"72px"}})}),(0,pr.jsx)(Gl,{href:s,onClick:()=>{setTimeout(()=>i(!0),1e3)},loading:t&&!s,children:a?"Go to App Store":"Continue"}),l.footnote?(0,pr.jsx)("p",{children:l.footnote}):null]}),(0,pr.jsx)(ce,{}),(0,pr.jsx)(j,{})]})},i5=(0,ev.default)(lr)`
2320
2320
  margin: 16px auto;
2321
- `;var ev=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),gi=require("react"),vi=y(require("styled-components"));var Je=require("react/jsx-runtime"),tv=()=>{let[e,t]=(0,gi.useState)(!0),{authenticated:r,getAccessToken:o}=G(),{walletProxy:n,closePrivyModal:a,createAnalyticsEvent:i}=R(),{navigate:s,data:l,onUserCloseViaDialogOrKeybindRef:c}=k(),[u,h]=(0,gi.useState)(void 0),[m,v]=(0,gi.useState)(""),[b,g]=(0,gi.useState)(!1),{privyWallet:P,onCompleteNavigateTo:A,onSuccess:E,onFailure:S}=l.recoverWallet,W=(I="User exited before their wallet could be recovered")=>{a({shouldCallAuthOnSuccess:!1}),S(typeof I=="string"?new nr(I):I)};c.current=W,(0,gi.useEffect)(()=>{if(!r||!P)return W("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let D=I=>{I&&h(I)};return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(_,{onClose:W}),(0,Je.jsx)(le,{}),(0,Je.jsxs)(e5,{children:[(0,Je.jsxs)(X4,{children:[(0,Je.jsx)(ev.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Je.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),(0,Je.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsxs)(An,{children:[(0,Je.jsx)(aa,{type:e?"password":"text",onChange:I=>D(I.target.value),disabled:b,style:{paddingRight:"2.3rem"}}),(0,Je.jsx)(sa,{style:{right:"0.75rem"},children:e?(0,Je.jsx)(la,{onClick:()=>t(!1)}):(0,Je.jsx)(ca,{onClick:()=>t(!0)})})]}),!!m&&(0,Je.jsx)(t5,{children:m})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsxs)(sh,{children:[(0,Je.jsx)("h4",{children:"Why is this necessary?"}),(0,Je.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Je.jsx)(r5,{loading:b||!n,disabled:!u,onClick:async()=>{g(!0);let I=await o();if(I&&P&&u!==null)try{i({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:P.address}}),await n?.recover({address:P.address,accessToken:I,recoveryPin:u,recoveryMethod:P.recoveryMethod}),v(""),A?s(A):a({shouldCallAuthOnSuccess:!1}),E?.(P),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:P.address}})}catch(H){Zh(H)?v("Invalid recovery password, please try again."):v("An error has occurred, please try again.")}finally{g(!1)}else return W("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!P&&b,children:"Recover your account"})]})]}),(0,Je.jsx)(ce,{}),(0,Je.jsx)(j,{protectedByPrivy:!0})]})},X4=vi.default.div`
2321
+ `;var rv=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),yi=require("react"),gi=y(require("styled-components"));var Je=require("react/jsx-runtime"),ov=()=>{let[e,t]=(0,yi.useState)(!0),{authenticated:r,getAccessToken:o}=G(),{walletProxy:n,closePrivyModal:a,createAnalyticsEvent:i}=R(),{navigate:s,data:l,onUserCloseViaDialogOrKeybindRef:c}=k(),[u,h]=(0,yi.useState)(void 0),[m,v]=(0,yi.useState)(""),[b,g]=(0,yi.useState)(!1),{privyWallet:S,onCompleteNavigateTo:A,onSuccess:E,onFailure:P}=l.recoverWallet,W=(I="User exited before their wallet could be recovered")=>{a({shouldCallAuthOnSuccess:!1}),P(typeof I=="string"?new ir(I):I)};c.current=W,(0,yi.useEffect)(()=>{if(!r||!S)return W("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let D=I=>{I&&h(I)};return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(_,{onClose:W}),(0,Je.jsx)(le,{}),(0,Je.jsxs)(s5,{children:[(0,Je.jsxs)(a5,{children:[(0,Je.jsx)(rv.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Je.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),(0,Je.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsxs)(An,{children:[(0,Je.jsx)(sa,{type:e?"password":"text",onChange:I=>D(I.target.value),disabled:b,style:{paddingRight:"2.3rem"}}),(0,Je.jsx)(la,{style:{right:"0.75rem"},children:e?(0,Je.jsx)(ca,{onClick:()=>t(!1)}):(0,Je.jsx)(pa,{onClick:()=>t(!0)})})]}),!!m&&(0,Je.jsx)(l5,{children:m})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsxs)(ch,{children:[(0,Je.jsx)("h4",{children:"Why is this necessary?"}),(0,Je.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Je.jsx)(c5,{loading:b||!n,disabled:!u,onClick:async()=>{g(!0);let I=await o();if(I&&S&&u!==null)try{i({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:S.address}}),await n?.recover({address:S.address,accessToken:I,recoveryPin:u,recoveryMethod:S.recoveryMethod}),v(""),A?s(A):a({shouldCallAuthOnSuccess:!1}),E?.(S),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:S.address}})}catch(H){Jh(H)?v("Invalid recovery password, please try again."):v("An error has occurred, please try again.")}finally{g(!1)}else return W("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!S&&b,children:"Recover your account"})]})]}),(0,Je.jsx)(ce,{}),(0,Je.jsx)(j,{})]})},a5=gi.default.div`
2322
2322
  display: flex;
2323
2323
  flex-direction: column;
2324
2324
  align-items: center;
@@ -2340,45 +2340,45 @@ You will have to sign up with another method first to register a passkey for you
2340
2340
  font-weight: 400;
2341
2341
  line-height: 20px;
2342
2342
  }
2343
- `,e5=vi.default.div`
2343
+ `,s5=gi.default.div`
2344
2344
  display: flex;
2345
2345
  flex-direction: column;
2346
2346
  justify-content: space-between;
2347
- `,t5=vi.default.div`
2347
+ `,l5=gi.default.div`
2348
2348
  line-height: 20px;
2349
2349
  height: 20px;
2350
2350
  font-size: 13px;
2351
2351
  color: var(--privy-color-error);
2352
2352
  text-align: left;
2353
2353
  margin-top: 0.5rem;
2354
- `,r5=(0,vi.default)(F)`
2355
- ${e=>e.hideAnimations&&vi.css`
2354
+ `,c5=(0,gi.default)(F)`
2355
+ ${e=>e.hideAnimations&&gi.css`
2356
2356
  && {
2357
2357
  // Remove animations because the recoverWallet task on the iframe partially
2358
2358
  // blocks the renderer, so the animation stutters and doesn't look good
2359
2359
  transition: none;
2360
2360
  }
2361
2361
  `}
2362
- `;var an=require("react");var Dn=require("react/jsx-runtime"),$c=e=>(0,Dn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,Dn.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,Dn.jsx)("defs",{children:(0,Dn.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,Dn.jsx)("stop",{stopColor:"#3E82F4"}),(0,Dn.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]});var Dr=require("react/jsx-runtime"),Kc=({style:e,...t})=>(0,Dr.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Dr.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,Dr.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,Dr.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,Dr.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,Dr.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,Dr.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,Dr.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,Dr.jsx)("defs",{children:(0,Dr.jsx)("clipPath",{id:"clip0_2115_829",children:(0,Dr.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]});var Hd=y(require("styled-components")),ks=Hd.default.div`
2362
+ `;var sn=require("react");var Dn=require("react/jsx-runtime"),Kc=e=>(0,Dn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,Dn.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,Dn.jsx)("defs",{children:(0,Dn.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,Dn.jsx)("stop",{stopColor:"#3E82F4"}),(0,Dn.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]});var Nr=require("react/jsx-runtime"),jc=({style:e,...t})=>(0,Nr.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Nr.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,Nr.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,Nr.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,Nr.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,Nr.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,Nr.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,Nr.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,Nr.jsx)("defs",{children:(0,Nr.jsx)("clipPath",{id:"clip0_2115_829",children:(0,Nr.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]});var Vd=y(require("styled-components")),Rs=Vd.default.div`
2363
2363
  display: flex;
2364
2364
  flex-direction: column;
2365
2365
  gap: 12px;
2366
2366
  padding-top: 24px;
2367
2367
  padding-bottom: 24px;
2368
- `,rv=Hd.default.div`
2368
+ `,nv=Vd.default.div`
2369
2369
  padding-bottom: 24px;
2370
- `;var jt=require("react/jsx-runtime"),ov={"google-drive":{name:"Google Drive",component:Kc},icloud:{name:"iCloud",component:$c}},nv=()=>{let{logout:e}=G(),{navigate:t,setModalData:r,data:o}=k(),{recoveryOAuthFlow:n,closePrivyModal:a,createAnalyticsEvent:i}=R(),[s,l]=(0,an.useState)(!1),{provider:c,action:u,isInAccountCreateFlow:h}=o?.recoveryOAuthStatus,[m,v]=(0,an.useState)(void 0),[b,g]=(0,an.useState)(u==="create-wallet");if(c==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let P=ov[c].name,A=ov[c].component,E=o?.recoverWallet?.onCompleteNavigateTo,S=new rt(async(J="create-wallet")=>(g(!0),new Promise((O,K)=>{setTimeout(async()=>{try{let N=window.open();await n(c,J,N),l(!0),O()}catch{v({message:`${J==="recover"?"Recovery":"Back up"} with ${P} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${P} account associated with your backup.`:"",retryable:!0}),K()}},0)})));(0,an.useEffect)(()=>{u!=="recover"&&S.execute(h?"create-wallet":"set-recovery")},[]),(0,an.useEffect)(()=>{if(!s)return;let J=setTimeout(()=>{h?(r({createWallet:{onSuccess:()=>{},onFailure:O=>{i({eventName:"embedded_wallet_creation_failure_logout",payload:{error:O,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):a({shouldCallAuthOnSuccess:!1})},et);return()=>clearTimeout(J)},[s]);let W=(0,an.useCallback)(async()=>{await S.execute("recover"),E?t(E):l(!0)},[]),D=c==="google-drive"?"Google Drive":"Apple iCloud",M=u==="recover"?"recovered":"backed up",I=u==="recover"?"Recovering":"Backing up",H=s&&`Successfully ${M} with ${D}.`||m&&m.message||`${I} with ${D}...`,$=m?m.detail:"";return(0,jt.jsxs)(jt.Fragment,{children:[(0,jt.jsx)(_,{}),b?(0,jt.jsx)(jt.Fragment,{children:(0,jt.jsxs)(ks,{children:[(0,jt.jsx)(Ge,{title:H,icon:(0,jt.jsx)(A,{style:{width:"38px",height:"38px"}}),description:$}),m&&m?.retryable?(0,jt.jsx)(F,{onClick:()=>{Qn(),v(void 0),u==="create-wallet"?S.execute("create-wallet"):W()},disabled:!s&&!m?.retryable,children:"Try again"}):null]})}):(0,jt.jsxs)(ks,{children:[(0,jt.jsx)(Ge,{title:"Confirm it's really you",icon:(0,jt.jsx)(A,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${D} where your account is backed up.`}),(0,jt.jsxs)(F,{onClick:W,children:["Confirm with ",D]})]}),(0,jt.jsx)(j,{protectedByPrivy:!0})]})};var sn=require("react");var av=require("react/jsx-runtime"),iv=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=k(),[n,a]=(0,sn.useState)(""),[i,s]=(0,sn.useState)(!1),[l,c]=(0,sn.useState)(),[u,h]=(0,sn.useState)(null),{authenticated:m}=G(),{closePrivyModal:v,isNewUserThisSession:b,initializeWalletProxy:g}=R(),{onSuccess:P,onFailure:A,callAuthOnSuccessOnClose:E}=r.createWallet,{createWallet:S}=sc(),[W,D]=(0,sn.useState)(null),M=new rt(async()=>{try{let $=await S(l);if(!$)return;D($),b?t("EMBEDDED_WALLET_CREATED_SCREEN"):(P($),v({shouldCallAuthOnSuccess:E}))}catch($){a($.message)}});(0,sn.useEffect)(()=>{u||g(3e4).then($=>h($))},[u]),(0,sn.useEffect)(()=>{if(!m){t("LANDING"),A(new Error("User must be authenticated before creating a Privy wallet"));return}},[m]);let I=()=>{W&&W?.recoveryMethod!=="user-passcode"?(A(new nr("User created a wallet but failed to set a password for it")),v({shouldCallAuthOnSuccess:!1})):W?(P(W),v({shouldCallAuthOnSuccess:E})):(A(new nr("User wallet creation failed")),v({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let H=async()=>{s(!0);let $=250;return M.execute().then(()=>new Promise(J=>setTimeout(J,$))).finally(()=>s(!1))};return(0,av.jsx)(pc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:i,buttonHideAnimations:!W&&i,isResettingPassword:!1,error:n,password:l||"",onClose:I,onPasswordChange:c,onPasswordGenerate:()=>c(cc()),onSubmit:H})};var sv=y(require("@heroicons/react/24/outline/LockClosedIcon")),lv=y(require("@heroicons/react/24/outline/PencilSquareIcon")),cv=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),pv=require("react"),dv=y(require("styled-components"));var _e=require("react/jsx-runtime"),Vd=dv.default.div`
2370
+ `;var Yt=require("react/jsx-runtime"),iv={"google-drive":{name:"Google Drive",component:jc},icloud:{name:"iCloud",component:Kc}},av=()=>{let{logout:e}=G(),{navigate:t,setModalData:r,data:o}=k(),{recoveryOAuthFlow:n,closePrivyModal:a,createAnalyticsEvent:i}=R(),[s,l]=(0,sn.useState)(!1),{provider:c,action:u,isInAccountCreateFlow:h}=o?.recoveryOAuthStatus,[m,v]=(0,sn.useState)(void 0),[b,g]=(0,sn.useState)(u==="create-wallet");if(c==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let S=iv[c].name,A=iv[c].component,E=o?.recoverWallet?.onCompleteNavigateTo,P=new rt(async(J="create-wallet")=>(g(!0),new Promise((O,K)=>{setTimeout(async()=>{try{let N=window.open();await n(c,J,N),l(!0),O()}catch{v({message:`${J==="recover"?"Recovery":"Back up"} with ${S} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${S} account associated with your backup.`:"",retryable:!0}),K()}},0)})));(0,sn.useEffect)(()=>{u!=="recover"&&P.execute(h?"create-wallet":"set-recovery")},[]),(0,sn.useEffect)(()=>{if(!s)return;let J=setTimeout(()=>{h?(r({createWallet:{onSuccess:()=>{},onFailure:O=>{i({eventName:"embedded_wallet_creation_failure_logout",payload:{error:O,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):a({shouldCallAuthOnSuccess:!1})},et);return()=>clearTimeout(J)},[s]);let W=(0,sn.useCallback)(async()=>{await P.execute("recover"),E?t(E):l(!0)},[]),D=c==="google-drive"?"Google Drive":"Apple iCloud",M=u==="recover"?"recovered":"backed up",I=u==="recover"?"Recovering":"Backing up",H=s&&`Successfully ${M} with ${D}.`||m&&m.message||`${I} with ${D}...`,$=m?m.detail:"";return(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(_,{}),b?(0,Yt.jsx)(Yt.Fragment,{children:(0,Yt.jsxs)(Rs,{children:[(0,Yt.jsx)(Ve,{title:H,icon:(0,Yt.jsx)(A,{style:{width:"38px",height:"38px"}}),description:$}),m&&m?.retryable?(0,Yt.jsx)(F,{onClick:()=>{Qn(),v(void 0),u==="create-wallet"?P.execute("create-wallet"):W()},disabled:!s&&!m?.retryable,children:"Try again"}):null]})}):(0,Yt.jsxs)(Rs,{children:[(0,Yt.jsx)(Ve,{title:"Confirm it's really you",icon:(0,Yt.jsx)(A,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${D} where your account is backed up.`}),(0,Yt.jsxs)(F,{onClick:W,children:["Confirm with ",D]})]}),(0,Yt.jsx)(j,{})]})};var ln=require("react");var lv=require("react/jsx-runtime"),sv=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=k(),[n,a]=(0,ln.useState)(""),[i,s]=(0,ln.useState)(!1),[l,c]=(0,ln.useState)(),[u,h]=(0,ln.useState)(null),{authenticated:m}=G(),{closePrivyModal:v,isNewUserThisSession:b,initializeWalletProxy:g}=R(),{onSuccess:S,onFailure:A,callAuthOnSuccessOnClose:E}=r.createWallet,{createWallet:P}=lc(),[W,D]=(0,ln.useState)(null),M=new rt(async()=>{try{let $=await P(l);if(!$)return;D($),b?t("EMBEDDED_WALLET_CREATED_SCREEN"):(S($),v({shouldCallAuthOnSuccess:E}))}catch($){a($.message)}});(0,ln.useEffect)(()=>{u||g(3e4).then($=>h($))},[u]),(0,ln.useEffect)(()=>{if(!m){t("LANDING"),A(new Error("User must be authenticated before creating a Privy wallet"));return}},[m]);let I=()=>{W&&W?.recoveryMethod!=="user-passcode"?(A(new ir("User created a wallet but failed to set a password for it")),v({shouldCallAuthOnSuccess:!1})):W?(S(W),v({shouldCallAuthOnSuccess:E})):(A(new ir("User wallet creation failed")),v({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let H=async()=>{s(!0);let $=250;return M.execute().then(()=>new Promise(J=>setTimeout(J,$))).finally(()=>s(!1))};return(0,lv.jsx)(dc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:i,buttonHideAnimations:!W&&i,isResettingPassword:!1,error:n,password:l||"",onClose:I,onPasswordChange:c,onPasswordGenerate:()=>c(pc()),onSubmit:H})};var cv=y(require("@heroicons/react/24/outline/LockClosedIcon")),pv=y(require("@heroicons/react/24/outline/PencilSquareIcon")),dv=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),uv=require("react"),mv=y(require("styled-components"));var _e=require("react/jsx-runtime"),Gd=mv.default.div`
2371
2371
  width: 24px;
2372
2372
  height: 24px;
2373
2373
  display: flex;
2374
2374
  justify-content: center;
2375
2375
  align-items: center;
2376
- `,o5={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},n5=({onClose:e})=>(0,_e.jsxs)(rv,{children:[(0,_e.jsx)(Ge,{title:"Why do I need to secure my account?",icon:(0,_e.jsx)(cv.default,{width:48}),description:(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),(0,_e.jsx)("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),(0,_e.jsx)(F,{onClick:e,children:"Select backup method"})]}),uv=()=>{let[e,t]=(0,pv.useState)(!1),{navigate:r,setModalData:o,data:n}=k(),{user:a}=G(),{embeddedWallets:i}=Wt(),s=Oe(a),l=s===null,{isInAccountCreateFlow:c,isResettingPassword:u}=n.recoverySelection,h=s?.recoveryMethod!=="privy",m=h?"Update backup method":"Secure your account",v=h?(0,_e.jsxs)("span",{children:["Your account is currently secured using"," ",(0,_e.jsx)("strong",{children:o5[s?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function b(g){o({recoveryOAuthStatus:{provider:g,action:l?"create-wallet":"set-recovery",isInAccountCreateFlow:c}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(_,{backFn:e?()=>t(!1):void 0,infoFn:e?void 0:()=>t(!0)},"header"),e?(0,_e.jsx)(n5,{onClose:()=>t(!1)}):(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(Ge,{title:m,icon:(0,_e.jsx)(sv.default,{width:48}),description:v}),(0,_e.jsx)(ks,{children:i.userOwnedRecoveryOptions.filter(g=>["icloud","google-drive"].includes(s?.recoveryMethod||"")?g!==s?.recoveryMethod:!0).sort().map(g=>{switch(g){case"google-drive":return(0,_e.jsxs)(Ue,{onClick:()=>b("google-drive"),children:[(0,_e.jsx)(Vd,{children:(0,_e.jsx)(Kc,{style:{width:18}})}),"Back up to Google Drive"]},g);case"icloud":return(0,_e.jsxs)(Ue,{onClick:()=>b("icloud"),children:[(0,_e.jsx)(Vd,{children:(0,_e.jsx)($c,{style:{width:24}})}),"Back up to Apple iCloud"]},g);case"user-passcode":return(0,_e.jsxs)(Ue,{onClick:()=>{let P=nd({isCreatingWallet:l,skipSplashScreen:!0});r(P)},children:[(0,_e.jsx)(Vd,{children:(0,_e.jsx)(lv.default,{style:{width:18}})}),u?"Reset your":"Set a"," password"]},g);default:return null}})})]}),(0,_e.jsx)(j,{protectedByPrivy:!0})]})};var Gd=require("@ethersproject/bignumber"),At=require("react"),Fn=y(require("styled-components")),Un=require("@privy-io/js-sdk-core");var i5=require("@ethersproject/providers"),mv=require("@privy-io/js-sdk-core");async function jc(e,t,r,o,n,a){o=Object.assign({chainId:$o},o),a5(o);let s=(await r.rpc({address:t,accessToken:e,requesterAppId:a,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(s)}async function Yc(e,t,r,o){let n=await o.getBalance(e),a=t.value||0,s=!n.sub((0,mv.QuantityToBigNumber)(a)).sub(r).isNegative();return{balance:n,hasSufficientFunds:s}}function a5(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!s5(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 s5(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&l5(e);return t||r||o}function l5(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Zc(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}}function fv(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var Aa=require("@heroicons/react/24/outline"),wv=require("react"),Pr=y(require("styled-components"));var Rs=require("@ethersproject/logger"),c5=new Set([Rs.ErrorCode.CALL_EXCEPTION,Rs.ErrorCode.NONCE_EXPIRED,Rs.ErrorCode.REPLACEMENT_UNDERPRICED,Rs.ErrorCode.TRANSACTION_REPLACED]),hv=e=>{let t;return e.code&&e.code!==-32e3&&c5.has(e.code)&&(t=e.transactionHash),t},yv=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";var je=require("react/jsx-runtime"),p5=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=hv(e),o=yv(e);return{errorCode:t,transactionHash:r,errorMessage:o}},d5=()=>(0,je.jsxs)(h5,{children:[(0,je.jsx)(g5,{}),(0,je.jsx)(y5,{})]}),bv=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=R(),[a,i]=(0,wv.useState)(!1),{errorCode:s,transactionHash:l,errorMessage:c}=p5(e),u=n.find(h=>h.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return(0,je.jsxs)(je.Fragment,{children:[(0,je.jsx)(_,{onClose:r}),(0,je.jsxs)(u5,{children:[(0,je.jsx)(d5,{}),(0,je.jsx)(m5,{children:s}),(0,je.jsx)(f5,{children:"Please try again."}),(0,je.jsxs)(vv,{children:[(0,je.jsx)(gv,{children:"Error message"}),(0,je.jsx)(Cv,{clickable:!1,children:c})]}),l&&(0,je.jsxs)(vv,{children:[(0,je.jsx)(gv,{children:"Transaction hash"}),(0,je.jsxs)(C5,{children:["Copy this hash to view details about the transaction on a"," ",(0,je.jsx)("u",{children:(0,je.jsx)("a",{href:u,children:"block explorer"})}),"."]}),(0,je.jsxs)(Cv,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(l),i(!0)},children:[l,(0,je.jsx)(E5,{clicked:a})]})]}),(0,je.jsx)(v5,{onClick:()=>o({resetNonce:!!l}),children:"Retry transaction"})]}),(0,je.jsx)(Y,{})]})},u5=Pr.default.div`
2376
+ `,p5={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},d5=({onClose:e})=>(0,_e.jsxs)(nv,{children:[(0,_e.jsx)(Ve,{title:"Why do I need to secure my account?",icon:(0,_e.jsx)(dv.default,{width:48}),description:(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),(0,_e.jsx)("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),(0,_e.jsx)(F,{onClick:e,children:"Select backup method"})]}),fv=()=>{let[e,t]=(0,uv.useState)(!1),{navigate:r,setModalData:o,data:n}=k(),{user:a}=G(),{embeddedWallets:i}=Mt(),s=Me(a),l=s===null,{isInAccountCreateFlow:c,isResettingPassword:u}=n.recoverySelection,h=s?.recoveryMethod!=="privy",m=h?"Update backup method":"Secure your account",v=h?(0,_e.jsxs)("span",{children:["Your account is currently secured using"," ",(0,_e.jsx)("strong",{children:p5[s?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function b(g){o({recoveryOAuthStatus:{provider:g,action:l?"create-wallet":"set-recovery",isInAccountCreateFlow:c}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(_,{backFn:e?()=>t(!1):void 0,infoFn:e?void 0:()=>t(!0)},"header"),e?(0,_e.jsx)(d5,{onClose:()=>t(!1)}):(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(Ve,{title:m,icon:(0,_e.jsx)(cv.default,{width:48}),description:v}),(0,_e.jsx)(Rs,{children:i.userOwnedRecoveryOptions.filter(g=>["icloud","google-drive"].includes(s?.recoveryMethod||"")?g!==s?.recoveryMethod:!0).sort().map(g=>{switch(g){case"google-drive":return(0,_e.jsxs)(De,{onClick:()=>b("google-drive"),children:[(0,_e.jsx)(Gd,{children:(0,_e.jsx)(jc,{style:{width:18}})}),"Back up to Google Drive"]},g);case"icloud":return(0,_e.jsxs)(De,{onClick:()=>b("icloud"),children:[(0,_e.jsx)(Gd,{children:(0,_e.jsx)(Kc,{style:{width:24}})}),"Back up to Apple iCloud"]},g);case"user-passcode":return(0,_e.jsxs)(De,{onClick:()=>{let S=id({isCreatingWallet:l,skipSplashScreen:!0});r(S)},children:[(0,_e.jsx)(Gd,{children:(0,_e.jsx)(pv.default,{style:{width:18}})}),u?"Reset your":"Set a"," password"]},g);default:return null}})})]}),(0,_e.jsx)(j,{})]})};var qd=require("@ethersproject/bignumber"),At=require("react"),Fn=y(require("styled-components")),Un=require("@privy-io/js-sdk-core");var u5=require("@ethersproject/providers"),hv=require("@privy-io/js-sdk-core");async function Yc(e,t,r,o,n,a){o=Object.assign({chainId:$o},o),m5(o);let s=(await r.rpc({address:t,accessToken:e,requesterAppId:a,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(s)}async function Zc(e,t,r,o){let n=await o.getBalance(e),a=t.value||0,s=!n.sub((0,hv.QuantityToBigNumber)(a)).sub(r).isNegative();return{balance:n,hasSufficientFunds:s}}function m5(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!f5(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 f5(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&h5(e);return t||r||o}function h5(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Qc(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}}function yv(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var xa=require("@heroicons/react/24/outline"),Ev=require("react"),Sr=y(require("styled-components"));var Is=require("@ethersproject/logger"),y5=new Set([Is.ErrorCode.CALL_EXCEPTION,Is.ErrorCode.NONCE_EXPIRED,Is.ErrorCode.REPLACEMENT_UNDERPRICED,Is.ErrorCode.TRANSACTION_REPLACED]),gv=e=>{let t;return e.code&&e.code!==-32e3&&y5.has(e.code)&&(t=e.transactionHash),t},vv=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";var Ke=require("react/jsx-runtime"),g5=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=gv(e),o=vv(e);return{errorCode:t,transactionHash:r,errorMessage:o}},v5=()=>(0,Ke.jsxs)(E5,{children:[(0,Ke.jsx)(S5,{}),(0,Ke.jsx)(T5,{})]}),Tv=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=R(),[a,i]=(0,Ev.useState)(!1),{errorCode:s,transactionHash:l,errorMessage:c}=g5(e),u=n.find(h=>h.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(_,{onClose:r}),(0,Ke.jsxs)(C5,{children:[(0,Ke.jsx)(v5,{}),(0,Ke.jsx)(w5,{children:s}),(0,Ke.jsx)(b5,{children:"Please try again."}),(0,Ke.jsxs)(wv,{children:[(0,Ke.jsx)(Cv,{children:"Error message"}),(0,Ke.jsx)(bv,{clickable:!1,children:c})]}),l&&(0,Ke.jsxs)(wv,{children:[(0,Ke.jsx)(Cv,{children:"Transaction hash"}),(0,Ke.jsxs)(_5,{children:["Copy this hash to view details about the transaction on a"," ",(0,Ke.jsx)("u",{children:(0,Ke.jsx)("a",{href:u,children:"block explorer"})}),"."]}),(0,Ke.jsxs)(bv,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(l),i(!0)},children:[l,(0,Ke.jsx)(k5,{clicked:a})]})]}),(0,Ke.jsx)(P5,{onClick:()=>o({resetNonce:!!l}),children:"Retry transaction"})]}),(0,Ke.jsx)(Y,{})]})},C5=Sr.default.div`
2377
2377
  display: flex;
2378
2378
  flex-direction: column;
2379
2379
  align-items: center;
2380
2380
  justify-content: center;
2381
- `,m5=Pr.default.span`
2381
+ `,w5=Sr.default.span`
2382
2382
  color: var(--privy-color-foreground);
2383
2383
  text-align: center;
2384
2384
  font-size: 1.125rem;
@@ -2386,7 +2386,7 @@ You will have to sign up with another method first to register a passkey for you
2386
2386
  line-height: 1.25rem; /* 111.111% */
2387
2387
  text-align: center;
2388
2388
  margin: 10px;
2389
- `,f5=Pr.default.span`
2389
+ `,b5=Sr.default.span`
2390
2390
  margin-top: 4px;
2391
2391
  margin-bottom: 10px;
2392
2392
  color: var(--privy-color-foreground-3);
@@ -2397,7 +2397,7 @@ You will have to sign up with another method first to register a passkey for you
2397
2397
  font-weight: 400;
2398
2398
  line-height: 20px; /* 142.857% */
2399
2399
  letter-spacing: -0.008px;
2400
- `,h5=Pr.default.div`
2400
+ `,E5=Sr.default.div`
2401
2401
  position: relative;
2402
2402
  width: 60px;
2403
2403
  height: 60px;
@@ -2405,37 +2405,37 @@ You will have to sign up with another method first to register a passkey for you
2405
2405
  display: flex;
2406
2406
  justify-content: center;
2407
2407
  align-items: center;
2408
- `,y5=(0,Pr.default)(Aa.ExclamationCircleIcon)`
2408
+ `,T5=(0,Sr.default)(xa.ExclamationCircleIcon)`
2409
2409
  position: absolute;
2410
2410
  width: 35px;
2411
2411
  height: 35px;
2412
2412
  color: var(--privy-color-error);
2413
- `,g5=Pr.default.div`
2413
+ `,S5=Sr.default.div`
2414
2414
  position: absolute;
2415
2415
  width: 60px;
2416
2416
  height: 60px;
2417
2417
  border-radius: 50%;
2418
2418
  background-color: var(--privy-color-error);
2419
2419
  opacity: 0.1;
2420
- `,v5=(0,Pr.default)(F)`
2420
+ `,P5=(0,Sr.default)(F)`
2421
2421
  && {
2422
2422
  margin-top: 24px;
2423
2423
  }
2424
2424
  transition: color 350ms ease, background-color 350ms ease;
2425
- `,gv=Pr.default.span`
2425
+ `,Cv=Sr.default.span`
2426
2426
  width: 100%;
2427
2427
  text-align: left;
2428
2428
  font-size: 0.825rem;
2429
2429
  color: var(--privy-color-foreground);
2430
2430
  padding: 4px;
2431
- `,vv=Pr.default.div`
2431
+ `,wv=Sr.default.div`
2432
2432
  width: 100%;
2433
2433
  margin: 5px;
2434
2434
  display: flex;
2435
2435
  flex-direction: column;
2436
2436
  justify-content: center;
2437
2437
  align-items: center;
2438
- `,C5=Pr.default.text`
2438
+ `,_5=Sr.default.text`
2439
2439
  position: relative;
2440
2440
  width: 100%;
2441
2441
  padding: 5px;
@@ -2443,7 +2443,7 @@ You will have to sign up with another method first to register a passkey for you
2443
2443
  color: var(--privy-color-foreground-3);
2444
2444
  text-align: left;
2445
2445
  word-wrap: break-word;
2446
- `,Cv=Pr.default.span`
2446
+ `,bv=Sr.default.span`
2447
2447
  position: relative;
2448
2448
  width: 100%;
2449
2449
  background-color: var(--privy-color-background-2);
@@ -2461,71 +2461,68 @@ You will have to sign up with another method first to register a passkey for you
2461
2461
  &:hover {
2462
2462
  background-color: var(--privy-color-foreground-4);
2463
2463
  }`}
2464
- `,w5=(0,Pr.default)(Aa.ClipboardDocumentIcon)`
2464
+ `,A5=(0,Sr.default)(xa.ClipboardDocumentIcon)`
2465
2465
  position: absolute;
2466
2466
  top: 13px;
2467
2467
  right: 13px;
2468
2468
  width: 24px;
2469
2469
  height: 24px;
2470
- `,b5=(0,Pr.default)(Aa.ClipboardDocumentCheckIcon)`
2470
+ `,x5=(0,Sr.default)(xa.ClipboardDocumentCheckIcon)`
2471
2471
  position: absolute;
2472
2472
  top: 13px;
2473
2473
  right: 13px;
2474
2474
  width: 24px;
2475
2475
  height: 24px;
2476
- `,E5=({clicked:e})=>e?(0,je.jsx)(b5,{}):(0,je.jsx)(w5,{});var Qc=require("@ethersproject/bignumber"),Ev=y(require("styled-components"));var to=require("react/jsx-runtime"),T5=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Qc.BigNumber.from(e.gasUsed),o=Qc.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let a=Qc.BigNumber.from(t);n=n.add(a)}return n.toString()}catch{return}else return},Tv=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:a,l1GasEstimate:i,receiptHeader:s,receiptDescription:l})=>(0,to.jsxs)(to.Fragment,{children:[(0,to.jsx)(_,{onClose:o}),(0,to.jsx)(ai,{title:s??"Transaction complete!",description:l??"You're all set."}),(0,to.jsx)(Ta,{tokenPrice:n,from:t.from,to:t.to,gas:T5(t,i),txn:e,transactionInfo:r,tokenSymbol:a}),(0,to.jsx)(bn,{}),(0,to.jsx)(P5,{loading:!1,onClick:o,children:"All Done"}),(0,to.jsx)(ce,{}),(0,to.jsx)(j,{protectedByPrivy:!0})]}),P5=(0,Ev.default)(F)`
2476
+ `,k5=({clicked:e})=>e?(0,Ke.jsx)(x5,{}):(0,Ke.jsx)(A5,{});var vi=require("react/jsx-runtime"),Sv=({txn:e,txnFamily:t,uiOptions:r,tokenSymbol:o,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(r.transactionInfo?.contractInfo)return(0,vi.jsx)(Dd,{contractInfo:r.transactionInfo.contractInfo,description:r.description});if(r.senderInfo)return(0,vi.jsx)(Dd,{contractInfo:r.senderInfo,description:r.description||r.senderInfo.actionText})}return(0,vi.jsx)(vi.Fragment,{children:(0,vi.jsx)(D2,{description:r.description||r.transactionInfo?.description||"",txn:e,tokenSymbol:o,tokenPrice:n})})};var Jc=require("@ethersproject/bignumber"),Pv=y(require("styled-components"));var eo=require("react/jsx-runtime"),R5=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Jc.BigNumber.from(e.gasUsed),o=Jc.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let a=Jc.BigNumber.from(t);n=n.add(a)}return n.toString()}catch{return}else return},_v=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:a,l1GasEstimate:i,receiptHeader:s,receiptDescription:l})=>(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(_,{onClose:o}),(0,eo.jsx)(ii,{title:s??"Transaction complete!",description:l??"You're all set."}),(0,eo.jsx)(Sa,{tokenPrice:n,from:t.from,to:t.to,gas:R5(t,i),txn:e,transactionInfo:r,tokenSymbol:a}),(0,eo.jsx)(bn,{}),(0,eo.jsx)(I5,{loading:!1,onClick:o,children:"All Done"}),(0,eo.jsx)(ce,{}),(0,eo.jsx)(j,{})]}),I5=(0,Pv.default)(F)`
2477
2477
  && {
2478
2478
  margin-top: 24px;
2479
2479
  }
2480
2480
  transition: color 350ms ease, background-color 350ms ease;
2481
- `;var Ae=require("react/jsx-runtime"),S5=({txn:e,txnFamily:t,uiOptions:r,tokenSymbol:o,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(r.transactionInfo?.contractInfo)return(0,Ae.jsx)(Nd,{contractInfo:r.transactionInfo.contractInfo,description:r.description});if(r.senderInfo)return(0,Ae.jsx)(Nd,{contractInfo:r.senderInfo,description:r.description||r.senderInfo.actionText})}return(0,Ae.jsx)(Ae.Fragment,{children:(0,Ae.jsx)(L2,{description:r.description||r.transactionInfo?.description||"",txn:e,tokenSymbol:o,tokenPrice:n})})},Sv=()=>{let{authenticated:e,getAccessToken:t}=G(),{wallets:r}=Sa(),{walletProxy:o,closePrivyModal:n,getFiatOnRampConfig:a,rpcConfig:i,chains:s,nativeTokenSymbolForChainId:l,appId:c}=R(),{app:u,navigate:h,data:m,onUserCloseViaDialogOrKeybindRef:v,setModalData:b}=k(),{transactionRequest:g,onSuccess:P,onFailure:A,uiOptions:E,fundWalletConfig:S,requesterAppId:W}=m.sendTransaction,[D,M]=(0,At.useState)(null),[I,H]=(0,At.useState)(null),[$,J]=(0,At.useState)(""),[O,K]=(0,At.useState)(),[N,nt]=(0,At.useState)(),[ht,Xe]=(0,At.useState)(!1),ne={INSUFFICIENT_FUNDS:`Add funds on ${s.find(at=>at.id===g.chainId)?.name??"this network"} to complete the transaction.`,ERROR_PREPARING:"There was an error preparing your transaction. Your transaction request will likely fail."},Ne=()=>{J(""),K(void 0),nt(void 0)},He=(at,st,bi)=>{J(at),K(new It(new _r(st??at,bi??Un.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[Yt,Fr]=(0,At.useState)(!1),[pr,kt]=(0,At.useState)(!0),[ve,Eo]=(0,At.useState)(null),[it,un]=(0,At.useState)(g),{tokenPrice:L,isTokenPriceLoading:Gt}=Gc(it),To=l(g.chainId)||"ETH",[ie,z]=(0,At.useState)(null),[be,dr]=(0,At.useState)(null),[Hn,wi]=(0,At.useState)(!0);(0,At.useEffect)(()=>{e||(h("LANDING"),A(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let Br=g.from?r.find(at=>at.address===g.from):r.find(at=>at.walletClientType==="privy"&&!at.imported),Wa=async()=>{if(!Br)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:at,externalTransactionId:st}=await a(Br.address,{config:S?.config||{}});b({fiatOnRampPrompt:{signedUrl:at},fiatOnRampStatus:{externalTransactionId:st}}),h("FIAT_ON_RAMP_PROMPT_SCREEN")},Go=(0,At.useMemo)(()=>zo(it.chainId,s,i,{appId:c}),[it.chainId,i]);async function Os(at){let st=at;if(!await t()||!o||!Br)return;try{st=await(0,Un.populateTransactionRequest)(Br.address,at,Go),un(st)}catch(Po){console.error(Po),He(ne.ERROR_PREPARING,Po.reason)}let Ei=Gd.BigNumber.from(0),Ns=Gd.BigNumber.from(0);try{({totalGasEstimate:Ei,l1ExecutionFeeEstimate:Ns}=await(0,Un.calculateTotalGasEstimate)(st,Go)),z(Ei.toHexString()),dr(Ns.toHexString())}catch{z(null)}try{let{balance:Po,hasSufficientFunds:Ds}=await Yc(Br.address,st,Ei,Go);Eo(Po.toHexString()),Ds||(kt(!1),He(ne.INSUFFICIENT_FUNDS,"Wallet has insufficient funds on this network for this transaction."),u?.fiatOnRamp.enabled&&Xe(!0))}catch(Po){console.warn(`Failed to fetch wallet balance with error: ${Po}`)}wi(!1)}(0,At.useEffect)(()=>{Os(it)},[o]);let ct=fv(it),Ls=ct==="SEND"?`Send ${To}`:"Review transaction",Ma={modalTitle:E.header||E.modalTitle||Ls,buttonText:E.buttonText||"Submit"},Vn=()=>{Yt||(I?P(I):A(O||new It(new _r("The user rejected the request",Un.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return v.current=Vn,L===void 0&&Gt||Hn?(0,Ae.jsxs)(Ae.Fragment,{children:[E.transactionInfo?.contractInfo?.imgUrl&&(0,Ae.jsx)(xl,{src:E.transactionInfo?.contractInfo?.imgUrl}),(0,Ae.jsx)(_,{title:Ma.modalTitle,onClose:Vn}),(0,Ae.jsx)(Pv,{children:(0,Ae.jsx)(oa,{})})]}):D!==null?(0,Ae.jsx)(Tv,{txn:it,onClose:Vn,receipt:D,transactionInfo:E.transactionInfo,tokenPrice:L,tokenSymbol:To,l1GasEstimate:be,receiptHeader:E.successHeader,receiptDescription:E.successDescription}):N?(0,Ae.jsx)(bv,{transactionError:N,chainId:it.chainId,onClose:Vn,onRetry:({resetNonce:at})=>{Ne();let st=it;at&&(st={...it,nonce:void 0}),Os(st)}}):(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)(_,{title:Ma.modalTitle,onClose:Vn}),(0,Ae.jsxs)(Pv,{children:[(0,Ae.jsxs)(k5,{children:[(0,Ae.jsx)(S5,{txn:it,txnFamily:ct,uiOptions:E,tokenSymbol:To,tokenPrice:L}),Br?(0,Ae.jsx)(Ta,{from:Br.address,to:it.to,txn:it,transactionInfo:E.transactionInfo,gas:ie||void 0,tokenPrice:L,tokenSymbol:To}):null,(0,Ae.jsx)(I5,{})]}),(0,Ae.jsxs)(R5,{children:[(0,Ae.jsx)(_5,{children:$}),(0,Ae.jsx)(M2,{txn:it,address:Br?.address??"",hasFunds:pr,balance:ve}),(0,Ae.jsxs)(A5,{children:[ht&&(0,Ae.jsx)(F,{onClick:Wa,children:"Add Funds"}),(0,Ae.jsx)(x5,{disabled:Yt||!pr,loading:!o||Yt,loadingText:Yt?"Submitting (may take a few moments)...":"Loading...",onClick:async()=>{Fr(!0);let at=await t();if(at&&!Yt&&Br)try{let st=await jc(at,Br.address,o,it,Go,W);H(st);let bi=await st.wait();M(Zc(bi)),Ne()}catch(st){console.warn({transaction:it,error:st}),nt(st),K(new It(new _r(st.reason??"Error processing transaction",Un.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}finally{Fr(!1)}},children:Ma.buttonText})]})]}),(0,Ae.jsx)(ce,{}),(0,Ae.jsx)(j,{protectedByPrivy:!0})]})]})},Pv=Fn.default.div`
2481
+ `;var je=require("react/jsx-runtime"),xv=()=>{let{authenticated:e,getAccessToken:t}=G(),{wallets:r}=_a(),{walletProxy:o,closePrivyModal:n,getFiatOnRampConfig:a,rpcConfig:i,chains:s,nativeTokenSymbolForChainId:l,appId:c}=R(),{app:u,navigate:h,data:m,onUserCloseViaDialogOrKeybindRef:v,setModalData:b}=k(),{transactionRequest:g,onSuccess:S,onFailure:A,uiOptions:E,fundWalletConfig:P,requesterAppId:W}=m.sendTransaction,[D,M]=(0,At.useState)(null),[I,H]=(0,At.useState)(null),[$,J]=(0,At.useState)(""),[O,K]=(0,At.useState)(),[N,nt]=(0,At.useState)(),[ht,Xe]=(0,At.useState)(!1),ne={INSUFFICIENT_FUNDS:`Add funds on ${s.find(at=>at.id===g.chainId)?.name??"this network"} to complete the transaction.`,ERROR_PREPARING:"There was an error preparing your transaction. Your transaction request will likely fail."},Le=()=>{J(""),K(void 0),nt(void 0)},Be=(at,st,Ei)=>{J(at),K(new Wt(new _r(st??at,Ei??Un.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[Zt,Ur]=(0,At.useState)(!1),[dr,kt]=(0,At.useState)(!0),[ve,bo]=(0,At.useState)(null),[it,un]=(0,At.useState)(g),{tokenPrice:L,isTokenPriceLoading:qt}=qc(it),Eo=l(g.chainId)||"ETH",[ie,z]=(0,At.useState)(null),[Ce,Rt]=(0,At.useState)(null),[Hn,bi]=(0,At.useState)(!0);(0,At.useEffect)(()=>{e||(h("LANDING"),A(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let Fr=g.from?r.find(at=>at.address===g.from):r.find(at=>at.walletClientType==="privy"&&!at.imported),Ma=async()=>{if(!Fr)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:at,externalTransactionId:st}=await a(Fr.address,{config:P?.config||{}});b({fiatOnRampPrompt:{signedUrl:at},fiatOnRampStatus:{externalTransactionId:st}}),h("FIAT_ON_RAMP_PROMPT_SCREEN")},Go=(0,At.useMemo)(()=>zo(it.chainId,s,i,{appId:c}),[it.chainId,i]);async function Ls(at){let st=at;if(!await t()||!o||!Fr)return;try{st=await(0,Un.populateTransactionRequest)(Fr.address,at,Go),un(st)}catch(To){console.error(To),Be(ne.ERROR_PREPARING,To.reason)}let Ti=qd.BigNumber.from(0),Ds=qd.BigNumber.from(0);try{({totalGasEstimate:Ti,l1ExecutionFeeEstimate:Ds}=await(0,Un.calculateTotalGasEstimate)(st,Go)),z(Ti.toHexString()),Rt(Ds.toHexString())}catch{z(null)}try{let{balance:To,hasSufficientFunds:Us}=await Zc(Fr.address,st,Ti,Go);bo(To.toHexString()),Us||(kt(!1),Be(ne.INSUFFICIENT_FUNDS,"Wallet has insufficient funds on this network for this transaction."),u?.fiatOnRamp.enabled&&Xe(!0))}catch(To){console.warn(`Failed to fetch wallet balance with error: ${To}`)}bi(!1)}(0,At.useEffect)(()=>{Ls(it)},[o]);let ct=yv(it),Ns=ct==="SEND"?`Send ${Eo}`:"Review transaction",Oa={modalTitle:E.header||E.modalTitle||Ns,buttonText:E.buttonText||"Submit"},Vn=()=>{Zt||(I?S(I):A(O||new Wt(new _r("The user rejected the request",Un.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return v.current=Vn,L===void 0&&qt||Hn?(0,je.jsxs)(je.Fragment,{children:[E.transactionInfo?.contractInfo?.imgUrl&&(0,je.jsx)(kl,{src:E.transactionInfo?.contractInfo?.imgUrl}),(0,je.jsx)(_,{title:Oa.modalTitle,onClose:Vn}),(0,je.jsx)(Av,{children:(0,je.jsx)(na,{})})]}):D!==null?(0,je.jsx)(_v,{txn:it,onClose:Vn,receipt:D,transactionInfo:E.transactionInfo,tokenPrice:L,tokenSymbol:Eo,l1GasEstimate:Ce,receiptHeader:E.successHeader,receiptDescription:E.successDescription}):N?(0,je.jsx)(Tv,{transactionError:N,chainId:it.chainId,onClose:Vn,onRetry:({resetNonce:at})=>{Le();let st=it;at&&(st={...it,nonce:void 0}),Ls(st)}}):(0,je.jsxs)(je.Fragment,{children:[(0,je.jsx)(_,{title:Oa.modalTitle,onClose:Vn}),(0,je.jsxs)(Av,{children:[(0,je.jsxs)(L5,{children:[(0,je.jsx)(Sv,{txn:it,txnFamily:ct,uiOptions:E,tokenSymbol:Eo,tokenPrice:L}),Fr?(0,je.jsx)(Sa,{from:Fr.address,to:it.to,txn:it,transactionInfo:E.transactionInfo,gas:ie||void 0,tokenPrice:L,tokenSymbol:Eo}):null,(0,je.jsx)(D5,{})]}),(0,je.jsxs)(N5,{children:[(0,je.jsx)(W5,{children:$}),(0,je.jsx)(L2,{txn:it,address:Fr?.address??"",hasFunds:dr,balance:ve}),(0,je.jsxs)(M5,{children:[ht&&(0,je.jsx)(F,{onClick:Ma,children:"Add Funds"}),(0,je.jsx)(O5,{disabled:Zt||!dr,loading:!o||Zt,loadingText:Zt?"Submitting (may take a few moments)...":"Loading...",onClick:async()=>{Ur(!0);let at=await t();if(at&&!Zt&&Fr)try{let st=await Yc(at,Fr.address,o,it,Go,W);H(st);let Ei=await st.wait();M(Qc(Ei)),Le()}catch(st){console.warn({transaction:it,error:st}),nt(st),K(new Wt(new _r(st.reason??"Error processing transaction",Un.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}finally{Ur(!1)}},children:Oa.buttonText})]})]}),(0,je.jsx)(ce,{}),(0,je.jsx)(j,{})]})]})},Av=Fn.default.div`
2482
2482
  display: flex;
2483
2483
  flex-direction: column;
2484
2484
  justify-content: space-between;
2485
2485
  flex-grow: 1;
2486
- `,_5=Fn.default.div`
2486
+ `,W5=Fn.default.div`
2487
2487
  font-size: 13px;
2488
2488
  color: var(--privy-color-error);
2489
2489
  width: 100%;
2490
2490
  margin-top: 16px;
2491
- `,A5=Fn.default.div`
2491
+ `,M5=Fn.default.div`
2492
2492
  display: flex;
2493
2493
  direction: row;
2494
2494
  justify-content: space-between;
2495
2495
  align-items: center;
2496
2496
  gap: 8px;
2497
- `,x5=(0,Fn.default)(F)`
2497
+ `,O5=(0,Fn.default)(F)`
2498
2498
  transition: color 350ms ease, background-color 350ms ease;
2499
- `,k5=Fn.default.div`
2499
+ `,L5=Fn.default.div`
2500
2500
  height: 100%;
2501
2501
  display: flex;
2502
2502
  flex-direction: column;
2503
2503
  justify-content: space-evenly;
2504
2504
  flex-grow: 1;
2505
- `,R5=Fn.default.div`
2505
+ `,N5=Fn.default.div`
2506
2506
  display: flex;
2507
2507
  flex-direction: column;
2508
2508
  gap: 8px;
2509
- `,I5=Fn.default.div`
2509
+ `,D5=Fn.default.div`
2510
2510
  flex-grow: 1;
2511
- `;var _v=require("@ethersproject/bytes"),Av=require("@ethersproject/strings"),ln=require("react"),cn=y(require("styled-components")),Jc=require("@privy-io/js-sdk-core");var ke=require("react/jsx-runtime"),W5=e=>{if(!(0,_v.isHexString)(e))return e;try{return(0,Av.toUtf8String)(e)}catch{return e}},M5=e=>JSON.stringify(e,null,2),O5=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?(0,ke.jsx)(U5,{children:Object.entries(r).map(([o,n])=>(0,ke.jsxs)("li",{children:[(0,ke.jsxs)("strong",{children:[o,":"]})," ",t(n)]},o))}):(0,ke.jsx)("span",{children:String(r)});return(0,ke.jsx)("div",{children:t(e)})},L5=e=>{let{types:t,primaryType:r,...o}=e.typedData;return(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)(kv,{children:(0,ke.jsx)(O5,{data:o})}),(0,ke.jsx)(Rn,{text:M5(e.typedData),itemName:"full payload to clipboard"})," "]})},xv=()=>{let{authenticated:e}=G(),{initializeWalletProxy:t,closePrivyModal:r}=R(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:a}=k(),[i,s]=(0,ln.useState)(!0),[l,c]=(0,ln.useState)(""),[u,h]=(0,ln.useState)(),[m,v]=(0,ln.useState)(null),[b,g]=(0,ln.useState)(!1),P=m!==null;(0,ln.useEffect)(()=>{e||o("LANDING")},[e]),(0,ln.useEffect)(()=>{t(Ai).then($=>{s(!1),$||(c("An error has occurred, please try again."),h(new It(new _r(l,Jc.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:A,data:E,confirmAndSign:S,onSuccess:W,onFailure:D,uiOptions:M}=n.signMessage,I={title:M.title||"Sign message",description:M.description||"Signing this message will not cost you any fees.",buttonText:M.buttonText||"Sign and continue"},H=$=>{$?W($):D(u||new It(new _r("The user rejected the request.",Jc.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{v(null),c(""),h(void 0)},200)};return a.current=()=>{H(m)},(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)(_,{onClose:()=>H(m)}),(0,ke.jsx)(le,{}),M.iconUrl&&typeof M.iconUrl=="string"?(0,ke.jsx)(H5,{children:(0,ke.jsx)(Hc,{size:"sm",src:M.iconUrl,alt:"app image"})}):null,(0,ke.jsx)(N5,{children:I.title}),(0,ke.jsx)(D5,{children:I.description}),A==="personal_sign"&&(0,ke.jsx)(kv,{children:W5(E)}),A==="eth_signTypedData_v4"&&(0,ke.jsx)(L5,{typedData:E}),(0,ke.jsx)(V5,{}),(0,ke.jsx)(F5,{fail:!0,children:l}),(0,ke.jsx)(Vf,{disabled:b||P||i,loading:b,onClick:async()=>{g(!0),c("");try{let $=await S();v($),g(!1),setTimeout(()=>{H($)},et)}catch($){console.error($),c("An error has occurred, please try again."),h(new It(new _r(l,Jc.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),g(!1)}},children:b?"Signing...":P?(0,ke.jsxs)(B5,{children:[(0,ke.jsx)(dc,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,ke.jsx)("span",{children:"Success"})]}):I.buttonText}),(0,ke.jsx)(ce,{}),(0,ke.jsx)(j,{protectedByPrivy:!0})]})},N5=cn.default.span`
2512
- color: var(--privy-color-foreground);
2513
- text-align: center;
2514
- font-size: 1.125rem;
2515
- font-weight: 500;
2516
- line-height: 1.25rem; /* 111.111% */
2517
- text-align: center;
2518
- `,D5=cn.default.span`
2511
+ `;var Mv=require("@ethersproject/bytes"),Ov=require("@ethersproject/strings"),cn=require("react"),Ci=y(require("styled-components")),Xc=require("@privy-io/js-sdk-core");var kv=y(require("styled-components")),Rv=kv.default.span`
2519
2512
  margin-top: 4px;
2520
2513
  color: var(--privy-color-foreground);
2521
2514
  text-align: center;
2522
2515
 
2523
- font-size: 0.825rem;
2524
- font-style: normal;
2516
+ font-size: 0.875rem;
2525
2517
  font-weight: 400;
2526
- line-height: 20px; /* 142.857% */
2527
- letter-spacing: -0.008px;
2528
- `,kv=cn.default.div`
2518
+ line-height: 1.375rem; /* 157.143% */
2519
+ `;var Iv=y(require("styled-components")),Wv=Iv.default.span`
2520
+ color: var(--privy-color-foreground);
2521
+ font-size: 1.125rem;
2522
+ font-weight: 600;
2523
+ line-height: 1.875rem; /* 166.667% */
2524
+ text-align: center;
2525
+ `;var xe=require("react/jsx-runtime"),U5=e=>{if(!(0,Mv.isHexString)(e))return e;try{return(0,Ov.toUtf8String)(e)}catch{return e}},F5=e=>JSON.stringify(e,null,2),B5=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?(0,xe.jsx)(V5,{children:Object.entries(r).map(([o,n])=>(0,xe.jsxs)("li",{children:[(0,xe.jsxs)("strong",{children:[o,":"]})," ",t(n)]},o))}):(0,xe.jsx)("span",{children:String(r)});return(0,xe.jsx)("div",{children:t(e)})},H5=e=>{let{types:t,primaryType:r,...o}=e.typedData;return(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(Nv,{children:(0,xe.jsx)(B5,{data:o})}),(0,xe.jsx)(Rn,{text:F5(e.typedData),itemName:"full payload to clipboard"})," "]})},Lv=()=>{let{authenticated:e}=G(),{initializeWalletProxy:t,closePrivyModal:r}=R(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:a}=k(),[i,s]=(0,cn.useState)(!0),[l,c]=(0,cn.useState)(""),[u,h]=(0,cn.useState)(),[m,v]=(0,cn.useState)(null),[b,g]=(0,cn.useState)(!1),S=m!==null;(0,cn.useEffect)(()=>{e||o("LANDING")},[e]),(0,cn.useEffect)(()=>{t(xi).then($=>{s(!1),$||(c("An error has occurred, please try again."),h(new Wt(new _r(l,Xc.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:A,data:E,confirmAndSign:P,onSuccess:W,onFailure:D,uiOptions:M}=n.signMessage,I={title:M.title||"Sign message",description:M.description||"Signing this message will not cost you any fees.",buttonText:M.buttonText||"Sign and continue"},H=$=>{$?W($):D(u||new Wt(new _r("The user rejected the request.",Xc.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{v(null),c(""),h(void 0)},200)};return a.current=()=>{H(m)},(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(_,{onClose:()=>H(m)}),(0,xe.jsx)(le,{}),M.iconUrl&&typeof M.iconUrl=="string"?(0,xe.jsx)(z5,{children:(0,xe.jsx)(Vc,{size:"sm",src:M.iconUrl,alt:"app image"})}):null,(0,xe.jsx)(Wv,{children:I.title}),(0,xe.jsx)(Rv,{children:I.description}),A==="personal_sign"&&(0,xe.jsx)(Nv,{children:U5(E)}),A==="eth_signTypedData_v4"&&(0,xe.jsx)(H5,{typedData:E}),(0,xe.jsx)($5,{}),(0,xe.jsx)(G5,{fail:!0,children:l}),(0,xe.jsx)(qf,{disabled:b||S||i,loading:b,onClick:async()=>{g(!0),c("");try{let $=await P();v($),g(!1),setTimeout(()=>{H($)},et)}catch($){console.error($),c("An error has occurred, please try again."),h(new Wt(new _r(l,Xc.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),g(!1)}},children:b?"Signing...":S?(0,xe.jsxs)(q5,{children:[(0,xe.jsx)(uc,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,xe.jsx)("span",{children:"Success"})]}):I.buttonText}),(0,xe.jsx)(ce,{}),(0,xe.jsx)(j,{})]})},Nv=Ci.default.div`
2529
2526
  margin-top: 1.5rem;
2530
2527
  background-color: var(--privy-color-background-2);
2531
2528
  border-radius: var(--privy-border-radius-md);
@@ -2544,19 +2541,19 @@ You will have to sign up with another method first to register a passkey for you
2544
2541
  display: none; /* Safari and Chrome */
2545
2542
  }
2546
2543
  }
2547
- `,U5=cn.default.ul`
2544
+ `,V5=Ci.default.ul`
2548
2545
  margin-left: 12px !important;
2549
2546
  white-space: nowrap;
2550
2547
 
2551
2548
  &:first-child {
2552
2549
  margin-left: 0 !important;
2553
2550
  }
2554
-
2551
+
2555
2552
  strong {
2556
2553
  font-weight: 500 !important;
2557
2554
  }
2558
2555
  }
2559
- `,F5=cn.default.div`
2556
+ `,G5=Ci.default.div`
2560
2557
  line-height: 20px;
2561
2558
  height: 20px;
2562
2559
  font-size: 13px;
@@ -2566,20 +2563,20 @@ You will have to sign up with another method first to register a passkey for you
2566
2563
  width: 100%;
2567
2564
  margin-top: 16px;
2568
2565
  margin-bottom: 4px;
2569
- `,B5=cn.default.span`
2566
+ `,q5=Ci.default.span`
2570
2567
  display: flex;
2571
2568
  align-items: center;
2572
2569
  gap: 8px;
2573
- `,H5=cn.default.div`
2570
+ `,z5=Ci.default.div`
2574
2571
  display: flex;
2575
2572
  flex-direction: column;
2576
2573
  justify-content: center;
2577
2574
  align-items: center;
2578
2575
  width: 100%;
2579
2576
  height: 82px;
2580
- `,V5=cn.default.div`
2577
+ `,$5=Ci.default.div`
2581
2578
  flex-grow: 1;
2582
- `;var xa=require("react"),Rv=y(require("styled-components"));var Bt=require("react/jsx-runtime"),Iv=()=>{let{authenticated:e,logout:t,ready:r,user:o}=G(),{app:n,setModalData:a,navigate:i,resetNavigation:s}=k(),{initLoginWithTelegram:l,loginWithTelegram:c,updateWallets:u,setReadyToTrue:h,closePrivyModal:m,createAnalyticsEvent:v}=R(),[b,g]=(0,xa.useState)(!1),[P,A]=(0,xa.useState)(void 0),E=et;async function S(){try{await c(),g(!0),h(!0)}catch(M){if(M?.privyErrorCode==="allowlist_rejected"){A(void 0),s(),i("ALLOWLIST_REJECTION_SCREEN");return}if(M?.privyErrorCode==="max_accounts_reached"){console.error(new Hr(M).toString()),A(void 0),s(),i("USER_LIMIT_REACHED_SCREEN");return}if(M?.privyErrorCode==="user_does_not_exist"){A(void 0),s(),i("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:I,detail:H}=Sp(M);A({retryable:I,detail:H,message:"Authentication failed"})}}(0,xa.useEffect)(()=>{S()},[]),(0,xa.useEffect)(()=>{if(!(r&&e&&b&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},E);return()=>clearTimeout(H)}if(hr(o,n?.embeddedWallets?.createOnLogin)){let H=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:$=>{console.error($),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:$,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},E);return()=>clearTimeout(H)}u();let I=setTimeout(()=>m({shouldCallAuthOnSuccess:!0,isSuccess:!0}),E);return()=>clearTimeout(I)},[r,e,b,o]);let W=b?"Successfully connected with Telegram":P?P.message:"Verifying connection to Telegram",D="";return b?D="You\u2019re good to go!":P?D=P.detail:D="Just a few moments more",(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(_,{}),(0,Bt.jsx)(le,{}),(0,Bt.jsxs)(G5,{children:[(0,Bt.jsx)(ut,{children:(0,Bt.jsxs)("div",{children:[(0,Bt.jsx)(wt,{success:b,fail:!!P}),(0,Bt.jsx)(Ac,{style:{width:"38px",height:"38px"}})]})}),(0,Bt.jsxs)(mt,{children:[(0,Bt.jsx)("h3",{children:W}),(0,Bt.jsx)("p",{children:D})]}),P&&P?.retryable?(0,Bt.jsx)(Ki,{onClick:()=>{l().then(async()=>S()).catch(M=>{let{retryable:I,detail:H}=Sp(M);A({retryable:I,detail:H,message:"Authentication failed"})}),A(void 0)},disabled:!b&&!P?.retryable,children:"Retry"}):null]}),(0,Bt.jsx)(ce,{}),(0,Bt.jsx)(Y,{})]})},G5=Rv.default.div`
2579
+ `;var ka=require("react"),Dv=y(require("styled-components"));var Ht=require("react/jsx-runtime"),Uv=()=>{let{authenticated:e,logout:t,ready:r,user:o}=G(),{app:n,setModalData:a,navigate:i,resetNavigation:s}=k(),{initLoginWithTelegram:l,loginWithTelegram:c,updateWallets:u,setReadyToTrue:h,closePrivyModal:m,createAnalyticsEvent:v}=R(),[b,g]=(0,ka.useState)(!1),[S,A]=(0,ka.useState)(void 0),E=et;async function P(){try{await c(),g(!0),h(!0)}catch(M){if(M?.privyErrorCode==="allowlist_rejected"){A(void 0),s(),i("ALLOWLIST_REJECTION_SCREEN");return}if(M?.privyErrorCode==="max_accounts_reached"){console.error(new Br(M).toString()),A(void 0),s(),i("USER_LIMIT_REACHED_SCREEN");return}if(M?.privyErrorCode==="user_does_not_exist"){A(void 0),s(),i("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:I,detail:H}=_p(M);A({retryable:I,detail:H,message:"Authentication failed"})}}(0,ka.useEffect)(()=>{P()},[]),(0,ka.useEffect)(()=>{if(!(r&&e&&b&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},E);return()=>clearTimeout(H)}if(hr(o,n?.embeddedWallets?.createOnLogin)){let H=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:$=>{console.error($),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:$,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},E);return()=>clearTimeout(H)}u();let I=setTimeout(()=>m({shouldCallAuthOnSuccess:!0,isSuccess:!0}),E);return()=>clearTimeout(I)},[r,e,b,o]);let W=b?"Successfully connected with Telegram":S?S.message:"Verifying connection to Telegram",D="";return b?D="You\u2019re good to go!":S?D=S.detail:D="Just a few moments more",(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)(_,{}),(0,Ht.jsx)(le,{}),(0,Ht.jsxs)(K5,{children:[(0,Ht.jsx)(ut,{children:(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)(wt,{success:b,fail:!!S}),(0,Ht.jsx)(xc,{style:{width:"38px",height:"38px"}})]})}),(0,Ht.jsxs)(mt,{children:[(0,Ht.jsx)("h3",{children:W}),(0,Ht.jsx)("p",{children:D})]}),S&&S?.retryable?(0,Ht.jsx)(ji,{onClick:()=>{l().then(async()=>P()).catch(M=>{let{retryable:I,detail:H}=_p(M);A({retryable:I,detail:H,message:"Authentication failed"})}),A(void 0)},disabled:!b&&!S?.retryable,children:"Retry"}):null]}),(0,Ht.jsx)(ce,{}),(0,Ht.jsx)(Y,{})]})},K5=Dv.default.div`
2583
2580
  display: flex;
2584
2581
  flex-direction: column;
2585
2582
  align-items: center;
@@ -2587,9 +2584,9 @@ You will have to sign up with another method first to register a passkey for you
2587
2584
  margin-left: 27px;
2588
2585
  margin-right: 27px;
2589
2586
  gap: 24px;
2590
- `;var Ov=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Wv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Is=require("react"),qd=y(require("styled-components"));var bo=require("react/jsx-runtime"),Mv=(0,Is.forwardRef)((e,t)=>{let[r,o]=(0,Is.useState)(""),[n,a]=(0,Is.useState)(!1),{authenticated:i,user:s}=G(),{initUpdateEmail:l}=R(),{navigate:c,setModalData:u,currentScreen:h}=k(),{enabled:m,token:v}=Se(),b=el(r),g=n,P=n||!b,A=async S=>{if(!s?.email)throw new Error("User is required to have an email address to update it.");a(!0);try{await l(s.email.address,r,S),c("AWAITING_PASSWORDLESS_CODE")}catch(W){u({errorModalData:{error:W,previousScreen:h||"LANDING"}})}a(!1)},E=()=>{m&&!v&&!i?(u({captchaModalData:{callback:S=>{if(!s?.email)throw new Error("User is required to have an email address to update it.");return l(s.email.address,r,S)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):A(v)};return(0,bo.jsxs)(bo.Fragment,{children:[(0,bo.jsx)(q5,{children:(0,bo.jsxs)(z5,{children:[(0,bo.jsx)(Wv.default,{}),(0,bo.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:S=>o(S.target.value),onKeyUp:S=>{S.key==="Enter"&&E()},value:r,autoComplete:"email"}),e.stacked?null:(0,bo.jsx)(ji,{isSubmitting:g,onClick:E,disabled:P,children:"Submit"})]})}),e.stacked?(0,bo.jsx)(F,{loadingText:null,loading:g,disabled:P,onClick:E,children:"Submit"}):null]})}),q5=qd.default.div`
2587
+ `;var Hv=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Fv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Ws=require("react"),zd=y(require("styled-components"));var wo=require("react/jsx-runtime"),Bv=(0,Ws.forwardRef)((e,t)=>{let[r,o]=(0,Ws.useState)(""),[n,a]=(0,Ws.useState)(!1),{authenticated:i,user:s}=G(),{initUpdateEmail:l}=R(),{navigate:c,setModalData:u,currentScreen:h}=k(),{enabled:m,token:v}=Pe(),b=tl(r),g=n,S=n||!b,A=async P=>{if(!s?.email)throw new Error("User is required to have an email address to update it.");a(!0);try{await l(s.email.address,r,P),c("AWAITING_PASSWORDLESS_CODE")}catch(W){u({errorModalData:{error:W,previousScreen:h||"LANDING"}})}a(!1)},E=()=>{m&&!v&&!i?(u({captchaModalData:{callback:P=>{if(!s?.email)throw new Error("User is required to have an email address to update it.");return l(s.email.address,r,P)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):A(v)};return(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(j5,{children:(0,wo.jsxs)(Y5,{children:[(0,wo.jsx)(Fv.default,{}),(0,wo.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:P=>o(P.target.value),onKeyUp:P=>{P.key==="Enter"&&E()},value:r,autoComplete:"email"}),e.stacked?null:(0,wo.jsx)(Yi,{isSubmitting:g,onClick:E,disabled:S,children:"Submit"})]})}),e.stacked?(0,wo.jsx)(F,{loadingText:null,loading:g,disabled:S,onClick:E,children:"Submit"}):null]})}),j5=zd.default.div`
2591
2588
  width: 100%;
2592
- `,z5=qd.default.label`
2589
+ `,Y5=zd.default.label`
2593
2590
  display: block;
2594
2591
  position: relative;
2595
2592
  width: 100%;
@@ -2647,7 +2644,7 @@ You will have to sign up with another method first to register a passkey for you
2647
2644
  && > input::placeholder {
2648
2645
  color: var(--privy-color-foreground-3);
2649
2646
  }
2650
- `;var Ur=require("react/jsx-runtime"),Lv=()=>(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(_,{},"header"),(0,Ur.jsx)(le,{}),(0,Ur.jsx)(Ge,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,Ur.jsx)(Ov.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Ur.jsx)($r,{children:(0,Ur.jsx)(Mv,{stacked:!0})}),(0,Ur.jsx)(ce,{}),(0,Ur.jsx)(j,{protectedByPrivy:!0})]});var Xc=y(require("styled-components"));var zd=require("react/jsx-runtime"),Nv=({style:e,...t})=>(0,zd.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:(0,zd.jsx)("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});var Sr=require("react/jsx-runtime"),Dv=()=>{let{navigate:e}=k();return(0,Sr.jsxs)(Sr.Fragment,{children:[(0,Sr.jsx)(_,{}),(0,Sr.jsxs)($5,{children:[(0,Sr.jsx)(K5,{children:(0,Sr.jsx)(Nv,{})}),(0,Sr.jsxs)(j5,{children:[(0,Sr.jsx)("h3",{children:"Unable to sign in"}),(0,Sr.jsx)("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),(0,Sr.jsx)(F,{onClick:()=>{e("LANDING")},children:"Go back"})]}),(0,Sr.jsx)(j,{protectedByPrivy:!0})]})},$5=Xc.default.div`
2647
+ `;var Dr=require("react/jsx-runtime"),Vv=()=>(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(_,{},"header"),(0,Dr.jsx)(le,{}),(0,Dr.jsx)(Ve,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,Dr.jsx)(Hv.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Dr.jsx)(zr,{children:(0,Dr.jsx)(Bv,{stacked:!0})}),(0,Dr.jsx)(ce,{}),(0,Dr.jsx)(j,{})]});var ep=y(require("styled-components"));var $d=require("react/jsx-runtime"),Gv=({style:e,...t})=>(0,$d.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:(0,$d.jsx)("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});var Pr=require("react/jsx-runtime"),qv=()=>{let{navigate:e}=k();return(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(_,{}),(0,Pr.jsxs)(Z5,{children:[(0,Pr.jsx)(Q5,{children:(0,Pr.jsx)(Gv,{})}),(0,Pr.jsxs)(J5,{children:[(0,Pr.jsx)("h3",{children:"Unable to sign in"}),(0,Pr.jsx)("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),(0,Pr.jsx)(F,{onClick:()=>{e("LANDING")},children:"Go back"})]}),(0,Pr.jsx)(j,{})]})},Z5=ep.default.div`
2651
2648
  display: flex;
2652
2649
  flex-direction: column;
2653
2650
  align-items: center;
@@ -2656,7 +2653,7 @@ You will have to sign up with another method first to register a passkey for you
2656
2653
  width: 100%;
2657
2654
  padding-top: 8px;
2658
2655
  padding-bottom: 32px;
2659
- `,K5=Xc.default.div`
2656
+ `,Q5=ep.default.div`
2660
2657
  display: flex;
2661
2658
  align-items: center;
2662
2659
  justify-content: center;
@@ -2665,11 +2662,11 @@ You will have to sign up with another method first to register a passkey for you
2665
2662
  color: var(--privy-color-error);
2666
2663
  background-color: var(--privy-color-error-light);
2667
2664
  border-radius: 50%;
2668
- `,j5=Xc.default.div`
2665
+ `,J5=ep.default.div`
2669
2666
  display: flex;
2670
2667
  flex-direction: column;
2671
2668
  gap: 8px;
2672
- `;var ep=y(require("styled-components"));var Y5=`
2669
+ `;var tp=y(require("styled-components"));var X5=`
2673
2670
  *,
2674
2671
  ::before,
2675
2672
  ::after {
@@ -2899,7 +2896,7 @@ You will have to sign up with another method first to register a passkey for you
2899
2896
  [hidden] {
2900
2897
  display: none;
2901
2898
  }
2902
- `,Uv=Y5;var Fv=ep.createGlobalStyle`
2899
+ `,zv=X5;var $v=tp.createGlobalStyle`
2903
2900
  :root {
2904
2901
  // Borders
2905
2902
  --privy-border-radius-sm: 6px;
@@ -2933,10 +2930,10 @@ You will have to sign up with another method first to register a passkey for you
2933
2930
  --privy-height-modal-full: 620px;
2934
2931
  --privy-height-modal-compact: 480px;
2935
2932
  };
2936
- `,$d=ep.default.div`
2933
+ `,Kd=tp.default.div`
2937
2934
  // css normalize only the privy application to avoid conflicts
2938
2935
  // with consuming application
2939
- ${Uv}
2936
+ ${zv}
2940
2937
 
2941
2938
  // Privy styles
2942
2939
  color: var(--privy-color-foreground-2);
@@ -2987,7 +2984,7 @@ You will have to sign up with another method first to register a passkey for you
2987
2984
  opacity: 1;
2988
2985
  }
2989
2986
  }
2990
- `;var Ci=require("@headlessui/react"),tp=y(require("react")),ka=y(require("styled-components")),pn=require("react/jsx-runtime"),Bv=({children:e,open:t,onClick:r,...o})=>(0,pn.jsx)(Ci.Transition,{show:t,as:tp.default.Fragment,children:(0,pn.jsxs)(Ci.Dialog,{onClose:r,...o,as:Q5,children:[(0,pn.jsx)(Ci.Transition.Child,{as:tp.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,pn.jsx)(Z5,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,pn.jsx)(J5,{children:(0,pn.jsx)(Ci.Transition.Child,{as:tp.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,pn.jsx)(Ci.Dialog.Panel,{as:X5,children:e})})})]})}),Z5=ka.default.div`
2987
+ `;var wi=require("@headlessui/react"),rp=y(require("react")),Ra=y(require("styled-components")),pn=require("react/jsx-runtime"),Kv=({children:e,open:t,onClick:r,...o})=>(0,pn.jsx)(wi.Transition,{show:t,as:rp.default.Fragment,children:(0,pn.jsxs)(wi.Dialog,{onClose:r,...o,as:t6,children:[(0,pn.jsx)(wi.Transition.Child,{as:rp.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,pn.jsx)(e6,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,pn.jsx)(r6,{children:(0,pn.jsx)(wi.Transition.Child,{as:rp.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,pn.jsx)(wi.Dialog.Panel,{as:o6,children:e})})})]})}),e6=Ra.default.div`
2991
2988
  position: fixed;
2992
2989
  inset: 0;
2993
2990
 
@@ -3000,10 +2997,10 @@ You will have to sign up with another method first to register a passkey for you
3000
2997
  backdrop-filter: unset;
3001
2998
  -webkit-backdrop-filter: unset;
3002
2999
  }
3003
- `,Q5=ka.default.div`
3000
+ `,t6=Ra.default.div`
3004
3001
  position: relative;
3005
3002
  z-index: 999999;
3006
- `,J5=ka.default.div`
3003
+ `,r6=Ra.default.div`
3007
3004
  position: fixed;
3008
3005
  inset: 0;
3009
3006
  display: flex;
@@ -3011,7 +3008,7 @@ You will have to sign up with another method first to register a passkey for you
3011
3008
  justify-content: center;
3012
3009
  width: 100vw;
3013
3010
  min-height: 100vh;
3014
- `,X5=ka.default.div`
3011
+ `,o6=Ra.default.div`
3015
3012
  // reset some default dialog styles
3016
3013
  padding: 0;
3017
3014
  background: transparent;
@@ -3058,13 +3055,13 @@ You will have to sign up with another method first to register a passkey for you
3058
3055
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3059
3056
  border-radius: var(--privy-border-radius-lg);
3060
3057
  }
3061
- `,Hv=ka.default.div`
3058
+ `,jv=Ra.default.div`
3062
3059
  display: flex;
3063
3060
  flex-direction: column;
3064
3061
  align-items: center;
3065
3062
  justify-content: center;
3066
3063
  height: 100%;
3067
- `;var Ye=require("react/jsx-runtime"),e6={["LANDING"]:g1,["CONNECT_OR_CREATE"]:y1,["AWAITING_PASSWORDLESS_CODE"]:gh,["AWAITING_CONNECTION"]:Vh,["AWAITING_CONNECT_ONLY_CONNECTION"]:zh,["AWAITING_FARCASTER_CONNECTION"]:yg,["AWAITING_FARCASTER_SIGNER"]:wg,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:Y2,["PHANTOM_INTERSTITIAL_SCREEN"]:X2,["LOGIN_FAILED_SCREEN"]:M1,["AWAITING_OAUTH_SCREEN"]:j2,["CROSS_APP_AUTH_SCREEN"]:jh,["ALLOWLIST_REJECTION_SCREEN"]:ih,["ACCOUNT_NOT_FOUND_SCREEN"]:Xf,["USER_LIMIT_REACHED_SCREEN"]:Dv,["INSTALL_PHANTOM_SCREEN"]:Vg,["LINK_EMAIL_SCREEN"]:C1,["LINK_PHONE_SCREEN"]:R1,["LINK_WALLET_SCREEN"]:I1,["LINK_PASSKEY_SCREEN"]:A1,["UPDATE_EMAIL_SCREEN"]:Lv,["CONNECT_ONLY_LANDING_SCREEN"]:Fh,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Oh,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:uy,["EMBEDDED_WALLET_CREATED_SCREEN"]:ny,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:ty,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:tv,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:uv,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:nv,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:cy,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:xv,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:Sv,["FIAT_ON_RAMP_PROMPT_SCREEN"]:kg,["FIAT_ON_RAMP_STATUS_SCREEN"]:Og,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Xy,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Yy,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:iv,["MFA_ENROLLMENT_FLOW_SCREEN"]:d2,["CAPTCHA_SCREEN"]:Sh,["ERROR_SCREEN"]:rg,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Dg,["AFFIRMATIVE_CONSENT_SCREEN"]:oh,["TELEGRAM_AUTH_SCREEN"]:Iv},t6=["LANDING","AWAITING_CONNECTION"],Vv=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=G(),{headless:n}=Wt(),{ready:a,currentScreen:i}=k(),{status:s,execute:l,reset:c,enabled:u}=Se(),h=o&&i&&t6.includes(i)&&!n&&s==="ready";if((0,dn.useEffect)(()=>{h&&l()},[h]),(0,dn.useEffect)(()=>{!o&&u&&c()},[o,u]),(!r||!a)&&i!=="AWAITING_OAUTH_SCREEN"&&i!=="CROSS_APP_AUTH_SCREEN"&&i!=="TELEGRAM_AUTH_SCREEN")return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(_,{}),(0,Ye.jsx)(le,{}),(0,Ye.jsx)(Hv,{children:(0,Ye.jsx)(Mt,{})}),(0,Ye.jsx)(ce,{}),(0,Ye.jsx)(Y,{})]});if(!i&&e)return(0,Ye.jsx)(Fd,{open:e,onClose:t});if(!i)return null;let m=e6[i];return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(mo,{if:!!e,children:(0,Ye.jsx)(m,{})}),(0,Ye.jsx)(mo,{if:!e,children:(0,Ye.jsx)(Fd,{open:e,onClose:t})})]})},r6=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=(0,dn.useRef)(null),o=Ff(r);return(0,Ye.jsx)(n6,{style:{height:o},id:"privy-modal-content",children:(0,Ye.jsx)("div",{ref:r,children:(0,Ye.jsx)(Vv,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},o6=()=>{let{closePrivyModal:e}=R(),{onUserCloseViaDialogOrKeybindRef:t}=k();return{gracefulClosePrivyModal:(0,dn.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},rp=({open:e})=>{let{app:t}=k(),{gracefulClosePrivyModal:r}=o6(),[o,n]=(0,dn.useState)(!1);Bl({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let a=e||o;return t.render.standalone?(0,Ye.jsx)($d,{children:(0,Ye.jsx)(Gv,{id:"privy-modal-content",children:(0,Ye.jsx)(Vv,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):(0,Ye.jsx)(Bv,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:(0,Ye.jsx)($d,{children:(0,Ye.jsx)(r6,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},Gv=Kd.default.div`
3064
+ `;var Ye=require("react/jsx-runtime"),n6={["LANDING"]:C1,["CONNECT_OR_CREATE"]:v1,["AWAITING_PASSWORDLESS_CODE"]:Ch,["AWAITING_CONNECTION"]:qh,["AWAITING_CONNECT_ONLY_CONNECTION"]:Kh,["AWAITING_FARCASTER_CONNECTION"]:vg,["AWAITING_FARCASTER_SIGNER"]:Eg,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:Q2,["PHANTOM_INTERSTITIAL_SCREEN"]:tv,["LOGIN_FAILED_SCREEN"]:L1,["AWAITING_OAUTH_SCREEN"]:Z2,["CROSS_APP_AUTH_SCREEN"]:Zh,["ALLOWLIST_REJECTION_SCREEN"]:sh,["ACCOUNT_NOT_FOUND_SCREEN"]:th,["USER_LIMIT_REACHED_SCREEN"]:qv,["INSTALL_PHANTOM_SCREEN"]:qg,["LINK_EMAIL_SCREEN"]:b1,["LINK_PHONE_SCREEN"]:W1,["LINK_WALLET_SCREEN"]:M1,["LINK_PASSKEY_SCREEN"]:k1,["UPDATE_EMAIL_SCREEN"]:Vv,["CONNECT_ONLY_LANDING_SCREEN"]:Hh,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Nh,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:fy,["EMBEDDED_WALLET_CREATED_SCREEN"]:ay,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:oy,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:ov,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:fv,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:av,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:dy,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:Lv,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:xv,["FIAT_ON_RAMP_PROMPT_SCREEN"]:Ig,["FIAT_ON_RAMP_STATUS_SCREEN"]:Ng,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:tg,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Qy,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:sv,["MFA_ENROLLMENT_FLOW_SCREEN"]:m2,["CAPTCHA_SCREEN"]:Ah,["ERROR_SCREEN"]:ng,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Fg,["AFFIRMATIVE_CONSENT_SCREEN"]:ih,["TELEGRAM_AUTH_SCREEN"]:Uv},i6=["LANDING","AWAITING_CONNECTION"],Yv=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=G(),{headless:n}=Mt(),{ready:a,currentScreen:i}=k(),{status:s,execute:l,reset:c,enabled:u}=Pe(),h=o&&i&&i6.includes(i)&&!n&&s==="ready";if((0,dn.useEffect)(()=>{h&&l()},[h]),(0,dn.useEffect)(()=>{!o&&u&&c()},[o,u]),(!r||!a)&&i!=="AWAITING_OAUTH_SCREEN"&&i!=="CROSS_APP_AUTH_SCREEN"&&i!=="TELEGRAM_AUTH_SCREEN")return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(_,{}),(0,Ye.jsx)(le,{}),(0,Ye.jsx)(jv,{children:(0,Ye.jsx)(Ot,{})}),(0,Ye.jsx)(ce,{}),(0,Ye.jsx)(Y,{})]});if(!i&&e)return(0,Ye.jsx)(Bd,{open:e,onClose:t});if(!i)return null;let m=n6[i];return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(uo,{if:!!e,children:(0,Ye.jsx)(m,{})}),(0,Ye.jsx)(uo,{if:!e,children:(0,Ye.jsx)(Bd,{open:e,onClose:t})})]})},a6=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=(0,dn.useRef)(null),o=Hf(r);return(0,Ye.jsx)(l6,{style:{height:o},id:"privy-modal-content",children:(0,Ye.jsx)("div",{ref:r,children:(0,Ye.jsx)(Yv,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},s6=()=>{let{closePrivyModal:e}=R(),{onUserCloseViaDialogOrKeybindRef:t}=k();return{gracefulClosePrivyModal:(0,dn.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},op=({open:e})=>{let{app:t}=k(),{gracefulClosePrivyModal:r}=s6(),[o,n]=(0,dn.useState)(!1);Hl({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let a=e||o;return t.render.standalone?(0,Ye.jsx)(Kd,{children:(0,Ye.jsx)(Zv,{id:"privy-modal-content",children:(0,Ye.jsx)(Yv,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):(0,Ye.jsx)(Kv,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:(0,Ye.jsx)(Kd,{children:(0,Ye.jsx)(a6,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},Zv=jd.default.div`
3068
3065
  display: flex;
3069
3066
  flex-direction: column;
3070
3067
  text-align: center;
@@ -3073,7 +3070,7 @@ You will have to sign up with another method first to register a passkey for you
3073
3070
  width: 100%;
3074
3071
  background: var(--privy-color-background);
3075
3072
  padding: 0 16px;
3076
- `,n6=(0,Kd.default)(Gv)`
3073
+ `,l6=(0,jd.default)(Zv)`
3077
3074
  transition: height 150ms ease-out;
3078
3075
  overflow: hidden;
3079
3076
 
@@ -3087,4 +3084,4 @@ You will have to sign up with another method first to register a passkey for you
3087
3084
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3088
3085
  border-radius: var(--privy-border-radius-lg);
3089
3086
  }
3090
- `;var Ws=require("react"),zv=require("react/jsx-runtime");function i6({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 qv(e){let t=(0,Ws.useRef)(null),r=(0,Ws.useRef)();return(0,Ws.useEffect)(()=>{r.current?.remove(),r.current=i6(e),t.current?.after(r.current)},[e]),(0,zv.jsx)("div",{ref:t,hidden:!0})}var $v=require("react"),Ra=require("react");var op=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 Bn(e,t,r,o,n,a=!1){let i=a,s=async u=>{if(i&&t&&t.length>0){u===(a?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new qe("missing_or_invalid_mfa","MFA verification failed, retry."));let h=await new Promise((m,v)=>{r.current={resolve:m,reject:v};let b=1e3*60*5;setTimeout(()=>{let g=new qe("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),v(g)},b)});return await e(h)}return await e()},l=4,c=null;for(let u=0;u<l;u++)try{c=await s(u),o.current?.resolve(void 0);break}catch(h){if(h.type==="missing_or_invalid_mfa")i=!0;else throw o.current?.resolve(void 0),h}if(c===null){let u=new qe("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}var jv=require("react/jsx-runtime"),a6=function(e){return()=>`id-${e++}`}(0);function s6(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Ht(e){return e.error!==void 0}var xt=new op,jd=new Map,l6=(e,t)=>typeof t=="bigint"?t.toString():t,c6=(e,t)=>`${e}${JSON.stringify(t,l6)}`;function Vt(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let a=c6(e,t);if(e==="privy:wallet:create"){let s=jd.get(a);if(s)return s}let i=new Promise((s,l)=>{let c=a6();xt.enqueue(c,{resolve:s,reject:l}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{jd.delete(a)});return jd.set(a,i),i}function p6(e){switch(e.event){case"privy:iframe:ready":let t=xt.dequeue(e.event,e.id);return Ht(e)?t.reject(new qe(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=xt.dequeue(e.event,e.id);return Ht(e)?r.reject(new qe(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=xt.dequeue(e.event,e.id);return Ht(e)?o.reject(new qe(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=xt.dequeue(e.event,e.id);return Ht(e)?n.reject(new qe(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let a=xt.dequeue(e.event,e.id);return Ht(e)?a.reject(new qe(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:rpc":let i=xt.dequeue(e.event,e.id);return Ht(e)?i.reject(new qe(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery":let s=xt.dequeue(e.event,e.id);return Ht(e)?s.reject(new qe(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let l=xt.dequeue(e.event,e.id);return Ht(e)?l.reject(new qe(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let m=xt.dequeue(e.event,e.id);return Ht(e)?m.reject(new qe(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:mfa:submit-enrollment":{let m=xt.dequeue(e.event,e.id);return Ht(e)?m.reject(new qe(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:mfa:unenroll":{let m=xt.dequeue(e.event,e.id);return Ht(e)?m.reject(new qe(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:mfa:clear":{let m=xt.dequeue(e.event,e.id);return Ht(e)?m.reject(new qe(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:farcaster:init-signer":{let m=xt.dequeue(e.event,e.id);return Ht(e)?m.reject(new qe(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:farcaster:sign":{let m=xt.dequeue(e.event,e.id);return Ht(e)?m.reject(new qe(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:solana-wallet:create":let c=xt.dequeue(e.event,e.id);return Ht(e)?c.reject(new qe(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let u=xt.dequeue(e.event,e.id);return Ht(e)?u.reject(new qe(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:recover":let h=xt.dequeue(e.event,e.id);return Ht(e)?h.reject(new qe(e.error.type,e.error.message)):h.resolve(e.data);case"privy:solana-wallet:rpc":{let m=xt.dequeue(e.event,e.id);return Ht(e)?m.reject(new qe(e.error.type,e.error.message)):m.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function Kv(e){let t=(0,Ra.useRef)(null),r=(0,Ra.useRef)(e.mfaMethods),o=$i(),[n,a]=(0,$v.useState)(!1);return(0,Ra.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,Ra.useEffect)(()=>{if(!n)return;let i=t.current;if(!i)return;function s(m){m&&m.origin===e.origin&&s6(m.data)&&p6(m.data)}let l={create(m){return Vt("privy:wallet:create",m,i,e.origin)},import(m){return Vt("privy:wallet:import",m,i,e.origin)},connect(m){return Vt("privy:wallet:connect",m,i,e.origin)},recover(m){return Bn(v=>Vt("privy:wallet:recover",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!m.recoveryMethod||m.recoveryMethod==="privy")},rpc(m){return Bn(v=>Vt("privy:wallet:rpc",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(m){return Vt("privy:solana-wallet:create",m,i,e.origin)},connectSolana(m){return Vt("privy:solana-wallet:connect",m,i,e.origin)},recoverSolana(m){return Vt("privy:solana-wallet:recover",m,i,e.origin)},rpcSolana(m){return Vt("privy:solana-wallet:rpc",m,i,e.origin)},setRecovery(m){return Bn(v=>Vt("privy:wallet:set-recovery",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(m){return Bn(v=>Vt("privy:mfa:verify",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(m){return Bn(v=>Vt("privy:mfa:init-enrollment",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(m){return Bn(v=>Vt("privy:mfa:submit-enrollment",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(m){return Bn(v=>Vt("privy:mfa:unenroll",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(m){return Vt("privy:mfa:clear",m,i,e.origin)},initFarcasterSigner(m){return Vt("privy:farcaster:init-signer",m,i,e.origin)},signFarcasterMessage(m){return Vt("privy:farcaster:sign",m,i,e.origin)}};window.addEventListener("message",s);let c=()=>e.onLoad(l),u=(...m)=>{console.warn("Privy iframe failed to load: ",...m),e.onLoadFailed()},h=new AbortController;return Oa(()=>Vt("privy:iframe:ready",{},i,e.origin),{abortSignal:h.signal}).then(c,u),()=>{window.removeEventListener("message",s),h.abort()}},[n]),(0,jv.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>a(!0),src:tl(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var np=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t,r){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return(await this.walletProxy.rpcSolana({accessToken:r,publicKey:this.address,request:t})).response.data}async request(t){console.debug("EmbeddedSolanaProvider.request() called with args",t);let r=await Pe();if(!r)throw new Error("User must be authenticated to use embedded Solana wallet");if(!await Yv())throw new w("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t,r);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};async function ip({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(a=>a.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 Zv({api:e,appId:t}){let r=Yn(),o=xi(),n=await ki(r);try{let{url:a}=await e.post(Ks,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:a,stateCode:o,codeVerifier:r}}catch(a){throw me(a)}}async function Qv({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(js,{authorization_code:n,state_code:r,code_verifier:o,provider:`privy:${t}`})).oauth_tokens?.access_token}catch(a){let i=me(a);throw i.privyErrorCode?new w(i.message||"Invalid code during cross-app auth flow.",void 0,i.privyErrorCode):i.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")}}async function Jv({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let i=setTimeout(()=>{n(new w("Authorization request timed out after 2 minutes.")),s()},12e4);function s(){t?.close(),window.removeEventListener("message",u)}let l,c=setInterval(()=>{t?.closed&&!l&&(s(),clearInterval(c),clearTimeout(i),n(new w("User rejected request")))},300);function u(h){h.data&&(h.data.type==="PRIVY_OAUTH_RESPONSE"&&h.data.stateCode&&h.data.authorizationCode&&(clearTimeout(i),o(h.data),s()),h.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(i),n(new w(h.data.error)),s()),h.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(l=new BroadcastChannel("popup-privy-oauth"),l.onmessage=u))}window.addEventListener("message",u)})}var ap=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:a})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let i=e?.linkedAccounts.find(m=>!!(m.type==="cross_app"&&m.embeddedWallets.find(v=>v.address===t)));if(!e||!i)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 s=r.getProviderAccessToken(i.providerApp.id),l=await ip({api:r.api,requesterAppId:n,providerAppId:i.providerApp.id});if(!s){if(l.readOnly)throw console.error("cannot transact against a read-only provider app"),new w("Cannot transact against a read-only provider app");await a({appId:i.providerApp.id})&&(s=r.getProviderAccessToken(i.providerApp.id))}if(!s)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,Yd({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 u=new URL(`${l.apiUrl}/oauth/transact`);return u.searchParams.set("token",s||""),u.searchParams.set("request",d6(o)),c.location=u.href,new Promise((m,v)=>{let g=setTimeout(()=>{E(),v(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),P=setInterval(()=>{c.closed&&(E(),v(new w("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),A=S=>{S.data&&(S.data.token?.action==="set"&&S.data.token?.value!==void 0?r.storeProviderAccessToken(i.providerApp.id,S.data.token.value):S.data.token?.action==="clear"&&r.storeProviderAccessToken(i.providerApp.id,null),S.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&S.data.result&&(E(),m(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&&(E(),v(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",A);let E=()=>{c.close(),clearInterval(P),clearTimeout(g),window.removeEventListener("message",A)}})},d6=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Yd=({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,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,i=n/window.screen.availWidth,s=a/window.screen.availHeight,l=(n-e)/2/i+r,c=(a-t)/2/s+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${l},top=${c}`};var u6="https://cdn.apple-cloudkit.com";async function Zd({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,a)=>{function i(){t?.close(),window.removeEventListener("message",s)}function s(l){l.data&&(l.data.type==="PRIVY_OAUTH_RESPONSE"&&l.data.stateCode&&l.data.authorizationCode&&(n(l.data),i()),l.origin===u6&&l.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:l.data.ckSession}),i()),l.data.type==="PRIVY_OAUTH_ERROR"&&(a(l.data.error),i()))}window.addEventListener("message",s)})}var Xv=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});var rr=require("react/jsx-runtime"),Vo;function m6(e){return typeof e=="string"&&e.length===25}function Pe(){if(!Vo){let e=re.get(qn);return Promise.resolve(e||null)}return Vo.getAccessToken()}var r3,xm=(e,t,r)=>r3(e,t,r),o3,km=(e,t)=>o3(e,t),n3,Rm=(e,t)=>n3(e,t),i3,Im=()=>i3(),a3,Yv=()=>a3(),f6=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;re.put(Da,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},s3=({config:e,...t})=>{if(!m6(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");Vo||(Vo=new qi({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,rr.jsx)(Ef,{client:Vo,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,rr.jsx)(h6,{...t,client:Vo})})},h6=e=>{let t=e.client,[r,o]=(0,pe.useState)(!1),[n,a]=(0,pe.useState)(!1),[i,s]=(0,pe.useState)(!1),[l,c]=(0,pe.useState)(null),[u,h]=(0,pe.useState)([]),[m,v]=(0,pe.useState)(null),b=(0,pe.useRef)(u),[g,P]=(0,pe.useState)(!1),[A,E]=(0,pe.useState)(null),[S,W]=(0,pe.useState)(!1),[D,M]=(0,pe.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:T}),[I,H]=(0,pe.useState)({status:"initial"}),[$,J]=(0,pe.useState)(null),[O,K]=(0,pe.useState)(null),N=Wt(),nt=Rl(),[ht,Xe]=(0,pe.useState)(!0),[we,ne]=(0,pe.useState)({}),[Ne,He]=(0,pe.useState)(null),[Yt,Fr]=(0,pe.useState)(null),[pr,kt]=(0,pe.useState)(!1),[ve,Eo]=(0,pe.useState)(!1),it=(0,pe.useRef)(null),un=(0,pe.useRef)(null),L=(0,pe.useRef)(Bf),[Gt,To]=(0,pe.useState)(!1);t.onStoreToken=p=>{p&&U(L,"accessToken","onAccessTokenGranted",p)},t.onDeleteToken=()=>{c(null),s(!1),U(L,"accessToken","onAccessTokenRemoved")};let ie=(0,pe.useRef)(null),z=(0,pe.useRef)(null),be=p=>{E(p),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:p}})},dr=p=>{N.embeddedWallets.createOnLogin!=="off"&&Xe(!0),be(p)};(0,pe.useEffect)(()=>{let p=ti(l);if(!p||!O)return;let d={address:p.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Li,id:"io.privy.solana.wallet"},getProvider:async()=>new np(O,p.address)};v(d)},[O,l]),(0,pe.useEffect)(()=>{if(!l){t.connectors?.removeEmbeddedWalletConnector();return}let p=Oe(l),d=El(l);if(p||t.connectors?.removeEmbeddedWalletConnector(),d||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!O){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}p&&t.connectors.addEmbeddedWalletConnector(O,p.address,N.defaultChain,e.appId),d&&t.connectors.addImportedWalletConnector(O,d.address,N.defaultChain,e.appId)},[O,l]),(0,pe.useEffect)(()=>{O&&Yt?.(O)},[O]),(0,pe.useEffect)(()=>{(async()=>{if(!N.customAuth?.enabled)return;Xe(!0);let{getCustomAccessToken:d,isLoading:f}=N.customAuth;if(!(!n||f))try{let C=await d();if(!C&&i){await Ti.logout();return}if(!C||i)return;t.startAuthFlow(new Pi(C));let{user:x,isNewUser:B}=await t.authenticate();if(!x){await Ti.logout();return}c(x||null),P(B||!1),s(!0),Eo(!0)}catch(C){console.warn(C),i&&await Ti.logout()}})()},[N.customAuth?.enabled,N.customAuth?.getCustomAccessToken,N.customAuth?.isLoading,n,i]),(0,pe.useEffect)(()=>{ve&&O&&l&&hr(l,N.embeddedWallets.createOnLogin)&&(Eo(!1),Ei(l,Ai).catch(console.error))},[ve&&O&&l]),(0,pe.useEffect)(()=>{async function p(){let d=Hn(),f=wi();f6();let C=(0,e3.createStore)();t.initializeConnectorManager({walletConnectCloudProjectId:N.walletConnectCloudProjectId,rpcConfig:N.rpcConfig,chains:N.chains,defaultChain:N.defaultChain,store:C,walletList:N.appearance.walletList,shouldEnforceDefaultChainOnConnect:N.shouldEnforceDefaultChainOnConnect,externalWalletConfig:N.externalWallets,appName:N.name??"Privy"});let x;t.connectors?.on("connectorInitialized",()=>{x&&clearTimeout(x);let De=t.connectors.walletConnectors.length,ue=t.connectors.walletConnectors.reduce((pt,Me)=>pt+(Me.initialized?1:0),0);ue===De?To(!0):x=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:ue,expected:De}),To(!0)},1500)}),t.connectors?.initialize().then(()=>{Os()});let B=await t.getAuthenticatedUser(),q=!!B;if(N.customAuth?.enabled||(s(!!B),B&&U(L,"login","onComplete",B,!1,!0,null,null),c(B)),d){z.current=q?"link":"login";return}if(f&&!q){z.current="login",dr("TELEGRAM_AUTH_SCREEN");return}de.setReadyToTrue(!!B)}!n&&nt&&p()},[t,Ne,n,nt]),(0,pe.useEffect)(()=>{if(!n)return;if(!l){kt(!0);return}if(!!!l.linkedAccounts.find(f=>f.type==="wallet"&&f.walletClientType==="privy")){kt(!0);return}let d=!!u.find(f=>f.walletClientType==="privy");kt(d)},[n,l,u]);let Hn=()=>{let p=qa();if(p.inProgress&&p.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(p.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:p.stateCode,authorizationCode:p.authorizationCode});return}let d="privy:";function f(C){return C.startsWith(d)}return p.inProgress&&f(p.provider)&&!p.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:p.stateCode,authorizationCode:p.authorizationCode}),window.close()),!p.inProgress||p.headless?!1:(t.startAuthFlow(new So(p)),dr("AWAITING_OAUTH_SCREEN"),!0)},wi=()=>{let p=Pm();if(!p||!N.loginMethods.telegram||!N.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let d=new Ii;return t.startAuthFlow(d),p.flowType==="login-url"&&(d.meta.telegramWebAppData=void 0,d.meta.telegramAuthResult={id:p.id,first_name:p.first_name,last_name:p.last_name,auth_date:p.auth_date,username:p.username,photo_url:p.photo_url,hash:p.hash}),p.flowType==="web-app"&&(d.meta.telegramAuthResult=void 0,d.meta.telegramWebAppData={query_id:p.query_id,user:p.user,auth_date:p.auth_date,hash:p.hash}),!0},Br=async(p,d,f,C)=>{let x=await t.connectors?.createWalletConnector(p,d)||null;Wa(x,d,f,C)};async function Wa(p,d,f,C){if(p)M({status:"disconnected",connectedWallet:null,connectError:null,connector:p,connectRetry:T});else return M({status:"disconnected",connectedWallet:null,connectError:new he("Unable to connect to wallet."),connector:null,connectRetry:T}),C?.(null,f);p instanceof ao&&d&&await p.resetConnection(d),M({connector:p,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Wa(p,d,f,C)});try{let x=await p.connect({showPrompt:!0});if(N.shouldEnforceDefaultChainOnConnect&&!N.chains.find(B=>B.id===Number(x?.chainId.replace("eip155:","")))&&!(x?.connectorType==="wallet_connect_v2"&&x?.walletClientType==="metamask")){M(B=>({...B,connector:p,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:T}));try{await x?.switchChain(N.defaultChain.id),x&&(x.chainId=_i(Gn(N.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${N.defaultChain.id}`)}}return M(B=>({...B,status:"connected",connectedWallet:x,connectError:null,connectRetry:T})),x&&U(L,"connectWallet","onSuccess",x),C?.(x,f)}catch(x){return x instanceof yt?(console.warn(x.cause?x.cause:x.message),U(L,"connectWallet","onError",x.privyErrorCode||"generic_connect_wallet_error")):(console.warn(x),U(L,"connectWallet","onError","unknown_connect_wallet_error")),M(B=>({...B,status:"disconnected",connectedWallet:null,connectError:x})),C?.(null,f)}}let Go=async(p,d)=>{if(p===null)return;let f=new Xn(p,t,d);t.startAuthFlow(f)},Os=()=>{let p=new URLSearchParams(window.location.search),d=p.get("privy_connector"),f=p.get("privy_wallet_client");if(!d||!f)return;if(f==="phantom"&&!fn()&&dr("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");be("AWAITING_CONNECTION");let C=new URL(window.location.href);C.searchParams.delete("privy_connector"),C.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",C),Br(d,f,void 0,Go)};(0,pe.useEffect)(()=>{n&&i&&l===null&&t.getAuthenticatedUser().then(c)},[n,i,l,t]);let ct=()=>{if(!i)throw U(L,"linkAccount","onError","must_be_authenticated"),new w("User must be authenticated before linking an account.")},Ls=()=>{ct(),ie.current="siwe",z.current="link",be("LINK_WALLET_SCREEN")},Ma=p=>{if(!i||!l)return!1;if(p.walletClientType==="privy")return!0;for(let d of l.linkedAccounts)if(d.type==="wallet"&&d.address===p.address&&d.walletClientType!=="privy")return!0;return!1},Vn=async p=>{if(!t.connectors)throw new w("Connector not initialized");let d=t.connectors.findWalletConnector(p.connectorType,p.walletClientType)||null;if(M(f=>({...f,connector:d,status:"connected",connectedWallet:p,connectError:null,connectRetry:T})),N.captchaEnabled&&!i){let f={callback:C=>Go(p,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};ne({captchaModalData:f}),dr("CAPTCHA_SCREEN")}else await Go(p),dr("AWAITING_CONNECTION")},at=async(p,d)=>{if(!N.fiatOnRamp.enabled)throw new w("Fiat on-ramp is not enabled");if(!d||!d.provider||d.provider==="moonpay"){let{signedUrl:f,externalTransactionId:C}=await Ag(t,p,d?.config??{},N.appearance.palette,N.fiatOnRamp.useSandbox);return{signedUrl:f,externalTransactionId:C}}else throw new w("Unsupported fund provider. Currently supported option is `moonpay`.")},st=()=>{h(p=>{let d=t.connectors?.wallets.map(f=>({...f,linked:Ma(f),loginOrLink:async()=>{if(!await f.isConnected())throw new w("Wallet is not connected");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");Vn(f)},fund:async C=>{let{signedUrl:x,externalTransactionId:B}=await at(f.address,C);ne({fiatOnRampPrompt:{signedUrl:x},fiatOnRampStatus:{externalTransactionId:B}}),be("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!i)throw new w("User is not authenticated.");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let C=await t.unlinkWallet(f.address);c(C)}}))||[];return Tl(p,d)?p:d})};(0,pe.useEffect)(()=>{st()},[l?.linkedAccounts,i,n]),(0,pe.useEffect)(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");st(),t.connectors.on("walletsUpdated",st)}},[n]);let bi=p=>{if(p&&"suggestedAddress"in p&&p.suggestedAddress){let d=(0,Ho.getAddress)(p.suggestedAddress);J(d)}be(i?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,pe.useEffect)(()=>{if(!u[0])return;let p=u[0],d=b.current.find(C=>C.address===p.address),f;if(p.walletClientType==="privy"?f=l?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===p.address&&C.walletClientType==="privy"):f=l?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===p.address&&C.walletClientType!=="privy"),!d&&f){let C=Object.assign({},l);C.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType,imported:f.imported},c(C)}b.current=u},[u]);let Ei=async(p,d)=>{if(Oe(p))throw U(L,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[C,x]=await Promise.all([de.initializeWalletProxy(d),Pe()]);if(!C&&N.customAuth?.enabled)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!C||!x||N.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((B,q)=>{Xe(!0),ne({createWallet:{onSuccess:ue=>{U(L,"createWallet","onSuccess",ue),B(ue)},onFailure:ue=>{U(L,"createWallet","onError","unknown_embedded_wallet_error"),q(ue)},callAuthOnSuccessOnClose:!1}}),be("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await C.create({accessToken:x});let B=await de.refreshUser(),q=Oe(B);if(!q)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return U(L,"createWallet","onSuccess",q),q}},Ns=p=>{if(!N.chains.map(d=>d.id).includes(p))throw new he(`Chain ID ${p} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Po=(p,d,f)=>new Promise(async(C,x)=>{let{requesterAppId:B}=d||{};if(!i||!l){U(L,"sendTransaction","onError","must_be_authenticated"),x(new Error("User must be authenticated before signing with a Privy wallet"));return}let q=p.from,De=q?l?.linkedAccounts.find(dt=>dt.type==="wallet"&&dt.walletClientType==="privy"&&(0,Ho.getAddress)(dt.address)===(0,Ho.getAddress)(q)):Oe(l);if(!De){U(L,"sendTransaction","onError","embedded_wallet_not_found"),x(new Error("Must have a Privy wallet before signing"));return}Xe(!0);let ue=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,pt=p.chainId?Number(p.chainId):ue.chainId;Ns(pt);let Me=Object.assign({},p,{chainId:pt}),mr=async()=>{let dt=await Pe();if(!dt||!O){U(L,"sendTransaction","onError","embedded_wallet_not_found"),x(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await de.recoverEmbeddedEthereumWallet()){U(L,"sendTransaction","onError","unknown_connect_wallet_error"),x(new Error("Unable to connect to wallet"));return}let ro=zo(Me.chainId,N.chains,N.rpcConfig,{appId:e.appId}),lp=await(0,Ia.populateTransactionRequest)(De.address,Me,ro);if(N.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:z3}=await(0,Ia.calculateTotalGasEstimate)(lp,ro),{hasSufficientFunds:$3}=await Yc(De.address,lp,z3,ro);if(!$3)throw new It(new _r("Wallet has insufficient funds for this transaction.",Ia.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let ru=await jc(dt,De.address,O,lp,ro,B);U(L,"sendTransaction","onSuccess",ru),C(ru)}catch(Fs){U(L,"sendTransaction","onError","transaction_failure"),x(Fs)}};if(N.embeddedWallets.noPromptOnSignature)d&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),mr();else{let dt={transactionRequest:Me,onSuccess:ro=>{U(L,"sendTransaction","onSuccess",ro),C(ro)},onFailure:ro=>{U(L,"sendTransaction","onError","transaction_failure"),x(ro)},uiOptions:d||{},fundWalletConfig:f,requesterAppId:B},Fs={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:ro=>{U(L,"sendTransaction","onError","unknown_connect_wallet_error"),x(ro)}};ne({connectWallet:Fs,sendTransaction:dt}),be("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Ds(){return new Promise(async(p,d)=>{let f=await Pe();if(!f||!O)throw new Error("Must have valid access token to enroll in MFA");try{await O.verifyMfa({accessToken:f}),p()}catch(C){d(C)}})}let eu=p=>p?.linkedAccounts.filter(d=>d.latestVerifiedAt!==null&&!(d.type==="wallet"&&d.walletClientType==="privy")).sort((d,f)=>f.latestVerifiedAt.getTime()-d.latestVerifiedAt.getTime())[0],ur=p=>{if(p==="passkey"){if(l&&l.linkedAccounts.filter(d=>d.type==="passkey").length>=5)throw U(L,"linkAccount","onError","cannot_link_more_of_type"),new w(`User already has an account of type ${p} linked.`)}else if(l?.[p])throw U(L,"linkAccount","onError","cannot_link_more_of_type"),new w(`User already has an account of type ${p} linked.`)},G3=()=>{if(!N.loginConfig.telegramAuthConfiguration?.linkEnabled)throw U(L,"linkAccount","onError","cannot_link_more_of_type"),new w("User can't link an account because Telegram linking is disabled.")};async function tu({legacySetWalletPasswordFlow:p=!1}){E(null);let d=p?"setWalletPassword":"setWalletRecovery";if(!i||!l)throw U(L,d,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let f=Oe(l);if(!f||!O)throw U(L,d,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(ti(l))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Ds()}catch(x){throw U(L,d,"onError","missing_or_invalid_mfa"),x}return new Promise((x,B)=>{Xe(!0);let q={onSuccess:Me=>{U(L,d,"onSuccess","user-passcode",Me),x(Me)},onFailure:Me=>{U(L,d,"onError","user_exited_set_password_flow"),B(Me)},callAuthOnSuccessOnClose:!1},De=f.recoveryMethod==="user-passcode",pt={onCompleteNavigateTo:nc({walletAction:"update",availableRecoveryMethods:N.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:De}),shouldForceMFA:!1,onFailure:Me=>{U(L,d,"onError","unknown_connect_wallet_error"),B(Me)}};ne({setWalletPassword:q,createWallet:q,connectWallet:pt,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:De}}),be("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Us({appId:p}){ct(),ie.current=`privy:${p}`,z.current="link";let d=window.open(void 0,void 0,Yd({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{appId:p}}),new Promise(async(f,C)=>{let{name:x,logoUrl:B}=await ip({api:t.api,providerAppId:p,requesterAppId:N.id});ne({crossAppAuth:{appId:p,name:x,logoUrl:B,popup:d,onSuccess:f,onError:C}}),dr("CROSS_APP_AUTH_SCREEN")})}let Ti={ready:n,authenticated:i,user:l,walletConnectors:t.connectors||null,connectWallet:bi,importWallet:async({privateKey:p})=>{ct();let[d,f]=await Promise.all([de.initializeWalletProxy(15e3),Pe()]);if(d&&f){await d.import({privateKey:p,accessToken:f});let C=await de.refreshUser(),x=El(C);if(!x)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return U(L,"createWallet","onSuccess",x),x}else throw new w("User is not authenticated")},linkWallet:Ls,linkCrossAppAccount:Us,linkEmail:()=>{ct(),ur("email"),ie.current="email",z.current="link",be("LINK_EMAIL_SCREEN")},linkPhone:()=>{ct(),ur("phone"),ie.current="sms",z.current="link",be("LINK_PHONE_SCREEN")},linkGoogle:async()=>{ct(),ur("google"),z.current="link",await de.initLoginWithOAuth("google")},linkTwitter:async()=>{ct(),ur("twitter"),z.current="link",await de.initLoginWithOAuth("twitter")},linkDiscord:async()=>{ct(),ur("discord"),z.current="link",await de.initLoginWithOAuth("discord")},linkGithub:async()=>{ct(),ur("github"),z.current="link",await de.initLoginWithOAuth("github")},linkSpotify:async()=>{ct(),ur("spotify"),z.current="link",await de.initLoginWithOAuth("spotify")},linkInstagram:async()=>{ct(),ur("instagram"),z.current="link",await de.initLoginWithOAuth("instagram")},linkTiktok:async()=>{ct(),ur("tiktok"),z.current="link",await de.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{ct(),ur("linkedin"),z.current="link",await de.initLoginWithOAuth("linkedin")},linkApple:async()=>{ct(),ur("apple"),z.current="link",await de.initLoginWithOAuth("apple")},linkPasskey:async()=>{ct(),ur("passkey"),await de.initLinkWithPasskey(),be("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{ct(),ur("telegram"),G3(),z.current="link",ie.current="telegram",await de.initLoginWithTelegram(),be("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{ct(),ur("farcaster"),await de.initLoginWithFarcaster(),z.current="link",ie.current="farcaster",be("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(ct(),!l?.email)throw new w("User does not have an email linked to their account.");z.current="link",ie.current="email",be("UPDATE_EMAIL_SCREEN")},login:async()=>{let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let d=await new Promise(f=>{He(C=>f.bind(C))});if(He(null),d){console.warn(p);return}}if(i){console.warn(p);return}z.current="login",dr("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(p=>{He(()=>p)}),He(null)),i){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(u[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}dr("CONNECT_OR_CREATE")},logout:async()=>{if(l&&t.clearProviderAcccessTokens(l),E(null),await t.logout(),l&&O)try{await O.clearMfa({userId:l.id})}catch{}c(null),s(!1),U(L,"logout","onSuccess"),z.current=null,ie.current=null,o(!1),re.del(Ua)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!l||!l.wallet)return new ot;let p=u.find(f=>l.wallet&&f.address===l.wallet.address),d=t.connectors?.walletConnectors.find(f=>f.wallets.find(C=>C.address===p?.address));return!p||!d?new ot:d.proxyProvider},getEthersProvider:()=>{if(!l||!l.wallet)return new sp.Web3Provider(new no(new ot));let p=u.find(f=>l.wallet&&f.address===l.wallet.address),d=t.connectors?.walletConnectors.find(f=>f.wallets.find(C=>C.address===p?.address));return!p||!d?new sp.Web3Provider(new no(new ot)):new sp.Web3Provider(new no(d.proxyProvider))},getWeb3jsProvider:()=>{if(!l||!l.wallet)return new vn(new ot);let p=u.find(f=>l.wallet&&f.address===l.wallet.address),d=t.connectors?.walletConnectors.find(f=>f.wallets.find(C=>C.address===p?.address));return!p||!d?new vn(new ot):new vn(d.proxyProvider)},unlinkWallet:async p=>{let d=await t.unlinkWallet(p);return c(d),d},unlinkEmail:async p=>{let d=await t.unlinkEmail(p);return c(d),d},unlinkPhone:async p=>{let d=await t.unlinkPhone(p);return c(d),d},unlinkGoogle:async p=>{let d=await t.unlinkOAuth("google",p);return c(d),d},unlinkTwitter:async p=>{let d=await t.unlinkOAuth("twitter",p);return c(d),d},unlinkDiscord:async p=>{let d=await t.unlinkOAuth("discord",p);return c(d),d},unlinkGithub:async p=>{let d=await t.unlinkOAuth("github",p);return c(d),d},unlinkSpotify:async p=>{let d=await t.unlinkOAuth("spotify",p);return c(d),d},unlinkInstagram:async p=>{let d=await t.unlinkOAuth("instagram",p);return c(d),d},unlinkTiktok:async p=>{let d=await t.unlinkOAuth("tiktok",p);return c(d),d},unlinkLinkedIn:async p=>{let d=await t.unlinkOAuth("linkedin",p);return c(d),d},unlinkApple:async p=>{let d=await t.unlinkOAuth("apple",p);return c(d),d},unlinkFarcaster:async p=>{let d=await t.unlinkFarcaster(p);return c(d),d},unlinkTelegram:async p=>{let d=await t.unlinkTelegram(p);return c(d),d},unlinkPasskey:async p=>{let d=await t.unlinkPasskey(p);return c(d),d},unlinkCrossAppAccount:async({subject:p})=>{let d=l?.linkedAccounts.find(C=>C.type==="cross_app"&&C.subject===p)?.providerApp;if(!d)throw new w("Invalid subject");t.storeProviderAccessToken(d.id,null);let f=await t.unlinkOAuth(`privy:${d.id}`,p);return c(f),f},setActiveWallet:async p=>{let d=u.find(C=>(0,Ho.getAddress)(C.address)===(0,Ho.getAddress)(p)),f=l?.linkedAccounts.find(C=>C.type==="wallet"&&(0,Ho.getAddress)(C.address)===(0,Ho.getAddress)(p));if(!d||!await d.isConnected())J(p),Ls();else if(!d.linked)d.loginOrLink();else{let C=Object.assign({},l);C.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType,imported:f.imported},c(C)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!i||!l)throw U(L,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ei(l,15e3)},setWalletRecovery:async()=>tu({legacySetWalletPasswordFlow:!1}),setWalletPassword:async()=>tu({legacySetWalletPasswordFlow:!0}),signMessage:(p,d,f)=>new Promise(async(C,x)=>{let{requesterAppId:B}=d||{};if(!i||!l){U(L,"signMessage","onError","must_be_authenticated"),x(new Error("User must be authenticated before signing with a Privy wallet"));return}let q=f?l?.linkedAccounts.find(ue=>ue.type==="wallet"&&ue.walletClientType==="privy"&&(0,Ho.getAddress)(ue.address)===(0,Ho.getAddress)(f)):Oe(l);if(!q){U(L,"signMessage","onError","embedded_wallet_not_found"),x(new Error("Must have a Privy wallet before signing"));return}if(typeof p!="string"||p.length<1){U(L,"signMessage","onError","invalid_message"),x(new Error("Message must be a non-empty string"));return}Xe(!0);let De=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let ue=await Pe();if(!O||!ue)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:q.address,requesterAppId:B}});let{response:Me}=await O.rpc({accessToken:ue,address:q.address,requesterAppId:B,request:{method:"personal_sign",params:[p,q.address]}}),mr=Me.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:q.address,requesterAppId:B}}),mr};if(N.embeddedWallets.noPromptOnSignature){d&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ue=await De();U(L,"signMessage","onSuccess",ue),C(ue)}catch(ue){U(L,"signMessage","onError","unable_to_sign"),x(ue??new It("Unable to sign message"))}}else{let Me={method:"personal_sign",data:p,confirmAndSign:De,onSuccess:dt=>{U(L,"signMessage","onSuccess",dt),C(dt)},onFailure:dt=>{U(L,"signMessage","onError","unable_to_sign"),x(dt)},uiOptions:d||{}},mr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:dt=>{U(L,"signMessage","onError","unknown_connect_wallet_error"),x(dt)},address:q.address};ne({signMessage:Me,connectWallet:mr}),be("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(p,d)=>new Promise(async(f,C)=>{let{requesterAppId:x}=d||{};if(!i||!l){U(L,"signTypedData","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let B=Oe(l);if(!B){U(L,"signTypedData","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}Xe(!0);let q=La(p),De=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let ue=await Pe();if(!O||!ue)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:B.address,requesterAppId:x}});let{response:Me}=await O.rpc({accessToken:ue,address:B.address,requesterAppId:x,request:{method:"eth_signTypedData_v4",params:[B.address,q]}}),mr=Me.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:B.address,requesterAppId:x}}),mr};if(N.embeddedWallets.noPromptOnSignature||(N.legacyWalletUiConfig??!1)){d&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ue=await De();U(L,"signTypedData","onSuccess",ue),f(ue)}catch(ue){U(L,"signTypedData","onError","unable_to_sign"),C(ue??new It("Unable to sign message"))}}else{let Me={method:"eth_signTypedData_v4",data:q,confirmAndSign:De,onSuccess:dt=>{U(L,"signTypedData","onSuccess",dt),f(dt)},onFailure:dt=>{U(L,"signTypedData","onError","unable_to_sign"),C(dt)},uiOptions:d||{}},mr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:dt=>{U(L,"signMessage","onError","unknown_connect_wallet_error"),C(dt)}};ne({signMessage:Me,connectWallet:mr}),be("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(p,d,f)=>{let x=await(await Po(p,d,f)).wait();return Zc(x)},exportWallet:()=>new Promise(async(p,d)=>{if(!i||!l){d(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!Oe(l)){d(new Error("Must have a Privy wallet before exporting"));return}Xe(!0);let C={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:d,shouldForceMFA:!0};if(ne(we),!await Pe()||!O){d(new Error("Must have valid access token to enroll in MFA"));return}if(!O){d(new Error("Must have a Privy wallet before exporting"));return}let B={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,onSuccess:p,onFailure:d};ne({keyExport:B,connectWallet:C}),be("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Ds,async init(p){switch(p){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${p}`)}},async submit(p,d){switch(p){case"totp":case"sms":if(typeof d!="string")throw new w("Invalid MFA code");it.current?.resolve({mfaMethod:p,mfaCode:d,relyingParty:window.origin}),await new Promise((B,q)=>{un.current={resolve:B,reject:q}});break;case"passkey":if(typeof d=="string")throw new w("Invalid authenticator response");let C=await(await import("@simplewebauthn/browser")).startAuthentication(d),x=Xv(C);it.current?.resolve({mfaMethod:p,mfaCode:x,relyingParty:window.origin}),await new Promise((B,q)=>{un.current={resolve:B,reject:q}});break;default:throw it.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${p}`)}},cancel(){it.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(p){let d=await Pe();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");await O.initEnrollMfa({method:"sms",accessToken:d,phoneNumber:p.phoneNumber})},enrollInMfa(p){return new Promise((d,f)=>{if(!p){de.closePrivyModal(),d();return}N.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:N.mfa.methods,onSuccess:d,onFailure:f}}),be("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let p=await Pe();if(!p||!O)throw new Error("Must have valid access token to enroll in MFA");let d=await O.initEnrollMfa({method:"totp",accessToken:p});return{secret:d.secret,authUrl:d.authUrl}},async submitEnrollmentWithSms(p){let d=await Pe();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"sms",accessToken:d,phoneNumber:p.phoneNumber,code:p.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async submitEnrollmentWithTotp(p){let d=await Pe();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"totp",accessToken:d,code:p.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:p}){let d=await Pe();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"passkey",accessToken:d,credentialIds:p});let f=await t.getAuthenticatedUser();c(f)},async unenroll(p){let d=await Pe();if(!d||!O)throw new Error("Must have valid access token to remove MFA");p==="passkey"?await O.submitEnrollMfa({method:"passkey",accessToken:d,credentialIds:[]}):await O.unenrollMfa({method:p,accessToken:d});let f=await t.getAuthenticatedUser();c(f)},requestFarcasterSignerFromWarpcast:async()=>{let p=await Pe(),d=l?.linkedAccounts.find(x=>x.type==="wallet"&&x.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!d)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let C=await O.initFarcasterSigner({address:d.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(C.status==="approved"){let x=await t.getAuthenticatedUser();c(x||l||null)}ne({farcasterSigner:C}),be("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let p=await Pe(),d=l?.linkedAccounts.find(x=>x.type==="wallet"&&x.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!d)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!l.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(x=>Uint8Array.from(x.match(/.{1,2}/g).map(B=>parseInt(B,16))))(l.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async p=>{let d=await Pe(),f=l?.linkedAccounts.find(q=>q.type==="wallet"&&q.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!f)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!l.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let x=await import("@simplewebauthn/browser"),B=await O.signFarcasterMessage({address:f.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,payload:{hash:x.bufferToBase64URLString(p)},fid:BigInt(l.farcaster.fid),relyingParty:window.origin});return new Uint8Array(x.base64URLStringToBuffer(B.signature))},isHeadlessOAuthLoading:S,loginWithCode(p){return de.loginWithCode(p)},initLoginWithEmail(p){return de.initLoginWithEmail(p)},initLoginWithSms(p){return de.initLoginWithSms(p)},otpState:I,fundWallet(p,d){return de.fundWallet(p,d)},initLoginWithHeadlessOAuth(p,d){return de.initLoginWithHeadlessOAuth(p,d)},loginWithHeadlessOAuth(p){return de.loginWithHeadlessOAuth(p)},generateSiweMessage({address:p,chainId:d}){return de.generateSiweMessage({address:p,chainId:d})},linkWithSiwe({message:p,signature:d,chainId:f,walletClientType:C,connectorType:x}){return ct(),de.linkWithSiwe({message:p,signature:d,chainId:f,walletClientType:C,connectorType:x})},signMessageWithCrossAppWallet(p,{address:d}){return ap({user:l,client:t,address:d,requesterAppId:N.id,request:{method:"personal_sign",params:[p,d]},reconnect:Us})},signTypedDataWithCrossAppWallet(p,{address:d}){let f=La(p);return ap({user:l,client:t,address:d,requesterAppId:N.id,request:{method:"eth_signTypedData_v4",params:[d,f]},reconnect:Us})},sendTransactionWithCrossAppWallet(p,{address:d}){return ap({user:l,client:t,address:d,requesterAppId:N.id,request:{method:"eth_sendTransaction",params:[p]},reconnect:Us})},isModalOpen:r,mfaMethods:N.mfa.methods};r3=Ti.signMessage,o3=Ti.signTypedData,n3=async(...p)=>{let d=await Po(...p);return N.embeddedWallets.waitForTransactionConfirmation&&await d.wait(),d};let de=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:$,pendingTransaction:null,walletConnectionStatus:D,connectors:t.connectors?.walletConnectors??[],rpcConfig:N.rpcConfig,chains:N.chains,appId:e.appId,showFiatPrices:N.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:p=>N.chains.find(d=>d.id===Number(p))?.nativeCurrency.symbol,initializeWalletProxy:async p=>{if(O)return O;let d=new Promise(x=>{Fr(()=>B=>x(B))}),f=new Promise(x=>setTimeout(()=>x(null),p)),C=await Promise.race([d,f]);return Fr(null),C},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(p={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let d=n&&i&&l,f;d&&ie.current&&(f=eu(l)),z.current==="login"?p.shouldCallAuthOnSuccess&&d&&ie.current?(U(L,"login","onComplete",l,g,!1,ie.current,f??null),e.onSuccess?.(l,g)):U(L,"login","onError","exited_auth_flow"):z.current==="link"&&f&&(p.isSuccess&&d&&ie.current?U(L,"linkAccount","onSuccess",l,ie.current,f):U(L,"linkAccount","onError","exited_link_flow")),J(null),z.current=null,ie.current=null,P(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:be,connectWallet:Wa,initLoginWithWallet:async(p,d)=>{ie.current="siwe",Go(p,d)},loginWithWallet:async()=>{if(!n)throw new qo;if(!(t.authFlow instanceof Xn))throw new w("Must initialize SIWE flow first.");let p,d;if(i)try{({user:p}=await t.link()),ie.current="siwe"}catch(f){throw U(L,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:p,isNewUser:d}=await t.authenticate()),ie.current="siwe"}catch(f){throw U(L,"login","onError",f.privyErrorCode||"generic_connect_wallet_error"),f}c(p||l||null),P(d||!1),s(!0)},initLoginWithFarcaster:async p=>{let d=new Na(p);t.startAuthFlow(d);try{ie.current="farcaster",await d.initializeFarcasterConnect()}catch(f){throw z.current==="login"?U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",f.privyErrorCode||"unknown_auth_error"),f}},loginWithFarcaster:async()=>{if(!n)throw new qo;if(!(t.authFlow instanceof Na))throw new w("Must initialize Farcaster flow first.");let p,d;if(i)try{({user:p}=await t.link()),ie.current="farcaster"}catch(f){throw U(L,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:p,isNewUser:d}=await t.authenticate()),ie.current="farcaster"}catch(f){throw U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}c(p||null),P(d||!1),s(!0)},async crossAppAuthFlow({appId:p,popup:d}){let f=`privy:${p}`;ie.current=f;let{url:C,stateCode:x,codeVerifier:B}=await Zv({api:t.api,appId:p});if(!C)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:p}}),new w("No authorization URL returned for cross-app auth.");try{let q=await Jv({url:C,popup:d,provider:f}),De=q.stateCode,ue=q.authorizationCode;if(De!==x)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:f,storedStateCode:x??"",returnedStateCode:De??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let pt=await Qv({api:Vo.api,appId:p,codeVerifier:B,stateCode:De,authorizationCode:ue});pt&&t.storeProviderAccessToken(p,pt);let Me=await de.refreshUser();if(!Me)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{appId:p}}),Me}catch(q){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:q.toString(),provider:f}}),q}},async initLoginWithOAuth(p,d){if(ie.current=p,up()){if(p==="google"&&Qi(window.navigator.userAgent)){dr("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{dr("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}p==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),re.del(Kn);let f=new So({provider:p});d&&f.addCaptchaToken(d),t.startAuthFlow(f);let C=await t.authFlow.getAuthorizationUrl();C&&C.url&&(p==="twitter"&&t3.isAndroid&&(C.url=C.url.replace("x.com","twitter.com")),window.location.assign(C.url))},async initLoginWithTelegram(p){if(!n)throw new qo;ie.current="telegram";let d=new Ii(p);t.startAuthFlow(d),d.meta.telegramWebAppData=void 0,d.meta.telegramAuthResult=await new Promise((f,C)=>{if(!N.loginConfig.telegramAuthConfiguration)return C(new w("Telegram Auth configuration is not loaded"));if(!window.Telegram)return C(new w("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:N.loginConfig.telegramAuthConfiguration.botId,request_access:!0},x=>x?f(x):C(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Ii))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let p,d;if(i)try{({user:p}=await t.link()),ie.current="telegram"}catch(f){throw U(L,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{let f=await t.authenticate();p=f.user,d=f.isNewUser,ie.current="telegram"}catch(f){throw z.current==="login"?U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}c(p),P(d||!1),s(!0)},async recoveryOAuthFlow(p,d,f){let C,x;function B(q){if(!q)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:p}}),new w("Recovery OAuth failed")}switch(p){case"google-drive":{let{url:q,codeVerifier:De,stateCode:ue}=await id({api:Vo.api,provider:p});B(q);let pt,Me;try{let mr=await Zd({url:q,popup:f,provider:p});if(pt=mr.stateCode,Me=mr.authorizationCode,pt!==ue)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:p,storedStateCode:ue??"",returnedStateCode:pt??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(mr){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:mr.toString(),provider:p}}),new w("Recovery OAuth failed")}[C,x]=await Promise.all([Pe(),Qh({api:Vo.api,provider:p,codeVerifier:De,stateCode:pt,authorizationCode:Me})]);break}case"icloud":{let{url:q}=await id({api:Vo.api,provider:p});B(q);let{ckWebAuthToken:De}=await Zd({url:q,popup:f,provider:p});x=De,C=await Pe();break}}if(!O)throw new w("Cannot connect to wallet proxy");if(!C)throw new w("Unable to authorize user");switch(d){case"recover":let q=we.recoverWallet?.privyWallet?.address;if(!q)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:q,recoveryMethod:p}}),await O.recover({address:q,accessToken:C,recoveryAccessToken:x,recoveryMethod:p}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:q,recoveryMethod:p}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await O.create({accessToken:C,recoveryAccessToken:x,recoveryMethod:p});let De=await de.refreshUser(),ue=Oe(De);if(!ue)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:ue.address}}),U(L,"createWallet","onSuccess",ue);break;case"set-recovery":let pt=Oe(l);if(!pt)throw U(L,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{recoveryMethod:p}}),await O.setRecovery({address:pt.address,accessToken:C,recoveryAccessToken:x,recoveryMethod:p});let Me=Oe(await de.refreshUser());if(!Me)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:pt.address,recoveryMethod:p}}),U(L,"setWalletRecovery","onSuccess",p,Me);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(p){if(!(t.authFlow instanceof So))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let d=re.get(zn),f=t.authFlow.meta.stateCode;if(d!==f)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:p,storedStateCode:d??"",returnedStateCode:f??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,x,B;if(i)try{let q=await t.link();C=q.user,B=q.oAuthTokens,ie.current=p}catch(q){throw U(L,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account"),q}else try{let q=await t.authenticate();C=q.user,x=q.isNewUser,B=q.oAuthTokens,ie.current=p}catch(q){throw z.current==="login"?U(L,"login","onError",q.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account"),q}return c(C),P(x||!1),s(!0),B&&U(L,"oAuthAuthorization","onOAuthTokenGrant",B),B},async initLoginWithPasskey(p){let d=new Jn(p);t.startAuthFlow(d),z.current="login";try{ie.current="passkey",await d.initAuthenticationFlow()}catch(f){throw U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}},async loginWithPasskey(){if(!n)throw new qo;if(!(t.authFlow instanceof Jn))throw new w("Must initialize Passkey flow first.");if(ie.current!=="passkey")throw new w("Must init login with Passkey flow first.");let p,d;try{ie.current="passkey",{user:p,isNewUser:d}=await t.authenticate()}catch(f){throw U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}c(p),P(d||!1),s(!0)},async initLinkWithPasskey(p){let d=new Jn(p);t.startAuthFlow(d),z.current="link",ie.current="passkey";try{await d.initLinkFlow()}catch(f){throw U(L,"linkAccount","onError",f.privyErrorCode||"unknown_auth_error"),f}},async linkWithPasskey(){if(!n)throw new qo;if(!(t.authFlow instanceof Jn))throw new w("Must initialize Passkey flow first.");if(ie.current!=="passkey")throw new w("Must init login with Passkey flow first.");let p;try{ie.current="passkey",{user:p}=await t.link()}catch(d){throw U(L,"linkAccount","onError",d.privyErrorCode||"failed_to_link_account"),d}return c(p||l||null),p},async initLoginWithHeadlessOAuth(p,d){if(up()){if(p==="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 f=new So({provider:p,headless:!0});d&&f.addCaptchaToken(d);let C=await t.startAuthFlow(f).getAuthorizationUrl();C?.url&&window.location.assign(C.url)},async loginWithHeadlessOAuth(p){W(!0),t.startAuthFlow(new So(p));let d=re.get(zn),f=p.stateCode;if(d!==f)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:p.provider,storedStateCode:d??"",returnedStateCode:f??""}}),W(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,x;if(i)try{({user:C}=await t.link()),ie.current=p.provider}catch(B){throw U(L,"linkAccount","onError",B.privyErrorCode||"failed_to_link_account"),B}else try{({user:C,isNewUser:x}=await t.authenticate()),ie.current=p.provider}catch(B){throw z.current==="login"?U(L,"login","onError",B.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",B.privyErrorCode||"failed_to_link_account"),B}return c(C),P(x||!1),s(!0),W(!1),C??void 0},initLoginWithEmail:async(p,d)=>{let f=new mn(p,d);t.startAuthFlow(f);try{ie.current="email",await f.sendCodeEmail()}catch(C){throw z.current==="login"?U(L,"login","onError",C.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account"),C}},initUpdateEmail:async(p,d,f)=>{let C=new Zs(p,d,f);t.startAuthFlow(C),await C.sendCodeEmail()},initLoginWithSms:async(p,d)=>{H({status:"sending-code"});let f=new ei(p,d);t.startAuthFlow(f);try{ie.current="sms",await f.sendSmsCode(),H({status:"awaiting-code-input"})}catch(C){throw H({status:"error",error:C}),z.current==="login"?U(L,"login","onError",C.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account"),C}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async p=>{if(H({status:"submitting-code"}),!n){let C=new qo;throw H({status:"error",error:C}),C}if(t.authFlow instanceof mn)t.authFlow.meta.emailCode=p.trim();else if(t.authFlow instanceof ei)t.authFlow.meta.smsCode=p.trim();else{let C=new w("Must initialize a passwordless code flow first");throw H({status:"error",error:C}),C}await Pe();let d,f;if(z.current==="link")try{({user:d}=await t.link())}catch(C){throw H({status:"error",error:C}),U(L,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account"),C}else try{({user:d,isNewUser:f}=await t.authenticate())}catch(C){throw H({status:"error",error:C}),U(L,"login","onError",C.privyErrorCode||"unknown_auth_error"),C}c(d||l||null),P(f||!1),s(!0),H({status:"done"})},generateSiweMessage:async({address:p,chainId:d,captchaToken:f})=>{z.current="link",ie.current="siwe";let C=await t.generateSiweNonce({address:p,captchaToken:f}),x=d.replace("eip155:","");return bl({address:p,chainId:x,nonce:C})},linkWithSiwe:async({message:p,signature:d,chainId:f,walletClientType:C,connectorType:x})=>{let B;try{if(z.current!=="link"||ie.current!=="siwe")throw new w("Must ensure no other auth flow is in progress other than the SIWE signature flow.");B=await t.linkWithSiwe({message:p,signature:d,chainId:f,walletClientType:C,connectorType:x});let q=eu(B);q&&U(L,"linkAccount","onSuccess",B,"siwe",q)}catch(q){throw U(L,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account"),z.current=null,ie.current=null,q}c(B||l||null),z.current=null,ie.current=null},refreshUser:async()=>{let p=await t.getAuthenticatedUser();return c(p),p},walletProxy:O,createAnalyticsEvent:({eventName:p,payload:d,timestamp:f})=>t.createAnalyticsEvent({eventName:p,payload:d,timestamp:f}),acceptTerms:async()=>{let p=await t.acceptTerms();return c(p),p},getUsdTokenPrice:p=>t.getUsdTokenPrice(p),recoverEmbeddedEthereumWallet:async()=>new Promise(async(p,d)=>{let f=Oe(l)||El(l),C=await Pe();if(!C||!O||!f){d(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Xe(!0);try{await O.connect({accessToken:C,address:f.address}),p(!0)}catch(x){if(ci(x)&&f.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:f.address}}),(await O.recover({address:f.address,accessToken:C,recoveryMethod:f.recoveryMethod})).address||d(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:f.address}}),p(!0);else if(ci(x)&&f.recoveryMethod!=="privy"){ne({recoverWallet:{privyWallet:f,onFailure:d,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:f.recoveryMethod,action:"recover"}});let B=ic(f.recoveryMethod);be(B)}else d(x)}}),embeddedSolanaWallet:m,createEmbeddedSolanaWallet:async()=>{Xe(!0);let p=await Pe(),d=ti(l),f=Oe(l);if(!l||!p)throw new w("User must be logged in to create a Solana wallet");if(d)throw new w("User already has an embedded Solana wallet.");if(f)if(f.recoveryMethod==="privy")await de.recoverEmbeddedEthereumWallet();else throw new w("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let C=await de.initializeWalletProxy(15e3);if(!C)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await C.createSolana({accessToken:p,ethereumAddress:f?.address});let x=await de.refreshUser(),B=ti(x);if(!B)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:B.address}}),B}catch(x){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",x)}},recoverEmbeddedSolanaWallet:async()=>new Promise(async(p,d)=>{let f=ti(l),C=await Pe();if(!C||!O||!f){d(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Xe(!0);try{await O.connectSolana({accessToken:C,publicKey:f.address}),p(!0)}catch(x){ci(x)&&f.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:f.address}}),(await O.recoverSolana({publicKey:f.address,accessToken:C})).publicKey||d(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:f.address}}),p(!0)):d(x)}}),getFiatOnRampConfig:at,setReadyToTrue:p=>{a(!0),Ne?.(p)},updateWallets:()=>st(),fundWallet:async(p,d)=>{let{signedUrl:f,externalTransactionId:C}=await at(p,d);ne({fiatOnRampPrompt:{signedUrl:f},fiatOnRampStatus:{externalTransactionId:C}}),be("FIAT_ON_RAMP_PROMPT_SCREEN")},requestFarcasterSignerStatus:async p=>{let d=await Pe(),f=l?.linkedAccounts.find(x=>x.type==="wallet"&&x.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!f)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let C=await t.requestFarcasterSignerStatus(p);if(C.status==="approved"){let x=await t.getAuthenticatedUser();c(x||l||null)}return C}}))();i3=de.recoverEmbeddedEthereumWallet,a3=de.recoverEmbeddedSolanaWallet;let q3=(0,pe.useMemo)(()=>({wallets:u,ready:pr&&Gt}),[u,pr,Gt]);return(0,rr.jsx)(xe.Provider,{value:Ti,children:(0,rr.jsx)(Fp.Provider,{value:L,children:(0,rr.jsx)(Dd.Provider,{value:q3,children:(0,rr.jsx)(Nf,{...N,children:(0,rr.jsxs)(Up.Provider,{value:de,children:[(0,rr.jsxs)(Sf,{data:we,setModalData:ne,setInitialScreen:E,initialScreen:A,authenticated:i,open:r,children:[e.children,!N.headless&&N.captchaEnabled&&n&&!i&&(0,rr.jsx)(Nl,{delayedExecution:!1}),(0,rr.jsx)(Fv,{theme:{...N.appearance.palette||{}}}),!N.render.standalone&&(0,rr.jsx)(rp,{open:r})]}),ht&&nt?(0,rr.jsx)(Kv,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:l?.mfaMethods,mfaPromise:it,mfaSubmitPromise:un,onLoad:K,onLoadFailed:()=>null}):null,N.loginMethods.telegram&&N.loginConfig.telegramAuthConfiguration&&(0,rr.jsx)(mo,{if:!0,children:(0,rr.jsx)(qv,{scriptHost:e.apiUrl||al,botUsername:N.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};var l3=require("react");function c3(e){let{login:t}=(0,l3.useContext)(xe);return Ze("login",e),{login:t}}var p3=require("react");function d3(e){let{logout:t}=(0,p3.useContext)(xe);return Ze("logout",e),{logout:t}}var Ms=require("react");function u3(){let e=Se(),t=Rl(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:a,user:i}=G(),s=(0,Ms.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new xr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),l=(0,Ms.useCallback)(async()=>{let c=qa();if(i)return console.warn("Cannot login with OAuth when already logged in"),i;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(u){throw u}finally{Qn()}},[o]);return(0,Ms.useEffect)(()=>{let c=qa();a&&t&&c.inProgress&&c.headless&&!c.popupFlow&&l()},[a,t]),{initOAuth:s,loginWithOAuth:l,loading:n}}var Qd=require("react");var m3=()=>{let e=Se(),{initLoginWithEmail:t,loginWithCode:r}=G(),o=(0,Qd.useCallback)(async({email:a})=>{if(!a)throw new Error("Email required to send OTP code");return t(a)},[t]),n=(0,Qd.useCallback)(async({code:a})=>{if(e.enabled&&e.status==="error")throw new xr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var Jd=require("react");var f3=()=>{let e=Se(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=G(),n=(0,Jd.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return t(i)},[t]),a=(0,Jd.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new xr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:n,loginWithCode:a,state:o}};var Xd=require("react");var h3=()=>{let e=Se(),{generateSiweMessage:t,linkWithSiwe:r}=G(),o=(0,Xd.useCallback)(async({address:a,chainId:i})=>{if(!a||!i)throw new Error("wallet address and chainId required to generate nonce");return t({address:a,chainId:i}).then(s=>s)},[t]),n=(0,Xd.useCallback)(async({signature:a,message:i,chainId:s,walletClientType:l,connectorType:c})=>{if(e.enabled&&e.status!=="success")throw new xr(e.error,null,"captcha_failure");return r({message:i,signature:a,chainId:s,walletClientType:l,connectorType:c})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};var y3=require("react");function g3(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:s,linkGithub:l,linkLinkedIn:c,linkTiktok:u,linkSpotify:h,linkInstagram:m,linkTelegram:v,linkFarcaster:b}=(0,y3.useContext)(xe);return Ze("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:s,linkGithub:l,linkLinkedIn:c,linkTiktok:u,linkSpotify:h,linkInstagram:m,linkFarcaster:b,linkTelegram:v}}var v3=require("react");function C3(e){let{connectWallet:t}=(0,v3.useContext)(xe);return Ze("connectWallet",e),{connectWallet:t}}var w3=require("react");function b3(e){let{createWallet:t}=(0,w3.useContext)(xe);return Ze("createWallet",e),{createWallet:t}}var E3=()=>{let{fundWallet:e}=G();return{fundWallet:e}};var T3=()=>{let{embeddedSolanaWallet:e,createEmbeddedSolanaWallet:t}=R();return{createWallet:t,wallets:e?[e]:[]}};var P3=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=G();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};var S3=require("react");function _3(e){let{sendTransaction:t}=(0,S3.useContext)(xe);return Ze("sendTransaction",e),{sendTransaction:t}}var A3=require("react");function x3(e){let{setWalletPassword:t}=(0,A3.useContext)(xe);return Ze("setWalletPassword",e),{setWalletPassword:t}}var k3=require("react");function R3(e){let{setWalletRecovery:t}=(0,k3.useContext)(xe);return Ze("setWalletRecovery",e),{setWalletRecovery:t}}var I3=require("react");function W3(e){let{signMessage:t}=(0,I3.useContext)(xe);return Ze("signMessage",e),{signMessage:t}}var M3=require("react");function O3(e){let{signTypedData:t}=(0,M3.useContext)(xe);return Ze("signTypedData",e),{signTypedData:t}}var L3=require("react");var N3=()=>{let{isModalOpen:e}=(0,L3.useContext)(xe);return{isOpen:e}};var D3=require("react");function U3(e){let{getAccessToken:t}=(0,D3.useContext)(xe);return Ze("accessToken",e),{getAccessToken:t}}function F3(e){let{authenticated:t,user:r}=G(),{initLoginWithOAuth:o}=R(),n=$i();return Ze("oAuthAuthorization",e),{reauthorize:a=>y6(t,r,o,n,a.provider)}}var y6=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated"),new w("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(i=>i.type.includes(n)))throw new w(`OAuth account of type ${n} not linked to the account.`);await r(n)};function B3(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=G();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function H3(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function V3(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,LoginModal,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,getEmbeddedConnectedWallet,useConnectWallet,useCreateWallet,useCrossAppAccounts,useExperimentalFarcasterSigner,useFundWallet,useLinkAccount,useLinkWithSiwe,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,useOAuthTokens,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSetWalletRecovery,useSignMessage,useSignTypedData,useSolanaWallets,useToken,useWallets});
3087
+ `;var Ms=require("react"),Jv=require("react/jsx-runtime");function c6({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 Qv(e){let t=(0,Ms.useRef)(null),r=(0,Ms.useRef)();return(0,Ms.useEffect)(()=>{r.current?.remove(),r.current=c6(e),t.current?.after(r.current)},[e]),(0,Jv.jsx)("div",{ref:t,hidden:!0})}var Xv=require("react"),Ia=require("react");var np=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 Bn(e,t,r,o,n,a=!1){let i=a,s=async u=>{if(i&&t&&t.length>0){u===(a?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Ge("missing_or_invalid_mfa","MFA verification failed, retry."));let h=await new Promise((m,v)=>{r.current={resolve:m,reject:v};let b=1e3*60*5;setTimeout(()=>{let g=new Ge("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),v(g)},b)});return await e(h)}return await e()},l=4,c=null;for(let u=0;u<l;u++)try{c=await s(u),o.current?.resolve(void 0);break}catch(h){if(h.type==="missing_or_invalid_mfa")i=!0;else throw o.current?.resolve(void 0),h}if(c===null){let u=new Ge("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}var t3=require("react/jsx-runtime"),p6=function(e){return()=>`id-${e++}`}(0);function d6(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Vt(e){return e.error!==void 0}var xt=new np,Yd=new Map,u6=(e,t)=>typeof t=="bigint"?t.toString():t,m6=(e,t)=>`${e}${JSON.stringify(t,u6)}`;function Gt(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let a=m6(e,t);if(e==="privy:wallet:create"){let s=Yd.get(a);if(s)return s}let i=new Promise((s,l)=>{let c=p6();xt.enqueue(c,{resolve:s,reject:l}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{Yd.delete(a)});return Yd.set(a,i),i}function f6(e){switch(e.event){case"privy:iframe:ready":let t=xt.dequeue(e.event,e.id);return Vt(e)?t.reject(new Ge(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=xt.dequeue(e.event,e.id);return Vt(e)?r.reject(new Ge(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=xt.dequeue(e.event,e.id);return Vt(e)?o.reject(new Ge(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=xt.dequeue(e.event,e.id);return Vt(e)?n.reject(new Ge(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let a=xt.dequeue(e.event,e.id);return Vt(e)?a.reject(new Ge(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:rpc":let i=xt.dequeue(e.event,e.id);return Vt(e)?i.reject(new Ge(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery":let s=xt.dequeue(e.event,e.id);return Vt(e)?s.reject(new Ge(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let l=xt.dequeue(e.event,e.id);return Vt(e)?l.reject(new Ge(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let m=xt.dequeue(e.event,e.id);return Vt(e)?m.reject(new Ge(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:mfa:submit-enrollment":{let m=xt.dequeue(e.event,e.id);return Vt(e)?m.reject(new Ge(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:mfa:unenroll":{let m=xt.dequeue(e.event,e.id);return Vt(e)?m.reject(new Ge(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:mfa:clear":{let m=xt.dequeue(e.event,e.id);return Vt(e)?m.reject(new Ge(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:farcaster:init-signer":{let m=xt.dequeue(e.event,e.id);return Vt(e)?m.reject(new Ge(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:farcaster:sign":{let m=xt.dequeue(e.event,e.id);return Vt(e)?m.reject(new Ge(e.error.type,e.error.message)):m.resolve(e.data)}case"privy:solana-wallet:create":let c=xt.dequeue(e.event,e.id);return Vt(e)?c.reject(new Ge(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let u=xt.dequeue(e.event,e.id);return Vt(e)?u.reject(new Ge(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:recover":let h=xt.dequeue(e.event,e.id);return Vt(e)?h.reject(new Ge(e.error.type,e.error.message)):h.resolve(e.data);case"privy:solana-wallet:rpc":{let m=xt.dequeue(e.event,e.id);return Vt(e)?m.reject(new Ge(e.error.type,e.error.message)):m.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function e3(e){let t=(0,Ia.useRef)(null),r=(0,Ia.useRef)(e.mfaMethods),o=Ki(),[n,a]=(0,Xv.useState)(!1);return(0,Ia.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,Ia.useEffect)(()=>{if(!n)return;let i=t.current;if(!i)return;function s(m){m&&m.origin===e.origin&&d6(m.data)&&f6(m.data)}let l={create(m){return Gt("privy:wallet:create",m,i,e.origin)},import(m){return Gt("privy:wallet:import",m,i,e.origin)},connect(m){return Gt("privy:wallet:connect",m,i,e.origin)},recover(m){return Bn(v=>Gt("privy:wallet:recover",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!m.recoveryMethod||m.recoveryMethod==="privy")},rpc(m){return Bn(v=>Gt("privy:wallet:rpc",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(m){return Gt("privy:solana-wallet:create",m,i,e.origin)},connectSolana(m){return Gt("privy:solana-wallet:connect",m,i,e.origin)},recoverSolana(m){return Gt("privy:solana-wallet:recover",m,i,e.origin)},rpcSolana(m){return Gt("privy:solana-wallet:rpc",m,i,e.origin)},setRecovery(m){return Bn(v=>Gt("privy:wallet:set-recovery",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(m){return Bn(v=>Gt("privy:mfa:verify",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(m){return Bn(v=>Gt("privy:mfa:init-enrollment",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(m){return Bn(v=>Gt("privy:mfa:submit-enrollment",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(m){return Bn(v=>Gt("privy:mfa:unenroll",{...m,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(m){return Gt("privy:mfa:clear",m,i,e.origin)},initFarcasterSigner(m){return Gt("privy:farcaster:init-signer",m,i,e.origin)},signFarcasterMessage(m){return Gt("privy:farcaster:sign",m,i,e.origin)}};window.addEventListener("message",s);let c=()=>e.onLoad(l),u=(...m)=>{console.warn("Privy iframe failed to load: ",...m),e.onLoadFailed()},h=new AbortController;return La(()=>Gt("privy:iframe:ready",{},i,e.origin),{abortSignal:h.signal}).then(c,u),()=>{window.removeEventListener("message",s),h.abort()}},[n]),(0,t3.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>a(!0),src:rl(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var ip=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t,r){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return(await this.walletProxy.rpcSolana({accessToken:r,publicKey:this.address,request:t})).response.data}async request(t){console.debug("EmbeddedSolanaProvider.request() called with args",t);let r=await Se();if(!r)throw new Error("User must be authenticated to use embedded Solana wallet");if(!await r3())throw new w("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t,r);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};async function ap({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(a=>a.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 o3({api:e,appId:t}){let r=Yn(),o=ki(),n=await Ri(r);try{let{url:a}=await e.post(js,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:a,stateCode:o,codeVerifier:r}}catch(a){throw me(a)}}async function n3({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(a){let i=me(a);throw i.privyErrorCode?new w(i.message||"Invalid code during cross-app auth flow.",void 0,i.privyErrorCode):i.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")}}async function i3({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let i=setTimeout(()=>{n(new w("Authorization request timed out after 2 minutes.")),s()},12e4);function s(){t?.close(),window.removeEventListener("message",u)}let l,c=setInterval(()=>{t?.closed&&!l&&(s(),clearInterval(c),clearTimeout(i),n(new w("User rejected request")))},300);function u(h){h.data&&(h.data.type==="PRIVY_OAUTH_RESPONSE"&&h.data.stateCode&&h.data.authorizationCode&&(clearTimeout(i),o(h.data),s()),h.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(i),n(new w(h.data.error)),s()),h.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(l=new BroadcastChannel("popup-privy-oauth"),l.onmessage=u))}window.addEventListener("message",u)})}var sp=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:a})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let i=e?.linkedAccounts.find(m=>!!(m.type==="cross_app"&&m.embeddedWallets.find(v=>v.address===t)));if(!e||!i)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 s=r.getProviderAccessToken(i.providerApp.id),l=await ap({api:r.api,requesterAppId:n,providerAppId:i.providerApp.id});if(!s){if(l.readOnly)throw console.error("cannot transact against a read-only provider app"),new w("Cannot transact against a read-only provider app");await a({appId:i.providerApp.id})&&(s=r.getProviderAccessToken(i.providerApp.id))}if(!s)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,Zd({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 u=new URL(`${l.apiUrl}/oauth/transact`);return u.searchParams.set("token",s||""),u.searchParams.set("request",h6(o)),c.location=u.href,new Promise((m,v)=>{let g=setTimeout(()=>{E(),v(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),S=setInterval(()=>{c.closed&&(E(),v(new w("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),A=P=>{P.data&&(P.data.token?.action==="set"&&P.data.token?.value!==void 0?r.storeProviderAccessToken(i.providerApp.id,P.data.token.value):P.data.token?.action==="clear"&&r.storeProviderAccessToken(i.providerApp.id,null),P.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&P.data.result&&(E(),m(P.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:o.method}})),P.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&P.data.error&&(E(),v(P.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:P.data.error,address:t}})))};window.addEventListener("message",A);let E=()=>{c.close(),clearInterval(S),clearTimeout(g),window.removeEventListener("message",A)}})},h6=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Zd=({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,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,i=n/window.screen.availWidth,s=a/window.screen.availHeight,l=(n-e)/2/i+r,c=(a-t)/2/s+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${l},top=${c}`};var y6="https://cdn.apple-cloudkit.com";async function Qd({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,a)=>{function i(){t?.close(),window.removeEventListener("message",s)}function s(l){l.data&&(l.data.type==="PRIVY_OAUTH_RESPONSE"&&l.data.stateCode&&l.data.authorizationCode&&(n(l.data),i()),l.origin===y6&&l.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:l.data.ckSession}),i()),l.data.type==="PRIVY_OAUTH_ERROR"&&(a(l.data.error),i()))}window.addEventListener("message",s)})}var a3=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});var or=require("react/jsx-runtime"),Vo;function g6(e){return typeof e=="string"&&e.length===25}function Se(){if(!Vo){let e=re.get(qn);return Promise.resolve(e||null)}return Vo.getAccessToken()}var c3,Rm=(e,t,r)=>c3(e,t,r),p3,Im=(e,t)=>p3(e,t),d3,Wm=(e,t)=>d3(e,t),u3,Mm=()=>u3(),m3,r3=()=>m3(),v6=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;re.put(Ua,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},f3=({config:e,...t})=>{if(!g6(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");Vo||(Vo=new zi({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,or.jsx)(Sf,{client:Vo,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,or.jsx)(C6,{...t,client:Vo})})},C6=e=>{let t=e.client,[r,o]=(0,pe.useState)(!1),[n,a]=(0,pe.useState)(!1),[i,s]=(0,pe.useState)(!1),[l,c]=(0,pe.useState)(null),[u,h]=(0,pe.useState)([]),[m,v]=(0,pe.useState)(null),b=(0,pe.useRef)(u),[g,S]=(0,pe.useState)(!1),[A,E]=(0,pe.useState)(null),[P,W]=(0,pe.useState)(!1),[D,M]=(0,pe.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:T}),[I,H]=(0,pe.useState)({status:"initial"}),[$,J]=(0,pe.useState)(null),[O,K]=(0,pe.useState)(null),N=Mt(),nt=Il(),[ht,Xe]=(0,pe.useState)(!0),[be,ne]=(0,pe.useState)({}),[Le,Be]=(0,pe.useState)(null),[Zt,Ur]=(0,pe.useState)(null),[dr,kt]=(0,pe.useState)(!1),[ve,bo]=(0,pe.useState)(!1),it=(0,pe.useRef)(null),un=(0,pe.useRef)(null),L=(0,pe.useRef)(Vf),[qt,Eo]=(0,pe.useState)(!1);t.onStoreToken=p=>{p&&U(L,"accessToken","onAccessTokenGranted",p)},t.onDeleteToken=()=>{c(null),s(!1),U(L,"accessToken","onAccessTokenRemoved")};let ie=(0,pe.useRef)(null),z=(0,pe.useRef)(null),Ce=p=>{E(p),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:p}})},Rt=p=>{N.embeddedWallets.createOnLogin!=="off"&&Xe(!0),Ce(p)};(0,pe.useEffect)(()=>{let p=ei(l);if(!p||!O)return;let d={address:p.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Ni,id:"io.privy.solana.wallet"},getProvider:async()=>new ip(O,p.address)};v(d)},[O,l]),(0,pe.useEffect)(()=>{if(!l){t.connectors?.removeEmbeddedWalletConnector();return}let p=Me(l),d=Tl(l);if(p||t.connectors?.removeEmbeddedWalletConnector(),d||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!O){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}p&&t.connectors.addEmbeddedWalletConnector(O,p.address,N.defaultChain,e.appId),d&&t.connectors.addImportedWalletConnector(O,d.address,N.defaultChain,e.appId)},[O,l]),(0,pe.useEffect)(()=>{O&&Zt?.(O)},[O]),(0,pe.useEffect)(()=>{(async()=>{if(!N.customAuth?.enabled)return;Xe(!0);let{getCustomAccessToken:d,isLoading:f}=N.customAuth;if(!(!n||f))try{let C=await d();if(!C&&i){await Si.logout();return}if(!C||i)return;t.startAuthFlow(new Pi(C));let{user:x,isNewUser:B}=await t.authenticate();if(!x){await Si.logout();return}c(x||null),S(B||!1),s(!0),bo(!0)}catch(C){console.warn(C),i&&await Si.logout()}})()},[N.customAuth?.enabled,N.customAuth?.getCustomAccessToken,N.customAuth?.isLoading,n,i]),(0,pe.useEffect)(()=>{ve&&O&&l&&hr(l,N.embeddedWallets.createOnLogin)&&(bo(!1),Ti(l,xi).catch(console.error))},[ve&&O&&l]),(0,pe.useEffect)(()=>{async function p(){let d=Hn(),f=bi();v6();let C=(0,s3.createStore)();t.initializeConnectorManager({walletConnectCloudProjectId:N.walletConnectCloudProjectId,rpcConfig:N.rpcConfig,chains:N.chains,defaultChain:N.defaultChain,store:C,walletList:N.appearance.walletList,shouldEnforceDefaultChainOnConnect:N.shouldEnforceDefaultChainOnConnect,externalWalletConfig:N.externalWallets,appName:N.name??"Privy"});let x;t.connectors?.on("connectorInitialized",()=>{x&&clearTimeout(x);let Ne=t.connectors.walletConnectors.length,ue=t.connectors.walletConnectors.reduce((pt,We)=>pt+(We.initialized?1:0),0);ue===Ne?Eo(!0):x=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:ue,expected:Ne}),Eo(!0)},1500)}),t.connectors?.initialize().then(()=>{Ls()});let B=await t.getAuthenticatedUser(),q=!!B;if(N.customAuth?.enabled||(s(!!B),B&&U(L,"login","onComplete",B,!1,!0,null,null),c(B)),d){z.current=q?"link":"login";return}if(f&&!q){z.current="login",Rt("TELEGRAM_AUTH_SCREEN");return}de.setReadyToTrue(!!B)}!n&&nt&&p()},[t,Le,n,nt]),(0,pe.useEffect)(()=>{if(!n)return;if(!l){kt(!0);return}if(!!!l.linkedAccounts.find(f=>f.type==="wallet"&&f.walletClientType==="privy")){kt(!0);return}let d=!!u.find(f=>f.walletClientType==="privy");kt(d)},[n,l,u]);let Hn=()=>{let p=za();if(p.inProgress&&p.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(p.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:p.stateCode,authorizationCode:p.authorizationCode});return}let d="privy:";function f(C){return C.startsWith(d)}return p.inProgress&&f(p.provider)&&!p.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:p.stateCode,authorizationCode:p.authorizationCode}),window.close()),!p.inProgress||p.headless?!1:(t.startAuthFlow(new So(p)),Rt("AWAITING_OAUTH_SCREEN"),!0)},bi=()=>{let p=_m();if(!p||!N.loginMethods.telegram||!N.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let d=new Wi;return t.startAuthFlow(d),p.flowType==="login-url"&&(d.meta.telegramWebAppData=void 0,d.meta.telegramAuthResult={id:p.id,first_name:p.first_name,last_name:p.last_name,auth_date:p.auth_date,username:p.username,photo_url:p.photo_url,hash:p.hash}),p.flowType==="web-app"&&(d.meta.telegramAuthResult=void 0,d.meta.telegramWebAppData={query_id:p.query_id,user:p.user,auth_date:p.auth_date,hash:p.hash}),!0},Fr=async(p,d,f,C)=>{let x=await t.connectors?.createWalletConnector(p,d)||null;Ma(x,d,f,C)};async function Ma(p,d,f,C){if(p)M({status:"disconnected",connectedWallet:null,connectError:null,connector:p,connectRetry:T});else return M({status:"disconnected",connectedWallet:null,connectError:new he("Unable to connect to wallet."),connector:null,connectRetry:T}),C?.(null,f);p instanceof io&&d&&await p.resetConnection(d),M({connector:p,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Ma(p,d,f,C)});try{let x=await p.connect({showPrompt:!0});if(N.shouldEnforceDefaultChainOnConnect&&!N.chains.find(B=>B.id===Number(x?.chainId.replace("eip155:","")))&&!(x?.connectorType==="wallet_connect_v2"&&x?.walletClientType==="metamask")){M(B=>({...B,connector:p,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:T}));try{await x?.switchChain(N.defaultChain.id),x&&(x.chainId=Ai(Gn(N.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${N.defaultChain.id}`)}}return M(B=>({...B,status:"connected",connectedWallet:x,connectError:null,connectRetry:T})),x&&U(L,"connectWallet","onSuccess",x),C?.(x,f)}catch(x){return x instanceof yt?(console.warn(x.cause?x.cause:x.message),U(L,"connectWallet","onError",x.privyErrorCode||"generic_connect_wallet_error")):(console.warn(x),U(L,"connectWallet","onError","unknown_connect_wallet_error")),M(B=>({...B,status:"disconnected",connectedWallet:null,connectError:x})),C?.(null,f)}}let Go=async(p,d)=>{if(p===null)return;let f=new Ko(p,t,d);t.startAuthFlow(f)},Ls=()=>{let p=new URLSearchParams(window.location.search),d=p.get("privy_connector"),f=p.get("privy_wallet_client");if(!d||!f)return;if(f==="phantom"&&!fn()&&Rt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");Ce("AWAITING_CONNECTION");let C=new URL(window.location.href);C.searchParams.delete("privy_connector"),C.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",C),Fr(d,f,void 0,Go)};(0,pe.useEffect)(()=>{n&&i&&l===null&&t.getAuthenticatedUser().then(c)},[n,i,l,t]);let ct=()=>{if(!i)throw U(L,"linkAccount","onError","must_be_authenticated"),new w("User must be authenticated before linking an account.")},Ns=()=>{ct(),ie.current="siwe",z.current="link",Ce("LINK_WALLET_SCREEN")},Oa=p=>{if(!i||!l)return!1;if(p.walletClientType==="privy")return!0;for(let d of l.linkedAccounts)if(d.type==="wallet"&&d.address===p.address&&d.walletClientType!=="privy")return!0;return!1},Vn=async p=>{if(!t.connectors)throw new w("Connector not initialized");let d=t.connectors.findWalletConnector(p.connectorType,p.walletClientType)||null;if(M(f=>({...f,connector:d,status:"connected",connectedWallet:p,connectError:null,connectRetry:T})),N.captchaEnabled&&!i){let f={callback:C=>Go(p,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};ne({captchaModalData:f}),Rt("CAPTCHA_SCREEN")}else await Go(p),Rt("AWAITING_CONNECTION")},at=async(p,d)=>{if(!N.fiatOnRamp.enabled)throw new w("Fiat on-ramp is not enabled");if(!d||!d.provider||d.provider==="moonpay"){let{signedUrl:f,externalTransactionId:C}=await kg(t,p,d?.config??{},N.appearance.palette,N.fiatOnRamp.useSandbox);return{signedUrl:f,externalTransactionId:C}}else throw new w("Unsupported fund provider. Currently supported option is `moonpay`.")},st=()=>{h(p=>{let d=t.connectors?.wallets.map(f=>({...f,linked:Oa(f),loginOrLink:async()=>{if(!await f.isConnected())throw new w("Wallet is not connected");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");Vn(f)},fund:async C=>{let{signedUrl:x,externalTransactionId:B}=await at(f.address,C);ne({fiatOnRampPrompt:{signedUrl:x},fiatOnRampStatus:{externalTransactionId:B}}),Ce("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!i)throw new w("User is not authenticated.");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let C=await t.unlinkWallet(f.address);c(C)}}))||[];return Sl(p,d)?p:d})};(0,pe.useEffect)(()=>{st()},[l?.linkedAccounts,i,n]),(0,pe.useEffect)(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");st(),t.connectors.on("walletsUpdated",st)}},[n]);let Ei=p=>{if(p&&"suggestedAddress"in p&&p.suggestedAddress){let d=(0,Ho.getAddress)(p.suggestedAddress);J(d)}Ce(i?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,pe.useEffect)(()=>{if(!u[0])return;let p=u[0],d=b.current.find(C=>C.address===p.address),f;if(p.walletClientType==="privy"?f=l?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===p.address&&C.walletClientType==="privy"):f=l?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===p.address&&C.walletClientType!=="privy"),!d&&f){let C=Object.assign({},l);C.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType,imported:f.imported},c(C)}b.current=u},[u]);let Ti=async(p,d)=>{if(Me(p))throw U(L,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[C,x]=await Promise.all([de.initializeWalletProxy(d),Se()]);if(!C&&N.customAuth?.enabled)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!C||!x||N.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((B,q)=>{Xe(!0),ne({createWallet:{onSuccess:ue=>{U(L,"createWallet","onSuccess",ue),B(ue)},onFailure:ue=>{U(L,"createWallet","onError","unknown_embedded_wallet_error"),q(ue)},callAuthOnSuccessOnClose:!1}}),Ce("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await C.create({accessToken:x});let B=await de.refreshUser(),q=Me(B);if(!q)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return U(L,"createWallet","onSuccess",q),q}},Ds=p=>{if(!N.chains.map(d=>d.id).includes(p))throw new he(`Chain ID ${p} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},To=(p,d,f)=>new Promise(async(C,x)=>{let{requesterAppId:B}=d||{};if(!i||!l){U(L,"sendTransaction","onError","must_be_authenticated"),x(new Error("User must be authenticated before signing with a Privy wallet"));return}let q=p.from,Ne=q?l?.linkedAccounts.find(dt=>dt.type==="wallet"&&dt.walletClientType==="privy"&&(0,Ho.getAddress)(dt.address)===(0,Ho.getAddress)(q)):Me(l);if(!Ne){U(L,"sendTransaction","onError","embedded_wallet_not_found"),x(new Error("Must have a Privy wallet before signing"));return}Xe(!0);let ue=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,pt=p.chainId?Number(p.chainId):ue.chainId;Ds(pt);let We=Object.assign({},p,{chainId:pt}),mr=async()=>{let dt=await Se();if(!dt||!O){U(L,"sendTransaction","onError","embedded_wallet_not_found"),x(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await de.recoverEmbeddedEthereumWallet()){U(L,"sendTransaction","onError","unknown_connect_wallet_error"),x(new Error("Unable to connect to wallet"));return}let to=zo(We.chainId,N.chains,N.rpcConfig,{appId:e.appId}),cp=await(0,Wa.populateTransactionRequest)(Ne.address,We,to);if(N.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:J3}=await(0,Wa.calculateTotalGasEstimate)(cp,to),{hasSufficientFunds:X3}=await Zc(Ne.address,cp,J3,to);if(!X3)throw new Wt(new _r("Wallet has insufficient funds for this transaction.",Wa.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let nu=await Yc(dt,Ne.address,O,cp,to,B);U(L,"sendTransaction","onSuccess",nu),C(nu)}catch(Bs){U(L,"sendTransaction","onError","transaction_failure"),x(Bs)}};if(N.embeddedWallets.noPromptOnSignature)d&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),mr();else{let dt={transactionRequest:We,onSuccess:to=>{U(L,"sendTransaction","onSuccess",to),C(to)},onFailure:to=>{U(L,"sendTransaction","onError","transaction_failure"),x(to)},uiOptions:d||{},fundWalletConfig:f,requesterAppId:B},Bs={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:to=>{U(L,"sendTransaction","onError","unknown_connect_wallet_error"),x(to)}};ne({connectWallet:Bs,sendTransaction:dt}),Ce("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Us(){return new Promise(async(p,d)=>{let f=await Se();if(!f||!O)throw new Error("Must have valid access token to enroll in MFA");try{await O.verifyMfa({accessToken:f}),p()}catch(C){d(C)}})}let ru=p=>p?.linkedAccounts.filter(d=>d.latestVerifiedAt!==null&&!(d.type==="wallet"&&d.walletClientType==="privy")).sort((d,f)=>f.latestVerifiedAt.getTime()-d.latestVerifiedAt.getTime())[0],ur=p=>{if(p==="passkey"){if(l&&l.linkedAccounts.filter(d=>d.type==="passkey").length>=5)throw U(L,"linkAccount","onError","cannot_link_more_of_type"),new w(`User already has an account of type ${p} linked.`)}else if(l?.[p])throw U(L,"linkAccount","onError","cannot_link_more_of_type"),new w(`User already has an account of type ${p} linked.`)},Z3=()=>{if(!N.loginConfig.telegramAuthConfiguration?.linkEnabled)throw U(L,"linkAccount","onError","cannot_link_more_of_type"),new w("User can't link an account because Telegram linking is disabled.")};async function ou({legacySetWalletPasswordFlow:p=!1}){E(null);let d=p?"setWalletPassword":"setWalletRecovery";if(!i||!l)throw U(L,d,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let f=Me(l);if(!f||!O)throw U(L,d,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(ei(l))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Us()}catch(x){throw U(L,d,"onError","missing_or_invalid_mfa"),x}return new Promise((x,B)=>{Xe(!0);let q={onSuccess:We=>{U(L,d,"onSuccess","user-passcode",We),x(We)},onFailure:We=>{U(L,d,"onError","user_exited_set_password_flow"),B(We)},callAuthOnSuccessOnClose:!1},Ne=f.recoveryMethod==="user-passcode",pt={onCompleteNavigateTo:ic({walletAction:"update",availableRecoveryMethods:N.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:Ne}),shouldForceMFA:!1,onFailure:We=>{U(L,d,"onError","unknown_connect_wallet_error"),B(We)}};ne({setWalletPassword:q,createWallet:q,connectWallet:pt,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Ne}}),Ce("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Fs({appId:p}){ct(),ie.current=`privy:${p}`,z.current="link";let d=window.open(void 0,void 0,Zd({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{appId:p}}),new Promise(async(f,C)=>{let{name:x,logoUrl:B}=await ap({api:t.api,providerAppId:p,requesterAppId:N.id});ne({crossAppAuth:{appId:p,name:x,logoUrl:B,popup:d,onSuccess:f,onError:C}}),Rt("CROSS_APP_AUTH_SCREEN")})}let Si={ready:n,authenticated:i,user:l,walletConnectors:t.connectors||null,connectWallet:Ei,importWallet:async({privateKey:p})=>{ct();let[d,f]=await Promise.all([de.initializeWalletProxy(15e3),Se()]);if(d&&f){await d.import({privateKey:p,accessToken:f});let C=await de.refreshUser(),x=Tl(C);if(!x)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return U(L,"createWallet","onSuccess",x),x}else throw new w("User is not authenticated")},linkWallet:Ns,linkCrossAppAccount:Fs,linkEmail:()=>{ct(),ur("email"),ie.current="email",z.current="link",Ce("LINK_EMAIL_SCREEN")},linkPhone:()=>{ct(),ur("phone"),ie.current="sms",z.current="link",Ce("LINK_PHONE_SCREEN")},linkGoogle:async()=>{ct(),ur("google"),z.current="link",await de.initLoginWithOAuth("google")},linkTwitter:async()=>{ct(),ur("twitter"),z.current="link",await de.initLoginWithOAuth("twitter")},linkDiscord:async()=>{ct(),ur("discord"),z.current="link",await de.initLoginWithOAuth("discord")},linkGithub:async()=>{ct(),ur("github"),z.current="link",await de.initLoginWithOAuth("github")},linkSpotify:async()=>{ct(),ur("spotify"),z.current="link",await de.initLoginWithOAuth("spotify")},linkInstagram:async()=>{ct(),ur("instagram"),z.current="link",await de.initLoginWithOAuth("instagram")},linkTiktok:async()=>{ct(),ur("tiktok"),z.current="link",await de.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{ct(),ur("linkedin"),z.current="link",await de.initLoginWithOAuth("linkedin")},linkApple:async()=>{ct(),ur("apple"),z.current="link",await de.initLoginWithOAuth("apple")},linkPasskey:async()=>{ct(),ur("passkey"),await de.initLinkWithPasskey(),Ce("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{ct(),ur("telegram"),Z3(),z.current="link",ie.current="telegram",await de.initLoginWithTelegram(),Ce("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{ct(),ur("farcaster"),await de.initLoginWithFarcaster(),z.current="link",ie.current="farcaster",Ce("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(ct(),!l?.email)throw new w("User does not have an email linked to their account.");z.current="link",ie.current="email",Ce("UPDATE_EMAIL_SCREEN")},login:async()=>{let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let d=await new Promise(f=>{Be(C=>f.bind(C))});if(Be(null),d){console.warn(p);return}}if(i){console.warn(p);return}z.current="login",Rt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(p=>{Be(()=>p)}),Be(null)),i){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(u[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}Rt("CONNECT_OR_CREATE")},logout:async()=>{if(l&&t.clearProviderAcccessTokens(l),E(null),await t.logout(),l&&O)try{await O.clearMfa({userId:l.id})}catch{}c(null),s(!1),U(L,"logout","onSuccess"),z.current=null,ie.current=null,o(!1),re.del(Fa)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!l||!l.wallet)return new ot;let p=u.find(f=>l.wallet&&f.address===l.wallet.address),d=t.connectors?.walletConnectors.find(f=>f.wallets.find(C=>C.address===p?.address));return!p||!d?new ot:d.proxyProvider},getEthersProvider:()=>{if(!l||!l.wallet)return new lp.Web3Provider(new oo(new ot));let p=u.find(f=>l.wallet&&f.address===l.wallet.address),d=t.connectors?.walletConnectors.find(f=>f.wallets.find(C=>C.address===p?.address));return!p||!d?new lp.Web3Provider(new oo(new ot)):new lp.Web3Provider(new oo(d.proxyProvider))},getWeb3jsProvider:()=>{if(!l||!l.wallet)return new vn(new ot);let p=u.find(f=>l.wallet&&f.address===l.wallet.address),d=t.connectors?.walletConnectors.find(f=>f.wallets.find(C=>C.address===p?.address));return!p||!d?new vn(new ot):new vn(d.proxyProvider)},unlinkWallet:async p=>{let d=await t.unlinkWallet(p);return c(d),d},unlinkEmail:async p=>{let d=await t.unlinkEmail(p);return c(d),d},unlinkPhone:async p=>{let d=await t.unlinkPhone(p);return c(d),d},unlinkGoogle:async p=>{let d=await t.unlinkOAuth("google",p);return c(d),d},unlinkTwitter:async p=>{let d=await t.unlinkOAuth("twitter",p);return c(d),d},unlinkDiscord:async p=>{let d=await t.unlinkOAuth("discord",p);return c(d),d},unlinkGithub:async p=>{let d=await t.unlinkOAuth("github",p);return c(d),d},unlinkSpotify:async p=>{let d=await t.unlinkOAuth("spotify",p);return c(d),d},unlinkInstagram:async p=>{let d=await t.unlinkOAuth("instagram",p);return c(d),d},unlinkTiktok:async p=>{let d=await t.unlinkOAuth("tiktok",p);return c(d),d},unlinkLinkedIn:async p=>{let d=await t.unlinkOAuth("linkedin",p);return c(d),d},unlinkApple:async p=>{let d=await t.unlinkOAuth("apple",p);return c(d),d},unlinkFarcaster:async p=>{let d=await t.unlinkFarcaster(p);return c(d),d},unlinkTelegram:async p=>{let d=await t.unlinkTelegram(p);return c(d),d},unlinkPasskey:async p=>{let d=await t.unlinkPasskey(p);return c(d),d},unlinkCrossAppAccount:async({subject:p})=>{let d=l?.linkedAccounts.find(C=>C.type==="cross_app"&&C.subject===p)?.providerApp;if(!d)throw new w("Invalid subject");t.storeProviderAccessToken(d.id,null);let f=await t.unlinkOAuth(`privy:${d.id}`,p);return c(f),f},setActiveWallet:async p=>{let d=u.find(C=>(0,Ho.getAddress)(C.address)===(0,Ho.getAddress)(p)),f=l?.linkedAccounts.find(C=>C.type==="wallet"&&(0,Ho.getAddress)(C.address)===(0,Ho.getAddress)(p));if(!d||!await d.isConnected())J(p),Ns();else if(!d.linked)d.loginOrLink();else{let C=Object.assign({},l);C.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType,imported:f.imported},c(C)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!i||!l)throw U(L,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ti(l,15e3)},setWalletRecovery:async()=>ou({legacySetWalletPasswordFlow:!1}),setWalletPassword:async()=>ou({legacySetWalletPasswordFlow:!0}),signMessage:(p,d,f)=>new Promise(async(C,x)=>{let{requesterAppId:B}=d||{};if(!i||!l){U(L,"signMessage","onError","must_be_authenticated"),x(new Error("User must be authenticated before signing with a Privy wallet"));return}let q=f?l?.linkedAccounts.find(ue=>ue.type==="wallet"&&ue.walletClientType==="privy"&&(0,Ho.getAddress)(ue.address)===(0,Ho.getAddress)(f)):Me(l);if(!q){U(L,"signMessage","onError","embedded_wallet_not_found"),x(new Error("Must have a Privy wallet before signing"));return}if(typeof p!="string"||p.length<1){U(L,"signMessage","onError","invalid_message"),x(new Error("Message must be a non-empty string"));return}Xe(!0);let Ne=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let ue=await Se();if(!O||!ue)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:q.address,requesterAppId:B}});let{response:We}=await O.rpc({accessToken:ue,address:q.address,requesterAppId:B,request:{method:"personal_sign",params:[p,q.address]}}),mr=We.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:q.address,requesterAppId:B}}),mr};if(N.embeddedWallets.noPromptOnSignature){d&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ue=await Ne();U(L,"signMessage","onSuccess",ue),C(ue)}catch(ue){U(L,"signMessage","onError","unable_to_sign"),x(ue??new Wt("Unable to sign message"))}}else{let We={method:"personal_sign",data:p,confirmAndSign:Ne,onSuccess:dt=>{U(L,"signMessage","onSuccess",dt),C(dt)},onFailure:dt=>{U(L,"signMessage","onError","unable_to_sign"),x(dt)},uiOptions:d||{}},mr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:dt=>{U(L,"signMessage","onError","unknown_connect_wallet_error"),x(dt)},address:q.address};ne({signMessage:We,connectWallet:mr}),Ce("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(p,d)=>new Promise(async(f,C)=>{let{requesterAppId:x}=d||{};if(!i||!l){U(L,"signTypedData","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let B=Me(l);if(!B){U(L,"signTypedData","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}Xe(!0);let q=Na(p),Ne=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let ue=await Se();if(!O||!ue)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:B.address,requesterAppId:x}});let{response:We}=await O.rpc({accessToken:ue,address:B.address,requesterAppId:x,request:{method:"eth_signTypedData_v4",params:[B.address,q]}}),mr=We.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:B.address,requesterAppId:x}}),mr};if(N.embeddedWallets.noPromptOnSignature||(N.legacyWalletUiConfig??!1)){d&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ue=await Ne();U(L,"signTypedData","onSuccess",ue),f(ue)}catch(ue){U(L,"signTypedData","onError","unable_to_sign"),C(ue??new Wt("Unable to sign message"))}}else{let We={method:"eth_signTypedData_v4",data:q,confirmAndSign:Ne,onSuccess:dt=>{U(L,"signTypedData","onSuccess",dt),f(dt)},onFailure:dt=>{U(L,"signTypedData","onError","unable_to_sign"),C(dt)},uiOptions:d||{}},mr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:dt=>{U(L,"signMessage","onError","unknown_connect_wallet_error"),C(dt)}};ne({signMessage:We,connectWallet:mr}),Ce("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(p,d,f)=>{let x=await(await To(p,d,f)).wait();return Qc(x)},exportWallet:()=>new Promise(async(p,d)=>{if(!i||!l){d(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!Me(l)){d(new Error("Must have a Privy wallet before exporting"));return}Xe(!0);let C={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:d,shouldForceMFA:!0};if(ne(be),!await Se()||!O){d(new Error("Must have valid access token to enroll in MFA"));return}if(!O){d(new Error("Must have a Privy wallet before exporting"));return}let B={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,onSuccess:p,onFailure:d};ne({keyExport:B,connectWallet:C}),Ce("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Us,async init(p){switch(p){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${p}`)}},async submit(p,d){switch(p){case"totp":case"sms":if(typeof d!="string")throw new w("Invalid MFA code");it.current?.resolve({mfaMethod:p,mfaCode:d,relyingParty:window.origin}),await new Promise((B,q)=>{un.current={resolve:B,reject:q}});break;case"passkey":if(typeof d=="string")throw new w("Invalid authenticator response");let C=await(await import("@simplewebauthn/browser")).startAuthentication(d),x=a3(C);it.current?.resolve({mfaMethod:p,mfaCode:x,relyingParty:window.origin}),await new Promise((B,q)=>{un.current={resolve:B,reject:q}});break;default:throw it.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${p}`)}},cancel(){it.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(p){let d=await Se();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");await O.initEnrollMfa({method:"sms",accessToken:d,phoneNumber:p.phoneNumber})},enrollInMfa(p){return new Promise((d,f)=>{if(!p){de.closePrivyModal(),d();return}N.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:N.mfa.methods,onSuccess:d,onFailure:f}}),Ce("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let p=await Se();if(!p||!O)throw new Error("Must have valid access token to enroll in MFA");let d=await O.initEnrollMfa({method:"totp",accessToken:p});return{secret:d.secret,authUrl:d.authUrl}},async submitEnrollmentWithSms(p){let d=await Se();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"sms",accessToken:d,phoneNumber:p.phoneNumber,code:p.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async submitEnrollmentWithTotp(p){let d=await Se();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"totp",accessToken:d,code:p.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:p}){let d=await Se();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"passkey",accessToken:d,credentialIds:p});let f=await t.getAuthenticatedUser();c(f)},async unenroll(p){let d=await Se();if(!d||!O)throw new Error("Must have valid access token to remove MFA");p==="passkey"?await O.submitEnrollMfa({method:"passkey",accessToken:d,credentialIds:[]}):await O.unenrollMfa({method:p,accessToken:d});let f=await t.getAuthenticatedUser();c(f)},requestFarcasterSignerFromWarpcast:async()=>{let p=await Se(),d=l?.linkedAccounts.find(x=>x.type==="wallet"&&x.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!d)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let C=await O.initFarcasterSigner({address:d.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(C.status==="approved"){let x=await t.getAuthenticatedUser();c(x||l||null)}ne({farcasterSigner:C}),Ce("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let p=await Se(),d=l?.linkedAccounts.find(x=>x.type==="wallet"&&x.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!d)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!l.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(x=>Uint8Array.from(x.match(/.{1,2}/g).map(B=>parseInt(B,16))))(l.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async p=>{let d=await Se(),f=l?.linkedAccounts.find(q=>q.type==="wallet"&&q.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!f)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!l.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let x=await import("@simplewebauthn/browser"),B=await O.signFarcasterMessage({address:f.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,payload:{hash:x.bufferToBase64URLString(p)},fid:BigInt(l.farcaster.fid),relyingParty:window.origin});return new Uint8Array(x.base64URLStringToBuffer(B.signature))},isHeadlessOAuthLoading:P,loginWithCode(p){return de.loginWithCode(p)},initLoginWithEmail(p){return de.initLoginWithEmail(p)},initLoginWithSms(p){return de.initLoginWithSms(p)},otpState:I,fundWallet(p,d){return de.fundWallet(p,d)},initLoginWithHeadlessOAuth(p,d){return de.initLoginWithHeadlessOAuth(p,d)},loginWithHeadlessOAuth(p){return de.loginWithHeadlessOAuth(p)},generateSiweMessage({address:p,chainId:d}){return de.generateSiweMessage({address:p,chainId:d})},linkWithSiwe({message:p,signature:d,chainId:f,walletClientType:C,connectorType:x}){return ct(),de.linkWithSiwe({message:p,signature:d,chainId:f,walletClientType:C,connectorType:x})},signMessageWithCrossAppWallet(p,{address:d}){return sp({user:l,client:t,address:d,requesterAppId:N.id,request:{method:"personal_sign",params:[p,d]},reconnect:Fs})},signTypedDataWithCrossAppWallet(p,{address:d}){let f=Na(p);return sp({user:l,client:t,address:d,requesterAppId:N.id,request:{method:"eth_signTypedData_v4",params:[d,f]},reconnect:Fs})},sendTransactionWithCrossAppWallet(p,{address:d}){return sp({user:l,client:t,address:d,requesterAppId:N.id,request:{method:"eth_sendTransaction",params:[p]},reconnect:Fs})},isModalOpen:r,mfaMethods:N.mfa.methods};c3=Si.signMessage,p3=Si.signTypedData,d3=async(...p)=>{let d=await To(...p);return N.embeddedWallets.waitForTransactionConfirmation&&await d.wait(),d};let de=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:$,pendingTransaction:null,walletConnectionStatus:D,connectors:t.connectors?.walletConnectors??[],rpcConfig:N.rpcConfig,chains:N.chains,appId:e.appId,showFiatPrices:N.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:p=>N.chains.find(d=>d.id===Number(p))?.nativeCurrency.symbol,initializeWalletProxy:async p=>{if(O)return O;let d=new Promise(x=>{Ur(()=>B=>x(B))}),f=new Promise(x=>setTimeout(()=>x(null),p)),C=await Promise.race([d,f]);return Ur(null),C},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(p={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let d=n&&i&&l,f;d&&ie.current&&(f=ru(l)),z.current==="login"?p.shouldCallAuthOnSuccess&&d&&ie.current?(U(L,"login","onComplete",l,g,!1,ie.current,f??null),e.onSuccess?.(l,g)):U(L,"login","onError","exited_auth_flow"):z.current==="link"&&f&&(p.isSuccess&&d&&ie.current?U(L,"linkAccount","onSuccess",l,ie.current,f):U(L,"linkAccount","onError","exited_link_flow")),J(null),z.current=null,ie.current=null,S(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:Ce,connectWallet:Ma,initLoginWithWallet:async(p,d)=>{ie.current="siwe",Go(p,d)},loginWithWallet:async()=>{if(!n)throw new qo;if(!(t.authFlow instanceof Ko))throw new w("Must initialize SIWE flow first.");let p,d;if(i)try{({user:p}=await t.link()),ie.current="siwe"}catch(f){throw U(L,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:p,isNewUser:d}=await t.authenticate()),ie.current="siwe"}catch(f){throw U(L,"login","onError",f.privyErrorCode||"generic_connect_wallet_error"),f}c(p||l||null),S(d||!1),s(!0)},initLoginWithFarcaster:async p=>{let d=new Da(p);t.startAuthFlow(d);try{ie.current="farcaster",await d.initializeFarcasterConnect()}catch(f){throw z.current==="login"?U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",f.privyErrorCode||"unknown_auth_error"),f}},loginWithFarcaster:async()=>{if(!n)throw new qo;if(!(t.authFlow instanceof Da))throw new w("Must initialize Farcaster flow first.");let p,d;if(i)try{({user:p}=await t.link()),ie.current="farcaster"}catch(f){throw U(L,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:p,isNewUser:d}=await t.authenticate()),ie.current="farcaster"}catch(f){throw U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}c(p||null),S(d||!1),s(!0)},async crossAppAuthFlow({appId:p,popup:d}){let f=`privy:${p}`;ie.current=f;let{url:C,stateCode:x,codeVerifier:B}=await o3({api:t.api,appId:p});if(!C)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:p}}),new w("No authorization URL returned for cross-app auth.");try{let q=await i3({url:C,popup:d,provider:f}),Ne=q.stateCode,ue=q.authorizationCode;if(Ne!==x)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:f,storedStateCode:x??"",returnedStateCode:Ne??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let pt=await n3({api:Vo.api,appId:p,codeVerifier:B,stateCode:Ne,authorizationCode:ue});pt&&t.storeProviderAccessToken(p,pt);let We=await de.refreshUser();if(!We)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{appId:p}}),We}catch(q){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:q.toString(),provider:f}}),q}},async initLoginWithOAuth(p,d){if(ie.current=p,mp()){if(p==="google"&&Ji(window.navigator.userAgent)){Rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}p==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),re.del(Kn);let f=new So({provider:p});d&&f.addCaptchaToken(d),t.startAuthFlow(f);let C=await t.authFlow.getAuthorizationUrl();C&&C.url&&(p==="twitter"&&l3.isAndroid&&(C.url=C.url.replace("x.com","twitter.com")),window.location.assign(C.url))},async initLoginWithTelegram(p){if(!n)throw new qo;ie.current="telegram";let d=new Wi(p);t.startAuthFlow(d),d.meta.telegramWebAppData=void 0,d.meta.telegramAuthResult=await new Promise((f,C)=>{if(!N.loginConfig.telegramAuthConfiguration)return C(new w("Telegram Auth configuration is not loaded"));if(!window.Telegram)return C(new w("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:N.loginConfig.telegramAuthConfiguration.botId,request_access:!0},x=>x?f(x):C(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Wi))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let p,d;if(i)try{({user:p}=await t.link()),ie.current="telegram"}catch(f){throw U(L,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{let f=await t.authenticate();p=f.user,d=f.isNewUser,ie.current="telegram"}catch(f){throw z.current==="login"?U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}c(p),S(d||!1),s(!0)},async recoveryOAuthFlow(p,d,f){let C,x;function B(q){if(!q)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:p}}),new w("Recovery OAuth failed")}switch(p){case"google-drive":{let{url:q,codeVerifier:Ne,stateCode:ue}=await ad({api:Vo.api,provider:p});B(q);let pt,We;try{let mr=await Qd({url:q,popup:f,provider:p});if(pt=mr.stateCode,We=mr.authorizationCode,pt!==ue)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:p,storedStateCode:ue??"",returnedStateCode:pt??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(mr){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:mr.toString(),provider:p}}),new w("Recovery OAuth failed")}[C,x]=await Promise.all([Se(),Xh({api:Vo.api,provider:p,codeVerifier:Ne,stateCode:pt,authorizationCode:We})]);break}case"icloud":{let{url:q}=await ad({api:Vo.api,provider:p});B(q);let{ckWebAuthToken:Ne}=await Qd({url:q,popup:f,provider:p});x=Ne,C=await Se();break}}if(!O)throw new w("Cannot connect to wallet proxy");if(!C)throw new w("Unable to authorize user");switch(d){case"recover":let q=be.recoverWallet?.privyWallet?.address;if(!q)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:q,recoveryMethod:p}}),await O.recover({address:q,accessToken:C,recoveryAccessToken:x,recoveryMethod:p}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:q,recoveryMethod:p}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await O.create({accessToken:C,recoveryAccessToken:x,recoveryMethod:p});let Ne=await de.refreshUser(),ue=Me(Ne);if(!ue)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:ue.address}}),U(L,"createWallet","onSuccess",ue);break;case"set-recovery":let pt=Me(l);if(!pt)throw U(L,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{recoveryMethod:p}}),await O.setRecovery({address:pt.address,accessToken:C,recoveryAccessToken:x,recoveryMethod:p});let We=Me(await de.refreshUser());if(!We)throw U(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:pt.address,recoveryMethod:p}}),U(L,"setWalletRecovery","onSuccess",p,We);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(p){if(!(t.authFlow instanceof So))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let d=re.get(zn),f=t.authFlow.meta.stateCode;if(d!==f)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:p,storedStateCode:d??"",returnedStateCode:f??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,x,B;if(i)try{let q=await t.link();C=q.user,B=q.oAuthTokens,ie.current=p}catch(q){throw U(L,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account"),q}else try{let q=await t.authenticate();C=q.user,x=q.isNewUser,B=q.oAuthTokens,ie.current=p}catch(q){throw z.current==="login"?U(L,"login","onError",q.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account"),q}return c(C),S(x||!1),s(!0),B&&U(L,"oAuthAuthorization","onOAuthTokenGrant",B),B},async initLoginWithPasskey(p){let d=new Jn(p);t.startAuthFlow(d),z.current="login";try{ie.current="passkey",await d.initAuthenticationFlow()}catch(f){throw U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}},async loginWithPasskey(){if(!n)throw new qo;if(!(t.authFlow instanceof Jn))throw new w("Must initialize Passkey flow first.");if(ie.current!=="passkey")throw new w("Must init login with Passkey flow first.");let p,d;try{ie.current="passkey",{user:p,isNewUser:d}=await t.authenticate()}catch(f){throw U(L,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}c(p),S(d||!1),s(!0)},async initLinkWithPasskey(p){let d=new Jn(p);t.startAuthFlow(d),z.current="link",ie.current="passkey";try{await d.initLinkFlow()}catch(f){throw U(L,"linkAccount","onError",f.privyErrorCode||"unknown_auth_error"),f}},async linkWithPasskey(){if(!n)throw new qo;if(!(t.authFlow instanceof Jn))throw new w("Must initialize Passkey flow first.");if(ie.current!=="passkey")throw new w("Must init login with Passkey flow first.");let p;try{ie.current="passkey",{user:p}=await t.link()}catch(d){throw U(L,"linkAccount","onError",d.privyErrorCode||"failed_to_link_account"),d}return c(p||l||null),p},async initLoginWithHeadlessOAuth(p,d){if(mp()){if(p==="google"&&Ji(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 f=new So({provider:p,headless:!0});d&&f.addCaptchaToken(d);let C=await t.startAuthFlow(f).getAuthorizationUrl();C?.url&&window.location.assign(C.url)},async loginWithHeadlessOAuth(p){W(!0),t.startAuthFlow(new So(p));let d=re.get(zn),f=p.stateCode;if(d!==f)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:p.provider,storedStateCode:d??"",returnedStateCode:f??""}}),W(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,x;if(i)try{({user:C}=await t.link()),ie.current=p.provider}catch(B){throw U(L,"linkAccount","onError",B.privyErrorCode||"failed_to_link_account"),B}else try{({user:C,isNewUser:x}=await t.authenticate()),ie.current=p.provider}catch(B){throw z.current==="login"?U(L,"login","onError",B.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",B.privyErrorCode||"failed_to_link_account"),B}return c(C),S(x||!1),s(!0),W(!1),C??void 0},initLoginWithEmail:async(p,d)=>{let f=new mn(p,d);t.startAuthFlow(f);try{ie.current="email",await f.sendCodeEmail()}catch(C){throw z.current==="login"?U(L,"login","onError",C.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account"),C}},initUpdateEmail:async(p,d,f)=>{let C=new Qs(p,d,f);t.startAuthFlow(C),await C.sendCodeEmail()},initLoginWithSms:async(p,d)=>{H({status:"sending-code"});let f=new Xn(p,d);t.startAuthFlow(f);try{ie.current="sms",await f.sendSmsCode(),H({status:"awaiting-code-input"})}catch(C){throw H({status:"error",error:C}),z.current==="login"?U(L,"login","onError",C.privyErrorCode||"unknown_auth_error"):z.current==="link"&&U(L,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account"),C}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async p=>{if(H({status:"submitting-code"}),!n){let C=new qo;throw H({status:"error",error:C}),C}if(t.authFlow instanceof mn)t.authFlow.meta.emailCode=p.trim();else if(t.authFlow instanceof Xn)t.authFlow.meta.smsCode=p.trim();else{let C=new w("Must initialize a passwordless code flow first");throw H({status:"error",error:C}),C}await Se();let d,f;if(z.current==="link")try{({user:d}=await t.link())}catch(C){throw H({status:"error",error:C}),U(L,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account"),C}else try{({user:d,isNewUser:f}=await t.authenticate())}catch(C){throw H({status:"error",error:C}),U(L,"login","onError",C.privyErrorCode||"unknown_auth_error"),C}c(d||l||null),S(f||!1),s(!0),H({status:"done"})},generateSiweMessage:async({address:p,chainId:d,captchaToken:f})=>{z.current="link",ie.current="siwe";let C=await t.generateSiweNonce({address:p,captchaToken:f}),x=d.replace("eip155:","");return El({address:p,chainId:x,nonce:C})},linkWithSiwe:async({message:p,signature:d,chainId:f,walletClientType:C,connectorType:x})=>{let B;try{if(z.current!=="link"||ie.current!=="siwe")throw new w("Must ensure no other auth flow is in progress other than the SIWE signature flow.");B=await t.linkWithSiwe({message:p,signature:d,chainId:f,walletClientType:C,connectorType:x});let q=ru(B);q&&U(L,"linkAccount","onSuccess",B,"siwe",q)}catch(q){throw U(L,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account"),z.current=null,ie.current=null,q}c(B||l||null),z.current=null,ie.current=null},refreshUser:async()=>{let p=await t.getAuthenticatedUser();return c(p),p},walletProxy:O,createAnalyticsEvent:({eventName:p,payload:d,timestamp:f})=>t.createAnalyticsEvent({eventName:p,payload:d,timestamp:f}),acceptTerms:async()=>{let p=await t.acceptTerms();return c(p),p},getUsdTokenPrice:p=>t.getUsdTokenPrice(p),recoverEmbeddedEthereumWallet:async()=>new Promise(async(p,d)=>{let f=Me(l)||Tl(l),C=await Se();if(!C||!O||!f){d(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Xe(!0);try{await O.connect({accessToken:C,address:f.address}),p(!0)}catch(x){if(li(x)&&f.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:f.address}}),(await O.recover({address:f.address,accessToken:C,recoveryMethod:f.recoveryMethod})).address||d(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:f.address}}),p(!0);else if(li(x)&&f.recoveryMethod!=="privy"){ne({recoverWallet:{privyWallet:f,onFailure:d,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:f.recoveryMethod,action:"recover"}});let B=ac(f.recoveryMethod);Ce(B)}else d(x)}}),embeddedSolanaWallet:m,createEmbeddedSolanaWallet:async()=>{Xe(!0);let p=await Se(),d=ei(l),f=Me(l);if(!l||!p)throw new w("User must be logged in to create a Solana wallet");if(d)throw new w("User already has an embedded Solana wallet.");if(f)if(f.recoveryMethod==="privy")await de.recoverEmbeddedEthereumWallet();else throw new w("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let C=await de.initializeWalletProxy(15e3);if(!C)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await C.createSolana({accessToken:p,ethereumAddress:f?.address});let x=await de.refreshUser(),B=ei(x);if(!B)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:B.address}}),B}catch(x){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",x)}},recoverEmbeddedSolanaWallet:async()=>new Promise(async(p,d)=>{let f=ei(l),C=await Se();if(!C||!O||!f){d(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Xe(!0);try{await O.connectSolana({accessToken:C,publicKey:f.address}),p(!0)}catch(x){li(x)&&f.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:f.address}}),(await O.recoverSolana({publicKey:f.address,accessToken:C})).publicKey||d(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:f.address}}),p(!0)):d(x)}}),getFiatOnRampConfig:at,setReadyToTrue:p=>{a(!0),Le?.(p)},updateWallets:()=>st(),fundWallet:async(p,d)=>{let{signedUrl:f,externalTransactionId:C}=await at(p,d);ne({fiatOnRampPrompt:{signedUrl:f},fiatOnRampStatus:{externalTransactionId:C}}),Ce("FIAT_ON_RAMP_PROMPT_SCREEN")},requestFarcasterSignerStatus:async p=>{let d=await Se(),f=l?.linkedAccounts.find(x=>x.type==="wallet"&&x.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!f)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let C=await t.requestFarcasterSignerStatus(p);if(C.status==="approved"){let x=await t.getAuthenticatedUser();c(x||l||null)}return C}}))();u3=de.recoverEmbeddedEthereumWallet,m3=de.recoverEmbeddedSolanaWallet;let Q3=(0,pe.useMemo)(()=>({wallets:u,ready:dr&&qt}),[u,dr,qt]);return(0,or.jsx)(Ae.Provider,{value:Si,children:(0,or.jsx)(Bp.Provider,{value:L,children:(0,or.jsx)(Ud.Provider,{value:Q3,children:(0,or.jsx)(Uf,{...N,children:(0,or.jsxs)(Fp.Provider,{value:de,children:[(0,or.jsxs)(Af,{data:be,setModalData:ne,setInitialScreen:E,initialScreen:A,authenticated:i,open:r,children:[e.children,!N.headless&&N.captchaEnabled&&n&&!i&&(0,or.jsx)(Dl,{delayedExecution:!1}),(0,or.jsx)($v,{theme:{...N.appearance.palette||{}}}),!N.render.standalone&&(0,or.jsx)(op,{open:r})]}),ht&&nt?(0,or.jsx)(e3,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:l?.mfaMethods,mfaPromise:it,mfaSubmitPromise:un,onLoad:K,onLoadFailed:()=>null}):null,N.loginMethods.telegram&&N.loginConfig.telegramAuthConfiguration&&(0,or.jsx)(uo,{if:!0,children:(0,or.jsx)(Qv,{scriptHost:e.apiUrl||sl,botUsername:N.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};var h3=require("react");function y3(e){let{login:t}=(0,h3.useContext)(Ae);return Ze("login",e),{login:t}}var g3=require("react");function v3(e){let{logout:t}=(0,g3.useContext)(Ae);return Ze("logout",e),{logout:t}}var Os=require("react");function C3(){let e=Pe(),t=Il(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:a,user:i}=G(),s=(0,Os.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new xr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),l=(0,Os.useCallback)(async()=>{let c=za();if(i)return console.warn("Cannot login with OAuth when already logged in"),i;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(u){throw u}finally{Qn()}},[o]);return(0,Os.useEffect)(()=>{let c=za();a&&t&&c.inProgress&&c.headless&&!c.popupFlow&&l()},[a,t]),{initOAuth:s,loginWithOAuth:l,loading:n}}var Jd=require("react");var w3=()=>{let e=Pe(),{initLoginWithEmail:t,loginWithCode:r}=G(),o=(0,Jd.useCallback)(async({email:a})=>{if(!a)throw new Error("Email required to send OTP code");return t(a)},[t]),n=(0,Jd.useCallback)(async({code:a})=>{if(e.enabled&&e.status==="error")throw new xr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var Xd=require("react");var b3=()=>{let e=Pe(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=G(),n=(0,Xd.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return t(i)},[t]),a=(0,Xd.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new xr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:n,loginWithCode:a,state:o}};var eu=require("react");var E3=()=>{let e=Pe(),{generateSiweMessage:t,linkWithSiwe:r}=G(),o=(0,eu.useCallback)(async({address:a,chainId:i})=>{if(!a||!i)throw new Error("wallet address and chainId required to generate nonce");return t({address:a,chainId:i}).then(s=>s)},[t]),n=(0,eu.useCallback)(async({signature:a,message:i,chainId:s,walletClientType:l,connectorType:c})=>{if(e.enabled&&e.status!=="success")throw new xr(e.error,null,"captcha_failure");return r({message:i,signature:a,chainId:s,walletClientType:l,connectorType:c})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};var T3=require("react");function S3(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:s,linkGithub:l,linkLinkedIn:c,linkTiktok:u,linkSpotify:h,linkInstagram:m,linkTelegram:v,linkFarcaster:b}=(0,T3.useContext)(Ae);return Ze("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:s,linkGithub:l,linkLinkedIn:c,linkTiktok:u,linkSpotify:h,linkInstagram:m,linkFarcaster:b,linkTelegram:v}}var P3=require("react");function _3(e){let{connectWallet:t}=(0,P3.useContext)(Ae);return Ze("connectWallet",e),{connectWallet:t}}var A3=require("react");function x3(e){let{createWallet:t}=(0,A3.useContext)(Ae);return Ze("createWallet",e),{createWallet:t}}var k3=()=>{let{fundWallet:e}=G();return{fundWallet:e}};var R3=()=>{let{embeddedSolanaWallet:e,createEmbeddedSolanaWallet:t}=R();return{createWallet:t,wallets:e?[e]:[]}};var I3=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=G();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};var W3=require("react");function M3(e){let{sendTransaction:t}=(0,W3.useContext)(Ae);return Ze("sendTransaction",e),{sendTransaction:t}}var O3=require("react");function L3(e){let{setWalletPassword:t}=(0,O3.useContext)(Ae);return Ze("setWalletPassword",e),{setWalletPassword:t}}var N3=require("react");function D3(e){let{setWalletRecovery:t}=(0,N3.useContext)(Ae);return Ze("setWalletRecovery",e),{setWalletRecovery:t}}var U3=require("react");function F3(e){let{signMessage:t}=(0,U3.useContext)(Ae);return Ze("signMessage",e),{signMessage:t}}var B3=require("react");function H3(e){let{signTypedData:t}=(0,B3.useContext)(Ae);return Ze("signTypedData",e),{signTypedData:t}}var V3=require("react");var G3=()=>{let{isModalOpen:e}=(0,V3.useContext)(Ae);return{isOpen:e}};var q3=require("react");function z3(e){let{getAccessToken:t}=(0,q3.useContext)(Ae);return Ze("accessToken",e),{getAccessToken:t}}function $3(e){let{authenticated:t,user:r}=G(),{initLoginWithOAuth:o}=R(),n=Ki();return Ze("oAuthAuthorization",e),{reauthorize:a=>w6(t,r,o,n,a.provider)}}var w6=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated"),new w("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(i=>i.type.includes(n)))throw new w(`OAuth account of type ${n} not linked to the account.`);await r(n)};var K3=tu;function tu(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=G();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function j3(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Y3(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,LoginModal,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,getEmbeddedConnectedWallet,useConnectWallet,useCreateWallet,useCrossAppAccounts,useExperimentalFarcasterSigner,useFarcasterSigner,useFundWallet,useLinkAccount,useLinkWithSiwe,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,useOAuthTokens,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSetWalletRecovery,useSignMessage,useSignTypedData,useSolanaWallets,useToken,useWallets});