@privy-io/react-auth 1.76.3 → 1.76.4

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 bw=Object.create;var pl=Object.defineProperty;var Ew=Object.getOwnPropertyDescriptor;var Tw=Object.getOwnPropertyNames;var Sw=Object.getPrototypeOf,_w=Object.prototype.hasOwnProperty;var Pw=(e,t)=>{for(var r in t)pl(e,r,{get:t[r],enumerable:!0})},fm=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Tw(t))!_w.call(e,n)&&n!==r&&pl(e,n,{get:()=>t[n],enumerable:!(o=Ew(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?bw(Sw(e)):{},fm(t||!e||!e.__esModule?pl(r,"default",{value:e,enumerable:!0}):r,e)),Aw=e=>fm(pl({},"__esModule",{value:!0}),e);var np=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var hm=(e,t,r)=>(np(e,t,"read from private field"),r?r.call(e):t.get(e)),ul=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},ip=(e,t,r,o)=>(np(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var ym=(e,t,r)=>(np(e,t,"access private method"),r);var h7={};Pw(h7,{AsExternalProvider:()=>bo,Captcha:()=>lc,ConnectorManager:()=>ca,LoginModal:()=>Xd,PrivyClient:()=>da,PrivyProvider:()=>x0,PrivyProxyProvider:()=>ct,SUPPORTED_CHAINS:()=>sa,VERSION:()=>Wl,WalletConnector:()=>mr,addRpcUrlOverrideToChain:()=>lw,errorIndicatesMaxMfaRetries:()=>Oc,errorIndicatesMfaTimeout:()=>Gn,errorIndicatesMfaVerificationFailed:()=>Vn,getAccessToken:()=>Ie,getEmbeddedConnectedWallet:()=>cw,useConnectWallet:()=>B0,useCreateWallet:()=>G0,useCrossAppAccounts:()=>z0,useExperimentalFarcasterSigner:()=>sw,useFarcasterSigner:()=>im,useFundWallet:()=>V0,useLinkAccount:()=>U0,useLinkWithSiwe:()=>N0,useLogin:()=>R0,useLoginWithEmail:()=>O0,useLoginWithOAuth:()=>W0,useLoginWithSms:()=>L0,useLogout:()=>M0,useMfa:()=>Ka,useMfaEnrollment:()=>yo,useModalStatus:()=>ow,useOAuthTokens:()=>aw,usePrivy:()=>z,useRegisterMfaListener:()=>uc,useSendTransaction:()=>K0,useSetWalletPassword:()=>Y0,useSetWalletRecovery:()=>Q0,useSignMessage:()=>X0,useSignTypedData:()=>tw,useSolanaWallets:()=>q0,useToken:()=>iw,useWallets:()=>fo});module.exports=Aw(h7);var on=require("@ethersproject/address"),rp=require("@ethersproject/providers"),w0=require("mipd"),ve=require("react"),b0=require("react-device-detect"),rs=require("@privy-io/js-sdk-core");var gm=require("ofetch"),wt=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},pr=class extends wt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},b=class extends wt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},ml=class extends b{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var we=class extends wt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},Ce=e=>{if(e instanceof wt)return e;if(!(e instanceof gm.FetchError))return bt(e);if(!e.response)return new pr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new pr(t||"ApiError",e.response.status,r||o,e,n)},bt=e=>e instanceof wt?e:e instanceof Error?new b(e.message,e):new b(`Internal error: ${e}`);var an=class extends b{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ur=class extends b{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},fl=class extends b{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var no=class extends b{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var hl="/api/v1/sessions",yl="/api/v1/sessions/logout",vm="/api/v1/sessions/fork",gl="/api/v1/sessions/fork/recover",Cm="/api/v1/siwe/init",wm="/api/v1/siwe/authenticate",bm="/api/v1/siwe/link",Em="/api/v1/siwe/unlink",Tm="/api/v1/farcaster/init",Sm="/api/v1/farcaster/authenticate",_m="/api/v1/farcaster/link",Pm="/api/v1/farcaster/status",Am="/api/v1/farcaster/unlink",xm="/api/v1/passwordless/init",km="/api/v1/passwordless/authenticate",Rm="/api/v1/passwordless/link",Im="/api/v1/passwordless/unlink",Mm="/api/v1/passwordless/update",Wm="/api/v1/passwordless_sms/init",Om="/api/v1/passwordless_sms/link",Lm="/api/v1/passwordless_sms/unlink",Nm="/api/v1/passwordless_sms/authenticate",Dm="/api/v1/passwordless_sms/update",vl="/api/v1/oauth/init",Um="/api/v1/oauth/authenticate",Cl="/api/v1/oauth/link",Fm="/api/v1/oauth/unlink",Bm="/api/v1/recovery/oauth/init",Hm="/api/v1/recovery/oauth/init_icloud",Gm="/api/v1/recovery/oauth/authenticate",Vm="/api/v1/passkeys/link/init",qm="/api/v1/passkeys/authenticate/init",zm="/api/v1/passkeys/link",$m="/api/v1/passkeys/authenticate",Km="/api/v1/passkeys/unlink",jm="/api/v1/telegram/authenticate",Ym="/api/v1/telegram/link",Zm="/api/v1/telegram/unlink";var Qm="/api/v1/mfa/passwordless_sms/init",Jm="/api/v1/mfa/passkeys/init",Xm="/api/v1/users/me/accept_terms",wl="/api/v1/analytics_events",ef="/api/v1/custom_jwt_account/authenticate",tf="/api/v1/plugins/moonpay_on_ramp/sign",rf="/api/v1/funding/coinbase_on_ramp/init",of="/api/v1/funding/coinbase_on_ramp/status";var zi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(ef,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){throw new Error("Unimplemented")}};var An=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(km,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Rm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw Ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{return await this.api.post(xm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},bl=class extends An{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new b("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Mm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw Ce(r)}}};var Rl=require("react-device-detect");var ap=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},El=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function sp(){try{let e="privy:__session_storage__test",t="blobby",r=new El;return r.put(e,t),r.del(e),!0}catch{return!1}}function xw(){return typeof window<"u"&&window.localStorage?new El:new ap}var X=xw();var $i=require("@ethersproject/providers");function nf(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var Tl=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var lp=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Tl(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!lp(r))return!1}return!0},xn=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Sl=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var af=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},_l=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),sf=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Wt=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},cp=e=>new Promise(t=>setTimeout(t,e));function lf(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var ns=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await cp(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},Pl=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var cf=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),li=e=>typeof e=="string"?e:"0x"+e.toString(16);async function df(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of nf()){let f=Tl(m);if(!s.some(u=>u.info.name===f)){if(lp(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function Ki(e){return`eip155:${String(Number(e))}`}var pf=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);return dp(i,r,o)},dp=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new we(`No RPC url found for ${o}`);return i},uf=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new we(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Er=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new $i.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new $i.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new $i.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new $i.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new $i.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new we(`No RPC url found for ${e}`);return a},is=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var Al=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(xl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var xl={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function mf(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function ff(e,t){let r=mf(t);if(r.deepLink)return wf(r.deepLink,e);if(r.universalLink)return pp(r.universalLink,e);throw new b(`Unsupported wallet ${t.id}`)}function hf(e,t){let r=mf(t);if(r.universalLink)return pp(r.universalLink,e)}var yf="WALLETCONNECT_DEEPLINK_CHOICE";function gf(){try{localStorage.removeItem(yf)}catch{}}function vf({href:e,name:t}){try{localStorage.setItem(yf,JSON.stringify({href:e,name:t}))}catch{}}function Cf(e){return e.startsWith("http://")||e.startsWith("https://")}function wf(e,t){if(Cf(e))return pp(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function pp(e,t){if(!Cf(e))return wf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function kl(e,t){window.open(e,t,"noreferrer noopener")}var rt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var as=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");try{let t=await this.api.post(Sm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new b("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(_m,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw Ce(t)}}async _startChannelOnce(){if(!this.api)throw new b("Auth flow has no API instance");let t=await this.api.post(Tm,{token:this.captchaToken});Rl.isMobile&&!Rl.isIOS&&t.connect_uri&&kl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new b("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");let t=await this.api.get(Pm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var bf="1.76.3";var Ef="34357d3c125c2bcf2ce2bc3309d98715",Il="https://auth.privy.io",Tf=2e4,ot=1400,Ml=2500,Wl=bf;var ci="privy:token",up="privy-token",Ol="privy:refresh_token",Sf="privy-refresh-token",mp="privy:id_token",fp="privy-id-token",Ll="privy-session",ss="privy:session_transfer_token",Rw="privy:wallet",ls="privy:caid",cs=e=>`privy:cross-app:${e}`,di="privy:state_code",pi="privy:code_verifier",ui="privy:headless_oauth",Nl=e=>`${Rw}:${e}`,hp="privy:connectors",yp="privy:connections";var mi=12e4,sn=1,gp="0x1",ji=3e4,_f="https://api.moonpay.com/v1",Pf="https://api.moonpay.com/v1",Af="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",xf="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var kf="deprecated";var vp=require("jose");async function Rf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function If(e){return crypto.getRandomValues(new Uint8Array(e))}var Iw="S256",Mw="S256";function fi(){return vp.base64url.encode(If(36))}function Yi(){return fi()}async function Zi(e,t=Iw){if(t==Mw){let r=await Rf(e);return vp.base64url.encode(r)}else return e}function Mf(){let e=X.get(pi);if(!e)throw new b("Authentication error.");return e}function Dl(){return!!X.get(ui)}var Uo=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Dl();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=Mf();try{let r=await this.api.post(Um,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(pi),this.meta.headless&&X.del(ui),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=Ce(r);throw o.privyErrorCode?new b(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=X.get(pi);if(!t)throw new b("Authentication error.");try{let r=await this.api.post(Cl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(pi),r}catch(r){throw Ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initializing OAuth authentication.");let t=fi();X.put(pi,t);let r=Yi();X.put(di,r);let o=await Zi(t);this.meta.headless&&X.put(ui,!0);try{return await this.api.post(vl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw Ce(n)}}};function Cp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ds=require("react/jsx-runtime"),Ul=({style:e,...t})=>(0,ds.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,ds.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,ds.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var kn=require("react/jsx-runtime"),Fl=({style:e,...t})=>(0,kn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,kn.jsx)("g",{clipPath:"url(#clip0)",children:(0,kn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,kn.jsx)("defs",{children:(0,kn.jsx)("clipPath",{id:"clip0",children:(0,kn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var wp=require("react/jsx-runtime"),Bl=({style:e,...t})=>(0,wp.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,wp.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var Wf=require("@heroicons/react/24/outline"),Lf=require("react/jsx-runtime"),Of=({style:e})=>(0,Lf.jsx)(Wf.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var hi=require("react/jsx-runtime"),Hl=({style:e,...t})=>(0,hi.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,hi.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,hi.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,hi.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,hi.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Ut=require("react/jsx-runtime");function Gl(e){return(0,Ut.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Ut.jsxs)("defs",{children:[(0,Ut.jsxs)("linearGradient",{id:"b",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Ut.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Ut.jsxs)("linearGradient",{id:"a",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Ut.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Ut.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Ut.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var ps=require("react/jsx-runtime");function Vl({style:e,...t}){return(0,ps.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,ps.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ps.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ps.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var us=require("react/jsx-runtime");function ql(e){return(0,us.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,us.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,us.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Qi=require("react/jsx-runtime");function zl(e){return(0,Qi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Qi.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Qi.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Qi.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var bp=require("react/jsx-runtime"),$l=({style:e,...t})=>(0,bp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,bp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Nf={google:{name:"Google",component:Hl},discord:{name:"Discord",component:Fl},github:{name:"Github",component:Bl},linkedin:{name:"LinkedIn",component:Vl},twitter:{name:"Twitter",component:$l},spotify:{name:"Spotify",component:ql},instagram:{name:"Instagram",component:Gl},tiktok:{name:"Tiktok",component:zl},apple:{name:"Apple",component:Ul}},ms=e=>e in Nf?Nf[e]:{name:"Unknown",component:Of};function Df(e,t){let r={detail:"",retryable:!1},o=Cp(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=ms(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ms(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function fs(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Dl(),popupFlow:window.opener!==null&&n}}function yi(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),X.del(di),window.history.replaceState({},"",e)}var gi=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post($m,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(zm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(qm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Vm,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var Kl=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
1
+ "use strict";var bw=Object.create;var pl=Object.defineProperty;var Ew=Object.getOwnPropertyDescriptor;var Tw=Object.getOwnPropertyNames;var Sw=Object.getPrototypeOf,_w=Object.prototype.hasOwnProperty;var Pw=(e,t)=>{for(var r in t)pl(e,r,{get:t[r],enumerable:!0})},fm=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Tw(t))!_w.call(e,n)&&n!==r&&pl(e,n,{get:()=>t[n],enumerable:!(o=Ew(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?bw(Sw(e)):{},fm(t||!e||!e.__esModule?pl(r,"default",{value:e,enumerable:!0}):r,e)),Aw=e=>fm(pl({},"__esModule",{value:!0}),e);var np=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var hm=(e,t,r)=>(np(e,t,"read from private field"),r?r.call(e):t.get(e)),ul=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},ip=(e,t,r,o)=>(np(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var ym=(e,t,r)=>(np(e,t,"access private method"),r);var h7={};Pw(h7,{AsExternalProvider:()=>bo,Captcha:()=>lc,ConnectorManager:()=>ca,LoginModal:()=>Xd,PrivyClient:()=>da,PrivyProvider:()=>x0,PrivyProxyProvider:()=>ct,SUPPORTED_CHAINS:()=>sa,VERSION:()=>Wl,WalletConnector:()=>mr,addRpcUrlOverrideToChain:()=>lw,errorIndicatesMaxMfaRetries:()=>Oc,errorIndicatesMfaTimeout:()=>Gn,errorIndicatesMfaVerificationFailed:()=>Vn,getAccessToken:()=>Ie,getEmbeddedConnectedWallet:()=>cw,useConnectWallet:()=>B0,useCreateWallet:()=>G0,useCrossAppAccounts:()=>z0,useExperimentalFarcasterSigner:()=>sw,useFarcasterSigner:()=>im,useFundWallet:()=>V0,useLinkAccount:()=>U0,useLinkWithSiwe:()=>N0,useLogin:()=>R0,useLoginWithEmail:()=>O0,useLoginWithOAuth:()=>W0,useLoginWithSms:()=>L0,useLogout:()=>M0,useMfa:()=>Ka,useMfaEnrollment:()=>yo,useModalStatus:()=>ow,useOAuthTokens:()=>aw,usePrivy:()=>z,useRegisterMfaListener:()=>uc,useSendTransaction:()=>K0,useSetWalletPassword:()=>Y0,useSetWalletRecovery:()=>Q0,useSignMessage:()=>X0,useSignTypedData:()=>tw,useSolanaWallets:()=>q0,useToken:()=>iw,useWallets:()=>fo});module.exports=Aw(h7);var on=require("@ethersproject/address"),rp=require("@ethersproject/providers"),w0=require("mipd"),ve=require("react"),b0=require("react-device-detect"),rs=require("@privy-io/js-sdk-core");var gm=require("ofetch"),wt=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},pr=class extends wt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},b=class extends wt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},ml=class extends b{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var we=class extends wt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},Ce=e=>{if(e instanceof wt)return e;if(!(e instanceof gm.FetchError))return bt(e);if(!e.response)return new pr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new pr(t||"ApiError",e.response.status,r||o,e,n)},bt=e=>e instanceof wt?e:e instanceof Error?new b(e.message,e):new b(`Internal error: ${e}`);var an=class extends b{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ur=class extends b{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},fl=class extends b{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var no=class extends b{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var hl="/api/v1/sessions",yl="/api/v1/sessions/logout",vm="/api/v1/sessions/fork",gl="/api/v1/sessions/fork/recover",Cm="/api/v1/siwe/init",wm="/api/v1/siwe/authenticate",bm="/api/v1/siwe/link",Em="/api/v1/siwe/unlink",Tm="/api/v1/farcaster/init",Sm="/api/v1/farcaster/authenticate",_m="/api/v1/farcaster/link",Pm="/api/v1/farcaster/status",Am="/api/v1/farcaster/unlink",xm="/api/v1/passwordless/init",km="/api/v1/passwordless/authenticate",Rm="/api/v1/passwordless/link",Im="/api/v1/passwordless/unlink",Mm="/api/v1/passwordless/update",Wm="/api/v1/passwordless_sms/init",Om="/api/v1/passwordless_sms/link",Lm="/api/v1/passwordless_sms/unlink",Nm="/api/v1/passwordless_sms/authenticate",Dm="/api/v1/passwordless_sms/update",vl="/api/v1/oauth/init",Um="/api/v1/oauth/authenticate",Cl="/api/v1/oauth/link",Fm="/api/v1/oauth/unlink",Bm="/api/v1/recovery/oauth/init",Hm="/api/v1/recovery/oauth/init_icloud",Gm="/api/v1/recovery/oauth/authenticate",Vm="/api/v1/passkeys/link/init",qm="/api/v1/passkeys/authenticate/init",zm="/api/v1/passkeys/link",$m="/api/v1/passkeys/authenticate",Km="/api/v1/passkeys/unlink",jm="/api/v1/telegram/authenticate",Ym="/api/v1/telegram/link",Zm="/api/v1/telegram/unlink";var Qm="/api/v1/mfa/passwordless_sms/init",Jm="/api/v1/mfa/passkeys/init",Xm="/api/v1/users/me/accept_terms",wl="/api/v1/analytics_events",ef="/api/v1/custom_jwt_account/authenticate",tf="/api/v1/plugins/moonpay_on_ramp/sign",rf="/api/v1/funding/coinbase_on_ramp/init",of="/api/v1/funding/coinbase_on_ramp/status";var zi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(ef,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){throw new Error("Unimplemented")}};var An=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(km,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Rm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw Ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{return await this.api.post(xm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},bl=class extends An{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new b("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Mm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw Ce(r)}}};var Rl=require("react-device-detect");var ap=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},El=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function sp(){try{let e="privy:__session_storage__test",t="blobby",r=new El;return r.put(e,t),r.del(e),!0}catch{return!1}}function xw(){return typeof window<"u"&&window.localStorage?new El:new ap}var X=xw();var $i=require("@ethersproject/providers");function nf(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var Tl=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var lp=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Tl(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!lp(r))return!1}return!0},xn=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Sl=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var af=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},_l=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),sf=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Wt=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},cp=e=>new Promise(t=>setTimeout(t,e));function lf(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var ns=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await cp(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},Pl=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var cf=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),li=e=>typeof e=="string"?e:"0x"+e.toString(16);async function df(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of nf()){let f=Tl(m);if(!s.some(u=>u.info.name===f)){if(lp(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function Ki(e){return`eip155:${String(Number(e))}`}var pf=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);return dp(i,r,o)},dp=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new we(`No RPC url found for ${o}`);return i},uf=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new we(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Er=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new $i.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new $i.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new $i.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new $i.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new $i.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new we(`No RPC url found for ${e}`);return a},is=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var Al=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(xl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var xl={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function mf(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function ff(e,t){let r=mf(t);if(r.deepLink)return wf(r.deepLink,e);if(r.universalLink)return pp(r.universalLink,e);throw new b(`Unsupported wallet ${t.id}`)}function hf(e,t){let r=mf(t);if(r.universalLink)return pp(r.universalLink,e)}var yf="WALLETCONNECT_DEEPLINK_CHOICE";function gf(){try{localStorage.removeItem(yf)}catch{}}function vf({href:e,name:t}){try{localStorage.setItem(yf,JSON.stringify({href:e,name:t}))}catch{}}function Cf(e){return e.startsWith("http://")||e.startsWith("https://")}function wf(e,t){if(Cf(e))return pp(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function pp(e,t){if(!Cf(e))return wf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function kl(e,t){window.open(e,t,"noreferrer noopener")}var rt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var as=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");try{let t=await this.api.post(Sm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new b("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(_m,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw Ce(t)}}async _startChannelOnce(){if(!this.api)throw new b("Auth flow has no API instance");let t=await this.api.post(Tm,{token:this.captchaToken});Rl.isMobile&&!Rl.isIOS&&t.connect_uri&&kl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new b("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");let t=await this.api.get(Pm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var bf="1.76.4";var Ef="34357d3c125c2bcf2ce2bc3309d98715",Il="https://auth.privy.io",Tf=2e4,ot=1400,Ml=2500,Wl=bf;var ci="privy:token",up="privy-token",Ol="privy:refresh_token",Sf="privy-refresh-token",mp="privy:id_token",fp="privy-id-token",Ll="privy-session",ss="privy:session_transfer_token",Rw="privy:wallet",ls="privy:caid",cs=e=>`privy:cross-app:${e}`,di="privy:state_code",pi="privy:code_verifier",ui="privy:headless_oauth",Nl=e=>`${Rw}:${e}`,hp="privy:connectors",yp="privy:connections";var mi=12e4,sn=1,gp="0x1",ji=3e4,_f="https://api.moonpay.com/v1",Pf="https://api.moonpay.com/v1",Af="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",xf="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var kf="deprecated";var vp=require("jose");async function Rf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function If(e){return crypto.getRandomValues(new Uint8Array(e))}var Iw="S256",Mw="S256";function fi(){return vp.base64url.encode(If(36))}function Yi(){return fi()}async function Zi(e,t=Iw){if(t==Mw){let r=await Rf(e);return vp.base64url.encode(r)}else return e}function Mf(){let e=X.get(pi);if(!e)throw new b("Authentication error.");return e}function Dl(){return!!X.get(ui)}var Uo=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Dl();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=Mf();try{let r=await this.api.post(Um,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(pi),this.meta.headless&&X.del(ui),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=Ce(r);throw o.privyErrorCode?new b(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=X.get(pi);if(!t)throw new b("Authentication error.");try{let r=await this.api.post(Cl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(pi),r}catch(r){throw Ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initializing OAuth authentication.");let t=fi();X.put(pi,t);let r=Yi();X.put(di,r);let o=await Zi(t);this.meta.headless&&X.put(ui,!0);try{return await this.api.post(vl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw Ce(n)}}};function Cp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ds=require("react/jsx-runtime"),Ul=({style:e,...t})=>(0,ds.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,ds.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,ds.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var kn=require("react/jsx-runtime"),Fl=({style:e,...t})=>(0,kn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,kn.jsx)("g",{clipPath:"url(#clip0)",children:(0,kn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,kn.jsx)("defs",{children:(0,kn.jsx)("clipPath",{id:"clip0",children:(0,kn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var wp=require("react/jsx-runtime"),Bl=({style:e,...t})=>(0,wp.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,wp.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var Wf=require("@heroicons/react/24/outline"),Lf=require("react/jsx-runtime"),Of=({style:e})=>(0,Lf.jsx)(Wf.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var hi=require("react/jsx-runtime"),Hl=({style:e,...t})=>(0,hi.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,hi.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,hi.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,hi.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,hi.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Ut=require("react/jsx-runtime");function Gl(e){return(0,Ut.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Ut.jsxs)("defs",{children:[(0,Ut.jsxs)("linearGradient",{id:"b",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Ut.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Ut.jsxs)("linearGradient",{id:"a",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Ut.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Ut.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Ut.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var ps=require("react/jsx-runtime");function Vl({style:e,...t}){return(0,ps.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,ps.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ps.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ps.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var us=require("react/jsx-runtime");function ql(e){return(0,us.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,us.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,us.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Qi=require("react/jsx-runtime");function zl(e){return(0,Qi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Qi.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Qi.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Qi.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var bp=require("react/jsx-runtime"),$l=({style:e,...t})=>(0,bp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,bp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Nf={google:{name:"Google",component:Hl},discord:{name:"Discord",component:Fl},github:{name:"Github",component:Bl},linkedin:{name:"LinkedIn",component:Vl},twitter:{name:"Twitter",component:$l},spotify:{name:"Spotify",component:ql},instagram:{name:"Instagram",component:Gl},tiktok:{name:"Tiktok",component:zl},apple:{name:"Apple",component:Ul}},ms=e=>e in Nf?Nf[e]:{name:"Unknown",component:Of};function Df(e,t){let r={detail:"",retryable:!1},o=Cp(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=ms(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ms(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function fs(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Dl(),popupFlow:window.opener!==null&&n}}function yi(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),X.del(di),window.history.replaceState({},"",e)}var gi=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post($m,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(zm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(qm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Vm,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var Kl=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
2
2
  ${e}
3
3
 
4
4
  ${i}
@@ -9,7 +9,7 @@ Chain ID: ${t}
9
9
  Nonce: ${r}
10
10
  Issued At: ${a}
11
11
  Resources:
12
- - https://privy.io`};var ln=class{constructor(t,r,o){this.getNonceOnce=new rt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw Ce(t)}}async sign(){if(!this.client)throw new b("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new b("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new b("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new b("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Kl({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var Rn=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Nm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Om,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw Ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new b("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Wm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},jl=class extends Rn{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new b("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Dm,{oldPhoneNumber:this.meta.oldPhoneNumber,newPhoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw Ce(r)}}};var Ji=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(jm,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(Ym,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw Ce(t)}}};function Ep(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Ff(){let e;if(e=Ww(),e)return Uf(),{...e,flowType:"login-url"};if(e=Ow(),e)return Uf(),{...e,flowType:"web-app"}}function Ww(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:l,auth_date:o,hash:r}}function Ow(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash");if(!(!r||!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i}}function Uf(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var Yh=require("uuid");function oe(e){return e?new Date(e*1e3):null}function Lw(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let m={subject:r.subject,username:r.username,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(m);break;case"twitter_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(f);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(u);break;case"github_oauth":let w={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(w);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let E={subject:r.subject,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(E);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)});break;case"farcaster":let S={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(S);break;case"passkey":let R={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(R);break;case"telegram":let _={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:oe(r.first_verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(_);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function Tr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var ke=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,vi=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Yl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,Nw=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Sr=(e,t)=>ke(e)||vi(e)?!1:t==="all-users"||t==="users-without-wallets"&&!Nw(e)?.length;function _r(e){if(!e)return null;let t=Lw(e.linked_accounts),r=Tr(t,"wallet"),o=Tr(t,"email"),n=Tr(t,"phone"),i=Tr(t,"google_oauth"),a=Tr(t,"twitter_oauth"),l=Tr(t,"discord_oauth"),s=Tr(t,"github_oauth"),c=Tr(t,"spotify_oauth"),m=Tr(t,"instagram_oauth"),f=Tr(t,"tiktok_oauth"),u=Tr(t,"linkedin_oauth"),w=Tr(t,"apple_oauth"),v=Tr(t,"farcaster"),g=Tr(t,"telegram"),E=e.mfa_methods.map(({type:R,verified_at:_})=>({type:R,verifiedAt:oe(_)}));return{id:e.id,createdAt:oe(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:w&&{subject:w.subject,email:w.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:E.map(R=>R.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Ip=require("@ethersproject/address"),Vh=require("@ethersproject/bytes"),qh=y(require("eventemitter3"));var jf=y(require("@coinbase/wallet-sdk"));var hs=require("react/jsx-runtime"),cn=({style:e,...t})=>(0,hs.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,hs.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,hs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var Eo=require("@ethersproject/address"),Tp=require("@ethersproject/providers"),Kf=y(require("eventemitter3"));var Gf=y(require("eventemitter3"));var Dw=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Bf=e=>Dw.includes(e);var Hf=require("@ethersproject/logger"),In=require("@privy-io/js-sdk-core");var Xi=class extends we{constructor(){super("Wallet timeout");this.type="wallet_error"}},ea=class extends we{constructor(){super("User rejected connection");this.type="wallet_error"}},wo=e=>{if(e instanceof we)return e;if(e?.code&&e?.reason){let t=new Kt(e);return e.code===Hf.ErrorCode.ACTION_REJECTED&&(t.details=In.ProviderErrors.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Kt(e):new we("Unknown connector error",e)},io=class extends wt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Kt=class extends io{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(In.ProviderErrors).find(i=>i.eipCode===o.code);this.details=n||In.ProviderErrors.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=In.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=In.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=In.ProviderErrors.E32002_WALLET_LOCKED))}},Uw={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},dn={...Uw,...In.ProviderErrors};var ct=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Xi,r=this.rpcTimeoutDuration)=>new Promise((o,n)=>setTimeout(()=>{n(t)},r));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(r=>{this.removeListener(r.eventName,r.listener)}),this.walletProvider=t,this._subscriptions.forEach(r=>{this.walletProvider?.on(r.eventName,r.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=r||mi,this._subscriptions=[]}on(t,r){if(this.walletProvider)return this.walletProvider.on(t,r);this._subscriptions.push({eventName:t,listener:r})}async request(t){if(!this.walletProvider)throw new we(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(r=>{throw wo(r)})}},Mn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},ys=class extends Gf.default{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=Er(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=ta(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new Mn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Ie()||!this.address)throw new Mn("Disconnected",4900);return(await zf(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new Mn(`Invalid params for ${r.method}`,4200);let o;if(typeof r.params[0]=="string")o=r.params[0];else if("chainId"in r.params[0]&&typeof r.params[0].chainId=="string")o=r.params[0].chainId;else throw new Mn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Er(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Vf(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await qf(is(o))}async handleEstimateGas(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_estimateGas");delete r.params[0].gasPrice,delete r.params[0].maxFeePerGas,delete r.params[0].maxPriorityFeePerGas;let o={...r.params[0],chainId:li(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return li(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(r);case"eth_sendTransaction":return this.handleSendTransaction(r);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(r);case"personal_sign":return this.handlePersonalSign(r);case"eth_signTypedData_v4":return this.handleSignedTypedData(r);default:break}if(Bf(r.method)){let o=await Ie();if(await $f(),!o||!this.address)throw new Mn("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:o,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new Mn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Ie();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},bo=class extends ct{constructor(r){super(r,r.rpcTimeoutDuration)}},Wn=class extends ct{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Fw=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},mr=class extends Kf.default{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=Ki(r),this.walletClientType==="privy"&&X.put(Nl(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=ta(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>(0,Eo.getAddress)(l.address)===(0,Eo.getAddress)(r));return{address:(0,Eo.getAddress)(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new we("Wallet is not currently connected.");let s=this.wallets.find(w=>(0,Eo.getAddress)(w.address)===(0,Eo.getAddress)(r))?.chainId;if(!s)throw new we("Unable to determine current chainId.");let c,m;if(typeof l=="number"?(c=`0x${l.toString(16)}`,m=l):(c=l,m=Number(l)),s===Ki(c))return;let f=this.chains.find(w=>w.id===m);if(!f)throw new we(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await u()}catch(w){if(Fw(w,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&w.message?.includes("wallet_switchEthereumChain")?new we(`Rainbow does not support the chainId ${o}`):w}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new Tp.Web3Provider(new bo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new Wn(this.proxyProvider)},sign:async l=>{if(!await a())throw new we("Wallet is not currently connected.");return await this.sign(l)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await ns(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch(c){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=(0,Eo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=X.get(Nl(i));this.chains.find(m=>m.id===Number(c))||(X.del(Nl(i)),c=null),l=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let c=await ns(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${gp}`,c),l=gp}let s=Ki(l);if(!a.find(c=>(0,Eo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,Eo.getAddress)(n),s,c,this.connectorType==="embedded_imported"))}Zl(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,Eo.getAddress)(n)===(0,Eo.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new Tp.Web3Provider(new bo(this.proxyProvider)).getSigner().signMessage(r)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}};var Bw=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Hw=(e,t)=>e.makeWeb3Provider({options:t}),Sp,Ql=class extends mr{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Sp){let s=[o.id].concat(r.map(m=>m.id)),c=this.connectionOptions!=="eoaOnly"?s.filter(m=>!Bw.includes(m)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),Sp=new jf.default({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Hw(Sp,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:cn,id:"com.coinbase.wallet"}}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw wo(r)}}};var _p=require("react/jsx-runtime"),On=({...e})=>(0,_p.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,_p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var gs=class extends mr{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[li(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:On,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Pp=require("react/jsx-runtime"),ra=({style:e,...t})=>(0,Pp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Pp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var or=require("react/jsx-runtime"),oa=({style:e,...t})=>(0,or.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,or.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,or.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,or.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,or.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,or.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,or.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,or.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,or.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,or.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,or.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,or.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,or.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,or.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var vs=require("react/jsx-runtime"),Fo=({style:e,...t})=>(0,vs.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,vs.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,vs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var ia=class extends mr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw wo(r)}}},na,aa=class extends mr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";ul(this,na,void 0);this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?ip(this,na,{name:"MetaMask",icon:oa,id:"io.metamask"}):a==="phantom"&&ip(this,na,{name:"Phantom",icon:Fo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return hm(this,na)??{name:"Browser Extension",icon:ra,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw wo(r)}}};na=new WeakMap;var Gw=require("@ethersproject/address"),Vw=require("@ethersproject/providers"),Yf=require("react-device-detect");var Jl=class extends ia{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Yf.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw wo(t)}}};var Xl=class extends mr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new ct(void 0,mi);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var ec=class extends Xl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Fo,id:"phantom"}}};var la=require("@walletconnect/ethereum-provider"),Gh=require("react-device-detect");var ao=require("react");var Qf=require("react/jsx-runtime");function Zf({src:e,...t}){return(0,Qf.jsx)("img",{src:e,...t,style:{display:"none"}})}var Bo=require("react"),Nh=require("react");var fr={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:Ef,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var Jf=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let o of e.primary.slice(1))t.includes(o)?console.warn(`Duplicated login method: ${o}`):t.push(o);for(let o of e.overflow??[])!t.includes(o)&&!r.includes(o)?r.push(o):console.warn(`Duplicated login method: ${o}`);return{primary:t,overflow:r}};var qw=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),Xf=e=>qw.has(e),eh=(e,t,r)=>r.indexOf(e)===t,th=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Xf).filter(eh):e?e.filter(Xf).filter(eh):fr.appearance.walletList;var rh={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var oh={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var nh={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var ih={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var ah={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var sh={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var lh={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var ch={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var dh={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var ph={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var uh={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var mh={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}};var fh={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var hh={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}};var yh={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var gh={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var vh={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var Ch={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var wh={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}};var tc={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var bh={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var Eh={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var Th={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var Sh={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var _h={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var Ph={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}};var Ah={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var xh={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var kh={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var Rh={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var Ih={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var sa=[rh,oh,nh,yh,xh,tc,bh,Eh,Th,Sh,_h,ph,uh,mh,fh,sh,lh,ch,dh,wh,vh,Ch,ih,ah,kh,Ih,Rh,gh,Ph,hh,Ah],mS=new Set(sa.map(e=>e.id));var Ln=y(require("tinycolor2")),Mh="#FFFFFF",zw="#040217",$w=Mh,Kw="#1E1E1D";function jw(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}function To(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Ln.default)({...e.toHsl(),l:r})}var Yw="#51BA81",Zw="#FFB74D",Qw="#EC6351",Jw=Mh,Xw=zw;function Wh({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=$w;break;case"dark":r=Kw;break;default:r=e;break}let o=(0,Ln.default)(r),n=(0,Ln.default)(t),i=(0,Ln.default)(Yw),a=(0,Ln.default)(Zw),l=(0,Ln.default)(Qw),s=jw(o.getLuminance()),c=To(o,s==="light"?-.04:.11),m=To(o,s==="light"?-.88:.87),f=To(o,s==="light"?-.7:.75),u=To(o,s==="light"?-.43:.45).desaturate(s==="light"?60:20),w=To(o,s==="light"?-.08:.25).desaturate(s==="light"?60:20),v=To(n,.15),g=To(n,-.06),E=To(l,.3),S=To(a,.3),R=(0,Ln.default)(n.getLuminance()>.5?Xw:Jw),_=To(i,-.16),k=To(i,.4);return{colorScheme:s,background:o.toHslString(),background2:c.toHslString(),foreground:m.toHslString(),foreground2:f.toHslString(),foreground3:u.toHslString(),foreground4:w.toHslString(),accent:n.toHslString(),accentLight:v.toHslString(),accentDark:g.toHslString(),foregroundAccent:R.toHslString(),success:i.toHslString(),successDark:_.toHslString(),successLight:k.toHslString(),error:l.toHslString(),errorLight:E.toHslString(),warn:a.toHslString(),warnLight:S.toHslString()}}function Ap(e,t,r){let o=r?console.warn:()=>{},n,i,a,l,s,c,m,f,u,w,v,g,E,S,R;t?.loginMethods?(n=t.loginMethods.includes("email"),i=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),s=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),m=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),w=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),v=t.loginMethods.includes("linkedin"),E=t.loginMethods.includes("apple"),S=t.loginMethods.includes("farcaster"),R=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,l=e.walletAuth,s=e.googleOAuth,c=e.twitterOAuth,m=e.discordOAuth,g=e.githubOAuth,u=e.spotifyOAuth,w=e.instagramOAuth,f=e.tiktokOAuth,v=e.linkedinOAuth,E=e.appleOAuth,S=e.farcasterAuth,R=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let _=[n,i].filter(Boolean),k=[s,c,m,g,u,w,f,v,E,S,R].filter(Boolean),I=[l].filter(Boolean);if(_.length+k.length+I.length===0)throw new Error("You must enable at least one login method");let M=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;M&&I.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),M=!1):!M&&k.length+_.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),M=!0);let U=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=th({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=Jf({input:t?.loginMethodsAndOrder}),Z=t?.intl?.defaultCountry??"US",{chains:L,defaultChain:F}=e4({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),O=!!t?.defaultChain,Me=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,je,Q=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?Me?je=t?.embeddedWallets?.noPromptOnSignature??!0:je=t?.embeddedWallets?.noPromptOnSignature??Q:je=Q,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&je!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:re,...ie}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??fr.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:Wh({backgroundTheme:t?.appearance?.theme??fr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??fr.appearance.accentColor}),loginGroupPriority:M?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:G},loginMethods:{wallet:l,email:n,sms:i,passkey:a,google:s,twitter:c,discord:m,github:g,spotify:u,instagram:w,tiktok:f,linkedin:v,apple:E,farcaster:S,telegram:R},loginMethodsAndOrder:Y,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??fr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??fr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??fr.rpcConfig.rpcTimeouts},chains:L,defaultChain:F,intl:{defaultCountry:Z},shouldEnforceDefaultChainOnConnect:O,captchaEnabled:e.captchaEnabled??fr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??fr.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U}},embeddedWallets:{...e.embeddedWalletConfig,...typeof re=="boolean"?{requireUserOwnedRecoveryOnCreate:re}:{},...Me?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...ie,noPromptOnSignature:je},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:Me?{enabled:!0,...t.customAuth}:void 0,loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??fr._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??fr.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??fr.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??fr.fundingMethodConfig.moonpay.useSandbox}}}}function Oh(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:i,...a}=e;return{...a,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function e4({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&o&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map(s=>s.rpcUrls.privyWalletOverride?s:sa.find(m=>m.id===s.id)??s)}else n=sa.concat(e??[]);let i=t?n[0]:tc,a=r??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var Lh=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,i;n<e.length;n++)i=e.charCodeAt(n),r=Math.imul(r^i,2654435761),o=Math.imul(o^i,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var Fh=require("react/jsx-runtime"),Dh={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},xp=Ap(Dh,void 0,!1),kp=(0,Nh.createContext)({appConfig:xp,isServerConfigLoaded:!1}),Uh=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=(0,Bo.useState)(null),a=(0,Bo.useMemo)(()=>Ap(n??Dh,o,!!n),[n,o]);return(0,Bo.useEffect)(()=>{if(!n)return;let l=Oh(o,t),s=Lh(JSON.stringify(l)).toString(),c=`privy:sent:${n.id}:${s}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:l}),localStorage.setItem(c,"t"))},[o,t,n]),(0,Bo.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,Fh.jsx)(kp.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},dt=()=>{let{appConfig:e}=(0,Bo.useContext)(kp);return e},rc=()=>{let{isServerConfigLoaded:e}=(0,Bo.useContext)(kp);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var oc=require("react/jsx-runtime"),Bh=(0,ao.createContext)({ready:!1,app:xp,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),t4=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Hh=e=>{let t=dt(),r=e.authenticated,[o,n]=(0,ao.useState)(e.initialScreen);(0,ao.useEffect)(()=>{!r&&!t4.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=(0,ao.useRef)(null);(0,ao.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,ao.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,oc.jsxs)(Bh.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,oc.jsx)(Zf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},P=()=>(0,ao.useContext)(Bh);var pn=require("react/jsx-runtime"),Cs=({style:e,...t})=>{let{app:r}=P();return(0,pn.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,pn.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,pn.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,pn.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,pn.jsx)("defs",{children:(0,pn.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,pn.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var So=class extends mr{constructor(r,o,n,i,a,l,s,c){super(c||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=xl[c],this.walletClientType=c)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=Al(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:oa,id:"io.metamask"}:{name:cf(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Cs,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=xl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,gf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new ea)};this.onQrModalClosed=n,(async()=>{let a="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(a=l[0]),!a||a==="")throw new we("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=Al(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=ta(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(wo(a));return}o(new we("Unknown error during connection"))}).finally(()=>this.modal?.closeModal())})}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let a of this.chains){let l=pf(a.id,this.chains,this.rpcConfig,this.privyAppId);l&&(r[a.id]=l)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await la.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:la.OPTIONAL_EVENTS,optionalMethods:la.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),Gh.isMobile&&this.walletEntry){let{redirect:l,href:s}=ff(a,this.walletEntry);vf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let c=hf(a,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),kl(l,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=Al(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var Mp=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,Vh.isHexString)(o)).map(o=>(0,Ip.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},ta=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||mi:mi,ca=class extends qh.default{constructor(r,o,n,i,a,l,s,c,m,f,u){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new ct:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=m,this.privyAppName=f,this.privyAppLogo=u,this.storedConnections=Rp()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return r.has(a)?!1:(r.add(a),!0)}),n=o.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;X.get(hp)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(hp));let r=df(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!xn()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new ys(r,o,this.rpcConfig,this.chains,i,n.id),s=new gs(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new ys(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,c=new gs(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(c)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Rp(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Rp(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof So&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Jl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new aa(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new aa(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new aa(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new ia(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Ql(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new ec(this.defaultChain):new So(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));X.put(yp,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Ip.getAddress)(r),this.emit("walletsUpdated")}};function Zl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var r4=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Rp=()=>{let e=X.get(yp);return e&&Array.isArray(e)&&e.map(o=>r4(o)).every(Boolean)?e:[]};var zh=require("ofetch");var o4=[hl,gl,yl,wl],nc=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Wl,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=zh.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let l=new Headers(a.headers);l.set("privy-app-id",this.appId),this.appClientId&&l.set("privy-client-id",this.appClientId),l.set("privy-ca-id",this.clientAnalyticsId||""),l.set("privy-client",`react-auth:${this.sdkVersion}`);let s=o4.includes(i.toString());if(!l.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:s});c!==null&&l.set("authorization",`Bearer ${c}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new ml}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw Ce(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw Ce(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw Ce(o)}}};var $h=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var un=y(require("js-cookie"));function Kh(e){return e instanceof An?"email":e instanceof Rn?"sms":e instanceof ln?"siwe":e instanceof zi?"custom_auth":e instanceof Uo?e.meta.provider:null}var jh=y(require("jose")),so=class{static parse(t){try{return new so(t)}catch{return null}}constructor(t){this.value=t,this._decoded=jh.decodeJwt(t)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(t=0){let r=Date.now(),o=(this.expiration-t)*1e3;return r>=o}};var n4=30,ic=class{constructor(){this.authenticateOnce=new rt(async t=>this._authenticate(t)),this.linkOnce=new rt(async t=>this._link(t)),this.refreshOnce=new rt(this._refresh.bind(this)),this.destroyOnce=new rt(this._destroy.bind(this)),this.forkSessionOnce=new rt(this._forkSession.bind(this))}get token(){try{let t=X.get(ci);return typeof t=="string"?new so(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(Ol);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(ss);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(cs(t));if(typeof r=="string"){let o=new so(r);return o.isExpired()?(X.del(cs(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=un.default.get(Ll);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==kf}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=so.parse(this.token);return t!==null&&!t.isExpired(n4)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(t,r){typeof r=="string"?X.put(cs(t),r):X.del(cs(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:i}=r;this.handleTokenResponse(r);let a=i,l=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0,s=Kh(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:_r(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),bt(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:_r(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),bt(r)}}async _refresh(){if(!this.api)throw new b("Session has no API instance");if(!this.client)throw new b("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(t&&r||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(hl,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(gl,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),_r(n.user)}catch(n){if(n instanceof pr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw bt(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&(this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token))}async _destroy(){try{await this.api?.post(yl,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new b("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(vm,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw bt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(ci);if(X.put(ci,t),!this.client?.useServerCookies){let o=so.parse(t)?.expiration;un.default.set(up,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(ci),un.default.remove(up),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put(Ol,t),this.client?.useServerCookies||un.default.set(Ll,"t",{sameSite:"Strict",secure:!0,expires:30})):(X.del(Ol),un.default.remove(Sf),un.default.remove(Ll))}storeIdentityToken(t){if(this.client?.useServerCookies)return;X.put(mp,t);let r=so.parse(t)?.expiration;un.default.set(fp,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){X.del(mp),un.default.remove(fp)}clearForkedToken(){X.del(ss)}};var Wp,ac,Zh,da=class{constructor(t){ul(this,ac);this.apiUrl=t.apiUrl||Il,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||Tf,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=ym(this,ac,Zh).call(this),Wp||(Wp=new ic),this.session=Wp,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:c}){this.connectors||(this.connectors=new ca(this.appId,t,r,o,n,i,a,l,s,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new nc({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new b("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new b("No auth flow in progress.");let{oAuthTokens:t}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:t}}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(Qm,{action:"verify"})}catch(t){throw Ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Jm,{});return $h(t.options)}catch(t){throw Ce(t)}}async acceptTerms(){try{let t=await this.api.post(Xm,{});return _r(t)}catch(t){throw bt(t)}}async unlinkEmail(t){try{let r=await this.api.post(Im,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPhone(t){try{let r=await this.api.post(Lm,{phoneNumber:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkWallet(t){try{let r=await this.api.post(Em,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Fm,{provider:t,subject:r});return await this.getAuthenticatedUser()??_r(o)}catch(o){throw bt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Am,{fid:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Zm,{telegram_user_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Km,{credential_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async createAnalyticsEvent({eventName:t,payload:r,timestamp:o,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(wl,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(tf,t)}catch(r){throw bt(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(rf,t)}catch(r){throw bt(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${of}?partnerUserId=${t}`)}catch(r){throw bt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?so.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0,i=o.funding_config?{methods:o.funding_config.methods,defaultRecommendedAmount:o.funding_config.default_recommended_amount,defaultRecommendedCurrency:o.funding_config.default_recommended_currency,promptFundingOnWalletCreation:o.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,twitterOAuthOnMobileEnabled:o.twitter_oauth_on_mobile_enabled,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(t){throw bt(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(Cm,{address:t,token:r})).nonce}catch(o){throw bt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(wm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(bm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i});return _r(a)}catch(a){throw bt(a)}}};ac=new WeakSet,Zh=function(){if(typeof window>"u")return null;try{let r=X.get(ls);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,Yh.v4)();try{return X.put(ls,t),t}catch{return t}};var ey=require("@marsidev/react-turnstile"),sc=require("react");var lo=require("react");var Xh=require("react/jsx-runtime"),Qh=(0,lo.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:T,setError:T,setExecuting:T,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:T,reset:T,execute:T}),Dr=class extends wt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Jh=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,lo.useRef)(null),[i,a]=(0,lo.useState)(),[l,s]=(0,lo.useState)(),[c,m]=(0,lo.useState)(!1),f=(0,lo.useMemo)(()=>o?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,c]);return(0,Xh.jsx)(Qh.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:m,remove(){o&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){o&&(m(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await lf(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Dr("Captcha failed",null,"captcha_timeout")}}},children:e})},We=()=>(0,lo.useContext)(Qh);var Op=require("react/jsx-runtime"),lc=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=We(),[,s]=(0,sc.useMemo)(()=>r?.split("t:")||[],[r]);if((0,sc.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Op.jsx)("div",{className:"hidden h-0 w-0",children:(0,Op.jsx)(ey.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var Pn=require("react"),Xu=y(require("styled-components"));var cc=require("react");var Lp=(0,cc.createContext)({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,initUpdatePhone:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,crossAppAuthFlow:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,recoverEmbeddedEthereumWallet:T,getMoonpaySignedUrl:T,initCoinbaseOnRamp:T,getCoinbaseOnRampStatus:T,updateWallets:T,fundWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T,generateSiweMessage:T,linkWithSiwe:T,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:T,recoverEmbeddedSolanaWallet:T,solanaSignMessage:T}),W=()=>(0,cc.useContext)(Lp);var dc=require("react");var Ue=(0,dc.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,linkCrossAppAccount:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,updatePhone:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkCrossAppAccount:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,importWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,initLoginWithEmail:T,initLoginWithSms:T,otpState:{status:"initial"},loginWithCode:T,fundWallet:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,generateSiweMessage:T,linkWithSiwe:T,signMessageWithCrossAppWallet:T,signTypedDataWithCrossAppWallet:T,sendTransactionWithCrossAppWallet:T,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),z=()=>(0,dc.useContext)(Ue);var pc=require("react"),ty=e=>{let[t,r]=(0,pc.useState)("auto");return(0,pc.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var pa=require("react"),ry={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]}},Np=(0,pa.createContext)(void 0),oy=()=>(0,pa.useContext)(Np);function He(e,t){if(!t)return;let o=oy().current[e];return(0,pa.useEffect)(()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(a=>a!==i)}},[t])}function B(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function ua(){let e=oy();return(t,r,...o)=>B(e,t,r,...o)}function uc(e){He("configureMfa",e)}var my=require("@heroicons/react/24/outline"),Fp=y(require("styled-components"));var _o=y(require("styled-components"));var mc=y(require("styled-components")),Nn=require("react/jsx-runtime"),At=({success:e,fail:t})=>(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(xt,{className:e?"success":t?"fail":""}),(0,Nn.jsx)(ws,{className:e?"success":t?"fail":""})]}),xt=mc.default.span`
12
+ - https://privy.io`};var ln=class{constructor(t,r,o){this.getNonceOnce=new rt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw Ce(t)}}async sign(){if(!this.client)throw new b("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new b("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new b("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new b("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Kl({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var Rn=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Nm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Om,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw Ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new b("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Wm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},jl=class extends Rn{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new b("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Dm,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw Ce(r)}}};var Ji=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(jm,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(Ym,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw Ce(t)}}};function Ep(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Ff(){let e;if(e=Ww(),e)return Uf(),{...e,flowType:"login-url"};if(e=Ow(),e)return Uf(),{...e,flowType:"web-app"}}function Ww(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:l,auth_date:o,hash:r}}function Ow(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash");if(!(!r||!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i}}function Uf(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var Yh=require("uuid");function oe(e){return e?new Date(e*1e3):null}function Lw(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let m={subject:r.subject,username:r.username,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(m);break;case"twitter_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(f);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(u);break;case"github_oauth":let w={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(w);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let E={subject:r.subject,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(E);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)});break;case"farcaster":let S={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(S);break;case"passkey":let R={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(R);break;case"telegram":let _={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:oe(r.first_verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(_);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function Tr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var ke=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,vi=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Yl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,Nw=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Sr=(e,t)=>ke(e)||vi(e)?!1:t==="all-users"||t==="users-without-wallets"&&!Nw(e)?.length;function _r(e){if(!e)return null;let t=Lw(e.linked_accounts),r=Tr(t,"wallet"),o=Tr(t,"email"),n=Tr(t,"phone"),i=Tr(t,"google_oauth"),a=Tr(t,"twitter_oauth"),l=Tr(t,"discord_oauth"),s=Tr(t,"github_oauth"),c=Tr(t,"spotify_oauth"),m=Tr(t,"instagram_oauth"),f=Tr(t,"tiktok_oauth"),u=Tr(t,"linkedin_oauth"),w=Tr(t,"apple_oauth"),v=Tr(t,"farcaster"),g=Tr(t,"telegram"),E=e.mfa_methods.map(({type:R,verified_at:_})=>({type:R,verifiedAt:oe(_)}));return{id:e.id,createdAt:oe(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:w&&{subject:w.subject,email:w.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:E.map(R=>R.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Ip=require("@ethersproject/address"),Vh=require("@ethersproject/bytes"),qh=y(require("eventemitter3"));var jf=y(require("@coinbase/wallet-sdk"));var hs=require("react/jsx-runtime"),cn=({style:e,...t})=>(0,hs.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,hs.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,hs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var Eo=require("@ethersproject/address"),Tp=require("@ethersproject/providers"),Kf=y(require("eventemitter3"));var Gf=y(require("eventemitter3"));var Dw=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Bf=e=>Dw.includes(e);var Hf=require("@ethersproject/logger"),In=require("@privy-io/js-sdk-core");var Xi=class extends we{constructor(){super("Wallet timeout");this.type="wallet_error"}},ea=class extends we{constructor(){super("User rejected connection");this.type="wallet_error"}},wo=e=>{if(e instanceof we)return e;if(e?.code&&e?.reason){let t=new Kt(e);return e.code===Hf.ErrorCode.ACTION_REJECTED&&(t.details=In.ProviderErrors.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Kt(e):new we("Unknown connector error",e)},io=class extends wt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Kt=class extends io{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(In.ProviderErrors).find(i=>i.eipCode===o.code);this.details=n||In.ProviderErrors.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=In.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=In.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=In.ProviderErrors.E32002_WALLET_LOCKED))}},Uw={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},dn={...Uw,...In.ProviderErrors};var ct=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Xi,r=this.rpcTimeoutDuration)=>new Promise((o,n)=>setTimeout(()=>{n(t)},r));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(r=>{this.removeListener(r.eventName,r.listener)}),this.walletProvider=t,this._subscriptions.forEach(r=>{this.walletProvider?.on(r.eventName,r.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=r||mi,this._subscriptions=[]}on(t,r){if(this.walletProvider)return this.walletProvider.on(t,r);this._subscriptions.push({eventName:t,listener:r})}async request(t){if(!this.walletProvider)throw new we(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(r=>{throw wo(r)})}},Mn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},ys=class extends Gf.default{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=Er(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=ta(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new Mn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Ie()||!this.address)throw new Mn("Disconnected",4900);return(await zf(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new Mn(`Invalid params for ${r.method}`,4200);let o;if(typeof r.params[0]=="string")o=r.params[0];else if("chainId"in r.params[0]&&typeof r.params[0].chainId=="string")o=r.params[0].chainId;else throw new Mn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Er(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Vf(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await qf(is(o))}async handleEstimateGas(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_estimateGas");delete r.params[0].gasPrice,delete r.params[0].maxFeePerGas,delete r.params[0].maxPriorityFeePerGas;let o={...r.params[0],chainId:li(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return li(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(r);case"eth_sendTransaction":return this.handleSendTransaction(r);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(r);case"personal_sign":return this.handlePersonalSign(r);case"eth_signTypedData_v4":return this.handleSignedTypedData(r);default:break}if(Bf(r.method)){let o=await Ie();if(await $f(),!o||!this.address)throw new Mn("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:o,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new Mn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Ie();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},bo=class extends ct{constructor(r){super(r,r.rpcTimeoutDuration)}},Wn=class extends ct{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Fw=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},mr=class extends Kf.default{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=Ki(r),this.walletClientType==="privy"&&X.put(Nl(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=ta(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>(0,Eo.getAddress)(l.address)===(0,Eo.getAddress)(r));return{address:(0,Eo.getAddress)(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new we("Wallet is not currently connected.");let s=this.wallets.find(w=>(0,Eo.getAddress)(w.address)===(0,Eo.getAddress)(r))?.chainId;if(!s)throw new we("Unable to determine current chainId.");let c,m;if(typeof l=="number"?(c=`0x${l.toString(16)}`,m=l):(c=l,m=Number(l)),s===Ki(c))return;let f=this.chains.find(w=>w.id===m);if(!f)throw new we(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await u()}catch(w){if(Fw(w,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&w.message?.includes("wallet_switchEthereumChain")?new we(`Rainbow does not support the chainId ${o}`):w}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new Tp.Web3Provider(new bo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new Wn(this.proxyProvider)},sign:async l=>{if(!await a())throw new we("Wallet is not currently connected.");return await this.sign(l)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await ns(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch(c){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=(0,Eo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=X.get(Nl(i));this.chains.find(m=>m.id===Number(c))||(X.del(Nl(i)),c=null),l=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let c=await ns(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${gp}`,c),l=gp}let s=Ki(l);if(!a.find(c=>(0,Eo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,Eo.getAddress)(n),s,c,this.connectorType==="embedded_imported"))}Zl(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,Eo.getAddress)(n)===(0,Eo.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new Tp.Web3Provider(new bo(this.proxyProvider)).getSigner().signMessage(r)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}};var Bw=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Hw=(e,t)=>e.makeWeb3Provider({options:t}),Sp,Ql=class extends mr{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Sp){let s=[o.id].concat(r.map(m=>m.id)),c=this.connectionOptions!=="eoaOnly"?s.filter(m=>!Bw.includes(m)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),Sp=new jf.default({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Hw(Sp,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:cn,id:"com.coinbase.wallet"}}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw wo(r)}}};var _p=require("react/jsx-runtime"),On=({...e})=>(0,_p.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,_p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var gs=class extends mr{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[li(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:On,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Pp=require("react/jsx-runtime"),ra=({style:e,...t})=>(0,Pp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Pp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var or=require("react/jsx-runtime"),oa=({style:e,...t})=>(0,or.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,or.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,or.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,or.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,or.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,or.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,or.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,or.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,or.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,or.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,or.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,or.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,or.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,or.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var vs=require("react/jsx-runtime"),Fo=({style:e,...t})=>(0,vs.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,vs.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,vs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var ia=class extends mr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw wo(r)}}},na,aa=class extends mr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";ul(this,na,void 0);this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?ip(this,na,{name:"MetaMask",icon:oa,id:"io.metamask"}):a==="phantom"&&ip(this,na,{name:"Phantom",icon:Fo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return hm(this,na)??{name:"Browser Extension",icon:ra,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw wo(r)}}};na=new WeakMap;var Gw=require("@ethersproject/address"),Vw=require("@ethersproject/providers"),Yf=require("react-device-detect");var Jl=class extends ia{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Yf.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw wo(t)}}};var Xl=class extends mr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new ct(void 0,mi);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var ec=class extends Xl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Fo,id:"phantom"}}};var la=require("@walletconnect/ethereum-provider"),Gh=require("react-device-detect");var ao=require("react");var Qf=require("react/jsx-runtime");function Zf({src:e,...t}){return(0,Qf.jsx)("img",{src:e,...t,style:{display:"none"}})}var Bo=require("react"),Nh=require("react");var fr={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:Ef,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var Jf=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let o of e.primary.slice(1))t.includes(o)?console.warn(`Duplicated login method: ${o}`):t.push(o);for(let o of e.overflow??[])!t.includes(o)&&!r.includes(o)?r.push(o):console.warn(`Duplicated login method: ${o}`);return{primary:t,overflow:r}};var qw=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),Xf=e=>qw.has(e),eh=(e,t,r)=>r.indexOf(e)===t,th=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Xf).filter(eh):e?e.filter(Xf).filter(eh):fr.appearance.walletList;var rh={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var oh={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var nh={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var ih={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var ah={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var sh={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var lh={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var ch={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var dh={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var ph={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var uh={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var mh={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}};var fh={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var hh={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}};var yh={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var gh={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var vh={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var Ch={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var wh={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}};var tc={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var bh={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var Eh={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var Th={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var Sh={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var _h={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var Ph={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}};var Ah={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var xh={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var kh={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var Rh={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var Ih={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var sa=[rh,oh,nh,yh,xh,tc,bh,Eh,Th,Sh,_h,ph,uh,mh,fh,sh,lh,ch,dh,wh,vh,Ch,ih,ah,kh,Ih,Rh,gh,Ph,hh,Ah],mS=new Set(sa.map(e=>e.id));var Ln=y(require("tinycolor2")),Mh="#FFFFFF",zw="#040217",$w=Mh,Kw="#1E1E1D";function jw(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}function To(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Ln.default)({...e.toHsl(),l:r})}var Yw="#51BA81",Zw="#FFB74D",Qw="#EC6351",Jw=Mh,Xw=zw;function Wh({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=$w;break;case"dark":r=Kw;break;default:r=e;break}let o=(0,Ln.default)(r),n=(0,Ln.default)(t),i=(0,Ln.default)(Yw),a=(0,Ln.default)(Zw),l=(0,Ln.default)(Qw),s=jw(o.getLuminance()),c=To(o,s==="light"?-.04:.11),m=To(o,s==="light"?-.88:.87),f=To(o,s==="light"?-.7:.75),u=To(o,s==="light"?-.43:.45).desaturate(s==="light"?60:20),w=To(o,s==="light"?-.08:.25).desaturate(s==="light"?60:20),v=To(n,.15),g=To(n,-.06),E=To(l,.3),S=To(a,.3),R=(0,Ln.default)(n.getLuminance()>.5?Xw:Jw),_=To(i,-.16),k=To(i,.4);return{colorScheme:s,background:o.toHslString(),background2:c.toHslString(),foreground:m.toHslString(),foreground2:f.toHslString(),foreground3:u.toHslString(),foreground4:w.toHslString(),accent:n.toHslString(),accentLight:v.toHslString(),accentDark:g.toHslString(),foregroundAccent:R.toHslString(),success:i.toHslString(),successDark:_.toHslString(),successLight:k.toHslString(),error:l.toHslString(),errorLight:E.toHslString(),warn:a.toHslString(),warnLight:S.toHslString()}}function Ap(e,t,r){let o=r?console.warn:()=>{},n,i,a,l,s,c,m,f,u,w,v,g,E,S,R;t?.loginMethods?(n=t.loginMethods.includes("email"),i=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),s=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),m=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),w=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),v=t.loginMethods.includes("linkedin"),E=t.loginMethods.includes("apple"),S=t.loginMethods.includes("farcaster"),R=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,l=e.walletAuth,s=e.googleOAuth,c=e.twitterOAuth,m=e.discordOAuth,g=e.githubOAuth,u=e.spotifyOAuth,w=e.instagramOAuth,f=e.tiktokOAuth,v=e.linkedinOAuth,E=e.appleOAuth,S=e.farcasterAuth,R=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let _=[n,i].filter(Boolean),k=[s,c,m,g,u,w,f,v,E,S,R].filter(Boolean),I=[l].filter(Boolean);if(_.length+k.length+I.length===0)throw new Error("You must enable at least one login method");let M=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;M&&I.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),M=!1):!M&&k.length+_.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),M=!0);let U=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=th({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=Jf({input:t?.loginMethodsAndOrder}),Z=t?.intl?.defaultCountry??"US",{chains:L,defaultChain:F}=e4({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),O=!!t?.defaultChain,Me=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,je,Q=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?Me?je=t?.embeddedWallets?.noPromptOnSignature??!0:je=t?.embeddedWallets?.noPromptOnSignature??Q:je=Q,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&je!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:re,...ie}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??fr.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:Wh({backgroundTheme:t?.appearance?.theme??fr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??fr.appearance.accentColor}),loginGroupPriority:M?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:G},loginMethods:{wallet:l,email:n,sms:i,passkey:a,google:s,twitter:c,discord:m,github:g,spotify:u,instagram:w,tiktok:f,linkedin:v,apple:E,farcaster:S,telegram:R},loginMethodsAndOrder:Y,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??fr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??fr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??fr.rpcConfig.rpcTimeouts},chains:L,defaultChain:F,intl:{defaultCountry:Z},shouldEnforceDefaultChainOnConnect:O,captchaEnabled:e.captchaEnabled??fr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??fr.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U}},embeddedWallets:{...e.embeddedWalletConfig,...typeof re=="boolean"?{requireUserOwnedRecoveryOnCreate:re}:{},...Me?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...ie,noPromptOnSignature:je},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:Me?{enabled:!0,...t.customAuth}:void 0,loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??fr._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??fr.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??fr.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??fr.fundingMethodConfig.moonpay.useSandbox}}}}function Oh(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:i,...a}=e;return{...a,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function e4({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&o&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map(s=>s.rpcUrls.privyWalletOverride?s:sa.find(m=>m.id===s.id)??s)}else n=sa.concat(e??[]);let i=t?n[0]:tc,a=r??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var Lh=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,i;n<e.length;n++)i=e.charCodeAt(n),r=Math.imul(r^i,2654435761),o=Math.imul(o^i,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var Fh=require("react/jsx-runtime"),Dh={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},xp=Ap(Dh,void 0,!1),kp=(0,Nh.createContext)({appConfig:xp,isServerConfigLoaded:!1}),Uh=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=(0,Bo.useState)(null),a=(0,Bo.useMemo)(()=>Ap(n??Dh,o,!!n),[n,o]);return(0,Bo.useEffect)(()=>{if(!n)return;let l=Oh(o,t),s=Lh(JSON.stringify(l)).toString(),c=`privy:sent:${n.id}:${s}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:l}),localStorage.setItem(c,"t"))},[o,t,n]),(0,Bo.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,Fh.jsx)(kp.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},dt=()=>{let{appConfig:e}=(0,Bo.useContext)(kp);return e},rc=()=>{let{isServerConfigLoaded:e}=(0,Bo.useContext)(kp);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var oc=require("react/jsx-runtime"),Bh=(0,ao.createContext)({ready:!1,app:xp,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),t4=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Hh=e=>{let t=dt(),r=e.authenticated,[o,n]=(0,ao.useState)(e.initialScreen);(0,ao.useEffect)(()=>{!r&&!t4.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=(0,ao.useRef)(null);(0,ao.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,ao.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,oc.jsxs)(Bh.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,oc.jsx)(Zf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},P=()=>(0,ao.useContext)(Bh);var pn=require("react/jsx-runtime"),Cs=({style:e,...t})=>{let{app:r}=P();return(0,pn.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,pn.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,pn.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,pn.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,pn.jsx)("defs",{children:(0,pn.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,pn.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var So=class extends mr{constructor(r,o,n,i,a,l,s,c){super(c||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=xl[c],this.walletClientType=c)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=Al(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:oa,id:"io.metamask"}:{name:cf(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Cs,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=xl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,gf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new ea)};this.onQrModalClosed=n,(async()=>{let a="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(a=l[0]),!a||a==="")throw new we("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=Al(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=ta(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(wo(a));return}o(new we("Unknown error during connection"))}).finally(()=>this.modal?.closeModal())})}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let a of this.chains){let l=pf(a.id,this.chains,this.rpcConfig,this.privyAppId);l&&(r[a.id]=l)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await la.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:la.OPTIONAL_EVENTS,optionalMethods:la.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),Gh.isMobile&&this.walletEntry){let{redirect:l,href:s}=ff(a,this.walletEntry);vf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let c=hf(a,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),kl(l,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=Al(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var Mp=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,Vh.isHexString)(o)).map(o=>(0,Ip.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},ta=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||mi:mi,ca=class extends qh.default{constructor(r,o,n,i,a,l,s,c,m,f,u){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new ct:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=m,this.privyAppName=f,this.privyAppLogo=u,this.storedConnections=Rp()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return r.has(a)?!1:(r.add(a),!0)}),n=o.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;X.get(hp)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(hp));let r=df(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!xn()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new ys(r,o,this.rpcConfig,this.chains,i,n.id),s=new gs(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new ys(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,c=new gs(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(c)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Rp(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Rp(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof So&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Jl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new aa(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new aa(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new aa(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new ia(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Ql(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new ec(this.defaultChain):new So(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));X.put(yp,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Ip.getAddress)(r),this.emit("walletsUpdated")}};function Zl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var r4=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Rp=()=>{let e=X.get(yp);return e&&Array.isArray(e)&&e.map(o=>r4(o)).every(Boolean)?e:[]};var zh=require("ofetch");var o4=[hl,gl,yl,wl],nc=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Wl,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=zh.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let l=new Headers(a.headers);l.set("privy-app-id",this.appId),this.appClientId&&l.set("privy-client-id",this.appClientId),l.set("privy-ca-id",this.clientAnalyticsId||""),l.set("privy-client",`react-auth:${this.sdkVersion}`);let s=o4.includes(i.toString());if(!l.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:s});c!==null&&l.set("authorization",`Bearer ${c}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new ml}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw Ce(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw Ce(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw Ce(o)}}};var $h=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var un=y(require("js-cookie"));function Kh(e){return e instanceof An?"email":e instanceof Rn?"sms":e instanceof ln?"siwe":e instanceof zi?"custom_auth":e instanceof Uo?e.meta.provider:null}var jh=y(require("jose")),so=class{static parse(t){try{return new so(t)}catch{return null}}constructor(t){this.value=t,this._decoded=jh.decodeJwt(t)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(t=0){let r=Date.now(),o=(this.expiration-t)*1e3;return r>=o}};var n4=30,ic=class{constructor(){this.authenticateOnce=new rt(async t=>this._authenticate(t)),this.linkOnce=new rt(async t=>this._link(t)),this.refreshOnce=new rt(this._refresh.bind(this)),this.destroyOnce=new rt(this._destroy.bind(this)),this.forkSessionOnce=new rt(this._forkSession.bind(this))}get token(){try{let t=X.get(ci);return typeof t=="string"?new so(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(Ol);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(ss);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(cs(t));if(typeof r=="string"){let o=new so(r);return o.isExpired()?(X.del(cs(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=un.default.get(Ll);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==kf}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=so.parse(this.token);return t!==null&&!t.isExpired(n4)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(t,r){typeof r=="string"?X.put(cs(t),r):X.del(cs(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:i}=r;this.handleTokenResponse(r);let a=i,l=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0,s=Kh(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:_r(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),bt(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:_r(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),bt(r)}}async _refresh(){if(!this.api)throw new b("Session has no API instance");if(!this.client)throw new b("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(t&&r||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(hl,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(gl,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),_r(n.user)}catch(n){if(n instanceof pr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw bt(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&(this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token))}async _destroy(){try{await this.api?.post(yl,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new b("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(vm,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw bt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(ci);if(X.put(ci,t),!this.client?.useServerCookies){let o=so.parse(t)?.expiration;un.default.set(up,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(ci),un.default.remove(up),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put(Ol,t),this.client?.useServerCookies||un.default.set(Ll,"t",{sameSite:"Strict",secure:!0,expires:30})):(X.del(Ol),un.default.remove(Sf),un.default.remove(Ll))}storeIdentityToken(t){if(this.client?.useServerCookies)return;X.put(mp,t);let r=so.parse(t)?.expiration;un.default.set(fp,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){X.del(mp),un.default.remove(fp)}clearForkedToken(){X.del(ss)}};var Wp,ac,Zh,da=class{constructor(t){ul(this,ac);this.apiUrl=t.apiUrl||Il,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||Tf,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=ym(this,ac,Zh).call(this),Wp||(Wp=new ic),this.session=Wp,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:c}){this.connectors||(this.connectors=new ca(this.appId,t,r,o,n,i,a,l,s,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new nc({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new b("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new b("No auth flow in progress.");let{oAuthTokens:t}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:t}}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(Qm,{action:"verify"})}catch(t){throw Ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Jm,{});return $h(t.options)}catch(t){throw Ce(t)}}async acceptTerms(){try{let t=await this.api.post(Xm,{});return _r(t)}catch(t){throw bt(t)}}async unlinkEmail(t){try{let r=await this.api.post(Im,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPhone(t){try{let r=await this.api.post(Lm,{phoneNumber:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkWallet(t){try{let r=await this.api.post(Em,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Fm,{provider:t,subject:r});return await this.getAuthenticatedUser()??_r(o)}catch(o){throw bt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Am,{fid:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Zm,{telegram_user_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Km,{credential_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async createAnalyticsEvent({eventName:t,payload:r,timestamp:o,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(wl,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(tf,t)}catch(r){throw bt(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(rf,t)}catch(r){throw bt(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${of}?partnerUserId=${t}`)}catch(r){throw bt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?so.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0,i=o.funding_config?{methods:o.funding_config.methods,defaultRecommendedAmount:o.funding_config.default_recommended_amount,defaultRecommendedCurrency:o.funding_config.default_recommended_currency,promptFundingOnWalletCreation:o.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,twitterOAuthOnMobileEnabled:o.twitter_oauth_on_mobile_enabled,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(t){throw bt(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(Cm,{address:t,token:r})).nonce}catch(o){throw bt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(wm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(bm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i});return _r(a)}catch(a){throw bt(a)}}};ac=new WeakSet,Zh=function(){if(typeof window>"u")return null;try{let r=X.get(ls);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,Yh.v4)();try{return X.put(ls,t),t}catch{return t}};var ey=require("@marsidev/react-turnstile"),sc=require("react");var lo=require("react");var Xh=require("react/jsx-runtime"),Qh=(0,lo.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:T,setError:T,setExecuting:T,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:T,reset:T,execute:T}),Dr=class extends wt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Jh=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,lo.useRef)(null),[i,a]=(0,lo.useState)(),[l,s]=(0,lo.useState)(),[c,m]=(0,lo.useState)(!1),f=(0,lo.useMemo)(()=>o?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,c]);return(0,Xh.jsx)(Qh.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:m,remove(){o&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){o&&(m(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await lf(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Dr("Captcha failed",null,"captcha_timeout")}}},children:e})},We=()=>(0,lo.useContext)(Qh);var Op=require("react/jsx-runtime"),lc=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=We(),[,s]=(0,sc.useMemo)(()=>r?.split("t:")||[],[r]);if((0,sc.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Op.jsx)("div",{className:"hidden h-0 w-0",children:(0,Op.jsx)(ey.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var Pn=require("react"),Xu=y(require("styled-components"));var cc=require("react");var Lp=(0,cc.createContext)({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,initUpdatePhone:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,crossAppAuthFlow:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,recoverEmbeddedEthereumWallet:T,getMoonpaySignedUrl:T,initCoinbaseOnRamp:T,getCoinbaseOnRampStatus:T,updateWallets:T,fundWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T,generateSiweMessage:T,linkWithSiwe:T,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:T,recoverEmbeddedSolanaWallet:T,solanaSignMessage:T}),W=()=>(0,cc.useContext)(Lp);var dc=require("react");var Ue=(0,dc.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,linkCrossAppAccount:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,updatePhone:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkCrossAppAccount:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,importWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,initLoginWithEmail:T,initLoginWithSms:T,otpState:{status:"initial"},loginWithCode:T,fundWallet:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,generateSiweMessage:T,linkWithSiwe:T,signMessageWithCrossAppWallet:T,signTypedDataWithCrossAppWallet:T,sendTransactionWithCrossAppWallet:T,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),z=()=>(0,dc.useContext)(Ue);var pc=require("react"),ty=e=>{let[t,r]=(0,pc.useState)("auto");return(0,pc.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var pa=require("react"),ry={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]}},Np=(0,pa.createContext)(void 0),oy=()=>(0,pa.useContext)(Np);function He(e,t){if(!t)return;let o=oy().current[e];return(0,pa.useEffect)(()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(a=>a!==i)}},[t])}function B(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function ua(){let e=oy();return(t,r,...o)=>B(e,t,r,...o)}function uc(e){He("configureMfa",e)}var my=require("@heroicons/react/24/outline"),Fp=y(require("styled-components"));var _o=y(require("styled-components"));var mc=y(require("styled-components")),Nn=require("react/jsx-runtime"),At=({success:e,fail:t})=>(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(xt,{className:e?"success":t?"fail":""}),(0,Nn.jsx)(ws,{className:e?"success":t?"fail":""})]}),xt=mc.default.span`
13
13
  && {
14
14
  width: 82px;
15
15
  height: 82px;