@privy-io/react-auth 1.81.0 → 1.81.2-beta-20240827151213
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/chunk-WIKDIW7V.js +118 -0
- package/dist/esm/chunk-WIKDIW7V.js +118 -0
- package/dist/esm/index.js +180 -180
- package/dist/esm/ui.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +151 -151
- package/dist/{types-ed6781aa.d.ts → types-abca3775.d.ts} +0 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +8 -8
- package/package.json +2 -2
- package/dist/chunk-5ZCXUOSH.js +0 -118
- package/dist/esm/chunk-5ZCXUOSH.js +0 -118
package/dist/esm/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{$ as In,$a as mm,A as zs,Aa as om,B as Lu,Ba as nm,C as _n,Ca as De,D as Nu,Da as Js,E as hi,Ea as dt,F as Ou,Fa as im,G as Wo,Ga as _,H as _r,Ha as Ie,I as Pa,Ia as q,J as Du,Ja as am,K as Ks,Ka as sm,L as Fu,La as lm,M as Me,Ma as ze,N as Uu,Na as D,O as Bu,Oa as vi,P as xd,Pa as Ci,Q as Mn,Qa as G,R as kd,Ra as J,S as Ys,Sa as cm,T as Hu,Ta as jt,U as Rd,Ua as dm,V as _d,Va as Pt,W as Qs,Wa as _a,X as xa,Xa as Ma,Y as ka,Ya as pm,Z as Xs,Za as um,_ as Ra,_a as wi,a as Pu,aa as Wn,ab as fm,b as Vs,ba as Ln,bb as Kr,c as Pd,ca as Zs,cb as bi,d as xu,da as Md,db as co,e as Jt,ea as Id,eb as bt,f as Rr,fa as Nn,fb as Ia,g as w,ga as Lo,gb as hm,h as ku,ha as Wd,hb as D0,i as ke,ia as yi,ib as F0,j as ce,ja as Vu,jb as U0,k as nt,ka as Gu,l as Rn,la as qu,m as fr,ma as zu,n as Ru,na as Ku,o as lo,oa as gi,p as Sa,pa as Yu,q as j,qa as Qu,r as Ko,ra as Xu,s as Gs,sa as Zu,t as _u,ta as Ju,u as qs,ua as ju,v as Mu,va as $u,w as Ft,wa as em,x as Iu,xa as tm,y as Wu,ya as Ld,z as Aa,za as rm}from"./chunk-5ZCXUOSH.js";import{getAddress as _o}from"@ethersproject/address";import{Web3Provider as wu}from"@ethersproject/providers";import{createStore as US}from"mipd";import{useEffect as io,useMemo as BS,useRef as wa,useState as ct}from"react";import{isAndroid as HS}from"react-device-detect";import{ProviderErrors as VS,calculateTotalGasEstimate as GS,populateTransactionRequest as qS}from"@privy-io/js-sdk-core";var js="/api/v1/sessions",$s="/api/v1/sessions/logout",ym="/api/v1/sessions/fork",el="/api/v1/sessions/fork/recover",gm="/api/v1/siwe/init",vm="/api/v1/siwe/authenticate",Cm="/api/v1/siwe/link",wm="/api/v1/siwe/unlink",bm="/api/v1/farcaster/init",Em="/api/v1/farcaster/authenticate",Tm="/api/v1/farcaster/link",Sm="/api/v1/farcaster/status",Am="/api/v1/farcaster/unlink",Pm="/api/v1/passwordless/init",xm="/api/v1/passwordless/authenticate",km="/api/v1/passwordless/link",Rm="/api/v1/passwordless/unlink",_m="/api/v1/passwordless/update",Mm="/api/v1/passwordless_sms/init",Im="/api/v1/passwordless_sms/link",Wm="/api/v1/passwordless_sms/unlink",Lm="/api/v1/passwordless_sms/authenticate",Nm="/api/v1/passwordless_sms/update",tl="/api/v1/oauth/init",Om="/api/v1/oauth/authenticate",rl="/api/v1/oauth/link",Dm="/api/v1/oauth/unlink",Fm="/api/v1/recovery/oauth/init",Um="/api/v1/recovery/oauth/init_icloud",Bm="/api/v1/recovery/oauth/authenticate",Hm="/api/v1/passkeys/link/init",Vm="/api/v1/passkeys/authenticate/init",Gm="/api/v1/passkeys/link",qm="/api/v1/passkeys/authenticate",zm="/api/v1/passkeys/unlink",Km="/api/v1/telegram/authenticate",Ym="/api/v1/telegram/link",Qm="/api/v1/telegram/unlink";var Xm="/api/v1/mfa/passwordless_sms/init",Zm="/api/v1/mfa/passkeys/init",Jm="/api/v1/users/me/accept_terms",ol="/api/v1/analytics_events",jm="/api/v1/custom_jwt_account/authenticate",$m="/api/v1/guest/authenticate",ef="/api/v1/plugins/moonpay_on_ramp/sign",tf="/api/v1/funding/coinbase_on_ramp/init",rf="/api/v1/funding/coinbase_on_ramp/status";var Ei=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(jm,{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 Yo=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(xm,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(km,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{return await this.api.post(Pm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ce(o)}}},nl=class extends Yo{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new w("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(_m,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ce(r)}}};import{isMobile as B0,isIOS as H0}from"react-device-detect";var il=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(al))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var al={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function of(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function nf(e,t){let r=of(t);if(r.deepLink)return pf(r.deepLink,e);if(r.universalLink)return Nd(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function af(e,t){let r=of(t);if(r.universalLink)return Nd(r.universalLink,e)}var sf="WALLETCONNECT_DEEPLINK_CHOICE";function lf(){try{localStorage.removeItem(sf)}catch{}}function cf({href:e,name:t}){try{localStorage.setItem(sf,JSON.stringify({href:e,name:t}))}catch{}}function df(e){return e.startsWith("http://")||e.startsWith("https://")}function pf(e,t){if(df(e))return Nd(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 Nd(e,t){if(!df(e))return pf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function sl(e,t){window.open(e,t,"noreferrer noopener")}var Ke=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 Wa=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Ke(this._startChannelOnce.bind(this)),this.pollForReady=new Ke(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");try{let t=await this.api.post(Em,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new w("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Tm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ce(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(bm,{token:this.captchaToken});B0&&!H0&&t.connect_uri&&sl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new w("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");let t=await this.api.get(Sm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as mf}from"jose";async function uf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function La(e){return crypto.getRandomValues(new Uint8Array(e))}var Ti=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=Xs(t);if(Sa()){if(j.get(r))return j.get(r);{let o=mf.encode(La(32));return j.put(r,o),o}}return mf.encode(La(32))}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post($m,{guest_credential:this.meta.guestCredential});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){throw new Error("Linking is not supported for the guest flow")}};import{base64url as ff}from"jose";var V0="S256",G0="S256";function On(){return ff.encode(La(36))}function Si(){return On()}async function Ai(e,t=V0){if(t==G0){let r=await uf(e);return ff.encode(r)}else return e}function hf(){let e=j.get(Wn);if(!e)throw new w("Authentication error.");return e}function ll(){return!!j.get(Ln)}var po=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:ll();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=hf();try{let r=await this.api.post(Om,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return j.del(Wn),this.meta.headless&&j.del(Ln),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=ce(r);throw o.privyErrorCode?new w(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=j.get(Wn);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(rl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return j.del(Wn),r}catch(r){throw ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initializing OAuth authentication.");let t=On();j.put(Wn,t);let r=Si();j.put(In,r);let o=await Ai(t);this.meta.headless&&j.put(Ln,!0);try{return await this.api.post(tl,{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 Od(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as yf,jsxs as q0}from"react/jsx-runtime";var cl=({style:e,...t})=>q0("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:[yf("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"}),yf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as Na,jsxs as z0}from"react/jsx-runtime";var dl=({style:e,...t})=>z0("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:[Na("g",{clipPath:"url(#clip0)",children:Na("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"})}),Na("defs",{children:Na("clipPath",{id:"clip0",children:Na("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as gf}from"react/jsx-runtime";var pl=({style:e,...t})=>gf("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:gf("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});import K0 from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Y0}from"react/jsx-runtime";var vf=({style:e})=>Y0(K0,{style:{color:"var(--privy-color-error)",...e}});import{jsx as ul,jsxs as Q0}from"react/jsx-runtime";var ml=({style:e,...t})=>Q0("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:[ul("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"}),ul("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"}),ul("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"}),ul("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as Mr,jsxs as fl}from"react/jsx-runtime";function hl(e){return fl("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:[fl("defs",{children:[fl("linearGradient",{id:"b",children:[Mr("stop",{offset:"0",stopColor:"#3771c8"}),Mr("stop",{stopColor:"#3771c8",offset:".128"}),Mr("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),fl("linearGradient",{id:"a",children:[Mr("stop",{offset:"0",stopColor:"#fd5"}),Mr("stop",{offset:".1",stopColor:"#fd5"}),Mr("stop",{offset:".5",stopColor:"#ff543e"}),Mr("stop",{offset:"1",stopColor:"#c837ab"})]}),Mr("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"}),Mr("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"})]}),Mr("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)"}),Mr("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)"}),Mr("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}import{jsx as yl}from"react/jsx-runtime";function gl({style:e,...t}){return yl("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:yl("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:yl("g",{transform:"scale(5.12,5.12)",children:yl("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Cf,jsxs as X0}from"react/jsx-runtime";function vl(e){return X0("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Cf("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"}),Cf("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as Dd,jsxs as Z0}from"react/jsx-runtime";function Cl(e){return Z0("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:[Dd("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"}),Dd("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"}),Dd("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as wf}from"react/jsx-runtime";var wl=({style:e,...t})=>wf("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:wf("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 bf={google:{name:"Google",component:ml},discord:{name:"Discord",component:dl},github:{name:"Github",component:pl},linkedin:{name:"LinkedIn",component:gl},twitter:{name:"Twitter",component:wl},spotify:{name:"Spotify",component:vl},instagram:{name:"Instagram",component:hl},tiktok:{name:"Tiktok",component:Cl},apple:{name:"Apple",component:cl}},Oa=e=>e in bf?bf[e]:{name:"Unknown",component:vf};function Ef(e,t){let r={detail:"",retryable:!1},o=Od(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=Oa(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=Oa(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 Da(){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:ll(),popupFlow:window.opener!==null&&n}}function Dn(){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"),j.del(In),window.history.replaceState({},"",e)}var Fn=class{constructor(t){this.initAuthenticateOnce=new Ke(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Ke(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(qm,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ce(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(Gm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Vm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Hm,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var bl=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,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
|
+
import{$ as Wn,$a as mm,A as zs,Aa as om,B as Lu,Ba as nm,C as Mn,Ca as De,D as Nu,Da as Js,E as gi,Ea as dt,F as Ou,Fa as im,G as Lo,Ga as _,H as _r,Ha as Ie,I as Pa,Ia as q,J as Du,Ja as am,K as Ks,Ka as sm,L as Fu,La as lm,M as Me,Ma as ze,N as Uu,Na as D,O as Bu,Oa as wi,P as xd,Pa as bi,Q as In,Qa as G,R as kd,Ra as J,S as Ys,Sa as cm,T as Hu,Ta as jt,U as Rd,Ua as dm,V as _d,Va as Pt,W as Qs,Wa as _a,X as xa,Xa as Ma,Y as ka,Ya as pm,Z as Xs,Za as um,_ as Ra,_a as Ei,a as Pu,aa as Ln,ab as fm,b as Vs,ba as Nn,bb as zr,c as Pd,ca as Zs,cb as Ti,d as xu,da as Md,db as co,e as Jt,ea as Id,eb as bt,f as Rr,fa as On,fb as Ia,g as w,ga as No,gb as hm,h as ku,ha as Wd,hb as D0,i as xe,ia as vi,ib as F0,j as ce,ja as Vu,jb as U0,k as nt,ka as Gu,l as _n,la as qu,m as fr,ma as zu,n as Ru,na as Ku,o as lo,oa as Ci,p as Sa,pa as Yu,q as j,qa as Qu,r as Yo,ra as Xu,s as Gs,sa as Zu,t as _u,ta as Ju,u as qs,ua as ju,v as Mu,va as $u,w as Dt,wa as em,x as Iu,xa as tm,y as Wu,ya as Ld,z as Aa,za as rm}from"./chunk-WIKDIW7V.js";import{getAddress as _o}from"@ethersproject/address";import{Web3Provider as wu}from"@ethersproject/providers";import{createStore as DS}from"mipd";import{useEffect as no,useMemo as FS,useRef as Ea,useState as ct}from"react";import{isAndroid as US}from"react-device-detect";import{ProviderErrors as BS,calculateTotalGasEstimate as HS,populateTransactionRequest as VS}from"@privy-io/js-sdk-core";var js="/api/v1/sessions",$s="/api/v1/sessions/logout",ym="/api/v1/sessions/fork",el="/api/v1/sessions/fork/recover",gm="/api/v1/siwe/init",vm="/api/v1/siwe/authenticate",Cm="/api/v1/siwe/link",wm="/api/v1/siwe/unlink",bm="/api/v1/farcaster/init",Em="/api/v1/farcaster/authenticate",Tm="/api/v1/farcaster/link",Sm="/api/v1/farcaster/status",Am="/api/v1/farcaster/unlink",Pm="/api/v1/passwordless/init",xm="/api/v1/passwordless/authenticate",km="/api/v1/passwordless/link",Rm="/api/v1/passwordless/unlink",_m="/api/v1/passwordless/update",Mm="/api/v1/passwordless_sms/init",Im="/api/v1/passwordless_sms/link",Wm="/api/v1/passwordless_sms/unlink",Lm="/api/v1/passwordless_sms/authenticate",Nm="/api/v1/passwordless_sms/update",tl="/api/v1/oauth/init",Om="/api/v1/oauth/authenticate",rl="/api/v1/oauth/link",Dm="/api/v1/oauth/unlink",Fm="/api/v1/recovery/oauth/init",Um="/api/v1/recovery/oauth/init_icloud",Bm="/api/v1/recovery/oauth/authenticate",Hm="/api/v1/passkeys/link/init",Vm="/api/v1/passkeys/authenticate/init",Gm="/api/v1/passkeys/link",qm="/api/v1/passkeys/authenticate",zm="/api/v1/passkeys/unlink",Km="/api/v1/telegram/authenticate",Ym="/api/v1/telegram/link",Qm="/api/v1/telegram/unlink";var Xm="/api/v1/mfa/passwordless_sms/init",Zm="/api/v1/mfa/passkeys/init",Jm="/api/v1/users/me/accept_terms",ol="/api/v1/analytics_events",jm="/api/v1/custom_jwt_account/authenticate",$m="/api/v1/guest/authenticate",ef="/api/v1/plugins/moonpay_on_ramp/sign",tf="/api/v1/funding/coinbase_on_ramp/init",rf="/api/v1/funding/coinbase_on_ramp/status";var Si=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(jm,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){throw new Error("Unimplemented")}};var Qo=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(xm,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(km,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{return await this.api.post(Pm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ce(o)}}},nl=class extends Qo{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new w("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(_m,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ce(r)}}};import{isMobile as B0,isIOS as H0}from"react-device-detect";var il=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(al))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var al={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function of(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function nf(e,t){let r=of(t);if(r.deepLink)return pf(r.deepLink,e);if(r.universalLink)return Nd(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function af(e,t){let r=of(t);if(r.universalLink)return Nd(r.universalLink,e)}var sf="WALLETCONNECT_DEEPLINK_CHOICE";function lf(){try{localStorage.removeItem(sf)}catch{}}function cf({href:e,name:t}){try{localStorage.setItem(sf,JSON.stringify({href:e,name:t}))}catch{}}function df(e){return e.startsWith("http://")||e.startsWith("https://")}function pf(e,t){if(df(e))return Nd(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 Nd(e,t){if(!df(e))return pf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function sl(e,t){window.open(e,t,"noreferrer noopener")}var Ke=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 Wa=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Ke(this._startChannelOnce.bind(this)),this.pollForReady=new Ke(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");try{let t=await this.api.post(Em,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new w("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Tm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ce(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(bm,{token:this.captchaToken});B0&&!H0&&t.connect_uri&&sl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new w("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");let t=await this.api.get(Sm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as mf}from"jose";async function uf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function La(e){return crypto.getRandomValues(new Uint8Array(e))}var Ai=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=Xs(t);if(Sa()){if(j.get(r))return j.get(r);{let o=mf.encode(La(32));return j.put(r,o),o}}return mf.encode(La(32))}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post($m,{guest_credential:this.meta.guestCredential});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){throw new Error("Linking is not supported for the guest flow")}};import{base64url as ff}from"jose";var V0="S256",G0="S256";function Dn(){return ff.encode(La(36))}function Pi(){return Dn()}async function xi(e,t=V0){if(t==G0){let r=await uf(e);return ff.encode(r)}else return e}function hf(){let e=j.get(Ln);if(!e)throw new w("Authentication error.");return e}function ll(){return!!j.get(Nn)}var po=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:ll();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=hf();try{let r=await this.api.post(Om,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return j.del(Ln),this.meta.headless&&j.del(Nn),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=ce(r);throw o.privyErrorCode?new w(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=j.get(Ln);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(rl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return j.del(Ln),r}catch(r){throw ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initializing OAuth authentication.");let t=Dn();j.put(Ln,t);let r=Pi();j.put(Wn,r);let o=await xi(t);this.meta.headless&&j.put(Nn,!0);try{return await this.api.post(tl,{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 Od(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as yf,jsxs as q0}from"react/jsx-runtime";var cl=({style:e,...t})=>q0("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:[yf("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"}),yf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as Na,jsxs as z0}from"react/jsx-runtime";var dl=({style:e,...t})=>z0("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:[Na("g",{clipPath:"url(#clip0)",children:Na("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"})}),Na("defs",{children:Na("clipPath",{id:"clip0",children:Na("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as gf}from"react/jsx-runtime";var pl=({style:e,...t})=>gf("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:gf("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});import K0 from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Y0}from"react/jsx-runtime";var vf=({style:e})=>Y0(K0,{style:{color:"var(--privy-color-error)",...e}});import{jsx as ul,jsxs as Q0}from"react/jsx-runtime";var ml=({style:e,...t})=>Q0("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:[ul("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"}),ul("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"}),ul("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"}),ul("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as Mr,jsxs as fl}from"react/jsx-runtime";function hl(e){return fl("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:[fl("defs",{children:[fl("linearGradient",{id:"b",children:[Mr("stop",{offset:"0",stopColor:"#3771c8"}),Mr("stop",{stopColor:"#3771c8",offset:".128"}),Mr("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),fl("linearGradient",{id:"a",children:[Mr("stop",{offset:"0",stopColor:"#fd5"}),Mr("stop",{offset:".1",stopColor:"#fd5"}),Mr("stop",{offset:".5",stopColor:"#ff543e"}),Mr("stop",{offset:"1",stopColor:"#c837ab"})]}),Mr("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"}),Mr("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"})]}),Mr("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)"}),Mr("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)"}),Mr("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}import{jsx as yl}from"react/jsx-runtime";function gl({style:e,...t}){return yl("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:yl("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:yl("g",{transform:"scale(5.12,5.12)",children:yl("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Cf,jsxs as X0}from"react/jsx-runtime";function vl(e){return X0("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Cf("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"}),Cf("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as Dd,jsxs as Z0}from"react/jsx-runtime";function Cl(e){return Z0("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:[Dd("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"}),Dd("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"}),Dd("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as wf}from"react/jsx-runtime";var wl=({style:e,...t})=>wf("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:wf("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 bf={google:{name:"Google",component:ml},discord:{name:"Discord",component:dl},github:{name:"Github",component:pl},linkedin:{name:"LinkedIn",component:gl},twitter:{name:"Twitter",component:wl},spotify:{name:"Spotify",component:vl},instagram:{name:"Instagram",component:hl},tiktok:{name:"Tiktok",component:Cl},apple:{name:"Apple",component:cl}},Oa=e=>e in bf?bf[e]:{name:"Unknown",component:vf};function Ef(e,t){let r={detail:"",retryable:!1},o=Od(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=Oa(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=Oa(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 Da(){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:ll(),popupFlow:window.opener!==null&&n}}function Fn(){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"),j.del(Wn),window.history.replaceState({},"",e)}var Un=class{constructor(t){this.initAuthenticateOnce=new Ke(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Ke(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(qm,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ce(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(Gm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Vm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Hm,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var bl=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",i=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
|
|
2
2
|
${e}
|
|
3
3
|
|
|
4
|
-
${
|
|
4
|
+
${a}
|
|
5
5
|
|
|
6
6
|
URI: ${n}
|
|
7
7
|
Version: 1
|
|
8
8
|
Chain ID: ${t}
|
|
9
9
|
Nonce: ${r}
|
|
10
|
-
Issued At: ${
|
|
10
|
+
Issued At: ${i}
|
|
11
11
|
Resources:
|
|
12
|
-
- https://privy.io`};var No=class{constructor(t,r,o){this.getNonceOnce=new Ke(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new w("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.client)throw new w("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ce(t)}}async sign(){if(!this.client)throw new w("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new w("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new w("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new w("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=bl({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var Qo=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Lm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Im,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Mm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ce(o)}}},El=class extends Qo{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new w("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Nm,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw ce(r)}}};var Pi=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Km,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Ym,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw ce(t)}}};function Fd(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 Sf(){let e;if(e=J0(),e)return Tf(),{...e,flowType:"login-url"};if(e=j0(),e)return Tf(),{...e,flowType:"web-app"}}function J0(){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 j0(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash"),a=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0,s=t.get("start_param")||void 0;if(!(!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i,chat_instance:a,chat_type:l,start_param:s}}function Tf(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),e.hash="",window.history.replaceState({},"",e)}import{v4 as Wv}from"uuid";function te(e){return e?new Date(e*1e3):null}function $0(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let d={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(d);break;case"instagram_oauth":let m={subject:r.subject,username:r.username,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(u);break;case"github_oauth":let C={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(C);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let b={subject:r.subject,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(b);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)});break;case"farcaster":let T={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(T);break;case"passkey":let R={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(R);break;case"telegram":let S={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:te(r.first_verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function $t(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var be=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,Un=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Tl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,ev=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Ut=(e,t)=>be(e)||Un(e)?!1:t==="all-users"||t==="users-without-wallets"&&!ev(e)?.length;function er(e){if(!e)return null;let t=$0(e.linked_accounts),r=$t(t,"wallet"),o=$t(t,"email"),n=$t(t,"phone"),i=$t(t,"google_oauth"),a=$t(t,"twitter_oauth"),l=$t(t,"discord_oauth"),s=$t(t,"github_oauth"),d=$t(t,"spotify_oauth"),m=$t(t,"instagram_oauth"),f=$t(t,"tiktok_oauth"),u=$t(t,"linkedin_oauth"),C=$t(t,"apple_oauth"),v=$t(t,"farcaster"),g=$t(t,"telegram"),b=e.mfa_methods.map(({type:R,verified_at:S})=>({type:R,verifiedAt:te(S)}));return{id:e.id,createdAt:te(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:d&&{subject:d.subject,email:d.email,name:d.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:C&&{subject:C.subject,email:C.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:b.map(R=>R.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest}}import{getAddress as Ff}from"@ethersproject/address";import{isHexString as Pv}from"@ethersproject/bytes";import xv from"eventemitter3";import lv from"@coinbase/wallet-sdk";import{jsx as Af,jsxs as tv}from"react/jsx-runtime";var Oo=({style:e,...t})=>tv("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:[Af("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Af("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as fo}from"@ethersproject/address";import{Web3Provider as Mf}from"@ethersproject/providers";import{default as av}from"eventemitter3";import iv from"eventemitter3";var rv=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],Pf=e=>rv.includes(e);import{ErrorCode as ov}from"@ethersproject/logger";import{ProviderErrors as Bn}from"@privy-io/js-sdk-core";var xi=class extends ke{constructor(){super("Wallet timeout");this.type="wallet_error"}},ki=class extends ke{constructor(){super("User rejected connection");this.type="wallet_error"}},Yr=e=>{if(e instanceof ke)return e;if(e?.code&&e?.reason){let t=new Et(e);return e.code===ov.ACTION_REJECTED&&(t.details=Bn.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Et(e):new ke("Unknown connector error",e)},Ir=class extends Jt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Et=class extends Ir{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Bn).find(i=>i.eipCode===o.code);this.details=n||Bn.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Bn.E32002_CONNECTION_ALREADY_PENDING:this.details=Bn.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Bn.E32002_WALLET_LOCKED))}},nv={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1}},uo={...nv,...Bn};var Xe=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new 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||Nn,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 ke(`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 Yr(r)})}},Xo=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Fa=class extends iv{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=_r(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Ri(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new Xo(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Ee()||!this.address)throw new Xo("Disconnected",4900);return(await Rf(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new Xo(`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 Xo(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=_r(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 xf(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 kf(Pa(o))}async handleEstimateGas(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_estimateGas");delete r.params[0].gasPrice,delete r.params[0].maxFeePerGas,delete r.params[0].maxPriorityFeePerGas;let o={...r.params[0],chainId:_n(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return _n(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(r);case"eth_sendTransaction":return this.handleSendTransaction(r);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(r);case"personal_sign":return this.handlePersonalSign(r);case"eth_signTypedData_v4":return this.handleSignedTypedData(r);default:break}if(Pf(r.method)){let o=await Ee();if(await _f(),!o||!this.address)throw new Xo("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 Xo("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Ee();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}}},mo=class extends Xe{constructor(r){super(r,r.rpcTimeoutDuration)}},Zo=class extends Xe{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var sv=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},tr=class extends av{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=hi(r),this.walletClientType==="privy"&&j.put(Zs(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=Ri(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>fo(l.address)===fo(r));return{address:fo(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new ke("Wallet is not currently connected.");let s=this.wallets.find(C=>fo(C.address)===fo(r))?.chainId;if(!s)throw new ke("Unable to determine current chainId.");let d,m;if(typeof l=="number"?(d=`0x${l.toString(16)}`,m=l):(d=l,m=Number(l)),s===hi(d))return;let f=this.chains.find(C=>C.id===m);if(!f)throw new ke(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:d}]})};try{return await u()}catch(C){if(sv(C,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:d,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&C.message?.includes("wallet_switchEthereumChain")?new ke(`Rainbow does not support the chainId ${o}`):C}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new ke("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new ke("Wallet is not currently connected.");return new Mf(new mo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new ke("Wallet is not currently connected.");return new Zo(this.proxyProvider)},sign:async l=>{if(!await a())throw new ke("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 d=await Aa(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,d),Array.isArray(d)&&(o=d)}}catch(d){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",d)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=fo(n),a=[],l;if(this.walletClientType==="privy"){let d=j.get(Zs(i));this.chains.find(m=>m.id===Number(d))||(j.del(Zs(i)),d=null),l=d||`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 d=await Aa(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,d),typeof d=="string")l=d;else if(typeof d=="number")l=`0x${d.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(d){console.warn(`Failed to get chainId from provider, defaulting to ${Wd}`,d),l=Wd}let s=hi(l);if(!a.find(d=>fo(d.address)===i)){let d={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet(fo(n),s,d,this.connectorType==="embedded_imported"))}Sl(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=>fo(n)===fo(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 Mf(new mo(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 cv=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],If=(e,t)=>e.makeWeb3Provider({options:t}),Al,Pl=class extends tr{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new Xe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Al){let s=[o.id].concat(r.map(m=>m.id)),d=this.connectionOptions!=="eoaOnly"?s.filter(m=>!cv.includes(m)):[];d.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${d.join(", ")}`),Al=new lv({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(If(Al,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:Oo,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 ke("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Yr(r)}}updateConnectionPreference(r){this.connectionOptions=r,this.walletClientType=r==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(If(Al,this.connectionOptions))}};var Ua=class extends tr{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[_n(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:gi,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Wf}from"react/jsx-runtime";var _i=({style:e,...t})=>Wf("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Wf("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as hr,jsxs as dv}from"react/jsx-runtime";var Mi=({style:e,...t})=>dv("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:[hr("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),hr("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as Lf,jsxs as pv}from"react/jsx-runtime";var ho=({style:e,...t})=>pv("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:[Lf("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Lf("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 Wi=class extends tr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Xe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new ke("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Yr(r)}}},Ii,Li=class extends tr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Vs(this,Ii,void 0);this.proxyProvider=new Xe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Pd(this,Ii,{name:"MetaMask",icon:Mi,id:"io.metamask"}):a==="phantom"&&Pd(this,Ii,{name:"Phantom",icon:ho,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 Pu(this,Ii)??{name:"Browser Extension",icon:_i,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 ke("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Yr(r)}}};Ii=new WeakMap;import{getAddress as Ck}from"@ethersproject/address";import{Web3Provider as bk}from"@ethersproject/providers";import{isMobile as uv}from"react-device-detect";var xl=class extends Wi{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{uv||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 ke("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Yr(t)}}};var kl=class extends tr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Xe(void 0,Nn);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var Rl=class extends kl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:ho,id:"phantom"}}};import{EthereumProvider as Ev,OPTIONAL_EVENTS as Tv,OPTIONAL_METHODS as Sv}from"@walletconnect/ethereum-provider";import{isMobile as Av}from"react-device-detect";import{createContext as fv,useContext as hv,useEffect as Ud,useRef as yv,useState as gv}from"react";import{jsx as mv}from"react/jsx-runtime";function Nf({src:e,...t}){return mv("img",{src:e,...t,style:{display:"none"}})}import{jsx as Cv,jsxs as wv}from"react/jsx-runtime";var Of=fv({ready:!1,app:om,currentScreen:null,lastScreen:null,navigate:dt,navigateBack:dt,resetNavigation:dt,setModalData:dt,onUserCloseViaDialogOrKeybindRef:void 0}),vv=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Df=e=>{let t=De(),r=e.authenticated,[o,n]=gv(e.initialScreen);Ud(()=>{!r&&!vv.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=yv(null);Ud(()=>{e.open||(i.current=null)},[e.open]),Ud(()=>{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 wv(Of.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&Cv(Nf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},A=()=>hv(Of);import{jsx as Ni,jsxs as bv}from"react/jsx-runtime";var Ba=({style:e,...t})=>{let{app:r}=A();return bv("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:[Ni("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Ni("g",{clipPath:"url(#clip0_1765_9946)",children:Ni("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"})}),Ni("defs",{children:Ni("clipPath",{id:"clip0_1765_9946",children:Ni("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var Qr=class extends tr{constructor(r,o,n,i,a,l,s,d){super(d||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new Xe(void 0,this.rpcTimeoutDuration),d&&(this.walletEntry=al[d],this.walletClientType=d)}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=il(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:Mi,id:"io.metamask"}:{name:Lu(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Ba,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=al[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,lf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new ki)};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 ke("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=il(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Ri(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(Yr(a));return}o(new ke("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=Ou(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 Ev.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:Tv,optionalMethods:Sv,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(),Av&&this.walletEntry){let{redirect:l,href:s}=nf(a,this.walletEntry);cf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let d=af(a,this.walletEntry);d?.redirect&&(this.fallbackUniversalRedirectUri=d.redirect),sl(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=il(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 Hd=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>Pv(o)).map(o=>Ff(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Ri=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Nn:Nn,Ha=class extends xv{constructor(r,o,n,i,a,l,s,d,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 Xe:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=d,this.externalWalletConfig=m,this.privyAppName=f,this.privyAppLogo=u,this.storedConnections=Bd()}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;j.get(Md)&&(j.getKeys().forEach(o=>{o.startsWith("walletconnect")&&j.del(o)}),j.del(Md));let r=Nu(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"),!Ko()&&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 Fa(r,o,this.rpcConfig,this.chains,i,n.id),s=new Ua(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 Fa(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,d=new Ua(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(d)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Bd(),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=Bd(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof Qr&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new xl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Li(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Li(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Li(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Wi(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Pl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Rl(this.defaultChain):new Qr(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}));j.put(Id,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=Ff(r),this.emit("walletsUpdated")}};function Sl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var kv=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Bd=()=>{let e=j.get(Id);return e&&Array.isArray(e)&&e.map(o=>kv(o)).every(Boolean)?e:[]};import{ofetch as Rv}from"ofetch";var _v=[js,el,$s,ol],_l=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=xd,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=Rv.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=_v.includes(i.toString());if(!l.has("authorization")){let d=await this.client.getAccessToken({disableAutoRefresh:s});d!==null&&l.set("authorization",`Bearer ${d}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new ku}})}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 Uf=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});import Jo from"js-cookie";function Bf(e){return e instanceof Yo?"email":e instanceof Qo?"sms":e instanceof No?"siwe":e instanceof Ti?"guest":e instanceof Ei?"custom_auth":e instanceof po?e.meta.provider:null}import{isSafari as Mv}from"react-device-detect";function Ml(){return!(Mv&&window.location.origin.startsWith("http://localhost"))}import*as Hf from"jose";var Wr=class{static parse(t){try{return new Wr(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Hf.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 Iv=30,Il=class{constructor(){this.authenticateOnce=new Ke(async t=>this._authenticate(t)),this.linkOnce=new Ke(async t=>this._link(t)),this.refreshOnce=new Ke(this._refresh.bind(this)),this.destroyOnce=new Ke(this._destroy.bind(this)),this.forkSessionOnce=new Ke(this._forkSession.bind(this))}get token(){try{let t=j.get(Mn);return typeof t=="string"?new Wr(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=j.get(Ys);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=j.get(xa);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=j.get(Ra(t));if(typeof r=="string"){let o=new Wr(r);return o.isExpired()?(j.del(Ra(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=Jo.get(Qs);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!==Ku}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Wr.parse(this.token);return t!==null&&!t.isExpired(Iv)}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"?j.put(Ra(t),r):j.del(Ra(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=Bf(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:er(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),nt(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:er(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),nt(r)}}async _refresh(){if(!this.api)throw new w("Session has no API instance");if(!this.client)throw new w("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(t&&r||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(js,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(el,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),er(n.user)}catch(n){if(n instanceof Rr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw nt(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($s,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new w("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(ym,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw nt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=j.get(Mn);if(j.put(Mn,t),!this.client?.useServerCookies){let o=Wr.parse(t)?.expiration;Jo.set(kd,t,{sameSite:"Strict",secure:Ml(),expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else j.del(Mn),Jo.remove(kd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(j.put(Ys,t),this.client?.useServerCookies||Jo.set(Qs,"t",{sameSite:"Strict",secure:Ml(),expires:30})):(j.del(Ys),Jo.remove(Hu),Jo.remove(Qs))}storeIdentityToken(t){if(this.client?.useServerCookies)return;j.put(Rd,t);let r=Wr.parse(t)?.expiration;Jo.set(_d,t,{sameSite:"Strict",secure:Ml(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){j.del(Rd),Jo.remove(_d)}clearForkedToken(){j.del(xa)}};var Vd,Wl,Vf,Va=class{constructor(t){Vs(this,Wl);this.apiUrl=t.apiUrl||Ks,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||Fu,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=xu(this,Wl,Vf).call(this),Vd||(Vd=new Il),this.session=Vd,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:d}){this.connectors||(this.connectors=new Ha(this.appId,t,r,o,n,i,a,l,s,d))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new _l({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new w("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new w("No auth flow in progress.");let{oAuthTokens:t}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:t}}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(Xm,{action:"verify"})}catch(t){throw ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Zm,{});return Uf(t.options)}catch(t){throw ce(t)}}async acceptTerms(){try{let t=await this.api.post(Jm,{});return er(t)}catch(t){throw nt(t)}}async unlinkEmail(t){try{let r=await this.api.post(Rm,{address:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkPhone(t){try{let r=await this.api.post(Wm,{phoneNumber:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkWallet(t){try{let r=await this.api.post(wm,{address:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Dm,{provider:t,subject:r});return await this.getAuthenticatedUser()??er(o)}catch(o){throw nt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Am,{fid:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Qm,{telegram_user_id:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(zm,{credential_id:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(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(ol,{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(ef,t)}catch(r){throw nt(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(tf,t)}catch(r){throw nt(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${rf}?partnerUserId=${t}`)}catch(r){throw nt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?this.session.hasRefreshCredentials()?Wr.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:(this.session.destroyLocalState(),null):!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 nt(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(gm,{address:t,token:r})).nonce}catch(o){throw nt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(vm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(Cm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i});return er(a)}catch(a){throw nt(a)}}};Wl=new WeakSet,Vf=function(){if(typeof window>"u")return null;try{let r=j.get(ka);if(typeof r=="string"&&r.length>0)return r}catch{}let t=Wv();try{return j.put(ka,t),t}catch{return t}};import{Turnstile as Uv}from"@marsidev/react-turnstile";import{useEffect as Bv,useMemo as Hv}from"react";import{useMemo as Lv,useRef as Nv,useContext as Ov,useState as Gd,createContext as Dv}from"react";import{jsx as Fv}from"react/jsx-runtime";var Gf=Dv({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:dt,setError:dt,setExecuting:dt,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:dt,reset:dt,execute:dt}),yr=class extends Jt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},qf=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=Nv(null),[i,a]=Gd(),[l,s]=Gd(),[d,m]=Gd(!1),f=Lv(()=>o?!d&&!i&&!l?{status:"ready"}:d&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,d]);return Fv(Gf.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 Wu(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new yr("Captcha failed",null,"captcha_timeout")}}},children:e})},Se=()=>Ov(Gf);import{jsx as zf}from"react/jsx-runtime";var qd=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Se(),[,s]=Hv(()=>r?.split("t:")||[],[r]);if(Bv(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return zf("div",{className:"hidden h-0 w-0",children:zf(Uv,{...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:d=>{e.onSuccess?.(d),i(d),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};import{useCallback as wS,useEffect as i0,useRef as bS,useState as ES}from"react";import l0 from"styled-components";function zd(e){ze("configureMfa",e)}import cC from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import jf from"styled-components";import Hn,{css as Kf}from"styled-components";import Yd from"styled-components";import{Fragment as Gv,jsx as Kd,jsxs as qv}from"react/jsx-runtime";var it=({success:e,fail:t})=>qv(Gv,{children:[Kd(at,{className:e?"success":t?"fail":""}),Kd(Ga,{className:e?"success":t?"fail":""})]}),at=Yd.span`
|
|
12
|
+
- https://privy.io`};var Oo=class{constructor(t,r,o){this.getNonceOnce=new Ke(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new w("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.client)throw new w("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ce(t)}}async sign(){if(!this.client)throw new w("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new w("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new w("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new w("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=bl({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var Xo=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Lm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Im,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Mm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ce(o)}}},El=class extends Xo{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new w("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Nm,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw ce(r)}}};var ki=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Km,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ce(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Ym,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw ce(t)}}};function Fd(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 Sf(){let e;if(e=J0(),e)return Tf(),{...e,flowType:"login-url"};if(e=j0(),e)return Tf(),{...e,flowType:"web-app"}}function J0(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),a=e.get("last_name")||void 0,i=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:a,username:i,photo_url:l,auth_date:o,hash:r}}function j0(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,o=t.get("user"),n=Number(t.get("auth_date")||""),a=t.get("hash"),i=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0,s=t.get("start_param")||void 0;if(!(!o||!n||!a))return{query_id:r,user:o,auth_date:n,hash:a,chat_instance:i,chat_type:l,start_param:s}}function Tf(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),e.hash="",window.history.replaceState({},"",e)}import{v4 as Wv}from"uuid";function te(e){return e?new Date(e*1e3):null}function $0(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let a={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(a);break;case"email":let i={address:r.address,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(i);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let d={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(d);break;case"instagram_oauth":let m={subject:r.subject,username:r.username,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(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:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(u);break;case"github_oauth":let C={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(C);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let b={subject:r.subject,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(b);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)});break;case"farcaster":let T={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(T);break;case"passkey":let R={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(R);break;case"telegram":let S={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:te(r.first_verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function $t(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var be=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,Bn=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Tl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,ev=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Ft=(e,t)=>be(e)||Bn(e)?!1:t==="all-users"||t==="users-without-wallets"&&!ev(e)?.length;function er(e){if(!e)return null;let t=$0(e.linked_accounts),r=$t(t,"wallet"),o=$t(t,"email"),n=$t(t,"phone"),a=$t(t,"google_oauth"),i=$t(t,"twitter_oauth"),l=$t(t,"discord_oauth"),s=$t(t,"github_oauth"),d=$t(t,"spotify_oauth"),m=$t(t,"instagram_oauth"),f=$t(t,"tiktok_oauth"),u=$t(t,"linkedin_oauth"),C=$t(t,"apple_oauth"),v=$t(t,"farcaster"),g=$t(t,"telegram"),b=e.mfa_methods.map(({type:R,verified_at:S})=>({type:R,verifiedAt:te(S)}));return{id:e.id,createdAt:te(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:a&&{subject:a.subject,email:a.email,name:a.name},twitter:i&&{subject:i.subject,username:i.username,name:i.name,profilePictureUrl:i.profilePictureUrl},discord: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:d&&{subject:d.subject,email:d.email,name:d.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:C&&{subject:C.subject,email:C.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:b.map(R=>R.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest}}import{getAddress as Ff}from"@ethersproject/address";import{isHexString as Pv}from"@ethersproject/bytes";import xv from"eventemitter3";import lv from"@coinbase/wallet-sdk";import{jsx as Af,jsxs as tv}from"react/jsx-runtime";var Do=({style:e,...t})=>tv("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:[Af("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Af("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as fo}from"@ethersproject/address";import{Web3Provider as Mf}from"@ethersproject/providers";import{default as av}from"eventemitter3";import iv from"eventemitter3";var rv=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],Pf=e=>rv.includes(e);import{ErrorCode as ov}from"@ethersproject/logger";import{ProviderErrors as Hn}from"@privy-io/js-sdk-core";var Ri=class extends xe{constructor(){super("Wallet timeout");this.type="wallet_error"}},_i=class extends xe{constructor(){super("User rejected connection");this.type="wallet_error"}},Kr=e=>{if(e instanceof xe)return e;if(e?.code&&e?.reason){let t=new Et(e);return e.code===ov.ACTION_REJECTED&&(t.details=Hn.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Et(e):new xe("Unknown connector error",e)},Ir=class extends Jt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Et=class extends Ir{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Hn).find(a=>a.eipCode===o.code);this.details=n||Hn.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Hn.E32002_CONNECTION_ALREADY_PENDING:this.details=Hn.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Hn.E32002_WALLET_LOCKED))}},nv={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1}},uo={...nv,...Hn};var Xe=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Ri,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||On,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 xe(`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 Kr(r)})}},Zo=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Fa=class extends iv{constructor(r,o,n,a,i,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=a,this.provider=_r(l,this.chains,n,{appId:i}),this.rpcTimeoutDuration=Mi(n,"privy"),this.appId=i}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new Zo(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Ee()||!this.address)throw new Zo("Disconnected",4900);return(await Rf(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new Zo(`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 Zo(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=_r(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 xf(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 kf(Pa(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:Mn(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(a){throw console.warn(`Gas estimation failed with error: ${a} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return Mn(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(Pf(r.method)){let o=await Ee();if(await _f(),!o||!this.address)throw new Zo("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 Zo("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Ee();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}}},mo=class extends Xe{constructor(r){super(r,r.rpcTimeoutDuration)}},Jo=class extends Xe{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var sv=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},tr=class extends av{constructor(r,o,n,a){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=gi(r),this.walletClientType==="privy"&&j.put(Zs(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=a,this.rpcTimeoutDuration=Mi(a,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,a){let i=async()=>!!this.wallets.find(l=>fo(l.address)===fo(r));return{address:fo(r),chainId:o,meta:n,imported:a,switchChain:async l=>{if(!i)throw new xe("Wallet is not currently connected.");let s=this.wallets.find(C=>fo(C.address)===fo(r))?.chainId;if(!s)throw new xe("Unable to determine current chainId.");let d,m;if(typeof l=="number"?(d=`0x${l.toString(16)}`,m=l):(d=l,m=Number(l)),s===gi(d))return;let f=this.chains.find(C=>C.id===m);if(!f)throw new xe(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:d}]})};try{return await u()}catch(C){if(sv(C,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:d,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&C.message?.includes("wallet_switchEthereumChain")?new xe(`Rainbow does not support the chainId ${o}`):C}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new xe("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new xe("Wallet is not currently connected.");return new Mf(new mo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new xe("Wallet is not currently connected.");return new Jo(this.proxyProvider)},sign:async l=>{if(!await i())throw new xe("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 d=await Aa(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,d),Array.isArray(d)&&(o=d)}}catch(d){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",d)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],a=fo(n),i=[],l;if(this.walletClientType==="privy"){let d=j.get(Zs(a));this.chains.find(m=>m.id===Number(d))||(j.del(Zs(a)),d=null),l=d||`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 d=await Aa(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,d),typeof d=="string")l=d;else if(typeof d=="number")l=`0x${d.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(d){console.warn(`Failed to get chainId from provider, defaulting to ${Wd}`,d),l=Wd}let s=gi(l);if(!i.find(d=>fo(d.address)===a)){let d={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};i.push(this.buildConnectedWallet(fo(n),s,d,this.connectorType==="embedded_imported"))}Sl(i,this.wallets)||(this.wallets=i,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>fo(n)===fo(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 Mf(new mo(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 cv=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],If=(e,t)=>e.makeWeb3Provider({options:t}),Al,Pl=class extends tr{constructor(r,o,n,a,i,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new Xe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=a.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Al){let s=[o.id].concat(r.map(m=>m.id)),d=this.connectionOptions!=="eoaOnly"?s.filter(m=>!cv.includes(m)):[];d.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${d.join(", ")}`),Al=new lv({appName:i,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(If(Al,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:Do,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 xe("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Kr(r)}}updateConnectionPreference(r){this.connectionOptions=r,this.walletClientType=r==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(If(Al,this.connectionOptions))}};var Ua=class extends tr{constructor(r,o,n,a,i=!1){super("privy",o,n,a);this.connectorType="embedded";this.proxyProvider=r,i&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Mn(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Ci,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Wf}from"react/jsx-runtime";var Ii=({style:e,...t})=>Wf("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Wf("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as hr,jsxs as dv}from"react/jsx-runtime";var Wi=({style:e,...t})=>dv("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:[hr("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),hr("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as Lf,jsxs as pv}from"react/jsx-runtime";var ho=({style:e,...t})=>pv("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:[Lf("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Lf("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 Ni=class extends tr{constructor(r,o,n,a,i){super(i||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Xe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=a;let l=a.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 xe("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Kr(r)}}},Li,Oi=class extends tr{constructor(r,o,n,a,i){super(i??"unknown",r,o,n);this.connectorType="injected";Vs(this,Li,void 0);this.proxyProvider=new Xe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(a),i==="metamask"?Pd(this,Li,{name:"MetaMask",icon:Wi,id:"io.metamask"}):i==="phantom"&&Pd(this,Li,{name:"Phantom",icon:ho,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 Pu(this,Li)??{name:"Browser Extension",icon:Ii,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 xe("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Kr(r)}}};Li=new WeakMap;import{getAddress as gk}from"@ethersproject/address";import{Web3Provider as Ck}from"@ethersproject/providers";import{isMobile as uv}from"react-device-detect";var xl=class extends Ni{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{uv||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 xe("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Kr(t)}}};var kl=class extends tr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Xe(void 0,On);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var Rl=class extends kl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:ho,id:"phantom"}}};import{EthereumProvider as Ev,OPTIONAL_EVENTS as Tv,OPTIONAL_METHODS as Sv}from"@walletconnect/ethereum-provider";import{isMobile as Av}from"react-device-detect";import{createContext as fv,useContext as hv,useEffect as Ud,useRef as yv,useState as gv}from"react";import{jsx as mv}from"react/jsx-runtime";function Nf({src:e,...t}){return mv("img",{src:e,...t,style:{display:"none"}})}import{jsx as Cv,jsxs as wv}from"react/jsx-runtime";var Of=fv({ready:!1,app:om,currentScreen:null,lastScreen:null,navigate:dt,navigateBack:dt,resetNavigation:dt,setModalData:dt,onUserCloseViaDialogOrKeybindRef:void 0}),vv=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Df=e=>{let t=De(),r=e.authenticated,[o,n]=gv(e.initialScreen);Ud(()=>{!r&&!vv.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let a=yv(null);Ud(()=>{e.open||(a.current=null)},[e.open]),Ud(()=>{a.current=null},[e.initialScreen]);let i={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:a};return wv(Of.Provider,{value:i,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&Cv(Nf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},A=()=>hv(Of);import{jsx as Di,jsxs as bv}from"react/jsx-runtime";var Ba=({style:e,...t})=>{let{app:r}=A();return bv("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:[Di("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Di("g",{clipPath:"url(#clip0_1765_9946)",children:Di("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"})}),Di("defs",{children:Di("clipPath",{id:"clip0_1765_9946",children:Di("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var Yr=class extends tr{constructor(r,o,n,a,i,l,s,d){super(d||"unknown",n,a,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new Xe(void 0,this.rpcTimeoutDuration),d&&(this.walletEntry=al[d],this.walletClientType=d)}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=il(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:Wi,id:"io.metamask"}:{name:Lu(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Ba,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=al[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,lf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new _i)};this.onQrModalClosed=n,(async()=>{let i="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(i=l[0]),!i||i==="")throw new xe("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=il(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Mi(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(i=>{if(i){o(Kr(i));return}o(new xe("Unknown error during connection"))}).finally(()=>this.modal?.closeModal())})}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let i of this.chains){let l=Ou(i.id,this.chains,this.rpcConfig,this.privyAppId);l&&(r[i.id]=l)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(i=>i.id),a=await Ev.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:Tv,optionalMethods:Sv,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return a.on("display_uri",i=>{if(a.signer.abortPairingAttempt(),Av&&this.walletEntry){let{redirect:l,href:s}=nf(i,this.walletEntry);cf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let d=af(i,this.walletEntry);d?.redirect&&(this.fallbackUniversalRedirectUri=d.redirect),sl(l,"_self")}else this.modal?.openModal({uri:i,chains:[this.defaultChain.id]})}),a.on("connect",()=>{if(this.modal?.closeModal(),a.session?.peer.metadata.url){let i=il(a.session?.peer.metadata.url);this.walletEntry=i?.entry,this.walletClientType=i?.walletClientType||"unknown"}}),a}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var Hd=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>Pv(o)).map(o=>Ff(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Mi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||On:On,Ha=class extends xv{constructor(r,o,n,a,i,l,s,d,m,f,u){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(a=>a.address===r?.address));return!r||!o?new Xe:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=a,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=d,this.externalWalletConfig=m,this.privyAppName=f,this.privyAppLogo=u,this.storedConnections=Bd()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(a=>a.wallets).sort((a,i)=>a.connectedAt&&i.connectedAt?i.connectedAt-a.connectedAt:0).filter(a=>{let i=`${a.address}${a.walletClientType}${a.connectorType}`;return r.has(i)?!1:(r.add(i),!0)}),n=o.findIndex(a=>a.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;j.get(Md)&&(j.getKeys().forEach(o=>{o.startsWith("walletconnect")&&j.del(o)}),j.del(Md));let r=Nu(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:a,legacyInjectedProvider:i})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:a,legacyInjectedProvider:i})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!Yo()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(a=>a.address===o.address&&a.connectorType===o.connectorType&&a.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,a){let i=this.findWalletConnector("embedded","privy");if(i)i.proxyProvider.walletProxy=r;else{let l=new Fa(r,o,this.rpcConfig,this.chains,a,n.id),s=new Ua(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}addImportedWalletConnector(r,o,n,a){let i=this.findWalletConnector("embedded_imported","privy");if(i)i.proxyProvider.walletProxy=r;else{let l=new Fa(r,o,this.rpcConfig,this.chains,a,n.id),s=!0,d=new Ua(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(d)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Bd(),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=Bd(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let a=this.findWalletConnector(r,o);if(a)return a instanceof Yr&&a.resetConnection(o),a;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new xl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Oi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Oi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Oi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Ni(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Pl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Rl(this.defaultChain):new Yr(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}));j.put(Id,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=Ff(r),this.emit("walletsUpdated")}};function Sl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var kv=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Bd=()=>{let e=j.get(Id);return e&&Array.isArray(e)&&e.map(o=>kv(o)).every(Boolean)?e:[]};import{ofetch as Rv}from"ofetch";var _v=[js,el,$s,ol],_l=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=xd,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=Rv.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:a,options:i})=>{let l=new Headers(i.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=_v.includes(a.toString());if(!l.has("authorization")){let d=await this.client.getAccessToken({disableAutoRefresh:s});d!==null&&l.set("authorization",`Bearer ${d}`)}i.headers=l,i.retryDelay&&(i.retryDelay=i.retryDelay*3)},onRequestError:({error:a})=>{if(a instanceof DOMException&&a.name==="AbortError")throw new ku}})}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 Uf=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});import jo from"js-cookie";function Bf(e){return e instanceof Qo?"email":e instanceof Xo?"sms":e instanceof Oo?"siwe":e instanceof Ai?"guest":e instanceof Si?"custom_auth":e instanceof po?e.meta.provider:null}import{isSafari as Mv}from"react-device-detect";function Ml(){return!(Mv&&window.location.origin.startsWith("http://localhost"))}import*as Hf from"jose";var Wr=class{static parse(t){try{return new Wr(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Hf.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 Iv=30,Il=class{constructor(){this.authenticateOnce=new Ke(async t=>this._authenticate(t)),this.linkOnce=new Ke(async t=>this._link(t)),this.refreshOnce=new Ke(this._refresh.bind(this)),this.destroyOnce=new Ke(this._destroy.bind(this)),this.forkSessionOnce=new Ke(this._forkSession.bind(this))}get token(){try{let t=j.get(In);return typeof t=="string"?new Wr(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=j.get(Ys);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=j.get(xa);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=j.get(Ra(t));if(typeof r=="string"){let o=new Wr(r);return o.isExpired()?(j.del(Ra(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=jo.get(Qs);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!==Ku}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Wr.parse(this.token);return t!==null&&!t.isExpired(Iv)}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"?j.put(Ra(t),r):j.del(Ra(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:a}=r;this.handleTokenResponse(r);let i=a,l=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,refreshTokenExpiresInSeconds:a.refresh_token_expires_in_seconds,scopes:i.scopes}:void 0,s=Bf(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:er(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),nt(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:er(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),nt(r)}}async _refresh(){if(!this.api)throw new w("Session has no API instance");if(!this.client)throw new w("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(t&&r||this.mightHaveServerCookies){let a={};t&&(a.authorization=`Bearer ${t}`);let i=r?{refresh_token:r}:{};n=await this.api.post(js,i,{headers:a}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(el,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),er(n.user)}catch(n){if(n instanceof Rr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw nt(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($s,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new w("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(ym,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw nt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=j.get(In);if(j.put(In,t),!this.client?.useServerCookies){let o=Wr.parse(t)?.expiration;jo.set(kd,t,{sameSite:"Strict",secure:Ml(),expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else j.del(In),jo.remove(kd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(j.put(Ys,t),this.client?.useServerCookies||jo.set(Qs,"t",{sameSite:"Strict",secure:Ml(),expires:30})):(j.del(Ys),jo.remove(Hu),jo.remove(Qs))}storeIdentityToken(t){if(this.client?.useServerCookies)return;j.put(Rd,t);let r=Wr.parse(t)?.expiration;jo.set(_d,t,{sameSite:"Strict",secure:Ml(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){j.del(Rd),jo.remove(_d)}clearForkedToken(){j.del(xa)}};var Vd,Wl,Vf,Va=class{constructor(t){Vs(this,Wl);this.apiUrl=t.apiUrl||Ks,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||Fu,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=xu(this,Wl,Vf).call(this),Vd||(Vd=new Il),this.session=Vd,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:a,walletList:i,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:d}){this.connectors||(this.connectors=new Ha(this.appId,t,r,o,n,a,i,l,s,d))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new _l({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new w("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new w("No auth flow in progress.");let{oAuthTokens:t}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:t}}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(Xm,{action:"verify"})}catch(t){throw ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Zm,{});return Uf(t.options)}catch(t){throw ce(t)}}async acceptTerms(){try{let t=await this.api.post(Jm,{});return er(t)}catch(t){throw nt(t)}}async unlinkEmail(t){try{let r=await this.api.post(Rm,{address:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkPhone(t){try{let r=await this.api.post(Wm,{phoneNumber:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkWallet(t){try{let r=await this.api.post(wm,{address:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Dm,{provider:t,subject:r});return await this.getAuthenticatedUser()??er(o)}catch(o){throw nt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Am,{fid:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Qm,{telegram_user_id:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(zm,{credential_id:t});return await this.getAuthenticatedUser()??er(r)}catch(r){throw nt(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(ol,{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(ef,t)}catch(r){throw nt(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(tf,t)}catch(r){throw nt(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${rf}?partnerUserId=${t}`)}catch(r){throw nt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?this.session.hasRefreshCredentials()?Wr.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:(this.session.destroyLocalState(),null):!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,a=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,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:a}}catch(t){throw nt(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(gm,{address:t,token:r})).nonce}catch(o){throw nt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){return await this.api.post(vm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:a})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){return await this.api.post(Cm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:a})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){try{let i=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a});return er(i)}catch(i){throw nt(i)}}};Wl=new WeakSet,Vf=function(){if(typeof window>"u")return null;try{let r=j.get(ka);if(typeof r=="string"&&r.length>0)return r}catch{}let t=Wv();try{return j.put(ka,t),t}catch{return t}};import{Turnstile as Uv}from"@marsidev/react-turnstile";import{useEffect as Bv,useMemo as Hv}from"react";import{useMemo as Lv,useRef as Nv,useContext as Ov,useState as Gd,createContext as Dv}from"react";import{jsx as Fv}from"react/jsx-runtime";var Gf=Dv({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:dt,setError:dt,setExecuting:dt,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:dt,reset:dt,execute:dt}),yr=class extends Jt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},qf=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=Nv(null),[a,i]=Gd(),[l,s]=Gd(),[d,m]=Gd(!1),f=Lv(()=>o?!d&&!a&&!l?{status:"ready"}:d&&!a&&!l?{status:"loading"}:a&&!l?{status:"success",token:a}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,a,l,d]);return Fv(Gf.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:i,setError:s,setExecuting:m,remove(){o&&(n.current?.remove(),m(!1),s(void 0),i(void 0))},reset(){o&&(n.current?.reset(),m(!1),s(void 0),i(void 0))},execute(){o&&(m(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await Wu(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new yr("Captcha failed",null,"captcha_timeout")}}},children:e})},Te=()=>Ov(Gf);import{jsx as zf}from"react/jsx-runtime";var qd=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:a,setExecuting:i,ref:l}=Te(),[,s]=Hv(()=>r?.split("t:")||[],[r]);if(Bv(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return zf("div",{className:"hidden h-0 w-0",children:zf(Uv,{...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"),i(!1)},onSuccess:d=>{e.onSuccess?.(d),a(d),i(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),a(void 0)}catch{n("expired_and_failed_reset")}}})})};import{useCallback as vS,useEffect as i0,useRef as CS,useState as wS}from"react";import l0 from"styled-components";function zd(e){ze("configureMfa",e)}import cC from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import jf from"styled-components";import Vn,{css as Kf}from"styled-components";import Yd from"styled-components";import{Fragment as Gv,jsx as Kd,jsxs as qv}from"react/jsx-runtime";var it=({success:e,fail:t})=>qv(Gv,{children:[Kd(at,{className:e?"success":t?"fail":""}),Kd(Ga,{className:e?"success":t?"fail":""})]}),at=Yd.span`
|
|
13
13
|
&& {
|
|
14
14
|
width: 82px;
|
|
15
15
|
height: 82px;
|
|
@@ -58,7 +58,7 @@ Resources:
|
|
|
58
58
|
/* Override default Loader to match button transitions */
|
|
59
59
|
transition: border-color 200ms ease;
|
|
60
60
|
}
|
|
61
|
-
`;import{jsx as rr,jsxs as Nl}from"react/jsx-runtime";var qa=
|
|
61
|
+
`;import{jsx as rr,jsxs as Nl}from"react/jsx-runtime";var qa=Vn.button`
|
|
62
62
|
display: flex;
|
|
63
63
|
flex-direction: row;
|
|
64
64
|
align-items: center;
|
|
@@ -80,7 +80,7 @@ Resources:
|
|
|
80
80
|
&& {
|
|
81
81
|
padding: 12px 16px;
|
|
82
82
|
}
|
|
83
|
-
`,U=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(Yf,{disabled:t||r,...n,children:t?Nl("span",{children:[rr(yo,{}),o?rr("span",{children:o}):null]}):e}),
|
|
83
|
+
`,U=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(Yf,{disabled:t||r,...n,children:t?Nl("span",{children:[rr(yo,{}),o?rr("span",{children:o}):null]}):e}),Fo=({children:e,loading:t,disabled:r,...o})=>rr(zv,{disabled:r,...o,children:t?rr(yo,{color:"var(--privy-color-foreground-accent)"}):e}),zv=Vn(qa)`
|
|
84
84
|
position: relative;
|
|
85
85
|
|
|
86
86
|
&& {
|
|
@@ -106,7 +106,7 @@ Resources:
|
|
|
106
106
|
color: var(--privy-color-foreground-accent);
|
|
107
107
|
background-color: var(--privy-color-accent-dark);
|
|
108
108
|
}
|
|
109
|
-
`,Ll=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(Yf,{as:"a",disabled:t||r,...n,children:t?Nl("span",{children:[rr(yo,{}),o?rr("span",{children:o}):null]}):e}),Yf=
|
|
109
|
+
`,Ll=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(Yf,{as:"a",disabled:t||r,...n,children:t?Nl("span",{children:[rr(yo,{}),o?rr("span",{children:o}):null]}):e}),Yf=Vn(qa)`
|
|
110
110
|
position: relative;
|
|
111
111
|
|
|
112
112
|
&& {
|
|
@@ -151,7 +151,7 @@ Resources:
|
|
|
151
151
|
opacity: 1;
|
|
152
152
|
animation: fadein 200ms ease;
|
|
153
153
|
}
|
|
154
|
-
`,
|
|
154
|
+
`,Qr=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(Kv,{disabled:t||r,...n,children:t?Nl("span",{children:[rr(yo,{}),o?rr("span",{children:o}):null]}):e}),Kv=Vn(qa)`
|
|
155
155
|
&& {
|
|
156
156
|
border-width: 1px;
|
|
157
157
|
border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
|
|
@@ -180,7 +180,7 @@ Resources:
|
|
|
180
180
|
opacity: 1;
|
|
181
181
|
animation: fadein 200ms ease;
|
|
182
182
|
}
|
|
183
|
-
|
|
183
|
+
`,$o=Vn.button`
|
|
184
184
|
&& {
|
|
185
185
|
padding: 12px 16px;
|
|
186
186
|
font-weight: 500;
|
|
@@ -211,10 +211,10 @@ Resources:
|
|
|
211
211
|
cursor: not-allowed;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
`,
|
|
214
|
+
`,E_=Vn.div`
|
|
215
215
|
/* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
|
|
216
216
|
height: 44px;
|
|
217
|
-
`,
|
|
217
|
+
`,Fi=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>Nl(Yv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[rr("span",{children:e}),rr("span",{children:rr(yo,{})})]}),Yv=Vn.button`
|
|
218
218
|
&& {
|
|
219
219
|
color: var(--privy-color-accent);
|
|
220
220
|
font-size: 16px;
|
|
@@ -268,7 +268,7 @@ Resources:
|
|
|
268
268
|
display: inline-block;
|
|
269
269
|
box-sizing: border-box;
|
|
270
270
|
}
|
|
271
|
-
`;import Xv from"@heroicons/react/24/outline/ArrowLeftIcon";import Zv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Jv from"@heroicons/react/24/outline/XMarkIcon";import
|
|
271
|
+
`;import Xv from"@heroicons/react/24/outline/ArrowLeftIcon";import Zv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Jv from"@heroicons/react/24/outline/XMarkIcon";import Ui from"styled-components";import{jsx as or,jsxs as Xf}from"react/jsx-runtime";var jv=({backFn:e})=>or("div",{children:or(Qd,{onClick:e,children:or(Xv,{height:"16px",width:"16px",strokeWidth:2})})}),$v=({infoFn:e})=>or("div",{children:or(tC,{"aria-label":"info",onClick:e,children:or(Zv,{height:"22px",width:"22px",strokeWidth:2})})}),eC=e=>or("div",{children:or(Qd,{"aria-label":"close modal",onClick:e.onClose,children:or(Jv,{height:"16px",width:"16px",strokeWidth:2})})});var x=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:a}=_(),i=De();return Xf(rC,{children:[Xf(oC,{children:[e&&or(jv,{backFn:e}),t&&or($v,{infoFn:t})]}),o&&or(iC,{id:"privy-dialog-title",children:o}),or(nC,{children:!i.render.standalone&&n&&or(eC,{onClose:r||(()=>a())})})]})},Qd=Ui.button`
|
|
272
272
|
&& {
|
|
273
273
|
cursor: pointer;
|
|
274
274
|
display: flex;
|
|
@@ -287,11 +287,11 @@ Resources:
|
|
|
287
287
|
opacity: 1;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
`,tC=
|
|
290
|
+
`,tC=Ui(Qd)`
|
|
291
291
|
&& {
|
|
292
292
|
background-color: transparent;
|
|
293
293
|
}
|
|
294
|
-
`,rC=
|
|
294
|
+
`,rC=Ui.div`
|
|
295
295
|
padding: 16px 0;
|
|
296
296
|
display: flex;
|
|
297
297
|
align-items: center;
|
|
@@ -303,16 +303,16 @@ Resources:
|
|
|
303
303
|
font-weight: 600;
|
|
304
304
|
color: var(--privy-color-foreground);
|
|
305
305
|
}
|
|
306
|
-
`,oC=
|
|
306
|
+
`,oC=Ui.div`
|
|
307
307
|
flex: 1;
|
|
308
308
|
align-items: center;
|
|
309
309
|
display: flex;
|
|
310
310
|
gap: 8px;
|
|
311
|
-
`,nC=
|
|
311
|
+
`,nC=Ui.div`
|
|
312
312
|
flex: 1;
|
|
313
313
|
display: flex;
|
|
314
314
|
justify-content: flex-end;
|
|
315
|
-
`,iC=
|
|
315
|
+
`,iC=Ui.div`
|
|
316
316
|
overflow: hidden;
|
|
317
317
|
white-space: nowrap;
|
|
318
318
|
max-width: 100%;
|
|
@@ -342,15 +342,15 @@ Resources:
|
|
|
342
342
|
left: -19px;
|
|
343
343
|
top: -19px;
|
|
344
344
|
}
|
|
345
|
-
`,$e=sC;import
|
|
345
|
+
`,$e=sC;import en,{css as lC}from"styled-components";var gr=en.div`
|
|
346
346
|
text-align: left;
|
|
347
347
|
flex-grow: 1;
|
|
348
|
-
`,Ol
|
|
348
|
+
`,Ol=en.div`
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: column;
|
|
351
351
|
justify-content: flex-end;
|
|
352
352
|
flex-grow: 1;
|
|
353
|
-
`,nr
|
|
353
|
+
`,nr=en.div`
|
|
354
354
|
display: flex;
|
|
355
355
|
flex-direction: column;
|
|
356
356
|
gap: 12px;
|
|
@@ -365,7 +365,7 @@ Resources:
|
|
|
365
365
|
&::-webkit-scrollbar {
|
|
366
366
|
display: none;
|
|
367
367
|
}
|
|
368
|
-
`,Zf
|
|
368
|
+
`,Zf=en(nr)`
|
|
369
369
|
${e=>{if(e.colorScheme==="light")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;";if(e.colorScheme==="dark")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;"}}
|
|
370
370
|
|
|
371
371
|
background-repeat: no-repeat;
|
|
@@ -408,22 +408,22 @@ Resources:
|
|
|
408
408
|
max-width: 24px;
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
`,Dl
|
|
411
|
+
`,Dl=en.div`
|
|
412
412
|
text-align: center;
|
|
413
413
|
font-size: 14px;
|
|
414
414
|
margin-bottom: 24px;
|
|
415
|
-
`,
|
|
415
|
+
`,Se=en.button`
|
|
416
416
|
${Jf}
|
|
417
|
-
`,Xd
|
|
417
|
+
`,Xd=en.a`
|
|
418
418
|
${Jf}
|
|
419
|
-
`,
|
|
419
|
+
`,Xr=en.div`
|
|
420
420
|
width: 100%;
|
|
421
421
|
height: 100%;
|
|
422
422
|
min-height: inherit;
|
|
423
423
|
display: flex;
|
|
424
424
|
flex-direction: column;
|
|
425
425
|
${e=>e.if?"display: none;":""}
|
|
426
|
-
`;import{Fragment as uC,jsx as
|
|
426
|
+
`;import{Fragment as uC,jsx as Gn,jsxs as za}from"react/jsx-runtime";var $f=()=>{let{navigate:e,app:t}=A();return za(uC,{children:[Gn(x,{}),za(dC,{children:[Gn($e,{children:za("div",{children:[Gn(Qf,{color:"var(--privy-color-warn-light)"}),Gn(cC,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),za(pC,{children:[Gn("h3",{children:"Account not found"}),za("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),Gn(gr,{}),Gn(U,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},dC=jf.div`
|
|
427
427
|
display: flex;
|
|
428
428
|
flex-direction: column;
|
|
429
429
|
align-items: center;
|
|
@@ -464,7 +464,7 @@ Resources:
|
|
|
464
464
|
@media (max-width: 440px) {
|
|
465
465
|
padding: 10px 10px 20px;
|
|
466
466
|
}
|
|
467
|
-
`,
|
|
467
|
+
`,qn=mt.div`
|
|
468
468
|
display: flex;
|
|
469
469
|
flex-direction: column;
|
|
470
470
|
align-items: stretch;
|
|
@@ -536,7 +536,7 @@ Resources:
|
|
|
536
536
|
height: 20px !important;
|
|
537
537
|
width: 20px !important;
|
|
538
538
|
}
|
|
539
|
-
`,
|
|
539
|
+
`,zn=mt.div`
|
|
540
540
|
display: flex;
|
|
541
541
|
align-items: center;
|
|
542
542
|
gap: 6px;
|
|
@@ -605,7 +605,7 @@ Resources:
|
|
|
605
605
|
}
|
|
606
606
|
`,Gl=mt.div`
|
|
607
607
|
color: var(--privy-color-error);
|
|
608
|
-
`;import{Fragment as gC,jsx as go,jsxs as Ya}from"react/jsx-runtime";var rh=()=>{let{user:e,logout:t}=q(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:
|
|
608
|
+
`;import{Fragment as gC,jsx as go,jsxs as Ya}from"react/jsx-runtime";var rh=()=>{let{user:e,logout:t}=q(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:a}=A(),{acceptTerms:i,closePrivyModal:l,createAnalyticsEvent:s}=_(),d=f=>{f?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=d;let m=async f=>{f.preventDefault(),await i(),e&&Ft(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:u=>{console.error(u),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:u,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return go(hC,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:m,onDecline:d})},hC=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>Ya(gC,{children:[go(x,{closeable:!1}),go(mC,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),go(me,{style:{marginTop:24},children:"One last step"}),go(he,{children:"By signing up, you agree to our terms and privacy policy."}),Ya(nr,{style:{marginTop:24},children:[e&&Ya(Xd,{target:"_blank",href:e,children:["View Terms ",go(th,{style:{marginLeft:"auto"}})]}),t&&Ya(Xd,{target:"_blank",href:t,children:["View Privacy Policy ",go(th,{style:{marginLeft:"auto"}})]})]}),Ya(yC,{style:{marginTop:24},children:[go(Qr,{onClick:o,children:"No thanks"}),go(U,{onClick:r,children:"Accept"})]}),go(G,{})]}),yC=fC.div`
|
|
609
609
|
display: flex;
|
|
610
610
|
gap: 10px;
|
|
611
611
|
`;import nh from"styled-components";import vC from"styled-components";var ql=vC.span`
|
|
@@ -635,7 +635,7 @@ Resources:
|
|
|
635
635
|
display: flex;
|
|
636
636
|
flex-direction: column;
|
|
637
637
|
gap: 8px;
|
|
638
|
-
`;import TC from"@heroicons/react/20/solid/CheckIcon";import SC from"@heroicons/react/24/outline/EnvelopeIcon";import AC from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as jd,useState as Xa}from"react";import{isMobile as PC}from"react-device-detect";import
|
|
638
|
+
`;import TC from"@heroicons/react/20/solid/CheckIcon";import SC from"@heroicons/react/24/outline/EnvelopeIcon";import AC from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as jd,useState as Xa}from"react";import{isMobile as PC}from"react-device-detect";import Yn from"styled-components";import sr from"styled-components";var lr=sr.div`
|
|
639
639
|
display: flex;
|
|
640
640
|
flex-direction: column;
|
|
641
641
|
align-items: flex-start;
|
|
@@ -655,11 +655,11 @@ Resources:
|
|
|
655
655
|
flex-direction: column;
|
|
656
656
|
align-items: center;
|
|
657
657
|
width: 100%;
|
|
658
|
-
`,
|
|
658
|
+
`,Bi=sr(Tt)`
|
|
659
659
|
padding: 20px 0;
|
|
660
660
|
`,vr=sr(Tt)`
|
|
661
661
|
gap: 16px;
|
|
662
|
-
`,
|
|
662
|
+
`,tn=sr.div`
|
|
663
663
|
display: flex;
|
|
664
664
|
flex-direction: column;
|
|
665
665
|
width: 100%;
|
|
@@ -667,7 +667,7 @@ Resources:
|
|
|
667
667
|
display: flex;
|
|
668
668
|
flex-direction: column;
|
|
669
669
|
gap: 8px;
|
|
670
|
-
`,
|
|
670
|
+
`,AM=sr.div`
|
|
671
671
|
display: flex;
|
|
672
672
|
flex-direction: column;
|
|
673
673
|
justify-content: space-between;
|
|
@@ -701,7 +701,7 @@ Resources:
|
|
|
701
701
|
height: 12px;
|
|
702
702
|
`,lh=sr.div`
|
|
703
703
|
position: relative;
|
|
704
|
-
`,
|
|
704
|
+
`,Hi=sr.div`
|
|
705
705
|
height: ${e=>e.height??"12"}px;
|
|
706
706
|
`,ch=sr.div`
|
|
707
707
|
background-color: var(--privy-color-accent);
|
|
@@ -711,7 +711,7 @@ Resources:
|
|
|
711
711
|
border-radius: 50%;
|
|
712
712
|
border-color: white;
|
|
713
713
|
border-width: 2px !important;
|
|
714
|
-
`;import Jd from"styled-components";import{Fragment as EC,jsx as Qa,jsxs as ph}from"react/jsx-runtime";var
|
|
714
|
+
`;import Jd from"styled-components";import{Fragment as EC,jsx as Qa,jsxs as ph}from"react/jsx-runtime";var Kn=({title:e,description:t,children:r,...o})=>Qa(dh,{...o,children:ph(EC,{children:[Qa("h3",{children:e}),typeof t=="string"?Qa("p",{children:t}):t,r]})}),Co=Jd(Kn)`
|
|
715
715
|
margin-bottom: 24px;
|
|
716
716
|
`,ge=({title:e,description:t,icon:r,children:o,...n})=>ph(bC,{...n,children:[r||null,Qa("h3",{children:e}),t&&typeof t=="string"?Qa("p",{children:t}):t,o]}),dh=Jd.div`
|
|
717
717
|
display: flex;
|
|
@@ -741,7 +741,7 @@ Resources:
|
|
|
741
741
|
h3 {
|
|
742
742
|
margin-bottom: 24px;
|
|
743
743
|
}
|
|
744
|
-
`;import{Fragment as NC,jsx as
|
|
744
|
+
`;import{Fragment as NC,jsx as Ut,jsxs as Uo}from"react/jsx-runtime";var $d=6,uh=new Array($d).fill(""),xC=1400,kC=30;var fh=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:a}=A(),{closePrivyModal:i,resendEmailCode:l,resendSmsCode:s,getAuthMeta:d,loginWithCode:m,updateWallets:f,createAnalyticsEvent:u}=_(),{authenticated:C,logout:v,user:g}=q(),[b,T]=Xa(uh),[R,S]=Xa(!1),[P,k]=Xa(null),[M,O]=Xa(null),[H,Y]=Xa(0);a.current=()=>null;let X=d()?.email?0:1,L=Me,Z=L-500;jd(()=>{if(H){let Q=setTimeout(()=>{Y(H-1)},1e3);return()=>clearTimeout(Q)}},[H]),jd(()=>{if(C&&R&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let oe=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},Z);return()=>clearTimeout(oe)}if(Ft(g,e?.embeddedWallets?.createOnLogin)){let oe=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:pe=>{console.error(pe),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:pe,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Z);return()=>clearTimeout(oe)}else{f();let oe=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),L);return()=>clearTimeout(oe)}}},[C,R,g]),jd(()=>{if(P&&M===0){let Q=setTimeout(()=>{T(uh),k(null),document.querySelector("input[name=code-0]")?.focus()},xC);return()=>clearTimeout(Q)}},[P]);let W=Q=>{Q.preventDefault();let oe=Q.currentTarget.value.replace(" ","");if(oe==="")return;if(isNaN(Number(oe))){k("Code should be numeric"),O(1);return}k(null),O(null);let pe=Number(Q.currentTarget.name?.charAt(5)),Ce=[...oe||[""]].slice(0,$d-pe),de=[...b.slice(0,pe),...Ce,...b.slice(pe+Ce.length)];T(de);let Ae=Ce.length,ut=Math.min(Math.max(pe+Ae,0),$d-1);isNaN(Number(Q.currentTarget.value))||document.querySelector(`input[name=code-${ut}]`)?.focus(),de.every(Je=>Je&&!isNaN(+Je))&&(document.querySelector(`input[name=code-${ut}]`)?.blur(),m(de.join("")).then(()=>S(!0)).catch(le=>{if(le instanceof Rr&&le.privyErrorCode==="invalid_credentials")k("Invalid or expired verification code");else if(le instanceof Rr&&le.privyErrorCode==="cannot_link_more_of_type")k(le.message);else if(le instanceof Rr&&le.privyErrorCode==="max_accounts_reached"){console.error(new lo(le).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(le instanceof Rr&&le.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(le instanceof Rr&&le.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:le,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else k("Issue verifying code");O(0)}))},z=Q=>{M===1&&(k(null),O(null));let oe=[...b.slice(0,Q),"",...b.slice(Q+1)];T(oe),Q>0&&document.querySelector(`input[name=code-${Q-1}]`)?.focus()},Re=X==0?Ut(SC,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):Ut(AC,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),re=X==0?Uo("p",{children:["Please check ",Ut(mh,{children:d()?.email})," for an email from privy.io and enter your code below."]}):Uo("p",{children:["Please check ",Ut(mh,{children:d()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return Uo(NC,{children:[Ut(x,{backFn:()=>o()},"header"),Uo(RC,{children:[Ut(ge,{title:"Enter confirmation code",description:re,icon:Re}),Uo(ah,{children:[Uo(_C,{children:[Ut(MC,{fail:!!P,success:R,children:Ut("span",{children:P||(R?"Success!":"")})}),Ut("div",{children:b.map((Q,oe)=>Ut("input",{name:`code-${oe}`,type:"text",value:b[oe],onChange:W,onKeyUp:pe=>{pe.key==="Backspace"&&z(oe)},inputMode:"numeric",autoFocus:oe===0,pattern:"[0-9]",className:`${R?"success":""} ${P?"fail":""}`,autoComplete:PC?"one-time-code":"off"},oe))})]}),Uo(IC,{children:[Uo("span",{children:["Didn't get ",X==0?"an email":"a message","?"]}),H?Uo(LC,{children:[Ut(TC,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),Ut("span",{children:"Code sent"})]}):Ut(WC,{children:Ut("button",{onClick:async()=>{Y(kC),X==0?await l():await s()},children:"Resend code"})})]})]})]}),Ut(G,{})]})},RC=Yn.div`
|
|
745
745
|
display: flex;
|
|
746
746
|
flex-direction: column;
|
|
747
747
|
align-items: flex-start;
|
|
@@ -749,7 +749,7 @@ Resources:
|
|
|
749
749
|
margin: auto;
|
|
750
750
|
gap: 16px;
|
|
751
751
|
flex-grow: 1;
|
|
752
|
-
`,_C=
|
|
752
|
+
`,_C=Yn.div`
|
|
753
753
|
display: flex;
|
|
754
754
|
flex-direction: column;
|
|
755
755
|
width: 100%;
|
|
@@ -806,7 +806,7 @@ Resources:
|
|
|
806
806
|
transform: translate(1px, 0px);
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
|
-
`,MC=
|
|
809
|
+
`,MC=Yn.div`
|
|
810
810
|
line-height: 20px;
|
|
811
811
|
height: 20px;
|
|
812
812
|
font-size: 13px;
|
|
@@ -814,7 +814,7 @@ Resources:
|
|
|
814
814
|
display: flex;
|
|
815
815
|
justify-content: flex-end;
|
|
816
816
|
width: 100%;
|
|
817
|
-
`,IC=
|
|
817
|
+
`,IC=Yn.div`
|
|
818
818
|
font-size: 13px;
|
|
819
819
|
color: var(--privy-color-foreground);
|
|
820
820
|
display: flex;
|
|
@@ -825,13 +825,13 @@ Resources:
|
|
|
825
825
|
// Equal opposing size buffer to account for auto margining when the
|
|
826
826
|
// success/fail text does not show up
|
|
827
827
|
padding-bottom: 32px;
|
|
828
|
-
`,WC=
|
|
828
|
+
`,WC=Yn.div`
|
|
829
829
|
color: var(--privy-color-accent);
|
|
830
830
|
padding: 2px 0;
|
|
831
831
|
> button {
|
|
832
832
|
text-decoration: underline;
|
|
833
833
|
}
|
|
834
|
-
`,LC=
|
|
834
|
+
`,LC=Yn.div`
|
|
835
835
|
display: flex;
|
|
836
836
|
align-items: center;
|
|
837
837
|
justify-content: center;
|
|
@@ -840,10 +840,10 @@ Resources:
|
|
|
840
840
|
gap: 4px;
|
|
841
841
|
background: var(--privy-color-background-2);
|
|
842
842
|
color: var(--privy-color-foreground-2);
|
|
843
|
-
`,mh=
|
|
843
|
+
`,mh=Yn.span`
|
|
844
844
|
font-weight: 500;
|
|
845
845
|
word-break: break-all;
|
|
846
|
-
`;import BC from"@heroicons/react/24/solid/CheckCircleIcon";import HC from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as ep,useRef as VC,useState as
|
|
846
|
+
`;import BC from"@heroicons/react/24/solid/CheckCircleIcon";import HC from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as ep,useRef as VC,useState as Gi}from"react";import GC from"styled-components";import OC from"styled-components";import{Fragment as UC,jsx as Vi,jsxs as FC}from"react/jsx-runtime";var hh=({icon:e})=>{let t=e;return Vi(UC,{children:Vi(DC,{children:FC("div",{children:[Vi(it,{}),typeof t=="string"?Vi("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?Vi(t,{style:{width:"38px",height:"38px"}}):Vi("span",{})]})})})},DC=OC.div`
|
|
847
847
|
display: flex;
|
|
848
848
|
flex-direction: column;
|
|
849
849
|
justify-content: center;
|
|
@@ -866,14 +866,14 @@ Resources:
|
|
|
866
866
|
left: -19px;
|
|
867
867
|
top: -19px;
|
|
868
868
|
}
|
|
869
|
-
`;import{Fragment as zC,jsx as
|
|
869
|
+
`;import{Fragment as zC,jsx as Zr,jsxs as tp}from"react/jsx-runtime";var gh=500,yh=gh*2,vh=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:a}=A(),{status:i,token:l,waitForResult:s,reset:d,execute:m}=Te(),f=VC([]),u=Z=>{f.current=[Z,...f.current]},[C,v]=Gi(!0);ep(()=>{let Z=setTimeout(v,yh,!1);return u(Z),()=>{f.current.forEach(W=>clearTimeout(W)),f.current=[]}},[]);let[g,b]=Gi(""),[T,R]=Gi("Checking that you are a human..."),[S,P]=Gi(Zr(U,{onClick:()=>{},disabled:!0,children:"Continue"})),[k,M]=Gi(!1),[O,H]=Gi(3),Y=r?.captchaModalData,X=async Z=>{try{await Y?.callback(Z),Y?.onSuccessNavigateTo&&n(Y?.onSuccessNavigateTo,!1)}catch(W){if(W instanceof yr)return;{let z={error:W,previousScreen:e||"LANDING"};a({errorModalData:z}),n(Y?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};ep(()=>{if(i==="success"){let Z=setTimeout(async()=>{let W=await s();!W||Y?.userIntentRequired||X(W)},yh);u(Z)}else if(i==="ready"){let Z=setTimeout(()=>{i==="ready"&&m()},gh);u(Z)}},[i]),ep(()=>{if(!C)switch(i){case"success":b("Success!"),R("CAPTCHA passed successfully."),P(Zr(U,{onClick:()=>{M(!0),X(l)},disabled:!Y?.userIntentRequired,loading:k,children:Y?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":b(""),R("Checking that you are a human..."),P(Zr(U,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":b("Something went wrong"),O<=0?(R("If you use an adblocker or VPN, try disabling and re-attempting."),P(null)):(R("You did not pass CAPTCHA. Please try again."),P(Zr(U,{onClick:L,children:"Retry"})));break;case"ready":default:break}},[i,C,k]);let L=async()=>{if(O<=0)return;H(W=>W-1),d(),m();let Z=await s();!Z||Y?.userIntentRequired||X(Z)};return tp(zC,{children:[Zr(x,{backFn:!e||t===e?void 0:o}),tp(qC,{children:[i==="success"?Zr(BC,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):i==="error"?Zr(HC,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):Zr(hh,{}),tp(Ye,{children:[g?Zr("h3",{children:g}):null,Zr("p",{children:T})]}),S]}),Zr(J,{})]})},qC=GC.div`
|
|
870
870
|
display: flex;
|
|
871
871
|
flex-direction: column;
|
|
872
872
|
align-items: center;
|
|
873
873
|
justify-content: center;
|
|
874
874
|
gap: 24px;
|
|
875
875
|
width: 100%;
|
|
876
|
-
`;import{isMobile as Rh}from"react-device-detect";import _h from"styled-components";import KC from"@heroicons/react/24/outline/WalletIcon";import{jsx as rp}from"react/jsx-runtime";var Yl=({icon:e,name:t})=>typeof e=="string"?rp("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?rp(KC,{}):e?rp(e,{}):null;import{jsx as jr,jsxs as Ch}from"react/jsx-runtime";var wh=({...e})=>Ch("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[jr("defs",{children:Ch("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[jr("stop",{offset:"0",stopColor:"#f1562b"}),jr("stop",{offset:"0.3",stopColor:"#f1542b"}),jr("stop",{offset:"0.41",stopColor:"#f04d2a"}),jr("stop",{offset:"0.49",stopColor:"#ef4229"}),jr("stop",{offset:"0.5",stopColor:"#ef4029"}),jr("stop",{offset:"0.56",stopColor:"#e83e28"}),jr("stop",{offset:"0.67",stopColor:"#e13c26"}),jr("stop",{offset:"1",stopColor:"#df3c26"})]})}),jr("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),jr("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as $r,jsxs as Za}from"react/jsx-runtime";var bh=({style:e,...t})=>Za("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[$r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),$r("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:$r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),Za("g",{mask:"url(#mask0_16909_31415)",children:[$r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),$r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),$r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),$r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),Za("defs",{children:[Za("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[$r("stop",{stopColor:"#002D72"}),$r("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),Za("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[$r("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),$r("stop",{offset:"1",stopColor:"#002D72"})]})]})]});import{jsx as Cr,jsxs as Vi}from"react/jsx-runtime";var Eh=e=>Vi("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Cr("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),Cr("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),Cr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),Cr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),Cr("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),Vi("defs",{children:[Vi("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[Cr("stop",{stopColor:"white"}),Cr("stop",{offset:"1",stopColor:"white"})]}),Vi("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[Cr("stop",{stopColor:"#8697FF"}),Cr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),Vi("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[Cr("stop",{stopColor:"#8697FF"}),Cr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),Vi("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[Cr("stop",{stopColor:"white"}),Cr("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});import{jsx as fe,jsxs as wr}from"react/jsx-runtime";var Th=({style:e,...t})=>wr("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[fe("g",{clipPath:"url(#clip0_5_32)",children:wr("g",{clipPath:"url(#clip1_5_32)",children:[fe("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:fe("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),fe("g",{mask:"url(#mask0_5_32)",children:fe("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),fe("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),fe("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),fe("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),fe("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),fe("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),fe("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),fe("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),fe("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),fe("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),wr("defs",{children:[wr("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#174299"}),fe("stop",{offset:"1",stopColor:"#001E59"})]}),wr("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[fe("stop",{offset:"0.770277",stopColor:"#FF4000"}),fe("stop",{offset:"1",stopColor:"#8754C9"})]}),wr("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#FF4000"}),fe("stop",{offset:"1",stopColor:"#8754C9"})]}),wr("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#8754C9"}),fe("stop",{offset:"1",stopColor:"#FF4000"})]}),wr("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[fe("stop",{offset:"0.723929",stopColor:"#FFF700"}),fe("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#FFF700"}),fe("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#FFF700"}),fe("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[fe("stop",{offset:"0.59513",stopColor:"#00AAFF"}),fe("stop",{offset:"1",stopColor:"#01DA40"})]}),wr("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[fe("stop",{stopColor:"#00AAFF"}),fe("stop",{offset:"1",stopColor:"#01DA40"})]}),wr("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[fe("stop",{stopColor:"#00AAFF"}),fe("stop",{offset:"1",stopColor:"#01DA40"})]}),fe("clipPath",{id:"clip0_5_32",children:fe("rect",{width:"120",height:"120",fill:"white"})}),fe("clipPath",{id:"clip1_5_32",children:fe("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as Ql,jsxs as YC}from"react/jsx-runtime";var Sh=({style:e,...t})=>YC("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:[Ql("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),Ql("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),Ql("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),Ql("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]});import{jsx as wo,jsxs as Ah}from"react/jsx-runtime";var Ph=({style:e,...t})=>Ah("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[wo("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),Ah("g",{children:[wo("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),wo("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),wo("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),wo("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),wo("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),wo("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),wo("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),wo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),wo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as Ja,jsxs as xh}from"react/jsx-runtime";var kh=({style:e,...t})=>xh("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[xh("g",{clipPath:"url(#clip0_1704_1423)",children:[Ja("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),Ja("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),Ja("defs",{children:Ja("clipPath",{id:"clip0_1704_1423",children:Ja("rect",{width:"176",height:"176",fill:"white"})})})]});var Nr={coinbase_wallet:{logo:Oo,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Oo,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Mi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:ho,displayName:"Phantom"},rainbow:{logo:Th,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Ba,displayName:"WalletConnect"},zerion:{logo:kh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:wh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:bh,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Ph,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:Eh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:Sh}},tn=(e,t,r)=>{if(Nr[e]?.displayName)return e==="coinbase_wallet"?Nr[r].displayName:Nr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},Xl=(e,t,r)=>{if(Nr[e]?.logo)return e==="coinbase_wallet"?Nr[r].logo:Nr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Ba};function Gi(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}import{jsx as Zl,jsxs as ZC}from"react/jsx-runtime";var Yn=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=A(),{connectWallet:a}=_(),l=Pt(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,d=window.matchMedia("(display-mode: standalone)").matches,m;return n.connectorType==="phantom"?m=()=>{Ko()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(Rh?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Rh&&!d&&!Gs()?m=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:m=()=>{Gi(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},ZC(QC,{onClick:m,children:[Zl(Yl,{icon:Xl(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),Zl("span",{children:tn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?Zl(XC,{color:"gray",children:"Recent"}):Zl("span",{id:"connect-text",children:"Connect"})]})},QC=_h(Ae)`
|
|
876
|
+
`;import{isMobile as Rh}from"react-device-detect";import _h from"styled-components";import KC from"@heroicons/react/24/outline/WalletIcon";import{jsx as rp}from"react/jsx-runtime";var Yl=({icon:e,name:t})=>typeof e=="string"?rp("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?rp(KC,{}):e?rp(e,{}):null;import{jsx as Jr,jsxs as Ch}from"react/jsx-runtime";var wh=({...e})=>Ch("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[Jr("defs",{children:Ch("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[Jr("stop",{offset:"0",stopColor:"#f1562b"}),Jr("stop",{offset:"0.3",stopColor:"#f1542b"}),Jr("stop",{offset:"0.41",stopColor:"#f04d2a"}),Jr("stop",{offset:"0.49",stopColor:"#ef4229"}),Jr("stop",{offset:"0.5",stopColor:"#ef4029"}),Jr("stop",{offset:"0.56",stopColor:"#e83e28"}),Jr("stop",{offset:"0.67",stopColor:"#e13c26"}),Jr("stop",{offset:"1",stopColor:"#df3c26"})]})}),Jr("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),Jr("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as jr,jsxs as Za}from"react/jsx-runtime";var bh=({style:e,...t})=>Za("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[jr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),jr("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:jr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),Za("g",{mask:"url(#mask0_16909_31415)",children:[jr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),jr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),jr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),jr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),Za("defs",{children:[Za("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[jr("stop",{stopColor:"#002D72"}),jr("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),Za("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[jr("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),jr("stop",{offset:"1",stopColor:"#002D72"})]})]})]});import{jsx as Cr,jsxs as qi}from"react/jsx-runtime";var Eh=e=>qi("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Cr("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),Cr("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),Cr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),Cr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),Cr("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),qi("defs",{children:[qi("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[Cr("stop",{stopColor:"white"}),Cr("stop",{offset:"1",stopColor:"white"})]}),qi("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[Cr("stop",{stopColor:"#8697FF"}),Cr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),qi("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[Cr("stop",{stopColor:"#8697FF"}),Cr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),qi("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[Cr("stop",{stopColor:"white"}),Cr("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});import{jsx as fe,jsxs as wr}from"react/jsx-runtime";var Th=({style:e,...t})=>wr("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[fe("g",{clipPath:"url(#clip0_5_32)",children:wr("g",{clipPath:"url(#clip1_5_32)",children:[fe("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:fe("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),fe("g",{mask:"url(#mask0_5_32)",children:fe("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),fe("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),fe("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),fe("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),fe("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),fe("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),fe("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),fe("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),fe("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),fe("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),wr("defs",{children:[wr("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#174299"}),fe("stop",{offset:"1",stopColor:"#001E59"})]}),wr("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[fe("stop",{offset:"0.770277",stopColor:"#FF4000"}),fe("stop",{offset:"1",stopColor:"#8754C9"})]}),wr("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#FF4000"}),fe("stop",{offset:"1",stopColor:"#8754C9"})]}),wr("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#8754C9"}),fe("stop",{offset:"1",stopColor:"#FF4000"})]}),wr("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[fe("stop",{offset:"0.723929",stopColor:"#FFF700"}),fe("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#FFF700"}),fe("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#FFF700"}),fe("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[fe("stop",{offset:"0.59513",stopColor:"#00AAFF"}),fe("stop",{offset:"1",stopColor:"#01DA40"})]}),wr("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[fe("stop",{stopColor:"#00AAFF"}),fe("stop",{offset:"1",stopColor:"#01DA40"})]}),wr("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[fe("stop",{stopColor:"#00AAFF"}),fe("stop",{offset:"1",stopColor:"#01DA40"})]}),fe("clipPath",{id:"clip0_5_32",children:fe("rect",{width:"120",height:"120",fill:"white"})}),fe("clipPath",{id:"clip1_5_32",children:fe("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as Ql,jsxs as YC}from"react/jsx-runtime";var Sh=({style:e,...t})=>YC("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:[Ql("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),Ql("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),Ql("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),Ql("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]});import{jsx as wo,jsxs as Ah}from"react/jsx-runtime";var Ph=({style:e,...t})=>Ah("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[wo("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),Ah("g",{children:[wo("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),wo("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),wo("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),wo("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),wo("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),wo("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),wo("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),wo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),wo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as Ja,jsxs as xh}from"react/jsx-runtime";var kh=({style:e,...t})=>xh("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[xh("g",{clipPath:"url(#clip0_1704_1423)",children:[Ja("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),Ja("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),Ja("defs",{children:Ja("clipPath",{id:"clip0_1704_1423",children:Ja("rect",{width:"176",height:"176",fill:"white"})})})]});var Nr={coinbase_wallet:{logo:Do,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Do,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Wi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:ho,displayName:"Phantom"},rainbow:{logo:Th,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Ba,displayName:"WalletConnect"},zerion:{logo:kh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:wh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:bh,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Ph,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:Eh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:Sh}},rn=(e,t,r)=>{if(Nr[e]?.displayName)return e==="coinbase_wallet"?Nr[r].displayName:Nr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},Xl=(e,t,r)=>{if(Nr[e]?.logo)return e==="coinbase_wallet"?Nr[r].logo:Nr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Ba};function zi(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}import{jsx as Zl,jsxs as ZC}from"react/jsx-runtime";var Qn=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:a}=A(),{connectWallet:i}=_(),l=Pt(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,d=window.matchMedia("(display-mode: standalone)").matches,m;return n.connectorType==="phantom"?m=()=>{Yo()?(i(n,s),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):a(Rh?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Rh&&!d&&!Gs()?m=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:m=()=>{zi(window.navigator.userAgent)&&!event?.isTrusted||(i(n,s),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},ZC(QC,{onClick:m,children:[Zl(Yl,{icon:Xl(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),Zl("span",{children:rn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?Zl(XC,{color:"gray",children:"Recent"}):Zl("span",{id:"connect-text",children:"Connect"})]})},QC=_h(Se)`
|
|
877
877
|
/* Show "Connect" on hover */
|
|
878
878
|
> #connect-text {
|
|
879
879
|
font-weight: 500;
|
|
@@ -897,7 +897,7 @@ Resources:
|
|
|
897
897
|
}
|
|
898
898
|
`,XC=_h(jt)`
|
|
899
899
|
margin-left: auto;
|
|
900
|
-
`;import{Fragment as t4,jsx as
|
|
900
|
+
`;import{Fragment as t4,jsx as Ki,jsxs as r4}from"react/jsx-runtime";var JC=["coinbase_wallet"],jC=["metamask","okx_wallet","rainbow","uniswap","uniswap_extension","zerion","rabby_wallet","cryptocom"],$C=["safe"],e4=["phantom"],Yi=({connectOnly:e})=>{let{connectors:t}=_(),{app:r}=A(),o=on(r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return r4(t4,{children:[...o]})},on=(e,t,r,o,n)=>{let a=[],i=[],l=[],s=t.find(d=>d.connectorType==="wallet_connect_v2");for(let d of e)if(d==="detected_wallets"){let m=t.filter(({connectorType:f,walletClientType:u})=>u==="uniswap_wallet_extension"||u==="uniswap_extension"?!o.includes("uniswap"):u==="crypto.com_wallet_extension"?!o.includes("cryptocom"):f==="injected"&&!o.includes(u));for(let f of m){let{walletClientType:u,walletBranding:C}=f;(u==="unknown"?i:a).push(Ki(Qn,{connectOnly:r,provider:u,logo:C.icon,displayName:C.name,connector:f},`${d}-${u}`))}}else if(e4.includes(d)){let m=t.find(f=>f.connectorType==="injected"&&f.walletClientType===d||f.connectorType===d);m&&a.push(Ki(Qn,{connectOnly:r,provider:d,connector:m},d))}else if(jC.includes(d)){let m=t.find(f=>d==="uniswap"?f.walletClientType==="uniswap_wallet_extension"||f.walletClientType==="uniswap_extension":d==="cryptocom"?f.walletClientType==="crypto.com_wallet_extension":f.connectorType==="injected"&&f.walletClientType===d);n&&!m&&(m=s),m&&a.push(Ki(Qn,{connectOnly:r,provider:d,connector:m,logo:m.connectorType==="injected"?m.walletBranding.icon:void 0,displayName:m.connectorType==="injected"?m.walletBranding.name:void 0},d))}else if(JC.includes(d)){let m=t.find(({connectorType:f})=>f===d);m&&a.push(Ki(Qn,{connectOnly:r,provider:d,connector:m},d))}else $C.includes(d)?s&&l.push(Ki(Qn,{connectOnly:r,provider:d,connector:s},d)):d==="wallet_connect"&&s&&l.push(Ki(Qn,{connectOnly:r,provider:d,connector:s},d));return[...i,...a,...l]};import{Fragment as o4,jsx as ja,jsxs as n4}from"react/jsx-runtime";var Mh=()=>{let{app:e}=A(),{linkingOrConnectingHint:t}=_(),r=t?`Connect the wallet with address ${Dt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return n4(o4,{children:[ja(x,{},"header"),ja(Co,{title:"Connect your wallet",description:r}),ja(nr,{children:ja(Yi,{connectOnly:!0})}),ja(G,{})]})};import{Fragment as i4,jsx as Qi,jsxs as a4}from"react/jsx-runtime";var Ih=()=>{let{app:e}=A(),{linkingOrConnectingHint:t}=_(),r=t?`Connect the wallet with address ${Dt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return a4(i4,{children:[Qi(x,{},"header"),Qi(Kn,{title:"Connect your wallet",description:r}),Qi(nr,{children:Qi(Yi,{connectOnly:!0})}),e&&Qi(bi,{app:e,alwaysShowImplicitConsent:!0}),Qi(G,{})]})};import{useEffect as Fh,useState as Uh}from"react";import{isMobile as f4}from"react-device-detect";import h4 from"styled-components";import{useEffect as op,useState as nn}from"react";import{isMobile as Jl}from"react-device-detect";import Oh from"styled-components";import{useEffect as Wh,useRef as s4}from"react";var l4=(e,t)=>{let r=s4(()=>{});Wh(()=>{r.current=e}),Wh(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Lh=l4;import{useState as c4,useEffect as d4,useCallback as p4}from"react";function Nh(){let[e,t]=c4(!1),r=p4(()=>{document.hidden&&t(!0)},[]);return d4(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as ip,jsx as ft,jsxs as Xi}from"react/jsx-runtime";var np=2,ap=e=>e?.privyErrorCode==="linked_to_another_user"?uo.ERROR_USER_EXISTS:e instanceof Et&&!e.details.default?e.details:e instanceof Ri?uo.ERROR_TIMED_OUT:e instanceof _i?uo.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode==="cannot_link_more_of_type"?uo.ERROR_USER_LIMIT_REACHED:uo.ERROR_WALLET_CONNECTION,Dh=()=>{let[e,t]=nn(!1),[r,o]=nn(!1),[n,a]=nn(void 0),{authenticated:i,logout:l}=q(),{app:s,navigate:d,navigateBack:m,lastScreen:f,currentScreen:u,setModalData:C}=A(),{getAuthFlow:v,walletConnectionStatus:g,closePrivyModal:b,initLoginWithWallet:T,loginWithWallet:R,updateWallets:S,createAnalyticsEvent:P}=_(),{walletConnectors:k}=q(),[M,O]=nn(0),{user:H}=q(),[Y]=nn(H?.linkedAccounts.length||0),[X,L]=nn(""),[Z,W]=nn(""),[z,Re]=nn(!1),{hasTabbedAway:re}=Nh(),{enabled:Q,token:oe}=Te(),pe=Jl&&g?.connector?.connectorType==="wallet_connect_v2"||Jl&&g?.connector?.connectorType==="coinbase_wallet"||Jl&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",Ce=g?.status==="connected",de=g?.status==="switching_to_supported_chain";op(()=>{let B=v(),se=B instanceof Oo?B:void 0;if(Ce&&!se&&(Q&&!oe&&!i?(C({captchaModalData:{callback:rt=>T(g.connectedWallet,rt).then(()=>{Re(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN",!1)):T(g.connectedWallet,oe).then(()=>{Re(!0)})),se&&pe&&Ce&&!se.preparedMessage){se.buildSiweMessage();return}!se||pe||!Ce||r||(async()=>{o(!0),a(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await Iu(2500),await ut()}catch(rt){console.warn("Auto-prompted signature failed",rt)}finally{o(!1)}})()},[M,Ce,z]),op(()=>{if(H&&e){let se=Me-500;if(s?.legal.requireUsersAcceptTerms&&!H.hasAcceptedTerms){let Rn=setTimeout(()=>{d("AFFIRMATIVE_CONSENT_SCREEN")},se);return()=>clearTimeout(Rn)}if(Ft(H,s?.embeddedWallets?.createOnLogin)){let Rn=setTimeout(()=>{C({createWallet:{onSuccess:()=>{},onFailure:mi=>{console.error(mi),P({eventName:"embedded_wallet_creation_failure_logout",payload:{error:mi,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),d("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},se);return()=>clearTimeout(Rn)}S();let rt=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Me);return()=>clearTimeout(rt)}},[H,e]);let Ae=B=>{if(B?.privyErrorCode==="allowlist_rejected"){d("ALLOWLIST_REJECTION_SCREEN");return}else if(B?.privyErrorCode==="max_accounts_reached"){console.error(new lo(B).toString()),d("USER_LIMIT_REACHED_SCREEN");return}else if(B?.privyErrorCode==="user_does_not_exist"){d("ACCOUNT_NOT_FOUND_SCREEN");return}a(ap(B))};async function ut(){try{await R(),t(!0)}catch(B){Ae(B)}finally{o(!1)}}op(()=>{g?.connectError&&Ae(g?.connectError)},[g]),Lh(()=>{let B=Je==="wallet_connect_v2"&&g?.connector instanceof Yr?g.connector.redirectUri:void 0;B&&L(B);let se=Je==="wallet_connect_v2"&&g?.connector instanceof Yr?g.connector.fallbackUniversalRedirectUri:void 0;se&&W(se)},g?.connector instanceof Yr&&!X?500:null);let Je=g?.connector?.connectorType||"injected",le=g?.connector?.walletClientType||"unknown",Yt=Nr[le]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",mr=Nr[le]?.logo||g?.connector?.walletBranding.icon||(B=>ft(Ii,{...B})),Ct=Yt==="Browser Extension"?Yt.toLowerCase():Yt,I;e?I=`Successfully connected with ${Ct}`:n?I=n.message:de?I="Switching networks":Ce?I=r&&pe?"Signing":"Sign to verify":I=`Waiting for ${Ct}`;let qe="Don\u2019t see your wallet? Check your other browser windows.";if(e){let B=H?.linkedAccounts.length||0;Y===B?qe="Wallet was already linked.":qe="You\u2019re good to go!"}else M>=np&&n?qe="Unable to connect wallet":n?qe=n.detail:de?qe="Switch your wallet to the requested network.":Ce&&pe?qe="Sign the message in your wallet to verify it belongs to you.":le==="metamask"&&Jl?qe="Click continue to open and connect MetaMask.":le==="metamask"?qe="For the best experience, connect only one wallet at a time.":Je==="wallet_connect"?qe="Open your mobile wallet app to continue":Je==="coinbase_wallet"&&(Gs()||(Hd(H)?qe="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":qe="Open the Coinbase app on your phone to continue."));let Qt=k?.walletConnectors?.find(B=>B.walletClientType==="coinbase_wallet"),F=le==="coinbase_wallet"&&(Hd(H)||n===uo.ERROR_USER_EXISTS);return Xi(ip,{children:[ft(x,{backFn:!f||u===f?void 0:m}),Xi(u4,{children:[ft(sp,{walletLogo:mr,success:e,fail:!!n}),Xi(Ye,{children:[ft("h3",{children:I}),ft("p",{children:qe}),!Ce&&X&&!re?Xi("p",{children:["Still here?"," ",ft("a",{href:X,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),Z&&Xi(ip,{children:[" ","or"," ",ft("a",{href:Z,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),F?ft(U,{onClick:()=>Qt&&Qt?.disconnect(),disabled:e,children:"Use a different wallet"}):n==uo.ERROR_USER_EXISTS&&u!==f?ft(U,{onClick:m,children:"Use a different wallet"}):Ce&&!e&&pe?ft(U,{onClick:()=>{o(!0),ut()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<np?ft(U,{onClick:()=>{O(M+1),a(void 0),Ce?(o(!0),ut()):g?.connectRetry()},disabled:!e&&(!n?.retryable||M>=np),children:"Retry"}):!e&&!n?ft(U,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),ft(J,{})]})},u4=Oh.div`
|
|
901
901
|
display: flex;
|
|
902
902
|
flex-direction: column;
|
|
903
903
|
align-items: center;
|
|
@@ -927,14 +927,14 @@ Resources:
|
|
|
927
927
|
left: -19px;
|
|
928
928
|
top: -19px;
|
|
929
929
|
}
|
|
930
|
-
`,sp=e=>{let t=e.walletLogo;return ft(ip,{children:ft(m4,{children:
|
|
930
|
+
`,sp=e=>{let t=e.walletLogo;return ft(ip,{children:ft(m4,{children:Xi("div",{children:[ft(it,{success:e.success,fail:e.fail}),typeof t=="string"?ft("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):ft(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as g4,jsx as Bo,jsxs as lp}from"react/jsx-runtime";var jl=2,Bh=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=A(),{walletConnectionStatus:a,closePrivyModal:i}=_(),[l,s]=Uh(void 0),[d,m]=Uh(0),f=a?.status==="connected",u=a?.status==="switching_to_supported_chain";Fh(()=>{if(f){let k;if(n?.externalConnectWallet?.onCompleteNavigateTo){let M=n.externalConnectWallet.onCompleteNavigateTo;k=setTimeout(()=>{t(M)},Me)}else k=setTimeout(i,Me);return()=>clearTimeout(k)}},[f]);let C=k=>{s(ap(k))};Fh(()=>{a?.connectError&&C(a?.connectError)},[a]);let v=a?.connector?.connectorType||"injected",g=a?.connector?.walletClientType||"unknown",b=Nr[g]?.displayName||a?.connector?.walletBranding.name||"Browser Extension",T=Nr[g]?.logo||a?.connector?.walletBranding.icon||(k=>Bo(Ii,{...k})),R=b==="Browser Extension"?b.toLowerCase():b,S;f?S=`Successfully connected with ${R}`:l?S=l.message:u?S="Switching networks":S=`Waiting for ${R}`;let P="Don\u2019t see your wallet? Check your other browser windows.";return f?P="You\u2019re good to go!":d>=jl&&l?P="Unable to connect wallet":l?P=l.detail:u?P="Switch your wallet to the requested network.":g==="metamask"&&f4?P="Click to continue to open and connect MetaMask.":g==="metamask"?P="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?P="Open your mobile wallet app to continue":v==="coinbase_wallet"&&(P="Open the Coinbase app on your phone to continue."),lp(g4,{children:[Bo(x,{backFn:o===r?void 0:e}),lp(y4,{children:[Bo(sp,{walletLogo:T,success:f,fail:!!l}),lp(Ye,{children:[Bo("h3",{children:S}),Bo("p",{children:P})]}),l==uo.ERROR_USER_EXISTS?Bo(U,{onClick:e,children:"Use a different wallet"}):!f&&l?.retryable&&d<jl?Bo(U,{onClick:()=>{m(d+1),s(void 0),a?.connectRetry()},disabled:!f&&(!l?.retryable||d>=jl),children:"Retry"}):!f&&l&&d>=jl?Bo(U,{onClick:e,children:"Use a different wallet"}):null]}),Bo(J,{})]})},y4=h4.div`
|
|
931
931
|
display: flex;
|
|
932
932
|
flex-direction: column;
|
|
933
933
|
align-items: center;
|
|
934
934
|
justify-content: center;
|
|
935
935
|
gap: 24px;
|
|
936
936
|
width: 100%;
|
|
937
|
-
`;import{useEffect as Gh,useMemo as v4,useState as C4}from"react";import w4 from"styled-components";import{jsx as Hh}from"react/jsx-runtime";var Vh=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?Hh("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):Hh("span",{})};import{Fragment as E4,jsx as
|
|
937
|
+
`;import{useEffect as Gh,useMemo as v4,useState as C4}from"react";import w4 from"styled-components";import{jsx as Hh}from"react/jsx-runtime";var Vh=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?Hh("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):Hh("span",{})};import{Fragment as E4,jsx as Ho,jsxs as $l}from"react/jsx-runtime";var qh=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=A(),{crossAppAuthFlow:r,updateWallets:o,closePrivyModal:n}=_(),[a,i]=C4({}),l={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},s=Me,d=new w(`There was an issue connecting your ${l.name} account. Please try again.`),m=new Ke(async v=>{if(!e?.crossAppAuth?.popup){i({error:d});return}try{let g=await r({appId:v,popup:e.crossAppAuth.popup});i({data:g})}catch(g){g instanceof w?i({error:g}):g instanceof Rr?(e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),i({error:d})):i({error:d})}}),f=()=>{a.data&&(o(),e?.crossAppAuth?.onSuccess(a.data),n({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(a.error??new w("User canceled flow")),n({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=f,Gh(()=>{l.id.length&&m.execute(l.id)},[l.id]),Gh(()=>{if(!a.data)return;let v=setTimeout(f,s);return()=>clearTimeout(v)},[a.data]);let{title:u,subtitle:C}=v4(()=>a.data?{title:`Successfully connected with ${l.name}`,subtitle:"You're good to go!"}:a.error?{title:"Authentication failed",subtitle:a.error.message}:{title:`Connecting to ${l.name}`,subtitle:`Please check the pop-up from ${l.name} to continue`},[a,l.name]);return $l(E4,{children:[Ho(x,{onClose:f}),Ho(ie,{}),$l(b4,{children:[Ho($e,{children:$l("div",{children:[Ho(it,{success:!!a.data,fail:!!a.error}),Ho(Vh,{name:l.name,logoUrl:l.logoUrl})]})}),$l(Ye,{children:[Ho("h3",{children:u}),Ho("p",{children:C})]})]}),Ho(ae,{}),Ho(J,{})]})},b4=w4.div`
|
|
938
938
|
display: flex;
|
|
939
939
|
flex-direction: column;
|
|
940
940
|
align-items: center;
|
|
@@ -998,9 +998,9 @@ Resources:
|
|
|
998
998
|
transform: rotate(360deg);
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
-
`;var zh=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];var Ne=class extends Error{constructor(r,o){super(o);this.type=r}};function
|
|
1001
|
+
`;var zh=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];var Ne=class extends Error{constructor(r,o){super(o);this.type=r}};function Zi(e){let t=e.type;return typeof t=="string"&&zh.includes(t)}function k4(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function Xn(e){return Zi(e)&&e.type==="wallet_not_on_device"}function Kh(e){return Zi(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Zn(e){return!!(Zi(e)&&e.type==="mfa_timeout")}function Jn(e){return!!(Zi(e)&&e.type==="missing_or_invalid_mfa")}function dp(e){return!!(Zi(e)&&e.type==="mfa_verification_max_attempts_reached")}function rc(e){return!!(Zi(e)&&e.message.includes("code 429"))}function oc(e){return!!(k4(e)&&e.message==="MFA canceled")}function pp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function nc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:o,showAutomaticRecovery:n}){return n?"EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN":r||t.length===1?pp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function ic(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function up({api:e,provider:t}){let r=Dn(),o=Pi(),n=await xi(r);try{return t==="icloud"?{url:(await e.post(Um,{client_type:"web"})).url}:{url:(await e.post(Fm,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(a){throw ce(a)}}async function Yh({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during OAuth flow");try{return(await e.post(Bm,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(a){let i=ce(a);throw i.privyErrorCode?new w(i.message||"Invalid code during OAuth flow.",void 0,i.privyErrorCode):i.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}import{Fragment as Xh,jsx as Ji,jsxs as mp}from"react/jsx-runtime";var Qh=1,Zh=()=>{let{authenticated:e,user:t,getAccessToken:r}=q(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:a}=_(),{navigate:i,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:d}=A(),m=M4(()=>Date.now(),[]),[f,u]=I4(!1),{onCompleteNavigateTo:C,onFailure:v,shouldForceMFA:g,address:b}=l?.connectWallet,T=S=>{f||(u(!0),v(typeof S=="string"?new Error(S):S))};_4(()=>{let S=b?t?.linkedAccounts.find(M=>M.type==="wallet"&&M.walletClientType==="privy"&&M.address===b):be(t),P;return!e||!S?T("User must be authenticated and have a Privy wallet before it can be connected"):a?((async()=>{let M=await r();if(!M)return T("User must be authenticated and have a Privy wallet before it can be connected");try{await a.connect({accessToken:M,address:S.address}),g&&await a.verifyMfa({accessToken:M});let O=(Date.now()-m)/1e3;C==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&O<Qh?P=setTimeout(()=>{i(C,!1)},(Qh-O)*1e3):i(C,!1)}catch(O){if(Xn(O)&&S.recoveryMethod==="privy"){let H=await r();if(!H)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:S.address}}),(await a?.recover({address:S.address,accessToken:H,recoveryMethod:S.recoveryMethod}))?.address||T(new Error("Unable to recover wallet")),C?i(C):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:S.address}}),i(C)}catch{T("An error has occurred, please try again.")}}else if(Xn(O)&&S.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:S,onCompleteNavigateTo:C,onFailure:v},recoveryOAuthStatus:{provider:S.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let H=ic(S.recoveryMethod);i(H)}else T(O)}})(),()=>clearTimeout(P)):void 0},[e,t,a]);let R=()=>{T("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return d.current=R,mp(Xh,{children:[Ji(x,{onClose:R}),f?mp(Xh,{children:[mp(vr,{children:[Ji(R4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Ji(ge,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),Ji(U,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):Ji(tc,{}),Ji(L4,{})]})},L4=W4.div`
|
|
1002
1002
|
height: 44px;
|
|
1003
|
-
`;import N4 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as O4}from"react";import{Fragment as D4,jsx as
|
|
1003
|
+
`;import N4 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as O4}from"react";import{Fragment as D4,jsx as ji,jsxs as Jh}from"react/jsx-runtime";var jh=()=>{let{user:e}=q(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=_(),{app:n,data:a,onUserCloseViaDialogOrKeybindRef:i}=A(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:d}=a.createWallet,m=()=>{let f=be(e);f?(o(),l(f)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:d})};return O4(()=>{let f=setTimeout(m,Uu);return()=>clearTimeout(f)},[]),i.current=m,Jh(D4,{children:[ji(x,{onClose:m}),ji(ie,{}),Jh(vr,{children:[ji(N4,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),ji(ge,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),ji(ae,{}),ji(G,{})]})};import{useEffect as ty,useRef as z4,useState as fp}from"react";import hp from"styled-components";import{ExclamationTriangleIcon as F4}from"@heroicons/react/24/outline";import U4 from"styled-components";import{jsx as H4,jsxs as V4}from"react/jsx-runtime";var $h=({children:e,theme:t})=>V4(B4,{$theme:t,children:[H4(F4,{width:"1.25rem",color:t==="dark"?"#FDE68A":"var(--privy-color-warn)"}),e]}),B4=U4.div`
|
|
1004
1004
|
display: flex;
|
|
1005
1005
|
gap: 0.5rem;
|
|
1006
1006
|
background-color: ${e=>e.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-background)"};
|
|
@@ -1032,13 +1032,13 @@ Resources:
|
|
|
1032
1032
|
&& a {
|
|
1033
1033
|
color: var(--privy-color-accent);
|
|
1034
1034
|
}
|
|
1035
|
-
`;import q4 from"styled-components";var
|
|
1035
|
+
`;import q4 from"styled-components";var $r=q4.span`
|
|
1036
1036
|
color: var(--privy-color-foreground);
|
|
1037
1037
|
font-size: 1.125rem;
|
|
1038
1038
|
font-weight: 600;
|
|
1039
1039
|
line-height: 1.875rem; /* 166.667% */
|
|
1040
1040
|
text-align: center;
|
|
1041
|
-
`;import{Fragment as X4,jsx as Dr,jsxs as ac}from"react/jsx-runtime";var ry=()=>{let[e,t]=fp(null),{authenticated:r,user:o,getAccessToken:n}=q(),{closePrivyModal:
|
|
1041
|
+
`;import{Fragment as X4,jsx as Dr,jsxs as ac}from"react/jsx-runtime";var ry=()=>{let[e,t]=fp(null),{authenticated:r,user:o,getAccessToken:n}=q(),{closePrivyModal:a,createAnalyticsEvent:i,clientAnalyticsId:l}=_(),s=De(),{data:d,onUserCloseViaDialogOrKeybindRef:m}=A(),{onFailure:f,onSuccess:u,origin:C,appId:v,appClientId:g,wallet:b}=d.keyExport,T=S=>{a({shouldCallAuthOnSuccess:!1}),f(typeof S=="string"?new Error(S):S)},R=()=>{a({shouldCallAuthOnSuccess:!1}),u(),i({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:b.address}})};return ty(()=>{if(!r||!b)return T("User must be authenticated before exporting their wallet");n().then(t,T)},[r,o]),m.current=R,ac(X4,{children:[Dr(x,{onClose:R}),ac(Y4,{children:[Dr($r,{children:"Transfer wallet"}),ac(Or,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",Dr("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),Dr($h,{theme:s.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),Dr(Ei,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:b.address,showIcon:!0}),Dr("div",{style:{width:"100%"},children:e&&Dr(K4,{origin:C,appId:v,appClientId:g,accessToken:e,clientAnalyticsId:l,wallet:b,dimensions:{height:"44px"}})})]}),Dr(G,{})]})};function K4(e){let[t,r]=fp(e.dimensions.width),[o,n]=fp(void 0),a=z4(null);ty(()=>{if(a.current&&t===void 0){let{width:s}=a.current.getBoundingClientRect();r(s)}let l=getComputedStyle(document.documentElement);n({background:l.getPropertyValue("--privy-color-background"),background2:l.getPropertyValue("--privy-color-background-2"),foreground3:l.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:l.getPropertyValue("--privy-color-foreground-accent"),accent:l.getPropertyValue("--privy-color-accent"),accentDark:l.getPropertyValue("--privy-color-accent-dark"),success:l.getPropertyValue("--privy-color-success")})},[]);let i=e.wallet.chainType==="ethereum"&&!e.wallet.imported;return Dr("div",{ref:a,children:t&&ac(Q4,{children:[Dr("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:zs(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.wallet.address,width:`${t}px`,caid:e.clientAnalyticsId,phrase_export:i,...o},{token:e.accessToken})}),Dr(ey,{children:"Loading..."}),i&&Dr(ey,{children:"Loading..."})]})})}var Y4=hp.div`
|
|
1042
1042
|
display: flex;
|
|
1043
1043
|
flex-direction: column;
|
|
1044
1044
|
gap: 1.25rem;
|
|
@@ -1061,7 +1061,7 @@ Resources:
|
|
|
1061
1061
|
border-radius: var(--privy-border-radius-md);
|
|
1062
1062
|
background-color: var(--privy-color-background-2);
|
|
1063
1063
|
color: var(--privy-color-foreground-3);
|
|
1064
|
-
`;import j4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as $4,useState as oy}from"react";import ew from"styled-components";import{useCallback as Z4,useRef as J4}from"react";function sc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=_(),o=J4(!1);return{createWallet:Z4(async
|
|
1064
|
+
`;import j4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as $4,useState as oy}from"react";import ew from"styled-components";import{useCallback as Z4,useRef as J4}from"react";function sc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=_(),o=J4(!1);return{createWallet:Z4(async a=>{let i=await Ee();if(!i)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),new Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let l=await r(vi);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,d=new Promise((C,v)=>{setTimeout(()=>{v(new Error("walletProxy.create timed out."))},s)});if(!await Promise.race([l.create({accessToken:i,recoveryPassword:a}),d]))throw new Error("walletProxy.create did not send a response.");let f=await e();if(!f)throw new Error("Failed to refresh user.");let u=be(f);if(!u)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:u.address}}),o.current=!0,u}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}import{Fragment as rw,jsx as $i,jsxs as ny}from"react/jsx-runtime";var iy=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=A(),[a,i]=oy(""),{embeddedWallets:l}=De(),{authenticated:s}=q(),{closePrivyModal:d}=_(),{onSuccess:m,onFailure:f,callAuthOnSuccessOnClose:u}=o.createWallet,C=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:v}=sc(),[g,b]=oy(null),T=new Ke(async()=>{try{let S=await v();if(!S)return;b(S),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(S){i(S.message)}});$4(()=>{if(!s){r("LANDING"),f(new Error("User must be authenticated before creating a Privy wallet"));return}if(C){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let S=nc({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(S)}T.execute()},[C,s]);let R=()=>{g?(m(g),d({shouldCallAuthOnSuccess:u})):(f(new fr("User wallet creation failed")),d({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,a?ny(rw,{children:[$i(x,{closeable:!1}),ny(vr,{children:[$i(j4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),$i(ge,{title:"Something went wrong",description:a})]}),$i(U,{onClick:R,children:"Close"}),$i(tw,{})]}):$i(tc,{})},tw=ew.div`
|
|
1065
1065
|
height: 44px;
|
|
1066
1066
|
`;import{useEffect as Xw,useState as uc}from"react";import{useCallback as Ep,useEffect as Qw}from"react";import sw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as lw,useState as vp}from"react";import ow from"@heroicons/react/24/outline/ArrowPathIcon";import nw from"@heroicons/react/24/outline/EyeIcon";import iw from"@heroicons/react/24/outline/EyeSlashIcon";import Rt,{css as yp}from"styled-components";var aw=yp`
|
|
1067
1067
|
font-size: 14px;
|
|
@@ -1080,12 +1080,12 @@ Resources:
|
|
|
1080
1080
|
&[aria-hidden='true'] {
|
|
1081
1081
|
visibility: hidden;
|
|
1082
1082
|
}
|
|
1083
|
-
`,
|
|
1083
|
+
`,an=Rt.div`
|
|
1084
1084
|
display: flex;
|
|
1085
1085
|
flex-direction: column;
|
|
1086
1086
|
justify-content: center;
|
|
1087
1087
|
flex-grow: 1;
|
|
1088
|
-
`,
|
|
1088
|
+
`,sn=Rt(U)`
|
|
1089
1089
|
${e=>e.hideAnimations&&yp`
|
|
1090
1090
|
&& {
|
|
1091
1091
|
transition: none;
|
|
@@ -1106,7 +1106,7 @@ Resources:
|
|
|
1106
1106
|
font-weight: 300;
|
|
1107
1107
|
line-height: 22px; /* 137.5% */
|
|
1108
1108
|
}
|
|
1109
|
-
`,
|
|
1109
|
+
`,ea=Rt.input`
|
|
1110
1110
|
${ay}
|
|
1111
1111
|
|
|
1112
1112
|
&::placeholder {
|
|
@@ -1120,13 +1120,13 @@ Resources:
|
|
|
1120
1120
|
white-space: nowrap;
|
|
1121
1121
|
`,sy=Rt.div`
|
|
1122
1122
|
${ay}
|
|
1123
|
-
`,
|
|
1123
|
+
`,ln=Rt.div`
|
|
1124
1124
|
position: relative;
|
|
1125
1125
|
width: 100%;
|
|
1126
1126
|
display: flex;
|
|
1127
1127
|
align-items: center;
|
|
1128
1128
|
justify-content: ${({centered:e})=>e?"center":"space-between"};
|
|
1129
|
-
`,
|
|
1129
|
+
`,cn=Rt.div`
|
|
1130
1130
|
display: flex;
|
|
1131
1131
|
flex-direction: column;
|
|
1132
1132
|
align-items: center;
|
|
@@ -1173,7 +1173,7 @@ Resources:
|
|
|
1173
1173
|
> :first-child {
|
|
1174
1174
|
min-width: 24px;
|
|
1175
1175
|
}
|
|
1176
|
-
`,
|
|
1176
|
+
`,CO=Rt.div`
|
|
1177
1177
|
height: var(--privy-height-modal-full);
|
|
1178
1178
|
|
|
1179
1179
|
@media (max-width: 440px) {
|
|
@@ -1191,7 +1191,7 @@ Resources:
|
|
|
1191
1191
|
border-color: var(--privy-color-foreground-3);
|
|
1192
1192
|
border-width: 1px;
|
|
1193
1193
|
}
|
|
1194
|
-
|
|
1194
|
+
`,ta=Rt.div`
|
|
1195
1195
|
position: absolute;
|
|
1196
1196
|
right: 0.5rem;
|
|
1197
1197
|
|
|
@@ -1208,7 +1208,7 @@ Resources:
|
|
|
1208
1208
|
:active {
|
|
1209
1209
|
stroke: var(--privy-color-accent-light);
|
|
1210
1210
|
}
|
|
1211
|
-
`,
|
|
1211
|
+
`,ra=Rt(iw)`
|
|
1212
1212
|
height: 1.25rem;
|
|
1213
1213
|
width: 1.25rem;
|
|
1214
1214
|
stroke: var(--privy-color-accent);
|
|
@@ -1217,7 +1217,7 @@ Resources:
|
|
|
1217
1217
|
:active {
|
|
1218
1218
|
stroke: var(--privy-color-accent-light);
|
|
1219
1219
|
}
|
|
1220
|
-
`,
|
|
1220
|
+
`,oa=Rt(nw)`
|
|
1221
1221
|
height: 1.25rem;
|
|
1222
1222
|
width: 1.25rem;
|
|
1223
1223
|
stroke: var(--privy-color-accent);
|
|
@@ -1242,7 +1242,7 @@ Resources:
|
|
|
1242
1242
|
transition: all 0.1s ease-out;
|
|
1243
1243
|
background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
|
|
1244
1244
|
}
|
|
1245
|
-
`;import{Fragment as cw,jsx as br,jsxs as cc}from"react/jsx-runtime";var dy=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i
|
|
1245
|
+
`;import{Fragment as cw,jsx as br,jsxs as cc}from"react/jsx-runtime";var dy=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[a,i]=vp(!0),[l,s]=vp(!1),[d,m]=vp(""),f=r===d;return lw(()=>{d&&!l&&s(!0)},[d]),cc(cw,{children:[br(x,{closeable:!1,backFn:n}),br(ie,{}),cc(an,{children:[cc(cn,{children:[br(sw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),br("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),br("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),cc(ln,{children:[br(ea,{value:d,onChange:u=>m(u.target.value),onKeyUp:u=>{u.key==="Enter"&&o()},onBlur:()=>s(!0),placeholder:"confirm your password",type:a?"password":"text",style:{paddingRight:"2.3rem"}}),br(ta,{style:{right:"0.75rem"},children:a?br(ra,{onClick:()=>i(!1)}):br(oa,{onClick:()=>i(!0)})})]}),br(lc,{"aria-hidden":!l||f,error:!0,children:"Passwords do not match"})]}),br(sn,{onClick:o,loading:t,disabled:!f,hideAnimations:e,children:"Continue"}),br(ae,{}),br(G,{})]})};import mw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as fw}from"react";import hw from"styled-components";import rs from"styled-components";import{jsx as ts,jsxs as uw}from"react/jsx-runtime";var py=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>ts("label",{children:uw(dw,{className:e,children:[ts(my,{checked:t,...o}),ts(pw,{color:r,checked:t,children:ts(uy,{viewBox:"0 0 24 24",children:ts("polyline",{points:"20 6 9 17 4 12"})})})]})});var MO=rs.label`
|
|
1246
1246
|
&& {
|
|
1247
1247
|
cursor: pointer;
|
|
1248
1248
|
display: flex;
|
|
@@ -1294,21 +1294,21 @@ Resources:
|
|
|
1294
1294
|
${uy} {
|
|
1295
1295
|
visibility: ${e=>e.checked?"visible":"hidden"};
|
|
1296
1296
|
}
|
|
1297
|
-
`;import{Fragment as fy,jsx as Fr,jsxs as os}from"react/jsx-runtime";var hy=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i
|
|
1297
|
+
`;import{Fragment as fy,jsx as Fr,jsxs as os}from"react/jsx-runtime";var hy=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[a,i]=fw(!1);return os(fy,{children:[Fr(x,{closeable:!1,backFn:o}),Fr(ie,{}),os(an,{children:[os(cn,{children:[Fr(mw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),Fr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),Fr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),Fr($a,{children:os(es,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),i(s=>!s)},children:[Fr(py,{color:"var(--privy-color-error)",readOnly:!0,checked:a}),Fr(fy,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),os(yw,{children:[n.initiatedBy==="user"&&Fr(Qr,{onClick:n.onCancel,disabled:t,children:"Cancel"}),Fr(sn,{onClick:r,loading:t,hideAnimations:e,disabled:!a,children:"Set Password"})]}),Fr(ae,{}),Fr(G,{})]})},yw=hw.div`
|
|
1298
1298
|
display: flex;
|
|
1299
1299
|
gap: 10px;
|
|
1300
|
-
`;import Iw from"@heroicons/react/24/outline/KeyIcon";import Ey from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as Ty,useMemo as Cp,useEffect as Ww}from"react";import Sy from"styled-components";import gw from"fast-password-entropy";import*as yy from"secure-password-utilities";import{DEFAULT_WORDLIST as vw}from"secure-password-utilities/wordlists";var Cw=95,ww=8,bw=3,Ew=.3,Tw=/[a-z]/,Sw=/[A-Z]/,Aw=/[0-9]/,Pw="a-zA-Z0-9",gy="!@#$%^&*()\\-_+.",vy=`${Pw}${gy}`,xw=new RegExp(`[${gy}]`),kw=new RegExp(`[${vy}]`),Cy=new RegExp(`^[${vy}]{6,}$`),wy=(e="")=>{let t=e.split("").filter(r=>!kw.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},dc=()=>yy.generatePassphrase(4,vw);function Rw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function _w(e){if(e.length<ww)return 0;let t=0;Tw.test(e)&&(t+=1),Sw.test(e)&&(t+=1),Aw.test(e)&&(t+=1),xw.test(e)&&(t+=1);let r=t/bw;return Math.max(0,Math.min(1,r))}function Mw(e=""){let t=_w(e),r=gw(e)/Cw;return(t*Ew+r)/2}function by(e=""){let t=Mw(e);return{value:t,label:Rw(t)}}import{Fragment as Ow,jsx as _t,jsxs as bo}from"react/jsx-runtime";var Ay=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:
|
|
1300
|
+
`;import Iw from"@heroicons/react/24/outline/KeyIcon";import Ey from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as Ty,useMemo as Cp,useEffect as Ww}from"react";import Sy from"styled-components";import gw from"fast-password-entropy";import*as yy from"secure-password-utilities";import{DEFAULT_WORDLIST as vw}from"secure-password-utilities/wordlists";var Cw=95,ww=8,bw=3,Ew=.3,Tw=/[a-z]/,Sw=/[A-Z]/,Aw=/[0-9]/,Pw="a-zA-Z0-9",gy="!@#$%^&*()\\-_+.",vy=`${Pw}${gy}`,xw=new RegExp(`[${gy}]`),kw=new RegExp(`[${vy}]`),Cy=new RegExp(`^[${vy}]{6,}$`),wy=(e="")=>{let t=e.split("").filter(r=>!kw.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},dc=()=>yy.generatePassphrase(4,vw);function Rw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function _w(e){if(e.length<ww)return 0;let t=0;Tw.test(e)&&(t+=1),Sw.test(e)&&(t+=1),Aw.test(e)&&(t+=1),xw.test(e)&&(t+=1);let r=t/bw;return Math.max(0,Math.min(1,r))}function Mw(e=""){let t=_w(e),r=gw(e)/Cw;return(t*Ew+r)/2}function by(e=""){let t=Mw(e);return{value:t,label:Rw(t)}}import{Fragment as Ow,jsx as _t,jsxs as bo}from"react/jsx-runtime";var Ay=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:a,onClose:i,onBack:l,onPasswordChange:s,onPasswordGenerate:d})=>{let[m,f]=Ty(!1),[u,C]=Ty(!1);Ww(()=>{r&&!u&&C(!0)},[r]);let v=Cp(()=>u?(r?.length||0)<6?"Password must be at least 6 characters":Cy.test(r||"")?null:`Invalid characters used ( ${wy(r).join(" ")} )`:null,[r,u]),g=Cp(()=>v?{value:0,label:"Weak"}:by(r),[r,v]),b=Cp(()=>!!(!r?.length||v),[v,r]);return bo(Ow,{children:[_t(x,{onClose:i,closeable:o.initiatedBy==="user",backFn:l}),_t(ie,{}),bo(an,{children:[bo(cn,{children:[_t(Iw,{height:48,width:48,stroke:"var(--privy-color-accent)"}),bo("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),_t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),bo(ln,{children:[_t(ea,{value:r,onChange:T=>s(T.target.value),onKeyUp:T=>{T.key==="Enter"&&a()},placeholder:"enter or generate a strong password",type:m?"password":"text",style:{paddingRight:"3.8rem"}}),bo(ta,{style:{width:"3.5rem"},children:[m?_t(ra,{onClick:()=>f(!1)}):_t(oa,{onClick:()=>f(!0)}),_t(ly,{onClick:d})]})]}),_t(cy,{value:g.value===0?.01:g.value,label:g.label}),_t(lc,{error:!!v,children:v||`Password Strength: ${u?g.label:"--"}`}),bo(Nw,{children:[_t(Lw,{children:bo($a,{children:[bo(es,{children:[_t(Ey,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),bo(es,{children:[_t(Ey,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),_t(sn,{onClick:a,loading:t,disabled:b,hideAnimations:e,children:"Continue"})]})]}),_t(ae,{}),_t(G,{})]})},Lw=Sy($a)`
|
|
1301
1301
|
flex: 1;
|
|
1302
1302
|
padding-top: 1rem;
|
|
1303
1303
|
`,Nw=Sy.div`
|
|
1304
1304
|
display: flex;
|
|
1305
1305
|
flex-direction: column;
|
|
1306
1306
|
height: 100%;
|
|
1307
|
-
`;import Dw from"@heroicons/react/24/outline/ArrowDownTrayIcon";import Fw from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import Uw from"@heroicons/react/24/outline/DocumentDuplicateIcon";import Bw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as Hw,useCallback as Py}from"react";import{Fragment as wp,jsx as cr,jsxs as
|
|
1307
|
+
`;import Dw from"@heroicons/react/24/outline/ArrowDownTrayIcon";import Fw from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import Uw from"@heroicons/react/24/outline/DocumentDuplicateIcon";import Bw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as Hw,useCallback as Py}from"react";import{Fragment as wp,jsx as cr,jsxs as jn}from"react/jsx-runtime";var xy=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:a})=>{let[i,l]=Hw(!1),s=Py(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),d=Py(()=>{let m=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),u=new Blob([Vw(r,o)],{type:"text/plain"}),C=URL.createObjectURL(u);m.href=C,m.target="_blank",m.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(m),m.click(),setTimeout(()=>{m.remove(),URL.revokeObjectURL(C)},5e3)},[o]);return jn(wp,{children:[cr(x,{backFn:a,closeable:!1}),cr(ie,{}),jn(an,{children:[jn(cn,{children:[cr(Bw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),cr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),cr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),cr(ln,{centered:!0,children:cr(sy,{children:o})}),jn("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[cr(gp,{onClick:s,children:i?jn(wp,{children:[cr(Fw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):jn(wp,{children:[cr(Uw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),jn(gp,{onClick:d,children:[cr(Dw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),cr(sn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),cr(ae,{}),cr(G,{})]})},Vw=(e,t)=>`Your wallet recovery password for ${e} is
|
|
1308
1308
|
|
|
1309
1309
|
${t}
|
|
1310
1310
|
|
|
1311
|
-
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import Gw from"@heroicons/react/24/solid/CheckCircleIcon";import qw from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as zw,jsx as
|
|
1311
|
+
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import Gw from"@heroicons/react/24/solid/CheckCircleIcon";import qw from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as zw,jsx as Vo,jsxs as bp}from"react/jsx-runtime";var ky=({error:e,onClose:t})=>bp(zw,{children:[Vo(x,{closeable:!1}),Vo(ie,{}),e?bp(vr,{children:[Vo(qw,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Vo(ge,{title:"Something went wrong",description:e})]}):bp(vr,{children:[Vo(Gw,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),Vo(ge,{title:"Success"})]}),Vo(U,{onClick:t,children:"Close"}),Vo(ae,{}),Vo(G,{})]});import{useReducer as Kw}from"react";var Yw=(e,t)=>{switch(e){case"creating":return t==="back"?e:"saving";case"saving":return t==="back"?"creating":"confirming";case"confirming":return t==="back"?"saving":"finalizing";case"finalizing":return t==="back"?"confirming":"done";default:return e}},Ry=()=>{let[e,t]=Kw(Yw,"creating");return{send:t,state:e}};import{jsx as ns}from"react/jsx-runtime";var pc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=A(),{send:n,state:a}=Ry(),i=Ep(async()=>{a==="finalizing"&&await e(),n("next")},[a,n,e]);Qw(()=>{let d;return a==="done"&&t.config.initiatedBy==="automatic"&&(d=setTimeout(()=>t.onClose?.(),Me)),()=>{d&&clearTimeout(d)}},[a,t.config.initiatedBy,t.onClose]);let l=Ep(()=>{n("back")},[n]),s=Ep(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return a==="creating"?ns(Ay,{...t,onSubmit:i,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):a==="saving"?ns(xy,{...t,onSubmit:i,onBack:l}):a==="confirming"?ns(dy,{...t,onSubmit:i,onBack:l}):a==="finalizing"?ns(hy,{...t,onSubmit:i,onBack:l}):a==="done"?ns(ky,{...t,onSubmit:i}):null};import{jsx as Zw}from"react/jsx-runtime";var _y=()=>{let[e,t]=uc(null),[r,o]=uc(!1),[n,a]=uc(null),[i,l]=uc(""),{authenticated:s,getAccessToken:d,user:m}=q(),{walletProxy:f,refreshUser:u,closePrivyModal:C,createAnalyticsEvent:v}=_(),{app:g,navigate:b,data:T,onUserCloseViaDialogOrKeybindRef:R}=A(),{onSuccess:S,onFailure:P}=T.createWallet,k=be(m),M=e?.recoveryMethod==="user-passcode",O=k?.recoveryMethod==="user-passcode";Xw(()=>{s||(b("LANDING"),P(new Ru("User must be authenticated before setting a password on a Privy wallet")))},[s]);let H=()=>{if(n){P(n),C({shouldCallAuthOnSuccess:!1});return}if(!M){P(new fr("Exited before password was added to wallet")),C({shouldCallAuthOnSuccess:!1});return}S(e),C({shouldCallAuthOnSuccess:!1})};R.current=H;let Y=async()=>{let L=await d();if(L&&k?.address&&i&&f)try{if(v({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:O}}),!(await f.setRecovery({accessToken:L,address:k.address,recoveryPassword:i,recoveryMethod:"user-passcode"})).address){a(new fr("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:O,reason:"error setting password"}});return}let W=await u(),z=be(W);if(!z){a(new fr("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:O,reason:"wallet disconnected"}});return}t(z),v({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:k.address,existingRecoveryMethod:k.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:O}})}catch(Z){console.warn(Z),a(Z instanceof Error?Z:new Error("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:k.address,reason:Z}})}},X=async()=>{M?(S(e),C({shouldCallAuthOnSuccess:!1})):(o(!0),a(null),await Y(),o(!1))};return Zw(pc,{appName:g?.name||"privy",config:{initiatedBy:"user",onCancel:H},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:i,isResettingPassword:O,onPasswordGenerate:()=>l(dc()),onPasswordChange:l,onSubmit:X,onClose:H})};import Jw from"@heroicons/react/24/outline/UserCircleIcon";import jw from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as $w,jsx as Go,jsxs as mc}from"react/jsx-runtime";var My=()=>{let{closePrivyModal:e}=_(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=A(),{onSuccess:a,onFailure:i}=t.setWalletPassword,l=()=>{i(new fr("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,mc($w,{children:[Go(x,{onClose:l}),Go(ie,{}),mc(vr,{children:[mc(lh,{children:[Go(Jw,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),Go(ch,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:Go(jw,{width:"12px",height:"12px",fill:"white"})})]}),mc(ge,{title:"Secure Your Account",children:["Please set a password to secure your account.",Go("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),Go(U,{onClick:()=>{r({createWallet:{onFailure:i,onSuccess:a,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),Go(ae,{}),Go(G,{})]})};import e5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import t5 from"@heroicons/react/24/outline/PhoneIcon";import Iy from"styled-components";import{Fragment as i5,jsx as Ur,jsxs as fc}from"react/jsx-runtime";var r5=(e,t)=>{let r=Ur(e5,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof w)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:r};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(e instanceof Ne&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:Ur(t5,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof Jt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:r};case"allowlist_rejected":return{title:t.errorTitle||"You don't have access to this app",detail:t.errorDetail||"Have you been invited?",ctaText:t.errorCtaText||"Try another account",icon:Ur(zl,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:Ur("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:Ur("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else return e instanceof Rr&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}},Wy=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=A(),a=r?.errorModalData?.previousScreen||(o===n?void 0:o);return Ur($n,{error:r?.errorModalData?.error||new Error,backFn:()=>a?e(a,!1):t(),onClick:()=>e(a||"LANDING",!1)})},$n=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Te(),{app:n}=A(),a=r5(e,n.allowlistConfig),i=()=>{if(e instanceof Jt&&(e.privyErrorCode==="invalid_captcha"&&o(),e.privyErrorCode==="allowlist_rejected"&&n.allowlistConfig.errorCtaLink)){window.location.href=n.allowlistConfig.errorCtaLink;return}r?.()};return fc(i5,{children:[Ur(x,{backFn:t}),fc(o5,{children:[Ur($e,{children:fc("div",{children:[Ur(ql,{color:"var(--privy-color-error)"}),a.icon]})}),fc(n5,{children:[Ur("h3",{children:a.title}),Ur("p",{children:a.detail})]}),Ur(U,{color:"var(--privy-color-error)",onClick:i,children:a.ctaText})]})]})},o5=Iy.div`
|
|
1312
1312
|
display: flex;
|
|
1313
1313
|
flex-direction: column;
|
|
1314
1314
|
align-items: center;
|
|
@@ -1320,7 +1320,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1320
1320
|
display: flex;
|
|
1321
1321
|
flex-direction: column;
|
|
1322
1322
|
gap: 8px;
|
|
1323
|
-
`;import{useEffect as Uy,useRef as A5,useState as Sp}from"react";import{isIOS as P5,isMobile as By}from"react-device-detect";import Gy from"styled-components";import{useState as a5}from"react";import s5 from"styled-components";import{jsx as Ly}from"react/jsx-runtime";var
|
|
1323
|
+
`;import{useEffect as Uy,useRef as A5,useState as Sp}from"react";import{isIOS as P5,isMobile as By}from"react-device-detect";import Gy from"styled-components";import{useState as a5}from"react";import s5 from"styled-components";import{jsx as Ly}from"react/jsx-runtime";var na=({style:e,color:t,...r})=>Ly("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:Ly("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as Ny,jsxs as c5}from"react/jsx-runtime";var dn=e=>{let[t,r]=a5(!1);return c5(l5,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?Ny(na,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):Ny(mm,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},l5=s5.button`
|
|
1324
1324
|
display: flex;
|
|
1325
1325
|
align-items: center;
|
|
1326
1326
|
gap: 6px;
|
|
@@ -1396,7 +1396,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1396
1396
|
width: 14px;
|
|
1397
1397
|
height: 14px;
|
|
1398
1398
|
}
|
|
1399
|
-
`;import f5 from"qrcode";import h5 from"react";import y5 from"styled-components";import{jsx as Oy}from"react/jsx-runtime";var Dy=()=>Oy("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:Oy("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as is,jsx as
|
|
1399
|
+
`;import f5 from"qrcode";import h5 from"react";import y5 from"styled-components";import{jsx as Oy}from"react/jsx-runtime";var Dy=()=>Oy("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:Oy("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as is,jsx as Bt,jsxs as Fy}from"react/jsx-runtime";var Er=7,Tp=(e,t,r,o,n)=>{for(let a=t;a<t+o;a++)for(let i=r;i<r+n;i++){let l=e?.[i];l&&l[a]&&(l[a]=0)}return e},g5=(e,t)=>{let r=f5.create(e,{errorCorrectionLevel:t}).modules,o=Mu(Array.from(r.data),r.size);return o=Tp(o,0,0,Er,Er),o=Tp(o,o.length-Er,0,Er,Er),o=Tp(o,0,o.length-Er,Er,Er),o},v5=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>Bt(is,{children:[0,1,2].map(a=>Bt("circle",{r:r*(Er-a*2)/2,cx:e+r*Er/2,cy:t+r*Er/2,fill:a%2!==0?o:n},`finder-${e}-${t}-${a}`))}),C5=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Er)*e,0],[0,(t-Er)*e]];return Bt(is,{children:n.map(([a,i])=>Bt(v5,{x:a,y:i,cellSize:e,bgColor:r,fgColor:o},`finder-${a}-${i}`))})},w5=({matrix:e,cellSize:t,color:r})=>Bt(is,{children:e.map((a,i)=>a.map((l,s)=>l?Bt("rect",{height:t-.2*2,width:t-.2*2,x:i*t+t*(.2/2),y:s*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${i}-${s}`):Bt(h5.Fragment,{},`circle-${i}-${s}`)))}),b5=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return Bt(is,{});let a=t*(o||.14),i=Math.floor(t/2-a/2),l=Math.floor(t/2+a/2);(l-i)%2!==t%2&&(l+=1);let s=(l-i)*e,d=.1,m=s-s*d*2,f=r,u=i*e;return Fy(is,{children:[Bt("rect",{x:i*e,y:i*e,width:s,height:s,fill:n}),Bt(f,{x:u+s*d,y:u+s*d,height:m,width:m})]})},E5=e=>{let t=e.outputSize,r=g5(e.url,e.errorCorrectionLevel),o=t/r.length,n=Du(o*2,{min:t*.025,max:t*.036});return Fy("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${n}px`},children:[Bt(w5,{matrix:r,cellSize:o,color:e.fgColor}),Bt(C5,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),Bt(b5,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},T5=y5.div`
|
|
1400
1400
|
display: flex;
|
|
1401
1401
|
justify-content: center;
|
|
1402
1402
|
align-items: center;
|
|
@@ -1410,7 +1410,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1410
1410
|
border-color: ${e=>e.borderColor};
|
|
1411
1411
|
border-radius: var(--privy-border-radius-md);
|
|
1412
1412
|
}
|
|
1413
|
-
`,
|
|
1413
|
+
`,pn=e=>{let{appearance:t}=De(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,a=t.palette.colorScheme==="dark"?r:o;return Bt(T5,{size:n,bgColor:r,fgColor:o,borderColor:a,children:Bt(E5,{url:e.url,logo:{element:e.squareLogoElement??Dy},outputSize:n,bgColor:r,fgColor:o,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})};import{jsx as yc,jsxs as S5}from"react/jsx-runtime";var Eo=({style:e,...t})=>S5("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[yc("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),yc("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),yc("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),yc("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});import{Fragment as gc,jsx as ke,jsxs as To}from"react/jsx-runtime";var Hy="#8a63d2",qy=1e3,x5=qy*2,k5=qy*120,zy=()=>{let{authenticated:e,logout:t,ready:r,user:o}=q(),{lastScreen:n,navigate:a,navigateBack:i,setModalData:l,app:s}=A(),{getAuthFlow:d,loginWithFarcaster:m,closePrivyModal:f,createAnalyticsEvent:u}=_(),[C,v]=Sp(void 0),[g,b]=Sp(!1),[T,R]=Sp(!1),S=A5([]),P=Me,k=d(),M=k?.meta.connectUri;return Uy(()=>{let O=Date.now(),H=setInterval(async()=>{let Y=await k.pollForReady.execute(),X=Date.now()-O;if(Y){clearInterval(H),b(!0);try{await m(),R(!0)}catch(L){let Z={retryable:!1,message:"Authentication failed"};if(L?.privyErrorCode==="allowlist_rejected"){a("ALLOWLIST_REJECTION_SCREEN");return}else if(L?.privyErrorCode==="max_accounts_reached"){console.error(new lo(L).toString()),a("USER_LIMIT_REACHED_SCREEN");return}else if(L?.privyErrorCode==="user_does_not_exist"){a("ACCOUNT_NOT_FOUND_SCREEN");return}else L?.privyErrorCode==="linked_to_another_user"?Z.detail="This account has already been linked to another user.":L?.privyErrorCode==="invalid_credentials"?(Z.retryable=!0,Z.detail="Something went wrong. Try again."):L?.privyErrorCode==="too_many_requests"&&(Z.detail="Too many requests. Please wait before trying again.");v(Z)}}else X>k5&&(clearInterval(H),v({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},x5);return()=>{clearInterval(H),S.current.forEach(Y=>clearTimeout(Y))}},[]),Uy(()=>{if(r&&e&&T&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},P);return()=>clearTimeout(H)}T&&(Ft(o,s?.embeddedWallets.createOnLogin)?S.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:H=>{console.error(H),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:H,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},P)):S.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),P)))}},[T,r,e,o]),By||g?To(gc,{children:[ke(x,{backFn:n?i:void 0,onClose:f},"header"),ke(ie,{}),P5?ke(gc,{children:To(R5,{children:[ke($e,{children:To("div",{children:[ke(it,{success:T,fail:!!C}),ke(Eo,{style:{width:"38px",height:"38px"}})]})}),To(Ye,{children:[ke(me,{children:C?C.message:"Sign in with Farcaster"}),ke(he,{children:C?C.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&ke(U,{onClick:O=>{O.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):ke(gc,{children:To(Vy,{children:[ke($e,{children:To("div",{children:[ke(it,{success:T,fail:!!C}),ke(Eo,{style:{width:"38px",height:"38px"}})]})}),To(Ye,{children:[ke(me,{children:C?C.message:"Signing in with Farcaster"}),ke(he,{children:C?C.detail:"This should only take a moment"}),ke(Tt,{children:M&&By&&ke(hc,{text:"Take me to Warpcast",url:M,color:Hy})})]})]})}),ke(J,{})]}):To(gc,{children:[ke(x,{backFn:n?i:void 0,onClose:f},"header"),ke(ie,{}),ke(Vy,{children:To("div",{children:[ke(me,{children:"Sign in with Farcaster"}),ke(he,{children:"Scan with your phone's camera to continue."}),ke(Bi,{children:M?ke(pn,{url:M,size:275,squareLogoElement:Eo}):ke(at,{})}),To(Tt,{children:[ke(he,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&ke(dn,{text:M,itemName:"link",color:Hy})]})]})}),ke(J,{})]})},Vy=Gy.div`
|
|
1414
1414
|
display: flex;
|
|
1415
1415
|
flex-direction: column;
|
|
1416
1416
|
align-items: center;
|
|
@@ -1425,7 +1425,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1425
1425
|
justify-content: center;
|
|
1426
1426
|
gap: 24px;
|
|
1427
1427
|
width: 100%;
|
|
1428
|
-
`;import{useEffect as _5,useRef as M5,useState as Ap}from"react";import{isIOS as I5,isMobile as Ky}from"react-device-detect";import Xy from"styled-components";import{Fragment as vc,jsx as We,jsxs as
|
|
1428
|
+
`;import{useEffect as _5,useRef as M5,useState as Ap}from"react";import{isIOS as I5,isMobile as Ky}from"react-device-detect";import Xy from"styled-components";import{Fragment as vc,jsx as We,jsxs as eo}from"react/jsx-runtime";var Yy="#8a63d2",Zy=1e3,W5=Zy*2,L5=Zy*300,Jy=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=A(),{requestFarcasterSignerStatus:n,closePrivyModal:a}=_(),[i,l]=Ap(void 0),[s,d]=Ap(!1),[m,f]=Ap(!1),u=M5([]),C=Me,v=r?.farcasterSigner;_5(()=>{let b=Date.now(),T=setInterval(async()=>{if(!v?.public_key){clearInterval(T),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}v.status==="approved"&&(clearInterval(T),d(!1),f(!0),u.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),C)));let R=await n(v?.public_key),S=Date.now()-b;R.status==="approved"?(clearInterval(T),d(!1),f(!0),u.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),C))):S>L5?(clearInterval(T),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):R.status==="revoked"&&(clearInterval(T),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},W5);return()=>{clearInterval(T),u.current.forEach(R=>clearTimeout(R))}},[]);let g=v?.status==="pending_approval"?v.signer_approval_url:void 0;return Ky||s?eo(vc,{children:[We(x,{backFn:e?t:void 0,onClose:a},"header"),We(ie,{}),I5?We(vc,{children:eo(N5,{children:[We($e,{children:eo("div",{children:[We(it,{success:m,fail:!!i}),We(Eo,{style:{width:"38px",height:"38px"}})]})}),eo(Ye,{children:[We(me,{children:i?i.message:"Add a signer to Farcaster"}),We(he,{children:i?i.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&We(U,{onClick:b=>{b.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):We(vc,{children:eo(Qy,{children:[We($e,{children:eo("div",{children:[We(it,{success:m,fail:!!i}),We(Eo,{style:{width:"38px",height:"38px"}})]})}),eo(Ye,{children:[We(me,{children:i?i.message:"Requesting signer from Farcaster"}),We(he,{children:i?i.detail:"This should only take a moment"}),We(Tt,{children:g&&Ky&&We(hc,{text:"Take me to Warpcast",url:g,color:Yy})})]})]})}),We(J,{})]}):eo(vc,{children:[We(x,{backFn:e?t:void 0,onClose:a},"header"),We(ie,{}),We(Qy,{children:eo("div",{children:[We(me,{children:"Add a signer to Farcaster"}),eo(he,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),We(Bi,{children:v?.status==="pending_approval"?We(pn,{url:v.signer_approval_url,size:275,squareLogoElement:Eo}):We(at,{})}),eo(Tt,{children:[We(he,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),v?.status==="pending_approval"&&We(dn,{text:v.signer_approval_url,itemName:"link",color:Yy})]})]})}),We(J,{})]})},Qy=Xy.div`
|
|
1429
1429
|
display: flex;
|
|
1430
1430
|
flex-direction: column;
|
|
1431
1431
|
align-items: center;
|
|
@@ -1440,7 +1440,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1440
1440
|
justify-content: center;
|
|
1441
1441
|
gap: 24px;
|
|
1442
1442
|
width: 100%;
|
|
1443
|
-
`;import D6 from"@heroicons/react/24/outline/CheckCircleIcon";import{useEffect as
|
|
1443
|
+
`;import D6 from"@heroicons/react/24/outline/CheckCircleIcon";import{useEffect as un,useState as qt}from"react";import{createPublicClient as H1,createWalletClient as F6,custom as U6,encodeFunctionData as B6,http as V1,parseEther as H6,publicActions as V6}from"viem";import{jsx as O5}from"react/jsx-runtime";function Mt({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=A(),a;return t==="FUNDING_MANUAL_TRANSFER_SCREEN"?a=r:t===n?.funding?.methodScreen?n.funding.comingFromSendTransactionScreen?a=()=>o("EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"):a=void 0:a=n?.funding?.methodScreen?()=>o(n.funding.methodScreen):void 0,O5(x,{title:e,backFn:a})}import Cc from"styled-components";import{jsx as Pp,jsxs as H5}from"react/jsx-runtime";var ia=({size:e})=>Pp(D5,{$size:e,children:H5(F5,{children:[Pp(U5,{}),Pp(B5,{})]})}),D5=Cc.div`
|
|
1444
1444
|
--spinner-size: ${e=>e.$size?e.$size:"96px"};
|
|
1445
1445
|
|
|
1446
1446
|
display: flex;
|
|
@@ -1495,7 +1495,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1495
1495
|
transform: rotate(360deg);
|
|
1496
1496
|
}
|
|
1497
1497
|
}
|
|
1498
|
-
`;function V5(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function wc(e){let t=e.filter(r=>!rm.has(r.id));return Ld.concat(t)}import{useState as xp,useEffect as G5}from"react";var So=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=_(),[n,
|
|
1498
|
+
`;function V5(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function wc(e){let t=e.filter(r=>!rm.has(r.id));return Ld.concat(t)}import{useState as xp,useEffect as G5}from"react";var So=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=_(),[n,a]=xp(!0),[i,l]=xp(void 0),[s,d]=xp(void 0);return G5(()=>{let m=e.chainId||No,u=wc(o).find(v=>v.id===Number(m));(async()=>{if(!t){a(!1);return}if(!u){a(!1),l(new Error(`Unable to fetch token price on chain id ${m}`));return}try{a(!0);let v=await r(u);v?d(v):l(new Error(`Unable to fetch token price on chain id ${u.id}`))}catch(v){l(v)}finally{a(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:i}};var as=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var bc=({amount:e,decimals:t})=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/10n**BigInt(t));var jy="0x0000000000000000000000000000000000000000",$y=e=>({tradeType:"EXACT_OUTPUT",originCurrency:jy,destinationCurrency:jy,...e}),q5="https://api.testnets.relay.link/execute/swap",z5="https://api.relay.link/execute/swap",e1=async({input:e,isTestnet:t})=>{let r=await fetch(t?q5:z5,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await r.json();if(!r.ok)throw console.error("Relay error:",o),new Error(o.message??"Error fetching quote from relay");return o},t1=e=>{let t=e.steps[0]?.items?.[0];if(t)return{from:t.data.from,to:t.data.to,value:Number(t.data.value),chainId:Number(t.data.chainId),data:t.data.data}};import{createPublicClient as K5,http as Y5}from"viem";var r1=({chains:e,appId:t,address:r,rpcConfig:o})=>Promise.all(e.map(async n=>({balance:await K5({chain:n,transport:Y5(Lo(n,o,t))}).getBalance({address:r}).catch(()=>0n),chain:n})));import{createPublicClient as Q5,http as X5}from"viem";var o1=async({chain:e,address:t,appId:r,rpcConfig:o,tokenAddress:n})=>({balance:await Q5({chain:e,transport:X5(Lo(e,o,r))}).readContract({address:n,abi:Z5,functionName:"balanceOf",args:[t]}).catch(()=>0n),chain:e}),Z5=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];import n1 from"styled-components";var Ec=n1.span`
|
|
1499
1499
|
display: flex;
|
|
1500
1500
|
flex-direction: column;
|
|
1501
1501
|
gap: 0.35rem;
|
|
@@ -1510,7 +1510,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1510
1510
|
font-size: 0.875rem;
|
|
1511
1511
|
font-weight: 400;
|
|
1512
1512
|
line-height: 1.375rem; /* 157.143% */
|
|
1513
|
-
`;import E1 from"styled-components";import j5 from"styled-components";var
|
|
1513
|
+
`;import E1 from"styled-components";import j5 from"styled-components";var Ht=j5.span`
|
|
1514
1514
|
color: var(--privy-color-foreground);
|
|
1515
1515
|
font-size: 0.875rem;
|
|
1516
1516
|
font-weight: 500;
|
|
@@ -1519,17 +1519,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1519
1519
|
text-align: right;
|
|
1520
1520
|
|
|
1521
1521
|
${cm}
|
|
1522
|
-
`;import n6 from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as
|
|
1523
|
-
C51.4,114,114.5,51,192.3,51C249.8,51,299.1,86,321,135.9h62.5V0z`})});import{jsx as na,jsxs as u1}from"react/jsx-runtime";var m1=e=>u1("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[na("rect",{width:"199.4",height:"207.623",fill:"#121212"}),u1("g",{"clip-path":"url(#clip0_2303_643)",children:[na("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),na("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),na("defs",{children:na("clipPath",{id:"clip0_2303_643",children:na("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});import{jsx as ss,jsxs as t6}from"react/jsx-runtime";var f1=e=>t6("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[ss("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),ss("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),ss("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),ss("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),ss("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});import{jsx as kp,jsxs as r6}from"react/jsx-runtime";var h1=e=>r6("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[kp("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),kp("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),kp("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]});import{jsx as y1,jsxs as o6}from"react/jsx-runtime";var g1=e=>o6("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[y1("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),y1("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]});import{jsx as Sc,jsxs as v1}from"react/jsx-runtime";var C1=e=>v1("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Sc("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),v1("defs",{children:[Sc("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:Sc("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),Sc("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]});import{jsx as w1}from"react/jsx-runtime";var i6={[Yu.id]:i1,[Qu.id]:s1,[Xu.id]:c1,[Zu.id]:p1,[Ju.id]:m1,[ju.id]:f1,[$u.id]:h1,[em.id]:g1,[tm.id]:C1},ia=({chainId:e,...t})=>{let r=i6[e];return r?w1(r,{...t}):w1(n6,{...t})};import{Fragment as l6,jsx as ls,jsxs as b1}from"react/jsx-runtime";var T1=({balance:e,className:t,chain:r})=>ls(um,{className:t,$state:void 0,children:ls(Ac,{balance:e,chain:r})}),Ac=({balance:e,chain:t})=>b1(l6,{children:[b1(a6,{children:[ls(s6,{chainId:t.id}),ls(Vt,{children:t.name})]}),ls(jt,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),a6=E1.div`
|
|
1522
|
+
`;import n6 from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Vt,jsxs as Tc}from"react/jsx-runtime";var i1=e=>Vt("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...e,children:Vt("g",{id:"Layer_x0020_1",children:Tc("g",{id:"_2405588477232",children:[Vt("rect",{fill:"none",width:"2500",height:"2500"}),Vt("g",{children:Tc("g",{children:[Vt("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),Vt("g",{children:Tc("g",{children:[Vt("g",{children:Vt("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),Vt("g",{children:Vt("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),Vt("g",{children:Vt("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),Vt("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),Tc("g",{children:[Vt("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),Vt("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})});import{jsx as a1,jsxs as $5}from"react/jsx-runtime";var s1=e=>$5("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[a1("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),a1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]});import{jsx as l1,jsxs as e6}from"react/jsx-runtime";var c1=e=>e6("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l1("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),l1("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]});import{jsx as d1}from"react/jsx-runtime";var p1=e=>d1("svg",{version:"1.1",id:"Symbol",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",x:"0px",y:"0px",viewBox:"0 0 384 383",enableBackground:"new 0 0 384 383;",...e,children:d1("path",{d:`M383.5,0H0.5v383h383V249.3h-63.6C298,298.1,248.7,332,192.3,332c-77.8,0-140.8-63.6-140.8-140.8
|
|
1523
|
+
C51.4,114,114.5,51,192.3,51C249.8,51,299.1,86,321,135.9h62.5V0z`})});import{jsx as aa,jsxs as u1}from"react/jsx-runtime";var m1=e=>u1("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[aa("rect",{width:"199.4",height:"207.623",fill:"#121212"}),u1("g",{"clip-path":"url(#clip0_2303_643)",children:[aa("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),aa("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),aa("defs",{children:aa("clipPath",{id:"clip0_2303_643",children:aa("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});import{jsx as ss,jsxs as t6}from"react/jsx-runtime";var f1=e=>t6("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[ss("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),ss("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),ss("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),ss("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),ss("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});import{jsx as kp,jsxs as r6}from"react/jsx-runtime";var h1=e=>r6("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[kp("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),kp("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),kp("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]});import{jsx as y1,jsxs as o6}from"react/jsx-runtime";var g1=e=>o6("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[y1("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),y1("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]});import{jsx as Sc,jsxs as v1}from"react/jsx-runtime";var C1=e=>v1("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Sc("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),v1("defs",{children:[Sc("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:Sc("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),Sc("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]});import{jsx as w1}from"react/jsx-runtime";var i6={[Yu.id]:i1,[Qu.id]:s1,[Xu.id]:c1,[Zu.id]:p1,[Ju.id]:m1,[ju.id]:f1,[$u.id]:h1,[em.id]:g1,[tm.id]:C1},sa=({chainId:e,...t})=>{let r=i6[e];return r?w1(r,{...t}):w1(n6,{...t})};import{Fragment as l6,jsx as ls,jsxs as b1}from"react/jsx-runtime";var T1=({balance:e,className:t,chain:r})=>ls(um,{className:t,$state:void 0,children:ls(Ac,{balance:e,chain:r})}),Ac=({balance:e,chain:t})=>b1(l6,{children:[b1(a6,{children:[ls(s6,{chainId:t.id}),ls(Ht,{children:t.name})]}),ls(jt,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),a6=E1.div`
|
|
1524
1524
|
display: flex;
|
|
1525
1525
|
align-items: center;
|
|
1526
|
-
`,s6=E1(
|
|
1526
|
+
`,s6=E1(sa)`
|
|
1527
1527
|
height: 1.25rem;
|
|
1528
1528
|
width: 1.25rem;
|
|
1529
1529
|
display: inline-block;
|
|
1530
1530
|
margin-right: 0.5rem;
|
|
1531
1531
|
border-radius: 4px;
|
|
1532
|
-
`;import{Menu as Pc}from"@headlessui/react";import{ChevronDownIcon as c6}from"@heroicons/react/24/outline";import ds from"styled-components";import{jsx as cs,jsxs as S1}from"react/jsx-runtime";var A1=({options:e,onSelect:t,selected:r,className:o})=>S1(Pc,{as:d6,children:[S1(Pc.Button,{as:m6,children:[cs(Ac,{balance:r.balance,chain:r.chain}),cs(Rp,{height:16})]}),cs(Pc.Items,{as:p6,className:o,anchor:"bottom",children:e.map((n,
|
|
1532
|
+
`;import{Menu as Pc}from"@headlessui/react";import{ChevronDownIcon as c6}from"@heroicons/react/24/outline";import ds from"styled-components";import{jsx as cs,jsxs as S1}from"react/jsx-runtime";var A1=({options:e,onSelect:t,selected:r,className:o})=>S1(Pc,{as:d6,children:[S1(Pc.Button,{as:m6,children:[cs(Ac,{balance:r.balance,chain:r.chain}),cs(Rp,{height:16})]}),cs(Pc.Items,{as:p6,className:o,anchor:"bottom",children:e.map((n,a)=>cs(Pc.Item,{as:u6,onClick:()=>t(a),children:cs(Ac,{balance:n.balance,chain:n.chain})},a))})]}),d6=ds.div`
|
|
1533
1533
|
width: 100%;
|
|
1534
1534
|
position: relative;
|
|
1535
1535
|
`,p6=ds.div`
|
|
@@ -1582,7 +1582,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1582
1582
|
rotate: -180deg;
|
|
1583
1583
|
}
|
|
1584
1584
|
}
|
|
1585
|
-
`;import Hr,{keyframes as M6}from"styled-components";import f6 from"@heroicons/react/24/outline/ClockIcon";import h6 from"@heroicons/react/24/outline/TrashIcon";import y6 from"@heroicons/react/24/solid/CheckBadgeIcon";import g6 from"@heroicons/react/24/solid/CheckCircleIcon";import v6 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as C6,useState as ps}from"react";import Br,{css as _1}from"styled-components";import{jsx as P1}from"react/jsx-runtime";var $n=({style:e,...t})=>P1("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:P1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});import{jsx as He,jsxs as x1}from"react/jsx-runtime";var ei=({style:e,...t})=>x1("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[x1("g",{clipPath:"url(#clip0_113_33841)",children:[He("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),He("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),He("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),He("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),He("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),He("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),He("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),He("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),He("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),He("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),He("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),He("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),He("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),He("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),He("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),He("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),He("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),He("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),He("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),He("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),He("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),He("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),He("defs",{children:He("clipPath",{id:"clip0_113_33841",children:He("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as _p,jsx as ve,jsxs as dr}from"react/jsx-runtime";var k1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=ps([]),a=t?e.length:2,l=d=>d.authenticatorName?d.createdWithBrowser?`${d.authenticatorName} on ${d.createdWithBrowser}`:d.authenticatorName:d.createdWithBrowser?d.createdWithOs?`${d.createdWithBrowser} on ${d.createdWithOs}`:`${d.createdWithBrowser}`:"Unknown device",s=async d=>{i(m=>m.concat([d])),await r(d),i(m=>m.filter(f=>f!==d))};return dr("div",{children:[ve(A6,{children:"Your passkeys"}),dr(I1,{children:[e.slice(0,a).map(d=>dr(k6,{children:[dr("div",{children:[ve(P6,{children:l(d)}),dr(x6,{children:["Last used: ",(d.latestVerifiedAt??d.verifiedAt).toLocaleString()]})]}),ve(_6,{disabled:n.includes(d.credentialId),onClick:()=>s(d.credentialId),children:n.includes(d.credentialId)?ve(yo,{}):ve(h6,{height:"1.6em"})})]},d.credentialId)),e.length>2&&!t&&ve(Mp,{onClick:o,children:"View all"})]})]})},w6=()=>dr(I1,{children:[dr(ar,{children:[ve(ir,{children:ve(y6,{})}),"Log in with Touch ID, Face ID, or a security key."]}),dr(ar,{children:[ve(ir,{children:ve(v6,{})}),"More secure than a password."]}),dr(ar,{children:[ve(ir,{children:ve(f6,{})}),"Takes seconds to set up and use."]})]}),M1=()=>{let{user:e,unlinkPasskey:t}=q(),{linkWithPasskey:r,closePrivyModal:o}=_(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[i,a]=ps(!1),[l,s]=ps(""),[d,m]=ps(!1),[f,u]=ps(!1);C6(()=>{n.length===0&&u(!1)},[n.length]);let C=()=>{a(!0),r().then(()=>m(!0)).catch(g=>{if(g instanceof Jt){if(g.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},v=async g=>(a(!0),await t(g).then(()=>m(!0)).catch(b=>{if(b instanceof Jt&&b.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return d?dr(_p,{children:[ve(x,{onClose:()=>o()},"header"),ve(Le,{children:ve(Ze,{status:"success",children:ve(g6,{})})}),ve(R1,{children:"Passkey added"}),ve(T6,{children:"From now on, you can use your passkey to log in."}),ve(kt,{children:ve(U,{onClick:()=>o(),children:"Done"})}),ve(J,{})]}):f?dr(_p,{children:[ve(x,{backFn:()=>u(!1),onClose:()=>o()},"header"),ve(k1,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),ve(J,{})]}):dr(_p,{children:[ve(x,{onClose:()=>o()},"header"),ve(Le,{children:dr(xc,{children:[ve($n,{}),ve(ei,{})]})}),ve(R1,{children:"Secure your account with a passkey"}),ve(S6,{}),n.length===0?ve(w6,{}):ve(k1,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),dr(kt,{style:{marginTop:"12px"},children:[l&&ve(b6,{fail:!0,children:l}),ve(U,{onClick:C,loading:i,children:"Add new passkey"})]}),ve(J,{})]})},xc=Br.div`
|
|
1585
|
+
`;import Hr,{keyframes as M6}from"styled-components";import f6 from"@heroicons/react/24/outline/ClockIcon";import h6 from"@heroicons/react/24/outline/TrashIcon";import y6 from"@heroicons/react/24/solid/CheckBadgeIcon";import g6 from"@heroicons/react/24/solid/CheckCircleIcon";import v6 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as C6,useState as ps}from"react";import Br,{css as _1}from"styled-components";import{jsx as P1}from"react/jsx-runtime";var ei=({style:e,...t})=>P1("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:P1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});import{jsx as He,jsxs as x1}from"react/jsx-runtime";var ti=({style:e,...t})=>x1("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[x1("g",{clipPath:"url(#clip0_113_33841)",children:[He("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),He("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),He("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),He("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),He("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),He("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),He("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),He("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),He("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),He("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),He("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),He("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),He("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),He("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),He("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),He("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),He("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),He("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),He("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),He("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),He("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),He("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),He("defs",{children:He("clipPath",{id:"clip0_113_33841",children:He("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as _p,jsx as ve,jsxs as dr}from"react/jsx-runtime";var k1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,a]=ps([]),i=t?e.length:2,l=d=>d.authenticatorName?d.createdWithBrowser?`${d.authenticatorName} on ${d.createdWithBrowser}`:d.authenticatorName:d.createdWithBrowser?d.createdWithOs?`${d.createdWithBrowser} on ${d.createdWithOs}`:`${d.createdWithBrowser}`:"Unknown device",s=async d=>{a(m=>m.concat([d])),await r(d),a(m=>m.filter(f=>f!==d))};return dr("div",{children:[ve(A6,{children:"Your passkeys"}),dr(I1,{children:[e.slice(0,i).map(d=>dr(k6,{children:[dr("div",{children:[ve(P6,{children:l(d)}),dr(x6,{children:["Last used: ",(d.latestVerifiedAt??d.verifiedAt).toLocaleString()]})]}),ve(_6,{disabled:n.includes(d.credentialId),onClick:()=>s(d.credentialId),children:n.includes(d.credentialId)?ve(yo,{}):ve(h6,{height:"1.6em"})})]},d.credentialId)),e.length>2&&!t&&ve(Mp,{onClick:o,children:"View all"})]})]})},w6=()=>dr(I1,{children:[dr(ar,{children:[ve(ir,{children:ve(y6,{})}),"Log in with Touch ID, Face ID, or a security key."]}),dr(ar,{children:[ve(ir,{children:ve(v6,{})}),"More secure than a password."]}),dr(ar,{children:[ve(ir,{children:ve(f6,{})}),"Takes seconds to set up and use."]})]}),M1=()=>{let{user:e,unlinkPasskey:t}=q(),{linkWithPasskey:r,closePrivyModal:o}=_(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[a,i]=ps(!1),[l,s]=ps(""),[d,m]=ps(!1),[f,u]=ps(!1);C6(()=>{n.length===0&&u(!1)},[n.length]);let C=()=>{i(!0),r().then(()=>m(!0)).catch(g=>{if(g instanceof Jt){if(g.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{i(!1)})},v=async g=>(i(!0),await t(g).then(()=>m(!0)).catch(b=>{if(b instanceof Jt&&b.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{i(!1)}));return d?dr(_p,{children:[ve(x,{onClose:()=>o()},"header"),ve(Le,{children:ve(Ze,{status:"success",children:ve(g6,{})})}),ve(R1,{children:"Passkey added"}),ve(T6,{children:"From now on, you can use your passkey to log in."}),ve(kt,{children:ve(U,{onClick:()=>o(),children:"Done"})}),ve(J,{})]}):f?dr(_p,{children:[ve(x,{backFn:()=>u(!1),onClose:()=>o()},"header"),ve(k1,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),ve(J,{})]}):dr(_p,{children:[ve(x,{onClose:()=>o()},"header"),ve(Le,{children:dr(xc,{children:[ve(ei,{}),ve(ti,{})]})}),ve(R1,{children:"Secure your account with a passkey"}),ve(S6,{}),n.length===0?ve(w6,{}):ve(k1,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),dr(kt,{style:{marginTop:"12px"},children:[l&&ve(b6,{fail:!0,children:l}),ve(U,{onClick:C,loading:a,children:"Add new passkey"})]}),ve(J,{})]})},xc=Br.div`
|
|
1586
1586
|
display: flex;
|
|
1587
1587
|
align-items: center;
|
|
1588
1588
|
justify-content: center;
|
|
@@ -1719,13 +1719,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1719
1719
|
svg {
|
|
1720
1720
|
border-radius: var(--privy-border-radius-sm);
|
|
1721
1721
|
}
|
|
1722
|
-
`,
|
|
1722
|
+
`,la=Hr.div`
|
|
1723
1723
|
display: flex;
|
|
1724
1724
|
flex-direction: column;
|
|
1725
1725
|
justify-content: center;
|
|
1726
1726
|
align-items: center;
|
|
1727
1727
|
gap: 8px;
|
|
1728
|
-
`,
|
|
1728
|
+
`,ca=Hr.div`
|
|
1729
1729
|
display: flex;
|
|
1730
1730
|
align-items: baseline;
|
|
1731
1731
|
gap: 4px;
|
|
@@ -1749,9 +1749,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1749
1749
|
`,N1=Hr.div`
|
|
1750
1750
|
cursor: pointer;
|
|
1751
1751
|
padding-left: 4px;
|
|
1752
|
-
`,
|
|
1752
|
+
`,da=Hr.div`
|
|
1753
1753
|
font-size: 18px;
|
|
1754
|
-
`,
|
|
1754
|
+
`,pa=Hr.div`
|
|
1755
1755
|
font-size: 12px;
|
|
1756
1756
|
color: var(--privy-color-foreground-3);
|
|
1757
1757
|
// we need this container to maintain a static height if there's no content
|
|
@@ -1775,15 +1775,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1775
1775
|
to {
|
|
1776
1776
|
opacity: 1;
|
|
1777
1777
|
}
|
|
1778
|
-
`,F1=Hr(
|
|
1778
|
+
`,F1=Hr($o)`
|
|
1779
1779
|
border-radius: var(--privy-border-radius-md) !important;
|
|
1780
1780
|
animation: ${I6} 0.3s ease-in-out;
|
|
1781
|
-
`;import{Fragment as W6,jsx as
|
|
1781
|
+
`;import{Fragment as W6,jsx as Gt,jsxs as us}from"react/jsx-runtime";var U1=({displayName:e,errorMessage:t,configuredFundingChain:r,formattedBalance:o,fundingAmount:n,fundingCurrency:a,fundingAmountInUsd:i,options:l,selectedOption:s,isPreparing:d,isSubmitting:m,onSubmit:f,onSelect:u})=>us(W6,{children:[Gt(Mt,{}),Gt(ie,{}),Gt($r,{children:"Transfer from another network"}),us(Or,{children:["You need more funds on the ",r.name," network. Bridge from another blockchain network."]}),us(la,{style:{marginTop:"2rem"},children:[us(ca,{children:[Gt(Rc,{children:n}),Gt(da,{children:a})]}),i&&Gt(pa,{children:i})]}),Gt(It,{style:{marginTop:"1.5rem"},children:Gt(Wt,{children:"From"})}),Gt(A1,{selected:{chain:s.chain,balance:bt(s.balance,s.chain.nativeCurrency.symbol,3,!0)},options:l.map(({chain:C,balance:v})=>({chain:C,balance:bt(v,C.nativeCurrency.symbol,3,!0)})),onSelect:u}),Gt(It,{children:Gt(Wt,{style:{marginTop:"1.5rem"},children:"To"})}),Gt(T1,{chain:r,balance:o}),Gt(_a,{style:{marginTop:"1rem"},children:t}),us(Fo,{style:{marginTop:"1rem"},loading:m||d,disabled:d||m,onClick:f,children:["Confirm with ",e]}),Gt(ae,{}),Gt(G,{})]});import L6 from"styled-components";import{Fragment as O6,jsx as St,jsxs as ri}from"react/jsx-runtime";var B1=({wallet:e,displayName:t,addressToFund:r,chain:o,isBridging:n,isErc20Flow:a,totalPriceInNativeCurrency:i,totalPriceInUsd:l,gasPriceInNativeCurrency:s,gasPriceInUsd:d})=>ri(O6,{children:[St(Mt,{}),St(ia,{}),St(Tt,{style:{marginTop:"16px"},children:St(Yl,{icon:Xl(e.walletClientType,e.connectorType,e.walletClientType),name:e.walletClientType})}),St(ge,{style:{marginTop:"8px",marginBottom:"12px"},title:`${n?"Bridging":"Confirming"} with ${t}`}),!n&&!a&&ri(Ec,{children:[ri(It,{children:[St(Wt,{children:"Total"}),St(Ht,{children:l||i})]}),ri(It,{children:[St(Wt,{children:"To"}),St(Ht,{children:St(Ma,{address:r,showCopyIcon:!1})})]}),ri(It,{children:[St(Wt,{children:"Network"}),St(Ht,{children:ri(N6,{children:[St(sa,{chainId:o.id,height:16,width:16})," ",o.name]})})]}),s&&ri(It,{children:[St(Wt,{children:"Estimated fee"}),St(Ht,{children:d||s})]})]}),St(Hi,{height:24}),St(G,{})]}),N6=L6.div`
|
|
1782
1782
|
display: flex;
|
|
1783
1783
|
flex-direction: row;
|
|
1784
1784
|
align-items: center;
|
|
1785
1785
|
gap: 4px;
|
|
1786
|
-
`;import{Fragment as G1,jsx as Vr,jsxs as Ip}from"react/jsx-runtime";var q1=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r}=_(),{navigate:o,setModalData:n,app:i,data:a}=A(),{wallets:l}=Kr(),[s,d]=zt(!1),[m,f]=zt(0n),[u,C]=zt(!1),[v,g]=zt(null),[b,T]=zt(null),[R,S]=zt([]),[P,k]=zt(0),[M,O]=zt(!1),[H,Y]=zt(!1),[Q,L]=zt(!1),[X,W]=zt(!1),{tokenContractInfo:z,tokenAddress:_e,address:re,chain:Z,amount:oe}=a.funding;pn(()=>{_e&&!z&&g(new Error("Unable to fetch token details"))},[]);let pe=!!_e&&!!z,Ce=pe?BigInt(parseFloat(oe)*10**z.decimals):H6(oe),de=l[0],[Te,ut]=zt(null);pn(()=>{(async()=>{if(!de)return;let Io=await de.getEthereumProvider(),xe=F6({account:de.address,transport:U6(Io)}).extend(V6);ut(xe)})().catch(console.error)},[de]);let[Je,le]=zt(0n);pn(()=>{H1({chain:Z,transport:V1(Wo(Z,e,t))}).getBalance({address:re}).then(le).catch(console.error)},[]);let[Qt,mr]=zt(0n);pn(()=>{pe&&o1({chain:Z,address:re,appId:t,rpcConfig:e,tokenAddress:_e}).then(wt=>mr(wt.balance)).catch(console.error)},[]);let{tokenPrice:Ct}=So({chainId:Z.id}),[I,qe]=zt({to:re,chain:Z,value:Ce,data:void 0});pn(()=>{(async()=>{if(!Te||!de||M||Q)return;O(!0);let Io;if(pe&&!I.data){if(!await Te.simulateContract({address:_e,chain:Z,abi:as,functionName:"transfer",args:[re,Ce]}).catch(zr=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",zr)})){O(!1),C(!0);return}O(!1),qe({to:_e,chain:Z,data:B6({abi:as,functionName:"transfer",args:[re,Ce]}),value:"0x0"});return}try{Io=await H1({chain:I.chain,transport:V1(Wo(I.chain,e,t))}).prepareTransactionRequest({account:de.address,to:I.to,chain:I.chain,data:I.data,value:BigInt(I.value??0)})}catch(Dt){console.error(Dt),R.length>1&&T(Dt.shortMessage??"Something went wrong")}if(!Io){O(!1),C(!0);return}O(!1),L(!0),d(!0),f(Io.gas);try{await Te.switchChain({id:I.chain.id})}catch{await Te.addChain({chain:I.chain}),await Te.switchChain({id:I.chain.id})}let xe;try{xe=await Te.sendTransaction(Io)}catch(Dt){console.error(Dt);let zr=Dt;zr.name==="TransactionExecutionError"&&(R.length<1?g(new w(zr.shortMessage,void 0,"transaction_failure")):T(Dt.shortMessage??"Something went wrong"))}if(!xe){L(!1);return}await Te.waitForTransactionReceipt({hash:xe}),L(!1),W(!0)})().catch(console.error)},[Te,I]),pn(()=>{(async()=>{if(!u||!Te||!de)return;let xe=wc(i.chains).filter(Qe=>Qe.id!==a.funding.chain.id&&!!Qe.testnet==!!a.funding.chain.testnet);pe&&xe.unshift(a.funding.chain);let Dt=await r1({chains:xe,address:de.address,appId:t,rpcConfig:e}),zr=pe?Dt.filter(Qe=>Qe.balance>0n):Dt.filter(Qe=>Qe.balance>Ce);if(zr.length<1){g(new w(`Wallet ${Ft(de.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}zr.sort((Qe,Ta)=>Number(Ta.balance-Qe.balance));let ba=(await Promise.allSettled(zr.map(async Qe=>({quote:await e1({isTestnet:!!a.funding?.chain.testnet,input:$y({amount:Ce.toString(),user:de.address,recipient:re,destinationChainId:Z.id,destinationCurrency:_e,originChainId:Qe.chain.id})}),...Qe})))).filter(Qe=>Qe.status==="fulfilled").map(Qe=>Qe.value);if(ba.length<1){g(new w(`Wallet ${Ft(de.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let Ea=ba.map(Qe=>({bridgeTx:t1(Qe.quote),balance:Qe.balance,chain:Qe.chain})).filter(Qe=>!!Qe.bridgeTx);if(Ea.length>1){S(Ea);return}let ao=Ea[0];if(!ao){g(new w(`Wallet ${Ft(de.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}Y(!0),qe({data:ao.bridgeTx.data,to:ao.bridgeTx.to,value:ao.bridgeTx.value,chain:ao.chain})})().catch(console.error)},[u]),pn(()=>{if(!v)return;let wt={error:v,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};n({funding:a?.funding,sendTransaction:a?.sendTransaction,errorModalData:wt}),o("ERROR_SCREEN",!1)},[v]);let Xt=de?tn(de.walletClientType,de.connectorType,de.walletClientType)||"wallet":null,F=Ct?bi(a?.funding?.amount??"0",Ct):void 0,B=pe?m:Ia([m,Ce]),se=B&&Ct?co(B,Ct):void 0,rt=B?bt(B,"ETH"):void 0,kn=m&&Ct?co(m,Ct):void 0,ui=m?bt(m,"ETH"):void 0;if(pn(()=>{if(!X)return;let wt=setTimeout(r,Bu);return()=>clearTimeout(wt)},[X]),X)return Ip(G1,{children:[Vr(Mt,{}),Vr(ie,{}),Ip(vr,{children:[Vr(D6,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),Vr(ge,{title:"Success!",description:`You\u2019ve successfully added ${oe} ${pe?z.symbol:Z.nativeCurrency.symbol} to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),Vr(ae,{}),Vr(G,{})]});let Fs=pe?bc({amount:Qt,decimals:z.decimals})+" "+z.symbol:bt(Je,Z.nativeCurrency.symbol,3,!0),qr=R[P];return R.length>1&&qr?Vr(U1,{displayName:Xt,configuredFundingChain:Z,balance:Fs,fundingAmount:oe,fundingCurrency:pe?z.symbol:Z.nativeCurrency.symbol,fundingAmountInUsd:F,options:R,selectedOption:qr,isPreparing:M,isSubmitting:Q,errorMessage:b,onSubmit:()=>{qe({to:qr.bridgeTx.to,data:qr.bridgeTx.data,value:qr.bridgeTx.value,chain:qr.chain})},onSelect:wt=>{wt!==P&&(T(null),k(wt))}}):s&&m&&de&&a?.funding?Vr(B1,{wallet:de,displayName:Xt,addressToFund:re,isBridging:H,isErc20Flow:pe,totalPriceInUsd:se,totalPriceInNativeCurrency:rt,gasPriceInUsd:kn,gasPriceInNativeCurrency:ui,chain:a.funding.chain}):Ip(G1,{children:[Vr(Mt,{}),Vr(oa,{}),Vr("div",{style:{marginTop:"1rem"}}),Vr(G,{})]})};import q6 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import z6 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as K6,useMemo as Y6,useState as J1}from"react";import j1 from"styled-components";async function _c({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(i=>i.provider_app_id===r);if(!n)throw new w("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function z1({api:e,appId:t}){let r=On(),o=Si(),n=await Ai(r);try{let{url:i}=await e.post(tl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw ce(i)}}async function K1({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during cross-app auth flow");try{return(await e.post(rl,{authorization_code:n,state_code:r,code_verifier:o,provider:`privy:${t}`})).oauth_tokens?.access_token}catch(i){let a=ce(i);throw a.privyErrorCode?new w(a.message||"Invalid code during cross-app auth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during cross-app auth flow"?new w("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new w("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var Mc=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:i})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let a=e?.linkedAccounts.find(u=>!!(u.type==="cross_app"&&u.embeddedWallets.find(C=>C.address===t)));if(!e||!a)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new w("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await _c({api:r.api,requesterAppId:n,providerAppId:a.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new w("Cannot transact against a read-only provider app");await i({appId:a.providerApp.id})&&(l=r.getProviderAccessToken(a.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new w("Transactions require a valid token");let d=window.open(void 0,void 0,ms({w:400,h:680}));if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new w("Failed to initialize signature request");let m=new URL(`${s.apiUrl}/oauth/transact`);return m.searchParams.set("token",l||""),m.searchParams.set("request",G6(o)),d.location=m.href,new Promise((u,C)=>{let g=setTimeout(()=>{R(),C(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),b=setInterval(()=>{d.closed&&(R(),C(new w("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),T=S=>{S.data&&(S.data.token?.action==="set"&&S.data.token?.value!==void 0?r.storeProviderAccessToken(a.providerApp.id,S.data.token.value):S.data.token?.action==="clear"&&r.storeProviderAccessToken(a.providerApp.id,null),S.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&S.data.result&&(R(),u(S.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:o.method}})),S.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&S.data.error&&(R(),C(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",T);let R=()=>{d.close(),clearInterval(b),clearTimeout(g),window.removeEventListener("message",T)}})},G6=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),ms=({w:e,h:t})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,o=window.screenTop!==void 0?window.screenTop:window.screenY,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=n/window.screen.availWidth,l=i/window.screen.availHeight,s=(n-e)/2/a+r,d=(i-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${d}`};var da="sdk_fiat_on_ramp_completed_with_status";var Y1={1:"ethereum",8453:"base",10:"optimism",137:"polygon",42161:"arbitrum"},Q1=e=>!!Y1[e];function X1(e){let t=Y1[e];if(!t)throw new w(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}var Z1=({input:e,amount:t,blockchain:r})=>{let o=new URL("https://pay.coinbase.com/buy/select-asset");return o.searchParams.set("appId",e.app_id),o.searchParams.set("sessionToken",e.session_token),o.searchParams.set("defaultExperience","buy"),o.searchParams.set("presetCryptoAmount",t),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};import{Fragment as tg,jsx as Tr,jsxs as fs}from"react/jsx-runtime";var Q6=240,$1=1500,X6=Math.floor(Q6*1e3/$1),eg=()=>{let{data:e,setModalData:t,navigate:r}=A(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=_(),l=e?.funding,[s,d]=J1(!1),[m,f]=J1(!1);return K6(()=>{if(s)return;d(!0);let u=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp"}});let v=window.open(void 0,void 0,ms({w:440,h:680})),g=X1(l.chain.id),b=await i({addresses:[{address:l.address,blockchains:[g]}]}),{url:T}=Z1({input:b,amount:l.amount,blockchain:g});if(!v)throw new Error("Unable to initiate Coinbase Onramp flow.");v.location=T.toString();let R=0,S=!1;for(;R<X6;){R++;let{status:P}=await a({partnerUserId:b.partner_user_id});if(P==="success"){S=!0;break}if(P==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(v.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(k=>setTimeout(k,$1))}if(!S)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:da,payload:{status:"success",provider:"coinbase-onramp"}}),f(!0)}catch(v){console.error(v),n({eventName:da,payload:{status:"failure",provider:"coinbase-onramp",error:v.message}}),t({funding:{...l,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),r("FUNDING_METHOD_SELECTION_SCREEN")}finally{d(!1)}},C=setTimeout(()=>void u(),500);return()=>clearTimeout(C)},[]),fs(tg,{children:[Tr(x,{title:"Fund account"},"header"),Tr(J6,{isSucccess:m,onClickCta:o}),Tr(G,{})]})},Z6=e=>e?{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"}:{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""},J6=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=Y6(()=>Z6(e),[e]);return fs(tg,{children:[fs(r7,{children:[Tr(e7,{isSucccess:e}),fs(Ye,{children:[Tr("h3",{children:r}),Tr(t7,{children:o})]})]}),n&&Tr(U,{onClick:t,children:n})]})},j6=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",$6=e=>e?z6:()=>Tr(q6,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),e7=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return fs("div",{style:{position:"relative"},children:[Tr(at,{color:o,style:{position:"absolute"}}),Tr(Ga,{color:o}),Tr(Oo,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=$6(e),r=j6(e);return Tr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Tr(t,{width:"4rem",height:"4rem",color:r})})},t7=j1.p`
|
|
1786
|
+
`;import{Fragment as G1,jsx as Vr,jsxs as Ip}from"react/jsx-runtime";var q1=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r}=_(),{navigate:o,setModalData:n,app:a,data:i}=A(),{wallets:l}=zr(),[s,d]=qt(!1),[m,f]=qt(0n),[u,C]=qt(!1),[v,g]=qt(null),[b,T]=qt(null),[R,S]=qt([]),[P,k]=qt(0),[M,O]=qt(!1),[H,Y]=qt(!1),[X,L]=qt(!1),[Z,W]=qt(!1),{tokenContractInfo:z,tokenAddress:Re,address:re,chain:Q,amount:oe}=i.funding;un(()=>{Re&&!z&&g(new Error("Unable to fetch token details"))},[]);let pe=!!Re&&!!z,Ce=pe?BigInt(parseFloat(oe)*10**z.decimals):H6(oe),de=l[0],[Ae,ut]=qt(null);un(()=>{(async()=>{if(!de)return;let Io=await de.getEthereumProvider(),_e=F6({account:de.address,transport:U6(Io)}).extend(V6);ut(_e)})().catch(console.error)},[de]);let[Je,le]=qt(0n);un(()=>{H1({chain:Q,transport:V1(Lo(Q,e,t))}).getBalance({address:re}).then(le).catch(console.error)},[]);let[Yt,mr]=qt(0n);un(()=>{pe&&o1({chain:Q,address:re,appId:t,rpcConfig:e,tokenAddress:Re}).then(wt=>mr(wt.balance)).catch(console.error)},[]);let{tokenPrice:Ct}=So({chainId:Q.id}),[I,qe]=qt({to:re,chain:Q,value:Ce,data:void 0});un(()=>{(async()=>{if(!Ae||!de||M||X)return;O(!0);let Io,_e=H1({chain:Q,transport:V1(Lo(Q,e,t))});if(pe&&!I.data){if(!await _e.simulateContract({address:Re,chain:Q,abi:as,functionName:"transfer",args:[re,Ce],account:de.address}).catch(io=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",io)})){O(!1),C(!0);return}O(!1),qe({to:Re,chain:Q,data:B6({abi:as,functionName:"transfer",args:[re,Ce]}),value:"0x0"});return}try{Io=await _e.prepareTransactionRequest({account:de.address,to:I.to,chain:I.chain,data:I.data,value:BigInt(I.value??0)})}catch(Xt){console.error(Xt),R.length>1&&T(Xt.shortMessage??"Something went wrong")}if(!Io){O(!1),C(!0);return}O(!1),L(!0),d(!0),f(Io.gas);try{await Ae.switchChain({id:I.chain.id})}catch{await Ae.addChain({chain:I.chain}),await Ae.switchChain({id:I.chain.id})}let Wo;try{Wo=await Ae.sendTransaction(Io)}catch(Xt){console.error(Xt);let io=Xt;io.name==="TransactionExecutionError"&&(R.length<1?g(new w(io.shortMessage,void 0,"transaction_failure")):T(Xt.shortMessage??"Something went wrong"))}if(!Wo){L(!1);return}await Ae.waitForTransactionReceipt({hash:Wo}),L(!1),W(!0)})().catch(console.error)},[Ae,I]),un(()=>{(async()=>{if(!u||!Ae||!de)return;let _e=wc(a.chains).filter(Qe=>Qe.id!==i.funding.chain.id&&!!Qe.testnet==!!i.funding.chain.testnet);pe&&_e.unshift(i.funding.chain);let Wo=await r1({chains:_e,address:de.address,appId:t,rpcConfig:e}),Xt=pe?Wo.filter(Qe=>Qe.balance>0n):Wo.filter(Qe=>Qe.balance>Ce);if(Xt.length<1){g(new w(`Wallet ${Dt(de.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}Xt.sort((Qe,Ta)=>Number(Ta.balance-Qe.balance));let io=(await Promise.allSettled(Xt.map(async Qe=>({quote:await e1({isTestnet:!!i.funding?.chain.testnet,input:$y({amount:Ce.toString(),user:de.address,recipient:re,destinationChainId:Q.id,destinationCurrency:Re,originChainId:Qe.chain.id})}),...Qe})))).filter(Qe=>Qe.status==="fulfilled").map(Qe=>Qe.value);if(io.length<1){g(new w(`Wallet ${Dt(de.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let fi=io.map(Qe=>({bridgeTx:t1(Qe.quote),balance:Qe.balance,chain:Qe.chain})).filter(Qe=>!!Qe.bridgeTx);if(fi.length>1){S(fi);return}let ao=fi[0];if(!ao){g(new w(`Wallet ${Dt(de.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}Y(!0),qe({data:ao.bridgeTx.data,to:ao.bridgeTx.to,value:ao.bridgeTx.value,chain:ao.chain})})().catch(console.error)},[u]),un(()=>{if(!v)return;let wt={error:v,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};n({funding:i?.funding,sendTransaction:i?.sendTransaction,errorModalData:wt}),o("ERROR_SCREEN",!1)},[v]);let Qt=de?rn(de.walletClientType,de.connectorType,de.walletClientType)||"wallet":null,F=!pe&&Ct?Ti(i?.funding?.amount??"0",Ct):void 0,B=pe?m:Ia([m,Ce]),se=B&&Ct?co(B,Ct):void 0,rt=B?bt(B,"ETH"):void 0,Rn=m&&Ct?co(m,Ct):void 0,mi=m?bt(m,"ETH"):void 0;if(un(()=>{if(!Z)return;let wt=setTimeout(r,Bu);return()=>clearTimeout(wt)},[Z]),Z)return Ip(G1,{children:[Vr(Mt,{}),Vr(ie,{}),Ip(vr,{children:[Vr(D6,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),Vr(ge,{title:"Success!",description:`You\u2019ve successfully added ${oe} ${pe?z.symbol:Q.nativeCurrency.symbol} to your ${a.name} wallet. It may take a minute before the funds are available to use.`})]}),Vr(ae,{}),Vr(G,{})]});let Fs=pe?`${bc({amount:Yt,decimals:z.decimals})} ${z.symbol}`:bt(Je,Q.nativeCurrency.symbol,3,!0),qr=R[P];return R.length>1&&qr?Vr(U1,{displayName:Qt,configuredFundingChain:Q,formattedBalance:Fs,fundingAmount:oe,fundingCurrency:pe?z.symbol:Q.nativeCurrency.symbol,fundingAmountInUsd:F,options:R,selectedOption:qr,isPreparing:M,isSubmitting:X,errorMessage:b,onSubmit:()=>{qe({to:qr.bridgeTx.to,data:qr.bridgeTx.data,value:qr.bridgeTx.value,chain:qr.chain})},onSelect:wt=>{wt!==P&&(T(null),k(wt))}}):s&&m&&de&&i?.funding?Vr(B1,{wallet:de,displayName:Qt,addressToFund:re,isBridging:H,isErc20Flow:pe,totalPriceInUsd:se,totalPriceInNativeCurrency:rt,gasPriceInUsd:Rn,gasPriceInNativeCurrency:mi,chain:i.funding.chain}):Ip(G1,{children:[Vr(Mt,{}),Vr(ia,{}),Vr("div",{style:{marginTop:"1rem"}}),Vr(G,{})]})};import q6 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import z6 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as K6,useMemo as Y6,useState as J1}from"react";import j1 from"styled-components";async function _c({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(a=>a.provider_app_id===r);if(!n)throw new w("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function z1({api:e,appId:t}){let r=Dn(),o=Pi(),n=await xi(r);try{let{url:a}=await e.post(tl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:a,stateCode:o,codeVerifier:r}}catch(a){throw ce(a)}}async function K1({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during cross-app auth flow");try{return(await e.post(rl,{authorization_code:n,state_code:r,code_verifier:o,provider:`privy:${t}`})).oauth_tokens?.access_token}catch(a){let i=ce(a);throw i.privyErrorCode?new w(i.message||"Invalid code during cross-app auth flow.",void 0,i.privyErrorCode):i.message==="User denied confirmation during cross-app auth flow"?new w("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new w("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var Mc=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:a})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let i=e?.linkedAccounts.find(u=>!!(u.type==="cross_app"&&u.embeddedWallets.find(C=>C.address===t)));if(!e||!i)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new w("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(i.providerApp.id),s=await _c({api:r.api,requesterAppId:n,providerAppId:i.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new w("Cannot transact against a read-only provider app");await a({appId:i.providerApp.id})&&(l=r.getProviderAccessToken(i.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new w("Transactions require a valid token");let d=window.open(void 0,void 0,ms({w:400,h:680}));if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new w("Failed to initialize signature request");let m=new URL(`${s.apiUrl}/oauth/transact`);return m.searchParams.set("token",l||""),m.searchParams.set("request",G6(o)),d.location=m.href,new Promise((u,C)=>{let g=setTimeout(()=>{R(),C(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),b=setInterval(()=>{d.closed&&(R(),C(new w("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),T=S=>{S.data&&(S.data.token?.action==="set"&&S.data.token?.value!==void 0?r.storeProviderAccessToken(i.providerApp.id,S.data.token.value):S.data.token?.action==="clear"&&r.storeProviderAccessToken(i.providerApp.id,null),S.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&S.data.result&&(R(),u(S.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:o.method}})),S.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&S.data.error&&(R(),C(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",T);let R=()=>{d.close(),clearInterval(b),clearTimeout(g),window.removeEventListener("message",T)}})},G6=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),ms=({w:e,h:t})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,o=window.screenTop!==void 0?window.screenTop:window.screenY,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,i=n/window.screen.availWidth,l=a/window.screen.availHeight,s=(n-e)/2/i+r,d=(a-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${d}`};var ua="sdk_fiat_on_ramp_completed_with_status";var Y1={1:"ethereum",8453:"base",10:"optimism",137:"polygon",42161:"arbitrum"},Q1=e=>!!Y1[e];function X1(e){let t=Y1[e];if(!t)throw new w(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}var Z1=({input:e,amount:t,blockchain:r})=>{let o=new URL("https://pay.coinbase.com/buy/select-asset");return o.searchParams.set("appId",e.app_id),o.searchParams.set("sessionToken",e.session_token),o.searchParams.set("defaultExperience","buy"),o.searchParams.set("presetCryptoAmount",t),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};import{Fragment as tg,jsx as Tr,jsxs as fs}from"react/jsx-runtime";var Q6=240,$1=1500,X6=Math.floor(Q6*1e3/$1),eg=()=>{let{data:e,setModalData:t,navigate:r}=A(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:a,getCoinbaseOnRampStatus:i}=_(),l=e?.funding,[s,d]=J1(!1),[m,f]=J1(!1);return K6(()=>{if(s)return;d(!0);let u=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp"}});let v=window.open(void 0,void 0,ms({w:440,h:680})),g=X1(l.chain.id),b=await a({addresses:[{address:l.address,blockchains:[g]}]}),{url:T}=Z1({input:b,amount:l.amount,blockchain:g});if(!v)throw new Error("Unable to initiate Coinbase Onramp flow.");v.location=T.toString();let R=0,S=!1;for(;R<X6;){R++;let{status:P}=await i({partnerUserId:b.partner_user_id});if(P==="success"){S=!0;break}if(P==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(v.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(k=>setTimeout(k,$1))}if(!S)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:ua,payload:{status:"success",provider:"coinbase-onramp"}}),f(!0)}catch(v){console.error(v),n({eventName:ua,payload:{status:"failure",provider:"coinbase-onramp",error:v.message}}),t({funding:{...l,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),r("FUNDING_METHOD_SELECTION_SCREEN")}finally{d(!1)}},C=setTimeout(()=>void u(),500);return()=>clearTimeout(C)},[]),fs(tg,{children:[Tr(x,{title:"Fund account"},"header"),Tr(J6,{isSucccess:m,onClickCta:o}),Tr(G,{})]})},Z6=e=>e?{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"}:{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""},J6=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=Y6(()=>Z6(e),[e]);return fs(tg,{children:[fs(r7,{children:[Tr(e7,{isSucccess:e}),fs(Ye,{children:[Tr("h3",{children:r}),Tr(t7,{children:o})]})]}),n&&Tr(U,{onClick:t,children:n})]})},j6=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",$6=e=>e?z6:()=>Tr(q6,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),e7=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return fs("div",{style:{position:"relative"},children:[Tr(at,{color:o,style:{position:"absolute"}}),Tr(Ga,{color:o}),Tr(Do,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=$6(e),r=j6(e);return Tr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Tr(t,{width:"4rem",height:"4rem",color:r})})},t7=j1.p`
|
|
1787
1787
|
font-size: 1rem;
|
|
1788
1788
|
color: var(--privy-color-foreground-3);
|
|
1789
1789
|
margin-bottom: 1rem;
|
|
@@ -1817,11 +1817,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1817
1817
|
border: 1px solid var(--privy-color-error);
|
|
1818
1818
|
border-radius: var(--privy-border-radius-sm);
|
|
1819
1819
|
}
|
|
1820
|
-
`;import{createPublicClient as l7,http as c7}from"viem";var Ic=async({address:e,chain:t,rpcConfig:r,privyAppId:o})=>{try{let n=l7({chain:t,transport:c7(
|
|
1820
|
+
`;import{createPublicClient as l7,http as c7}from"viem";var Ic=async({address:e,chain:t,rpcConfig:r,privyAppId:o})=>{try{let n=l7({chain:t,transport:c7(Lo(t,r,o))}),[a,i]=await Promise.all([n.readContract({abi:og,address:e,functionName:"symbol"}),n.readContract({abi:og,address:e,functionName:"decimals"})]);return{decimals:i,symbol:a}}catch(n){return console.log(n),null}},og=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];import{jsx as Wp,jsxs as d7}from"react/jsx-runtime";var ma=({size:e=61,...t})=>Wp("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:d7("g",{id:"moonpay_symbol_wht 2",children:[Wp("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),Wp("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});import{Fragment as ag,jsx as ht,jsxs as mn}from"react/jsx-runtime";var sg=()=>{let{wallets:e}=zr(),{navigate:t,data:r,setModalData:o}=A(),n=De(),a=r?.funding,i=m7(null),[l,s]=f7(!1);ig(()=>{i.current&&i.current.style.setProperty("--funding-input-length",Math.max(a.amount.length,1).toString())},[a.amount,i.current]);let d=n.fundingConfig?.methods.slice()??[],{tokenPrice:m}=So({chainId:a.chain.id});ig(()=>{a.tokenAddress&&a.chain&&Ic({address:a.tokenAddress,chain:a.chain,rpcConfig:n.rpcConfig,privyAppId:n.id}).then(T=>o({...r,funding:{...r.funding,tokenContractInfo:T?{symbol:T.symbol,decimals:T.decimals}:void 0}})).catch(console.error)},[a.tokenAddress,a.chain]);let f=m?Ti(a.amount,m):void 0,u=e.find(T=>ng(T.address)===ng(a.address)),C=u&&u.walletClientType!=="privy"?rn(u.walletClientType,u.connectorType,u.walletClientType):n.name,v=parseFloat(a.amount),g=!isNaN(v)&&v>0,b=!!(a.tokenAddress&&!a.tokenContractInfo);return mn(ag,{children:[ht(Mt,{}),mn("h3",{children:["Add funds to your"," ",C?.toLowerCase().endsWith("wallet")?C:C+" wallet"]}),ht(tn,{style:{marginTop:"32px"},children:ht(la,{children:b?ht(ia,{size:"50px"}):mn(ag,{children:[mn(ca,{onClick:()=>i.current?.focus(),children:[ht(L1,{ref:i,value:a.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:T=>{let R=T.target.value;/^[0-9.]*$/.test(R)&&R.split(".").length-1<=1&&o({...r,funding:{...a,amount:R}})}}),ht(da,{children:a.tokenAddress?a.tokenContractInfo?.symbol:a.chain.nativeCurrency.symbol}),!l&&ht(N1,{children:ht(p7,{width:12,height:12})})]}),!a.tokenAddress&&ht(pa,{children:f&&g?f:""})]})})}),mn(W1,{children:[a.errorMessage&&ht(rg,{children:a.errorMessage}),d.sort().map(T=>{switch(T){case"moonpay":return mn(Se,{disabled:!g||b,onClick:()=>{t("MOONPAY_PROMPT_SCREEN")},children:[ht(kc,{children:ht(ma,{style:{width:24}})}),"Moonpay"]},T);case"coinbase-onramp":return Q1(Number(a.chain.id))?mn(Se,{disabled:!g||b,onClick:()=>{t("COINBASE_ONRAMP_STATUS_SCREEN")},children:[ht(kc,{children:ht(Do,{style:{width:24}})}),"Coinbase Onramp"]},T):null;case"external":return mn(Se,{disabled:!g||b,onClick:()=>{t("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[ht(kc,{children:ht(u7,{style:{width:24}})}),"Transfer from wallet"]},T)}}),ht(D1,{disabled:!g,onClick:()=>t("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),ht(G,{})]})};import{formatUnits as h7}from"@ethersproject/units";import y7 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import g7 from"@heroicons/react/24/outline/InformationCircleIcon";import v7 from"@heroicons/react/24/outline/QrCodeIcon";import{useEffect as C7,useMemo as w7,useState as Lp}from"react";import fa from"styled-components";import{Fragment as Wc,jsx as Ve,jsxs as Lt}from"react/jsx-runtime";var b7=2e3,lg=()=>{let{wallets:e}=zr(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:a}=A(),{chains:i,rpcConfig:l,appId:s,closePrivyModal:d}=_(),[m,f]=Lp("default"),[u,C]=Lp(void 0),v=r?.funding,{tokenPrice:g}=So({chainId:v.chain.id}),b=g?Ti(v.amount,g):void 0,T=e.find(k=>Dt(k.address)===Dt(v.address)),R=T&&T.walletClientType!=="privy"?rn(T.walletClientType,T.connectorType,T.walletClientType):t.name;if(!v)return o({errorModalData:{error:new Error("Couldn't find funding config"),previousScreen:a||"FUNDING_METHOD_SELECTION_SCREEN"},funding:r?.funding,sendTransaction:r?.sendTransaction}),n("ERROR_SCREEN"),Ve(Wc,{});C7(()=>{let k=_r(v.chain.id,i,l,{appId:s});function M(){k.getBalance(v.address).then(H=>C(parseFloat(h7(H,"ether")))).catch(()=>C(void 0))}let O=setInterval(M,b7);return M(),()=>clearInterval(O)},[]);let S=w7(()=>u!==void 0?u>=parseFloat(v.amount):!1,[u,v.amount]),P=Lt(Wc,{children:[Ve(Ei,{title:"Your wallet",errMsg:void 0,isLoading:!v||u===void 0,isPulsing:!S,balance:`${u!==void 0?u.toPrecision(2):""} ETH`,address:v.address,statusColor:S?"green":"gray"}),S&&Ve(F1,{onClick:()=>d(),children:"Close"})]});return m==="qr-code"?Lt(Wc,{children:[Ve(x,{backFn:()=>f("default")}),Lt(tn,{style:{gap:"24px",marginBottom:"24px"},children:[Lt("div",{children:[Ve(me,{children:"Scan QR code"}),Lt(he,{children:["Scan this code using your mobile wallet to send funds to your ",R," ","wallet."]})]}),Ve(pn,{url:v.address,size:200,squareLogoElement:E7}),P]}),Ve(G,{})]}):Lt(Wc,{children:[Ve(Mt,{}),Ve(ge,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),Lt(tn,{style:{gap:"16px"},children:[Lt(A7,{children:[Ve(g7,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),Lt(P7,{children:["Make sure to send on ",v.chain.name,"."]})]}),Lt(x7,{children:[Ve(Hi,{height:16}),Lt(la,{children:[Lt(ca,{children:[Ve(Rc,{children:v.amount}),Ve(da,{children:v.chain.nativeCurrency.symbol})]}),Ve(pa,{children:b?`${b} USD`:"..."}),Lt(O1,{children:[Ve(sa,{chainId:v.chain.id,height:16,width:16})," ",v.chain.name]})]}),Ve(Hi,{height:8}),Lt(S7,{children:[Ve(T7,{text:v.address}),Ve(dg,{onClick:()=>f("qr-code"),children:Lt(cg,{children:[Ve(v7,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),P]}),Ve(Hi,{height:16}),Ve(G,{})]})},E7=({...e})=>Ve(Ci,{color:"black",...e}),T7=e=>{let[t,r]=Lp(!1);return Ve(dg,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:Lt(cg,{children:[t?Ve(na,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):Ve(y7,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},S7=fa.div`
|
|
1821
1821
|
display: flex;
|
|
1822
1822
|
flex-direction: row;
|
|
1823
1823
|
gap: 8px;
|
|
1824
|
-
`,A7=
|
|
1824
|
+
`,A7=fa.div`
|
|
1825
1825
|
display: flex;
|
|
1826
1826
|
flex-direction: row;
|
|
1827
1827
|
padding: 8px;
|
|
@@ -1830,11 +1830,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1830
1830
|
svg {
|
|
1831
1831
|
margin-right: 12px;
|
|
1832
1832
|
}
|
|
1833
|
-
`,P7=
|
|
1833
|
+
`,P7=fa.div`
|
|
1834
1834
|
line-height: 20px;
|
|
1835
1835
|
font-size: 18px
|
|
1836
1836
|
text-align: center;
|
|
1837
|
-
`,x7=
|
|
1837
|
+
`,x7=fa.div`
|
|
1838
1838
|
display: flex;
|
|
1839
1839
|
flex-direction: column;
|
|
1840
1840
|
background-color: var(--privy-color-background-2);
|
|
@@ -1844,11 +1844,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1844
1844
|
}
|
|
1845
1845
|
padding: 16px;
|
|
1846
1846
|
gap: 8px;
|
|
1847
|
-
`,cg=
|
|
1847
|
+
`,cg=fa.span`
|
|
1848
1848
|
display: flex;
|
|
1849
1849
|
align-items: center;
|
|
1850
1850
|
margin: auto;
|
|
1851
|
-
`,dg=
|
|
1851
|
+
`,dg=fa.button`
|
|
1852
1852
|
display: flex;
|
|
1853
1853
|
align-items: center;
|
|
1854
1854
|
width: 100%;
|
|
@@ -1885,7 +1885,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1885
1885
|
width: 18px;
|
|
1886
1886
|
height: 18px;
|
|
1887
1887
|
}
|
|
1888
|
-
`;import{useEffect as K7,useState as Y7}from"react";import k7 from"@heroicons/react/24/outline/ClockIcon";import R7 from"@heroicons/react/24/outline/EyeSlashIcon";import _7 from"@heroicons/react/24/outline/LinkIcon";import Ao from"styled-components";import{Fragment as pg,jsx as
|
|
1888
|
+
`;import{useEffect as K7,useState as Y7}from"react";import k7 from"@heroicons/react/24/outline/ClockIcon";import R7 from"@heroicons/react/24/outline/EyeSlashIcon";import _7 from"@heroicons/react/24/outline/LinkIcon";import Ao from"styled-components";import{Fragment as pg,jsx as zt,jsxs as oi}from"react/jsx-runtime";var Np=({title:e,desc:t,icon:r})=>oi(O7,{children:[zt(F7,{children:r}),oi(D7,{children:[zt(L7,{children:e}),zt(N7,{children:t})]})]}),ug=({app:e,signedUrl:t,onContinue:r})=>oi(pg,{children:[oi(I7,{children:[zt(ma,{size:"3.75rem"}),oi(W7,{children:[e?.name," uses ",zt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),oi(U7,{children:[zt(Np,{icon:zt(_7,{width:"1rem"}),title:"Purchase assets to fund your account",desc:oi(pg,{children:["Connect a payment method (",zt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),zt(Np,{icon:zt(k7,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),zt(Np,{icon:zt(R7,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),zt(B7,{className:"mobile-only"})]}),zt(M7,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),zt(Ll,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),M7=Ao.span`
|
|
1889
1889
|
display: inline-block;
|
|
1890
1890
|
color: var(--privy-color-foreground-3);
|
|
1891
1891
|
text-align: center;
|
|
@@ -1941,7 +1941,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1941
1941
|
margin: 0 0.5rem;
|
|
1942
1942
|
`,B7=Ao.div`
|
|
1943
1943
|
margin: 30px 0;
|
|
1944
|
-
`;import{ofetch as H7}from"ofetch";import{useEffect as V7,useRef as G7,useState as q7}from"react";var Lc="moonpay";function mg(e){switch(e){case"eip155:42161":return"ETH_ARBITRUM";case"eip155:43114":return"AVAX_CCHAIN";case"eip155:8453":return"ETH_BASE";case"eip155:42220":return"CELO_CELO";case"eip155:137":return"MATIC_POLYGON";case"eip155:1":return"ETH_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function fg(e){return parseFloat(e)}function hg(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function hs(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function yg(e,t,r,o,n=!1){let
|
|
1944
|
+
`;import{ofetch as H7}from"ofetch";import{useEffect as V7,useRef as G7,useState as q7}from"react";var Lc="moonpay";function mg(e){switch(e){case"eip155:42161":return"ETH_ARBITRUM";case"eip155:43114":return"AVAX_CCHAIN";case"eip155:8453":return"ETH_BASE";case"eip155:42220":return"CELO_CELO";case"eip155:137":return"MATIC_POLYGON";case"eip155:1":return"ETH_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function fg(e){return parseFloat(e)}function hg(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function hs(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function yg(e,t,r,o,n=!1){let a=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},i=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...a,...i}})}async function z7(e,t){let r=t?Gu:Vu,o=t?zu:qu;return H7(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function gg(e,t=!1){let[r,o]=q7(null),{createAnalyticsEvent:n}=_(),{data:a,navigate:i,setModalData:l}=A(),s=a?.funding,d=G7(0);return V7(()=>{let m=setInterval(async()=>{if(e)try{let[f]=await z7(e,t),u=f.status==="waitingAuthorization"&&f.paymentMethod==="credit_debit_card"?"pending":f.status;if(["failed","completed","awaitingAuthorization"].includes(u)&&(n({eventName:ua,payload:{status:u,provider:Lc,paymentMethod:f.paymentMethod,cardPaymentType:f.cardPaymentType,currency:f.currency?.code,baseCurrencyAmount:f.baseCurrencyAmount,quoteCurrencyAmount:f.quoteCurrencyAmount,feeAmount:f.feeAmount,extraFeeAmount:f.extraFeeAmount,networkFeeAmount:f.networkFeeAmount}}),clearInterval(m)),u==="failed"||u==="serviceFailure"){l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),i("FUNDING_METHOD_SELECTION_SCREEN");return}o(u)}catch(f){f.response?.status!==404&&(d.current+=1),d.current>=3&&(n({eventName:ua,payload:{status:"serviceFailure",provider:Lc}}),clearInterval(m),l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),i("FUNDING_METHOD_SELECTION_SCREEN"))}},3e3);return()=>clearInterval(m)},[e,d]),r}import{Fragment as Q7,jsx as Op,jsxs as X7}from"react/jsx-runtime";var vg=()=>{let{app:e,data:t,navigate:r,setModalData:o}=A(),{createAnalyticsEvent:n,getMoonpaySignedUrl:a}=_(),[i,l]=Y7(null),s=t?.funding;return K7(()=>{if(i||!s)return;async function d(){if(!e.fundingConfig)return;let{signedUrl:m,externalTransactionId:f}=await a(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??mg(`eip155:${s.chain.id}`),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??fg(s.amount)});l(m),o({moonpayStatus:{externalTransactionId:f},funding:t?.funding})}d()},[i,s]),X7(Q7,{children:[Op(Mt,{}),Op(ug,{app:e,signedUrl:i,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:Lc}}),r("MOONPAY_STATUS_SCREEN")}}),Op(G,{})]})};import Z7 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import J7 from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as j7}from"react";import Cg from"styled-components";import{Fragment as bg,jsx as Sr,jsxs as ys}from"react/jsx-runtime";var wg=()=>{let{app:e,data:t}=A(),{closePrivyModal:r}=_(),{externalTransactionId:o}=t?.moonpayStatus,n=gg(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return ys(bg,{children:[Sr(x,{title:"Fund account"},"header"),Sr(e8,{status:n,onClickCta:r}),Sr(G,{})]})},$7=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},e8=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=j7(()=>$7(e),[e]);return ys(bg,{children:[ys(i8,{children:[Sr(o8,{status:e}),ys(Ye,{children:[Sr("h3",{children:r}),Sr(n8,{children:o})]})]}),n&&Sr(U,{onClick:t,children:n})]})},t8=e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)",r8=e=>{switch(e){case"completed":return J7;case"waitingAuthorization":return()=>Sr(Z7,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},o8=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return ys("div",{style:{position:"relative"},children:[Sr(at,{color:o,style:{position:"absolute"}}),Sr(Ga,{color:o}),Sr(ma,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=r8(e),r=t8(e);return Sr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Sr(t,{width:"4rem",height:"4rem",color:r})})},n8=Cg.p`
|
|
1945
1945
|
font-size: 1rem;
|
|
1946
1946
|
color: var(--privy-color-foreground-3);
|
|
1947
1947
|
margin-bottom: 1rem;
|
|
@@ -1956,7 +1956,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1956
1956
|
margin-left: 1.75rem;
|
|
1957
1957
|
margin-right: 1.75rem;
|
|
1958
1958
|
padding: 2rem 0;
|
|
1959
|
-
`;import{useEffect as m8,useState as f8}from"react";import a8,{css as s8}from"styled-components";import{jsx as c8}from"react/jsx-runtime";var Nc=()=>{let{enabled:e,token:t}=
|
|
1959
|
+
`;import{useEffect as m8,useState as f8}from"react";import a8,{css as s8}from"styled-components";import{jsx as c8}from"react/jsx-runtime";var Nc=()=>{let{enabled:e,token:t}=Te(),{navigate:r,setModalData:o}=A(),{initLoginWithPasskey:n}=_();return c8(Dp,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:i=>n(i),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSKEY_SYSTEM_DIALOGUE",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await n(),r("AWAITING_PASSKEY_SYSTEM_DIALOGUE"))},children:"I have a passkey"})},l8=s8`
|
|
1960
1960
|
&& {
|
|
1961
1961
|
width: 100%;
|
|
1962
1962
|
font-size: 0.875rem;
|
|
@@ -1983,7 +1983,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1983
1983
|
}
|
|
1984
1984
|
`,Dp=a8.button`
|
|
1985
1985
|
${l8}
|
|
1986
|
-
`;import d8 from"@heroicons/react/24/outline/ChevronRightIcon";import p8 from"@heroicons/react/24/outline/WalletIcon";import{jsx as Fp,jsxs as u8}from"react/jsx-runtime";var Oc=({onClick:e,text:t})=>u8(
|
|
1986
|
+
`;import d8 from"@heroicons/react/24/outline/ChevronRightIcon";import p8 from"@heroicons/react/24/outline/WalletIcon";import{jsx as Fp,jsxs as u8}from"react/jsx-runtime";var Oc=({onClick:e,text:t})=>u8(Se,{onClick:e,children:[Fp(p8,{}),Fp(gr,{children:t}),Fp(d8,{})]});import{Fragment as Eg,jsx as fn,jsxs as Dc}from"react/jsx-runtime";var Tg=()=>{let{connectors:e}=_(),{app:t,setModalData:r,data:o,navigate:n}=A(),[a,i]=f8("default"),l=on(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=fn(Oc,{text:"More wallets",onClick:()=>i("overflow")});return m8(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),a==="overflow"?Dc(Eg,{children:[fn(x,{backFn:()=>i("default")},"header"),Dc(nr,{children:[fn(Or,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),fn(G,{})]}):Dc(Eg,{children:[fn(Mt,{}),fn(ge,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),Dc(nr,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,fn(Dp,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),fn(G,{})]})};import h8 from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import y8 from"styled-components";import{Fragment as v8,jsx as hn,jsxs as C8}from"react/jsx-runtime";var Sg=()=>{let{closePrivyModal:e}=_();return C8(v8,{children:[hn(x,{},"header"),hn(g8,{children:hn(h8,{style:{width:32,height:32}})}),hn(Co,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),hn(lr,{children:hn(U,{onClick:()=>e(),children:"Close"})}),hn(ae,{}),hn(G,{})]})},g8=y8.div`
|
|
1987
1987
|
border-radius: 50%;
|
|
1988
1988
|
height: 68px;
|
|
1989
1989
|
width: 68px;
|
|
@@ -2022,20 +2022,20 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2022
2022
|
margin-bottom: auto;
|
|
2023
2023
|
}
|
|
2024
2024
|
}
|
|
2025
|
-
`;import{Fragment as P8,jsx as At,jsxs as gs}from"react/jsx-runtime";var S8=()=>gs(A8,{children:[At(
|
|
2025
|
+
`;import{Fragment as P8,jsx as At,jsxs as gs}from"react/jsx-runtime";var S8=()=>gs(A8,{children:[At(Kn,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),At(Tt,{children:At(ho,{style:{width:"152px",height:"152px"}})}),gs(xg,{children:[At(Fc,{children:gs("div",{children:[At("span",{children:"Install the "}),At("a",{href:kg.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),At(Bp,{}),At(Fc,{children:"Set up your first wallet"}),At(Bp,{}),At(Fc,{children:"Store your recovery phrase in a safe place!"})]}),At($o,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),Rg=()=>{let{navigateBack:e}=A();return gs(P8,{children:[At(x,{backFn:e},"header"),At(ie,{}),At(S8,{}),At(ae,{}),gs(J,{children:[At("span",{children:"Still not sure? "}),At("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},A8=T8(Tt)`
|
|
2026
2026
|
gap: 30px;
|
|
2027
2027
|
|
|
2028
2028
|
> :first-child > svg {
|
|
2029
2029
|
margin-top: 20px;
|
|
2030
2030
|
}
|
|
2031
|
-
`;import y9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as g9,useState as Yg}from"react";import
|
|
2031
|
+
`;import y9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as g9,useState as Yg}from"react";import v9 from"styled-components";var x8={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",cross_app:"privy:",guest:"guest"},yn=e=>{let t=x8[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};import _8 from"styled-components";import k8 from"react";import{jsx as R8}from"react/jsx-runtime";var _g=()=>{let{app:e}=A(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?R8("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?k8.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};import{jsx as Mg}from"react/jsx-runtime";var Uc=e=>{let{app:t}=A();return t?.appearance.logo?Mg(M8,{...e,children:Mg(_g,{})}):null},M8=_8.div`
|
|
2032
2032
|
display: flex;
|
|
2033
2033
|
flex-direction: column;
|
|
2034
2034
|
align-items: center;
|
|
2035
2035
|
padding: 24px 0;
|
|
2036
2036
|
flex-grow: 1;
|
|
2037
2037
|
justify-content: center;
|
|
2038
|
-
`;import D8 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as F8}from"react";import I8 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as W8,useState as Hp}from"react";import Wg from"styled-components";import{Fragment as O8,jsx as
|
|
2038
|
+
`;import D8 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as F8}from"react";import I8 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as W8,useState as Hp}from"react";import Wg from"styled-components";import{Fragment as O8,jsx as ni,jsxs as Ig}from"react/jsx-runtime";var Bc=W8((e,t)=>{let[r,o]=Hp(e.defaultValue||""),[n,a]=Hp(!1),{authenticated:i}=q(),{initLoginWithEmail:l}=_(),{navigate:s,setModalData:d,currentScreen:m}=A(),{enabled:f,token:u}=Te(),[C,v]=Hp(!1),{accountType:g}=Pt(),b=qs(r),T=n,R=n||!b,S=k=>{a(!0),l(r,k).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(M=>{d({errorModalData:{error:M,previousScreen:m||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{a(!1)})},P=()=>{f&&!u&&!i?(d({captchaModalData:{callback:k=>l(r,k),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):S(u)};return Ig(O8,{children:[ni(L8,{children:Ig(N8,{stacked:e.stacked,children:[ni(I8,{}),ni("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>v(!0),onChange:k=>o(k.target.value),onKeyUp:k=>{k.key==="Enter"&&P()},value:r,autoComplete:"email"}),g==="email"&&!C?ni(jt,{color:"gray",children:"Recent"}):e.stacked?ni("span",{}):ni(Fi,{isSubmitting:T,onClick:P,disabled:R,children:"Submit"})]})}),e.stacked?ni(U,{loadingText:null,loading:T,disabled:R,onClick:P,children:"Submit"}):null]})}),L8=Wg.div`
|
|
2039
2039
|
width: 100%;
|
|
2040
2040
|
`,N8=Wg.label`
|
|
2041
2041
|
display: block;
|
|
@@ -2104,9 +2104,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2104
2104
|
&& > input::placeholder {
|
|
2105
2105
|
color: var(--privy-color-foreground-3);
|
|
2106
2106
|
}
|
|
2107
|
-
`;import{Fragment as U8,jsx as Hc,jsxs as Lg}from"react/jsx-runtime";var Vc=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=F8(null);return Lg(U8,{children:[Hc(
|
|
2107
|
+
`;import{Fragment as U8,jsx as Hc,jsxs as Lg}from"react/jsx-runtime";var Vc=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=F8(null);return Lg(U8,{children:[Hc(Xr,{if:!e,children:Hc(Bc,{ref:o,defaultValue:r})}),Hc(Xr,{if:e,children:Lg(Se,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[Hc(D8,{})," Continue with Email"]})})]})};import{useState as B8}from"react";import H8 from"styled-components";import{jsx as Vp,jsxs as G8}from"react/jsx-runtime";var Gc=()=>{let[e,t]=B8(!1),{currentScreen:r,navigate:o,setModalData:n}=A(),{enabled:a,token:i}=Te(),{initLoginWithFarcaster:l}=_(),{accountType:s}=Pt();return G8(Se,{onClick:async()=>{t(!0);try{a&&!i?(n({captchaModalData:{callback:m=>l(m),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(i),o("AWAITING_FARCASTER_CONNECTION"))}catch(m){n({errorModalData:{error:m,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[Vp(Eo,{})," Farcaster",e&&Vp(yo,{}),s==="farcaster"&&Vp(V8,{color:"gray",children:"Recent"})]})},V8=H8(jt)`
|
|
2108
2108
|
margin-left: auto;
|
|
2109
|
-
`;import r9 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as o9}from"react";import{forwardRef as J8,useEffect as j8,useState as Kc}from"react";import Vg from"styled-components";import q8 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as z8,AsYouType as Ng,getCountries as K8,getCountryCallingCode as qc,getExampleNumber as Y8}from"libphonenumber-js/min";import{jsx as Z8,jsxs as X8}from"react/jsx-runtime";var vs=(e,t)=>z8(String(e),t),zc=(e,t)=>`+${qc(t)} ${e}`,Og=e=>`*${e.replaceAll("-","").slice(-4)}`,Dg=e=>new Ng(e),Q8=K8().map(e=>({code:e,callCode:qc(e)})),Fg=e=>{let t=Y8(e,q8)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},Ug=({value:e,onChange:t})=>Z8("select",{value:e,onChange:t,children:Q8.map(r=>X8("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))}),Bg=e=>{let t=new Ng;t.input(e);let r=t.getCountry()||"US",o=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+o,"")}};import{Fragment as t9,jsx as
|
|
2109
|
+
`;import r9 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as o9}from"react";import{forwardRef as J8,useEffect as j8,useState as Kc}from"react";import Vg from"styled-components";import q8 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as z8,AsYouType as Ng,getCountries as K8,getCountryCallingCode as qc,getExampleNumber as Y8}from"libphonenumber-js/min";import{jsx as Z8,jsxs as X8}from"react/jsx-runtime";var vs=(e,t)=>z8(String(e),t),zc=(e,t)=>`+${qc(t)} ${e}`,Og=e=>`*${e.replaceAll("-","").slice(-4)}`,Dg=e=>new Ng(e),Q8=K8().map(e=>({code:e,callCode:qc(e)})),Fg=e=>{let t=Y8(e,q8)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},Ug=({value:e,onChange:t})=>Z8("select",{value:e,onChange:t,children:Q8.map(r=>X8("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))}),Bg=e=>{let t=new Ng;t.input(e);let r=t.getCountry()||"US",o=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+o,"")}};import{Fragment as t9,jsx as ii,jsxs as Hg}from"react/jsx-runtime";var gn=J8((e,t)=>{let{app:r}=A(),[o,n]=Kc(!1),{accountType:a}=Pt(),[i,l]=Kc(""),[s,d]=Kc(r?.intl.defaultCountry??"US"),m=vs(i,s),f=Dg(s),u=Fg(s),C=qc(s),v=!m,[g,b]=Kc(!1),T=C.length,R=k=>{let M=k.target.value;d(M),l(""),e.onChange&&e.onChange({rawPhoneNumber:i,qualifiedPhoneNumber:zc(i,M),countryCode:M,isValid:vs(i,s)})},S=(k,M)=>{try{let O=k.replace(/\D/g,""),H=i.replace(/\D/g,""),Y=O===H?k:f.input(k);l(Y),e.onChange&&e.onChange({rawPhoneNumber:Y,qualifiedPhoneNumber:zc(k,M),countryCode:M,isValid:vs(k,M)})}catch(O){console.error("Error processing phone number:",O)}},P=()=>{b(!0);let k=zc(i,s);e.onSubmit({rawPhoneNumber:i,qualifiedPhoneNumber:k,countryCode:s,isValid:vs(i,s)}).finally(()=>b(!1))};return j8(()=>{if(e.defaultValue){let k=Bg(e.defaultValue);f.reset(),R({target:{value:k.countryCode}}),S(k.phone,k.countryCode)}},[e.defaultValue]),Hg(t9,{children:[ii($8,{children:Hg(e9,{callingCodeLength:T,stacked:e.stacked,children:[ii(Ug,{value:s,onChange:R}),ii("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:u,onFocus:()=>n(!0),onChange:k=>{S(k.target.value,s)},onKeyUp:k=>{k.key==="Enter"&&P()},value:i,autoComplete:"tel"}),a==="phone"&&!o&&!e.hideRecent?ii(jt,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?ii(Fi,{isSubmitting:g,onClick:P,disabled:v,children:"Submit"}):ii("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?ii(U,{loading:g,loadingText:null,onClick:P,disabled:v,children:"Submit"}):null]})}),$8=Vg.div`
|
|
2110
2110
|
width: 100%;
|
|
2111
2111
|
`,e9=Vg.label`
|
|
2112
2112
|
--country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
|
|
@@ -2201,15 +2201,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2201
2201
|
&& > input::placeholder {
|
|
2202
2202
|
color: var(--privy-color-foreground-3);
|
|
2203
2203
|
}
|
|
2204
|
-
`;import{Fragment as n9,jsx as Yc,jsxs as Gg}from"react/jsx-runtime";var Qc=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=o9(null),{authenticated:n}=q(),{navigate:
|
|
2204
|
+
`;import{Fragment as n9,jsx as Yc,jsxs as Gg}from"react/jsx-runtime";var Qc=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=o9(null),{authenticated:n}=q(),{navigate:a,setModalData:i,currentScreen:l}=A(),{initLoginWithSms:s}=_(),{enabled:d,token:m}=Te();async function f({qualifiedPhoneNumber:u}){if(d&&!m&&!n)i({captchaModalData:{callback:C=>s(u,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),a("CAPTCHA_SCREEN");else try{await s(u,m),a("AWAITING_PASSWORDLESS_CODE")}catch(C){i({errorModalData:{error:C,previousScreen:l||"LANDING"}}),a("ERROR_SCREEN")}}return Gg(n9,{children:[Yc(Xr,{if:!e,children:Yc(gn,{ref:o,onSubmit:f,defaultValue:r})}),Yc(Xr,{if:e,children:Gg(Se,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[Yc(r9,{})," Continue with SMS"]})})]})};import{useState as i9}from"react";import a9 from"styled-components";import{jsx as Po,jsxs as c9}from"react/jsx-runtime";var s9={apple:{logo:Po(cl,{}),displayName:"Apple"},discord:{logo:Po(dl,{}),displayName:"Discord"},github:{logo:Po(pl,{}),displayName:"GitHub"},google:{logo:Po(ml,{}),displayName:"Google"},linkedin:{logo:Po(gl,{}),displayName:"LinkedIn"},spotify:{logo:Po(vl,{}),displayName:"Spotify"},instagram:{logo:Po(hl,{}),displayName:"Instagram"},twitter:{logo:Po(wl,{}),displayName:"Twitter"},tiktok:{logo:Po(Cl,{}),displayName:"TikTok"}},st=({provider:e})=>{let{enabled:t,token:r}=Te(),{navigate:o,setModalData:n}=A(),[a,i]=i9(!1),{initLoginWithOAuth:l}=_(),{accountType:s}=Pt(),d=s?yn(s):null,{displayName:m,logo:f}=s9[e];return c9(Se,{onClick:()=>{i(!0),t&&!r?(n({captchaModalData:{callback:C=>l(e,C),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:a,children:[f," ",m,d?.loginMethod===e&&Po(l9,{color:"gray",children:"Recent"})]})},l9=a9(jt)`
|
|
2205
2205
|
margin-left: auto;
|
|
2206
|
-
`;import{useState as d9}from"react";import p9 from"styled-components";import{jsx as
|
|
2206
|
+
`;import{useState as d9}from"react";import p9 from"styled-components";import{jsx as vn,jsxs as qg}from"react/jsx-runtime";function Xc(e){return qg("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[vn("defs",{children:qg("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[vn("stop",{offset:"0",stopColor:"#1d93d2"}),vn("stop",{offset:"1",stopColor:"#38b0e3"})]})}),vn("title",{children:"Telegram_logo"}),vn("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),vn("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),vn("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),vn("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}import{jsx as zg,jsxs as m9}from"react/jsx-runtime";var Zc=()=>{let{enabled:e,token:t}=Te(),{navigate:r,setModalData:o}=A(),[n,a]=d9(!1),{initLoginWithTelegram:i}=_(),{accountType:l}=Pt();async function s(m){try{await i(m),r("TELEGRAM_AUTH_SCREEN")}catch(f){console.error(f),a(!1)}}async function d(){if(a(!0),e&&!t){o({captchaModalData:{callback:s,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await s()}return m9(Se,{onClick:d,disabled:n,children:[zg(Xc,{}),"Telegram",l==="telegram"&&zg(u9,{color:"gray",children:"Recent"})]})},u9=p9(jt)`
|
|
2207
2207
|
margin-left: auto;
|
|
2208
|
-
`;import f9 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as Kg,jsxs as h9}from"react/jsx-runtime";var Jc=({onClick:e,text:t,icon:r})=>h9(
|
|
2208
|
+
`;import f9 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as Kg,jsxs as h9}from"react/jsx-runtime";var Jc=({onClick:e,text:t,icon:r})=>h9(Se,{onClick:e,children:[r,Kg(gr,{children:t}),Kg(f9,{})]});import{Fragment as Gp,jsx as et,jsxs as $c}from"react/jsx-runtime";var ed=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=_(),{app:o,onUserCloseViaDialogOrKeybindRef:n,data:a}=A(),{appearance:{palette:{colorScheme:i}}}=De(),{accountType:l,walletClientType:s}=Pt(),d=l?yn(l):null,m=o.loginMethodsAndOrder?.primary??[],f=o.loginMethodsAndOrder?.overflow??[],u=[...m,...f],C=o.loginMethods.passkey,v=a?.login,g=[];s&&u.includes(s)?g.push(s):l&&u.includes(d?.loginMethod)&&g.push(d?.loginMethod);let[b,T]=Yg("default"),[R,S]=Yg(l==="phone"?"sms":"email");g9(()=>{l==="phone"&&S("sms");let z=u.indexOf("sms"),Re=u.indexOf("email");z>-1&&z<Re&&S("sms")},[l,m,f]);let P=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{T("default")},150)};n.current=P;let k=z=>z==="email"?et(Vc,{isEditable:R==="email",setIsEditable:()=>{S("email")},defaultValue:v?.prefill?.type==="email"?v.prefill.value:void 0},z):z==="sms"?et(Qc,{isEditable:R==="sms",setIsEditable:()=>{S("sms")},defaultValue:v?.prefill?.type==="phone"?v.prefill.value:void 0},z):z==="apple"?et(st,{provider:"apple"},z):z==="discord"?et(st,{provider:"discord"},z):z==="farcaster"?et(Gc,{},z):z==="github"?et(st,{provider:"github"},z):z==="google"?et(st,{provider:"google"},z):z==="linkedin"?et(st,{provider:"linkedin"},z):z==="spotify"?et(st,{provider:"spotify"},z):z==="instagram"?et(st,{provider:"instagram"},z):z==="tiktok"?et(st,{provider:"tiktok"},z):z==="twitter"?et(st,{provider:"twitter"},z):z==="telegram"?et(Zc,{},z):on([z],r,e,u,o.externalWallets.walletConnect.enabled),M=g.flatMap(k),O=m.filter(z=>z!==s&&z!==d?.loginMethod).flatMap(k),H=f.filter(z=>z!==s&&z!==d?.loginMethod).flatMap(k),Y=[...M,...O,...H],X=C9({primary:O.length+M.length,overflow:H.length}),[L,Z]=_u(Y,X),W=b==="default"?void 0:()=>{T("default")};return $c(Gp,{children:[et(x,{title:o.appearance.landingHeader,onClose:P,backFn:W}),b==="default"&&et(w9,{}),b==="default"&&(typeof o.appearance.loginMessage=="string"?et(Dl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),et(Ol,{style:{overflow:"hidden"},children:$c(Zf,{colorScheme:i,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[b==="default"&&$c(Gp,{children:[...L,Z.length>0&&et(Jc,{text:"More options",icon:et(y9,{}),onClick:()=>T("overflow")})]}),b==="overflow"&&$c(Gp,{children:[...Z]}),C&&b==="default"&&et(Nc,{})]})}),o&&et(bi,{app:o}),et(G,{})]})},jc=5,C9=({primary:e,overflow:t})=>e<jc?e:e===jc&&t===0?jc:jc-1,w9=v9(Uc)`
|
|
2209
2209
|
margin-bottom: 16px;
|
|
2210
|
-
`;import
|
|
2210
|
+
`;import b9 from"@heroicons/react/24/outline/EnvelopeIcon";import E9 from"@heroicons/react/24/outline/PhoneIcon";import T9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as S9,useMemo as Zg,useState as Jg}from"react";import A9 from"styled-components";import{toObjectKeys as P9}from"@privy-io/js-sdk-core";import{jsx as Cs,jsxs as Qg}from"react/jsx-runtime";var Xg=({...e})=>Qg("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[Qg("g",{clipPath:"url(#clip0_2856_1743)",children:[Cs("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Cs("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Cs("defs",{children:Cs("clipPath",{id:"clip0_2856_1743",children:Cs("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import{Fragment as ws,jsx as Fe,jsxs as ha}from"react/jsx-runtime";var td=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=_(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=A(),a=De(),{accountType:i,walletClientType:l}=Pt(),s=i?yn(i):null,d=o?.login,m=Zg(()=>d?.loginMethods?P9(d.loginMethods,!0):null,[d]),{email:f,sms:u,google:C,twitter:v,discord:g,github:b,spotify:T,instagram:R,tiktok:S,linkedin:P,apple:k,wallet:M,farcaster:O,telegram:H}=m??a.loginMethods,{passkey:Y}=a.loginMethods,X=[f&&"email",u&&"sms",C&&"google",v&&"twitter",g&&"discord",b&&"github",T&&"spotify",R&&"instagram",S&&"tiktok",P&&"linkedin",k&&"apple",O&&"farcaster",H&&"telegram"].filter(F=>!!F),L=X.length>0,Z=Zg(()=>M&&!L?"web3-first":M&&a?.appearance.loginGroupPriority||"web2-first",[M,L,a?.appearance.loginGroupPriority]),W=a?.appearance.hideDirectWeb2Inputs,[z,Re]=Jg("default"),[re,Q]=Jg(jg({mostRecentlyUsedAccountType:i,smsAvailable:u,emailAvailable:f,prefilledType:d?.prefill?.type}));S9(()=>{Q(jg({mostRecentlyUsedAccountType:i,smsAvailable:u,emailAvailable:f,prefilledType:d?.prefill?.type}))},[f,u,i]);let oe=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{Re("default")},150)};n.current=oe;let pe=[];l&&M?pe.push(l):s?.loginMethod&&X.includes(s.loginMethod)&&pe.push(s.loginMethod);let Ce=F=>F==="email"?Fe(Vc,{isEditable:re==="email",setIsEditable:()=>{Q("email")},defaultValue:d?.prefill?.type==="email"?d.prefill.value:void 0},F):F==="sms"?Fe(Qc,{isEditable:re==="sms",setIsEditable:()=>{Q("sms")},defaultValue:d?.prefill?.type==="phone"?d.prefill.value:void 0},F):F==="apple"?Fe(st,{provider:"apple"},F):F==="discord"?Fe(st,{provider:"discord"},F):F==="farcaster"?Fe(Gc,{},F):F==="github"?Fe(st,{provider:"github"},F):F==="google"?Fe(st,{provider:"google"},F):F==="linkedin"?Fe(st,{provider:"linkedin"},F):F==="tiktok"?Fe(st,{provider:"tiktok"},F):F==="spotify"?Fe(st,{provider:"spotify"},F):F==="instagram"?Fe(st,{provider:"instagram"},F):F==="twitter"?Fe(st,{provider:"twitter"},F):F==="telegram"?Fe(Zc,{},F):on([F],r,e,[],a.externalWallets.walletConnect.enabled),de=on(a.appearance.walletList.filter(F=>F!==l),r,e,[...a.appearance.walletList,l],a.externalWallets.walletConnect.enabled),Ae=X.filter(F=>F!==s?.loginMethod).flatMap(Ce),ut=pe.flatMap(Ce);Z==="web3-first"&&z==="default"?de.unshift(...ut):Z==="web2-first"&&Ae.unshift(...ut);let Je=z==="default"?void 0:()=>{Re("default")},le=X.filter(F=>F!=="email"&&F!=="sms"),Yt=k9({priority:Z,email:f,sms:u,social:le}),mr=R9({priority:Z,email:f,sms:u,social:le}),Ct=_9({priority:Z}),I=Fe(Oc,{text:Ct,onClick:()=>Re("web3-overflow")}),qe=Fe(Jc,{text:Yt,icon:mr,onClick:()=>Re("web2-overflow")}),Qt=W?0:1;return ha(ws,{children:[Fe(x,{title:a.appearance.landingHeader,onClose:oe,backFn:Je}),z==="default"&&Fe(x9,{}),z==="default"&&(typeof a.appearance.loginMessage=="string"?Fe(Dl,{children:a.appearance.loginMessage}):a.appearance.loginMessage),Fe(Ol,{style:{overflow:"hidden",padding:2},children:ha(nr,{children:[z==="default"&&Z==="web2-first"&&ha(ws,{children:[...Ae.length>4?Ae.slice(0,3):Ae,Ae.length>4&&qe,M&&I]}),z==="default"&&Z==="web3-first"&&ha(ws,{children:[M&&ha(ws,{children:[...de.length>4?de.slice(0,3):de,de.length>4&&I]}),Ae.length>Qt&&qe,Ae.length===Qt&&Ae[0]]}),z==="web2-overflow"&&ha(ws,{children:[...Z==="web3-first"?Ae:Ae.slice(3)]}),...z==="web3-overflow"?de:[],Y&&z==="default"&&Fe(Nc,{})]})}),a&&Fe(bi,{app:a}),Fe(G,{})]})},x9=A9(Uc)`
|
|
2211
2211
|
margin-bottom: 16px;
|
|
2212
|
-
`,
|
|
2212
|
+
`,k9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"?"Other socials":t&&r&&o.length>0||t&&o.length>0?"Log in with email or socials":r&&o.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",R9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?Fe(T9,{}):t&&r?Fe(Xg,{}):t?Fe(b9,{}):r?Fe(E9,{}):null,_9=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",jg=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:r,prefilledType:o})=>r&&(e==="email"&&o!=="phone"||o==="email")?"email":t&&(e==="phone"||o==="phone")?"sms":"email";import{jsx as $g}from"react/jsx-runtime";var e2=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?$g(ed,{connectOnly:!0}):$g(td,{connectOnly:!0})};import{jsx as t2}from"react/jsx-runtime";var r2=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?t2(ed,{connectOnly:!1}):t2(td,{connectOnly:!1})};import M9 from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as I9,jsx as Cn,jsxs as W9}from"react/jsx-runtime";var o2=()=>{let{app:e}=A();return W9(I9,{children:[Cn(x,{},"header"),Cn(ie,{}),Cn(ge,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:Cn(M9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Cn(lr,{children:Cn(Bc,{stacked:!0})}),Cn(ae,{}),Cn(G,{})]})};import L9 from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as N9,jsx as wn,jsxs as O9}from"react/jsx-runtime";var n2=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=A(),{initLoginWithSms:a}=_();async function i({qualifiedPhoneNumber:l}){try{await a(l),o("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return O9(N9,{children:[wn(x,{},"header"),wn(ie,{}),wn(ge,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:wn(L9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),wn(lr,{children:wn(gn,{stacked:!0,onSubmit:i,hideRecent:!0})}),wn(ae,{}),wn(G,{})]})};import{Fragment as D9,jsx as bs,jsxs as F9}from"react/jsx-runtime";var i2=()=>{let{linkingOrConnectingHint:e}=_(),{app:t}=A(),r=e?`Link the wallet with address ${Dt(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return F9(D9,{children:[bs(x,{},"header"),bs(Co,{title:"Link your wallet",description:r}),bs(nr,{children:bs(Yi,{connectOnly:!1})}),bs(G,{})]})};import{jsx as a2,jsxs as U9}from"react/jsx-runtime";var s2=({style:e,...t})=>U9("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[a2("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),a2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});import{Fragment as B9,jsx as bn,jsxs as l2}from"react/jsx-runtime";var c2=()=>{let{closePrivyModal:e}=_(),{navigate:t}=A();return l2(B9,{children:[bn(x,{},"header"),bn(ie,{}),bn(s2,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),bn(Co,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),l2(lr,{children:[bn(U,{onClick:()=>t("LANDING"),children:"Try again"}),bn(Qr,{onClick:()=>e(),children:"Cancel"})]}),bn(ae,{}),bn(G,{})]})};import Tb from"@heroicons/react/24/solid/CheckBadgeIcon";import Sb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import Ab from"@heroicons/react/24/solid/IdentificationIcon";import Pb from"@heroicons/react/24/solid/PhoneIcon";import xb from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import E2 from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as kb,useState as ya}from"react";import{useContext as H9}from"react";function Es(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=H9(Ie);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}import{useContext as V9}from"react";function to(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:a,unenroll:i,enrollInMfa:l}=V9(Ie);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:a,unenrollWithSms:()=>i("sms"),unenrollWithTotp:()=>i("totp"),unenrollWithPasskey:()=>i("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}import G9 from"styled-components";import{jsx as d2,jsxs as z9}from"react/jsx-runtime";var p2=e=>z9(q9,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[d2("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),d2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),q9=G9.svg`
|
|
2213
2213
|
height: 90px;
|
|
2214
2214
|
width: 90px;
|
|
2215
2215
|
|
|
@@ -2220,7 +2220,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2220
2220
|
> path {
|
|
2221
2221
|
fill: white;
|
|
2222
2222
|
}
|
|
2223
|
-
`;import qp from"@heroicons/react/20/solid/CheckIcon";import
|
|
2223
|
+
`;import qp from"@heroicons/react/20/solid/CheckIcon";import K9 from"@heroicons/react/24/outline/ChevronRightIcon";import Y9 from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import Q9 from"@heroicons/react/24/outline/FingerPrintIcon";import X9 from"@heroicons/react/24/outline/PhoneIcon";import zp from"@heroicons/react/24/outline/TrashIcon";import Z9 from"@heroicons/react/24/solid/ShieldCheckIcon";import{Fragment as J9,jsx as Pe,jsxs as pr}from"react/jsx-runtime";var u2=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:a,error:i,onClose:l,onBackToIntro:s,handleSelectMethod:d,setRemovingMfaMethod:m})=>{let f=t.reduce((C,v)=>({...C,[v]:!0}),{}),u=r.reduce((C,v)=>({...C,[v]:!0}),{});return pr(J9,{children:[Pe(x,{backFn:e?s:void 0,onClose:l},"header"),Pe(Le,{children:Pe(Ze,{children:Pe(Z9,{})})}),Pe(me,{children:"Choose a verification method"}),t.length>0?Pe(he,{children:"To add or delete verification methods, verification is required."}):Pe(he,{children:"How would you like to verify your identity? You can change this later."}),i&&Pe(Gl,{style:{marginTop:"1.25rem"},children:i.message}),pr(Fl,{children:[(u.totp||f.totp)&&pr(Ul,{children:[Pe(Se,{style:{justifyContent:"center"},disabled:f.totp||n,onClick:()=>d("totp"),children:n?Pe(at,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):pr(Vl,{children:[pr(Hl,{children:[Pe(Y9,{}),"Authenticator App"]}),f.totp?pr(zn,{children:[Pe(qp,{}),"Added"]}):Pe(zn,{children:"Recommended"})]})}),f.totp&&Pe(Bl,{onClick:()=>m("totp"),children:Pe(zp,{})})]},"totp"),(u.sms||f.sms)&&pr(Ul,{children:[Pe(Se,{disabled:f.sms||o,onClick:()=>d("sms"),children:pr(Vl,{children:[pr(Hl,{children:[Pe(X9,{}),"SMS"]}),f.sms&&pr(zn,{children:[Pe(qp,{}),"Added"]}),o&&Pe(zn,{children:"Disabled"})]})}),f.sms&&Pe(Bl,{onClick:()=>m("sms"),children:Pe(zp,{})})]},"sms"),(u.passkey||f.passkey)&&pr(Ul,{children:[Pe(Se,{style:{justifyContent:"center"},onClick:()=>d("passkey"),disabled:f.passkey||a,children:a?Pe(at,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):pr(Vl,{children:[pr(Hl,{children:[Pe(Q9,{}),"Passkey"]}),f.passkey?pr(zn,{children:[Pe(qp,{}),"Added"]}):Pe(zn,{isAccent:!0,children:Pe(K9,{})})]})}),f.passkey&&Pe(Bl,{onClick:()=>m("passkey"),children:Pe(zp,{})})]},"passkey")]}),Pe(J,{})]})};import j9 from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import $9 from"@heroicons/react/24/outline/ClockIcon";import eb from"@heroicons/react/24/outline/ShieldCheckIcon";import tb from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as rb,useState as Ts}from"react";import rd from"styled-components";import{Fragment as Kp,jsx as ye,jsxs as Gr}from"react/jsx-runtime";var f2=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=q(),{data:n}=A(),{initLinkWithPasskey:a,linkWithPasskey:i}=_(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=to(),[d,m]=Ts(!1),[f,u]=Ts(!1),[C,v]=Ts(!1),[g,b]=Ts(null),T=rb(()=>o?.linkedAccounts.filter(k=>k.type==="passkey")??[],[o]),R=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},S=async k=>{m(!0);try{await l(),await s({credentialIds:k}),v(!0)}catch(M){b(M)}finally{m(!1)}},P=async()=>{u(!0),b(null);try{await a();let M=(await i())?.linkedAccounts.filter(O=>O.type==="passkey").map(O=>O.credentialId)??[];await S(M)}catch(k){b(k)}finally{u(!1)}};return T.length===0||f?ye(ob,{onReset:r,onClose:t,onClick:P,isCreating:f}):C?ye(ib,{onClick:R,onClose:R}):g?ye($n,{error:g,backFn:()=>b(null),onClick:()=>b(null)}):ye(nb,{passkeys:T,isSubmitting:d,isCreating:f,onReset:r,onClose:t,onSubmitEnrollment:()=>S(T.map(k=>k.credentialId)),onAddPasskey:P})},ob=({onReset:e,onClose:t,onClick:r,isCreating:o})=>Gr(Kp,{children:[ye(x,{backFn:e,onClose:t},"header"),ye(Le,{children:Gr(xc,{children:[ye(ei,{}),ye(ti,{})]})}),ye(me,{children:"Set up passkey verification"}),Gr(qn,{children:[Gr(ar,{children:[ye(ir,{children:ye(eb,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),Gr(ar,{children:[ye(ir,{children:ye($9,{})}),"Takes seconds to set up and use"]}),Gr(ar,{children:[ye(ir,{children:ye(j9,{})}),"Use your passkey to verify transactions and login to your account"]})]}),ye(U,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),ye(J,{})]}),nb=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:a,isCreating:i})=>{let[l,s]=Ts(!1),d=l?n.length:n.length>3?2:3;return Gr(Kp,{children:[ye(x,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&ye(Le,{children:Gr(xc,{children:[ye(ei,{}),ye(ti,{})]})}),ye(me,{children:"Enable your passkeys for verification"}),Gr(qn,{children:[n.slice(0,d).map(m=>Gr(ab,{children:[ye(sb,{children:cb(m)}),Gr(lb,{children:["Last used: ",m.latestVerifiedAt?.toLocaleString()]})]},m.credentialId)),!l&&n.length>3&&ye(m2,{onClick:()=>s(!0),children:"View All"})]}),ye(U,{style:{marginTop:"1.5rem"},onClick:o,loading:a,children:"Enable passkeys"}),n.length<5&&ye(m2,{style:{marginTop:"0.5rem"},onClick:r,disabled:i,children:i?ye(at,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),ye(J,{})]})},ib=({onClick:e,onClose:t})=>Gr(Kp,{children:[ye(x,{onClose:t},"header"),ye(Le,{children:ye(Ze,{status:"success",children:ye(tb,{})})}),ye(me,{children:"Passkey verification added"}),ye(he,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),ye(kt,{children:ye(U,{onClick:e,children:"Done"})}),ye(J,{})]}),ab=rd.div`
|
|
2224
2224
|
&& {
|
|
2225
2225
|
padding: 0.75rem 1rem;
|
|
2226
2226
|
text-align: left;
|
|
@@ -2228,19 +2228,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2228
2228
|
border: 1px solid var(--privy-color-foreground-4);
|
|
2229
2229
|
width: 100%;
|
|
2230
2230
|
}
|
|
2231
|
-
`,
|
|
2231
|
+
`,sb=rd.div`
|
|
2232
2232
|
font-size: 0.875rem;
|
|
2233
2233
|
line-height: 1.375rem;
|
|
2234
2234
|
font-weight: 500;
|
|
2235
2235
|
|
|
2236
2236
|
color: var(--privy-color-foreground-1);
|
|
2237
|
-
`,
|
|
2237
|
+
`,lb=rd.div`
|
|
2238
2238
|
font-size: 0.75rem;
|
|
2239
2239
|
font-weight: 400;
|
|
2240
2240
|
line-height: 1.125rem;
|
|
2241
2241
|
|
|
2242
2242
|
color: var(--privy-color-foreground-2);
|
|
2243
|
-
`,
|
|
2243
|
+
`,cb=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device",m2=rd.button`
|
|
2244
2244
|
&& {
|
|
2245
2245
|
width: 100%;
|
|
2246
2246
|
font-size: 0.875rem;
|
|
@@ -2265,7 +2265,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2265
2265
|
box-shadow: none;
|
|
2266
2266
|
}
|
|
2267
2267
|
}
|
|
2268
|
-
`;import
|
|
2268
|
+
`;import vb from"@heroicons/react/24/solid/CheckCircleIcon";import g2 from"@heroicons/react/24/solid/PhoneIcon";import{useState as od}from"react";import{useState as Yp}from"react";import{isMobile as db}from"react-device-detect";import y2 from"styled-components";import{Fragment as gb,jsx as Ss,jsxs as yb}from"react/jsx-runtime";var As=6,pb=new Array(As).fill("");function ub(e){return e.replace(/\s+/g,"")}function Qp(e){return/^[0-9]{1}$/.test(e)}function h2(e){return e.length===As&&e.every(Qp)}function mb(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var ai=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,a]=Yp(pb),[i,l]=Yp(null),[s,d]=Yp(null),m=async v=>{v.preventDefault();let g=ub(v.currentTarget.value);if(g==="")return;let b=mb(n,Qp),T=g.split(""),R=!T.every(Qp),S=T.length+b>As;if(R){l("Passcode can only be numbers"),d(1);return}if(S){l("Passcode must be exactly 6 numbers"),d(1);return}l(null),d(null);let P=Number(v.currentTarget.name?.charAt(4)),k=[...g||[""]].slice(0,As-P),M=[...n.slice(0,P),...k,...n.slice(P+k.length)];a(M);let O=k.length,H=Math.min(Math.max(P+O,0),As-1);if(document.querySelector(`input[name=pin-${H}]`)?.focus(),h2(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${H}]`)?.blur()}catch(X){d(1),l(X.message)}else try{await e(null)}catch(X){d(1),l(X.message)}},f=v=>{s===1&&(l(null),d(null));let g=[...n.slice(0,v),"",...n.slice(v+1)];a(g),v>0&&document.querySelector(`input[name=pin-${v-1}]`)?.focus(),h2(g)?e(g.join("")):e(null)},C=o?"success":!!(r||i)?"fail":"";return Ss(gb,{children:yb(fb,{children:[Ss("div",{children:n.map((v,g)=>Ss("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:m,onKeyUp:b=>{b.key==="Backspace"&&f(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:C,autoComplete:db?"one-time-code":"off",disabled:t},g))}),Ss("div",{children:Ss(hb,{fail:!!r||!!i,children:r||i})})]})})},fb=y2.div`
|
|
2269
2269
|
display: flex;
|
|
2270
2270
|
flex-direction: column;
|
|
2271
2271
|
width: 100%;
|
|
@@ -2333,7 +2333,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2333
2333
|
transform: translate(1px, 0px);
|
|
2334
2334
|
}
|
|
2335
2335
|
}
|
|
2336
|
-
`,
|
|
2336
|
+
`,hb=y2.div`
|
|
2337
2337
|
line-height: 20px;
|
|
2338
2338
|
font-size: 13px;
|
|
2339
2339
|
display: flex;
|
|
@@ -2341,7 +2341,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2341
2341
|
width: 100%;
|
|
2342
2342
|
|
|
2343
2343
|
color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
2344
|
-
`;import{Fragment as Xp,jsx as Ue,jsxs as
|
|
2344
|
+
`;import{Fragment as Xp,jsx as Ue,jsxs as si}from"react/jsx-runtime";var v2=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=od(""),[a,i]=od(!1),[l,s]=od(null),[d,m]=od("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:u}=to(),{app:C,data:v}=A();function g(){v?.mfaEnrollmentFlow?.onSuccess(),e()}async function b({qualifiedPhoneNumber:S}){try{await f({phoneNumber:S}),n(S),m("verify")}catch(P){s(P)}}async function T(S){try{if(!S)return;await u({phoneNumber:o,mfaCode:S}),i(!0)}catch(P){throw rc(P)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Jn(P)?new Error("The code you entered is not valid"):Zn(P)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):oc(P)?new Error("Verification canceled"):new Error("Unknown error")}}function R(){d==="verify"?m("enroll"):t()}return l?Ue($n,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):d==="enroll"?si(Xp,{children:[Ue(x,{backFn:t,onClose:r},"header"),Ue(Le,{children:Ue(Ze,{children:Ue(g2,{})})}),Ue(me,{children:"Set up SMS verification"}),Ue(he,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),si(Lr,{children:[Ue(gn,{onSubmit:b,hideRecent:!0}),si(eh,{children:["By providing your mobile number, you agree to receive text messages from ",C?.name,". Some carrier charges may apply"]})]}),Ue(J,{})]}):a?si(Xp,{children:[Ue(x,{onClose:g},"header"),Ue(Le,{children:Ue(Ze,{status:"success",children:Ue(vb,{})})}),Ue(me,{children:"SMS verification added"}),Ue(he,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),Ue(kt,{children:Ue(U,{onClick:g,children:"Done"})}),Ue(J,{})]}):si(Xp,{children:[Ue(x,{backFn:R,onClose:r},"header"),Ue(Le,{children:Ue(Ze,{children:Ue(g2,{})})}),Ue(me,{children:"Enter enrollment code"}),si(Lr,{children:[Ue(ai,{onChange:T}),si(he,{children:["To continue, enter the 6-digit code sent to ",Ue("strong",{children:Og(o)})]})]}),Ue(J,{})]})};import bb from"@heroicons/react/24/solid/CheckCircleIcon";import Eb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import{useState as w2}from"react";import Cb from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as wb}from"react/jsx-runtime";var C2=({size:e,authUrl:t})=>wb(pn,{url:t,squareLogoElement:Cb,size:e,fgColor:"#1F1F1F"});import{Fragment as Zp,jsx as Oe,jsxs as Ps}from"react/jsx-runtime";var b2=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,a]=w2("enroll"),[i,l]=w2(!1),{submitEnrollmentWithTotp:s}=to(),{data:d}=A();function m(){d?.mfaEnrollmentFlow?.onSuccess(),e()}function f(){a("verify")}async function u(v){try{if(!v)return;await s({mfaCode:v}),l(!0)}catch(g){throw rc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Jn(g)?new Error("The code you entered is not valid"):Zn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):oc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function C(){n==="verify"?a("enroll"):r()}return n==="enroll"?Ps(Zp,{children:[Oe(x,{backFn:r,onClose:t},"header"),Oe(me,{children:"Scan QR code"}),Oe(he,{children:"Open your authenticator app and scan the QR code to continue."}),Oe(Bi,{children:Oe(C2,{authUrl:o.authUrl,size:200})}),Ps(kt,{children:[Oe(Tt,{children:Oe(dn,{itemName:"secret",text:o.secret})}),Oe(U,{onClick:f,children:"Continue"})]}),Oe(J,{})]}):i?Ps(Zp,{children:[Oe(x,{onClose:m},"header"),Oe(Le,{children:Oe(Ze,{status:"success",children:Oe(bb,{})})}),Oe(me,{children:"Authenticator app verification added"}),Oe(he,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),Oe(kt,{children:Oe(U,{onClick:m,children:"Done"})}),Oe(J,{})]}):Ps(Zp,{children:[Oe(x,{backFn:C,onClose:t},"header"),Oe(Le,{children:Oe(Ze,{children:Oe(Eb,{})})}),Oe(me,{children:"Enter enrollment code"}),Oe(Lr,{children:Oe(ai,{onChange:u})}),Ps(he,{children:["To continue, enter the 6-digit code generated from your ",Oe("strong",{children:"authenticator app"})]}),Oe(J,{})]})};import{Fragment as ga,jsx as $,jsxs as Ar}from"react/jsx-runtime";var T2=()=>{let{user:e,enrollInMfa:t}=q(),[r,o]=ya(null),{unenrollWithSms:n,unenrollWithTotp:a,unenrollWithPasskey:i}=to(),{app:l,ready:s,data:d,onUserCloseViaDialogOrKeybindRef:m}=A(),{closePrivyModal:f}=_(),{promptMfa:u}=Es(),{initEnrollmentWithTotp:C}=to(),[v,g]=ya(!1),[b,T]=ya(null),[R,S]=ya(null),P=()=>{f({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),T(null)},500)},{initEnrollmentWithPasskey:k,submitEnrollmentWithPasskey:M}=to(),[O,H]=ya(!1),[Y,X]=ya(null);m.current=P;let L=e?.mfaMethods.includes("sms"),Z=!!e?.phone,W=e?.mfaMethods.includes("totp"),z=e?.mfaMethods.includes("passkey"),Re=L||W||z,re=e?.linkedAccounts.filter(le=>le.type==="passkey").map(le=>le.credentialId)??[];kb(()=>{Re&&g(!0)},[Re]);function Q(){o(null),T(null)}function oe(){g(!1)}async function pe(){H(!0);try{await k(),await M({credentialIds:re})}catch(le){X(le)}finally{H(!1)}}async function Ce(le){if(await u().catch(X),le==="totp"){T(le),S(null),C().then(Yt=>{S(Yt)}).catch(()=>{S(null),Q()});return}if(le==="passkey"&&re.length===1)return await pe();T(le)}if(!s||!e||!l)return Ar(ga,{children:[$(x,{onClose:P},"header"),$(Le,{children:$(p2,{})}),$(Lr,{children:$(at,{})}),$(J,{})]});async function de(){o(null);try{await n()}catch{o(null)}}async function Ae(){o(null);try{await a()}catch{o(null)}}async function ut(){o(null);try{await u(),await i()}catch{o(null)}}if(r==="sms")return Ar(ga,{children:[$(x,{backFn:Q,onClose:P},"header"),$(Le,{children:$(Ze,{children:$(Pb,{})})}),$(me,{children:"Remove SMS verification?"}),Ar(he,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(kt,{children:$(U,{warn:!0,onClick:de,children:"Remove SMS for MFA"})}),$(J,{})]});if(r==="totp")return Ar(ga,{children:[$(x,{backFn:Q,onClose:P},"header"),$(Le,{children:$(Ze,{children:$(Sb,{})})}),$(me,{children:"Remove Authenticator App verification?"}),Ar(he,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(kt,{children:$(U,{warn:!0,onClick:Ae,children:"Remove Authenticator App for MFA"})}),$(J,{})]});if(r==="passkey")return Ar(ga,{children:[$(x,{backFn:Q,onClose:P},"header"),$(Le,{children:$(Ze,{children:$(xb,{})})}),$(me,{children:"Are you sure you want to remove passkey verification?"}),$(he,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),$(kt,{children:$(U,{warn:!0,onClick:ut,children:"Yes, remove"})}),$(J,{})]});if(d.mfaEnrollmentFlow.mfaMethods.length===0&&!Re)return Ar(ga,{children:[$(x,{onClose:P},"header"),$(Le,{children:$(Ze,{children:$(E2,{})})}),$(me,{children:"Add more security"}),Ar(he,{children:[l?.name," does not have any verification methods enabled."]}),$(kt,{children:$(U,{onClick:P,children:"Close"})}),$(J,{})]});let Je=!Re&&!v;return Je?Ar(ga,{children:[$(x,{onClose:P},"header"),$(Le,{children:$(Ze,{children:$(E2,{})})}),$(me,{children:"Transaction Protection"}),$(he,{children:"Set up transaction protection to add an extra layer of security to your account"}),Ar(qn,{children:[Ar(ar,{children:[$(ir,{children:$(Tb,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),Ar(ar,{children:[$(ir,{children:$(Ab,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),Ar(kt,{children:[$(U,{onClick:()=>g(!0),children:"Continue"}),$(Qr,{onClick:P,children:"Not now"})]}),$(J,{})]}):b==="sms"?$(v2,{onComplete:P,onReset:Q,onClose:P}):b==="totp"&&R?$(b2,{onComplete:P,onClose:P,onReset:Q,totpInfo:R}):b==="passkey"?$(f2,{onComplete:P,onReset:Q,onClose:P}):$(u2,{showIntro:Je,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:Z,onBackToIntro:oe,handleSelectMethod:Ce,isTotpLoading:b==="totp"&&!R,isPasskeyLoading:O,error:Y,onClose:P,setRemovingMfaMethod:o})};import sE from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import lE from"@heroicons/react/24/outline/FingerPrintIcon";import cE from"@heroicons/react/24/outline/PhoneIcon";import dE from"@heroicons/react/24/outline/ShieldCheckIcon";import pE from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import uE from"@heroicons/react/24/solid/PhoneIcon";import{useEffect as mE,useState as Rs}from"react";import{useMemo as jb,useEffect as $b,useState as z2}from"react";import eE from"styled-components";import{calculateTotalGasEstimate as tE,populateTransactionRequest as rE}from"@privy-io/js-sdk-core";import G2 from"styled-components";import A2 from"styled-components";import{jsx as S2,jsxs as Mb}from"react/jsx-runtime";var nd=({label:e,children:t,valueStyles:r})=>Mb(Rb,{children:[S2("div",{children:e}),S2(_b,{style:{...r},children:t})]}),Rb=A2.div`
|
|
2345
2345
|
display: flex;
|
|
2346
2346
|
align-items: center;
|
|
2347
2347
|
justify-content: space-between;
|
|
@@ -2356,7 +2356,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2356
2356
|
color: var(--privy-color-foreground-2);
|
|
2357
2357
|
text-align: right;
|
|
2358
2358
|
}
|
|
2359
|
-
`,
|
|
2359
|
+
`,_b=A2.div`
|
|
2360
2360
|
font-size: 14px;
|
|
2361
2361
|
line-height: 100%;
|
|
2362
2362
|
display: flex;
|
|
@@ -2365,22 +2365,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2365
2365
|
border-radius: var(--privy-border-radius-full);
|
|
2366
2366
|
background-color: var(--privy-color-background-2);
|
|
2367
2367
|
padding: 4px 8px;
|
|
2368
|
-
`;import ad from"styled-components";import{Fragment as
|
|
2368
|
+
`;import ad from"styled-components";import{Fragment as Nb,jsx as id,jsxs as P2}from"react/jsx-runtime";var x2=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ia(e),n=t?co(o,t):void 0,a=bt(o,r);return id(k2,{children:n||a})},Jp=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ia(e),n=t?co(o,t):void 0,a=bt(o,r);return id(k2,{children:n?P2(Nb,{children:[id(Ib,{children:"USD"}),n==="<$0.01"?P2(Lb,{children:[id(Wb,{children:"<"}),"$0.01"]}):n]}):a})},k2=ad.span`
|
|
2369
2369
|
font-size: 14px;
|
|
2370
2370
|
line-height: 140%;
|
|
2371
2371
|
display: flex;
|
|
2372
2372
|
gap: 4px;
|
|
2373
2373
|
align-items: center;
|
|
2374
|
-
`,
|
|
2374
|
+
`,Ib=ad.span`
|
|
2375
2375
|
font-size: 12px;
|
|
2376
2376
|
line-height: 12px;
|
|
2377
2377
|
color: var(--privy-color-foreground-3);
|
|
2378
|
-
`,
|
|
2378
|
+
`,Wb=ad.span`
|
|
2379
2379
|
font-size: 10px;
|
|
2380
|
-
`,
|
|
2380
|
+
`,Lb=ad.span`
|
|
2381
2381
|
display: flex;
|
|
2382
2382
|
align-items: center;
|
|
2383
|
-
`;import jp from"styled-components";import{QuantityToBigNumber as R2}from"@privy-io/js-sdk-core";import{jsx as
|
|
2383
|
+
`;import jp from"styled-components";import{QuantityToBigNumber as R2}from"@privy-io/js-sdk-core";import{jsx as En,jsxs as sd}from"react/jsx-runtime";var _2=({gas:e,tokenPrice:t,tokenSymbol:r})=>sd(tn,{style:{paddingBottom:"12px"},children:[sd(I2,{children:[En(L2,{children:"Est. Fees"}),En("div",{children:En(Jp,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&En(W2,{children:`${bt(e,r)}`})]}),M2=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=R2(e.value||0).add(R2(t)).toHexString();return sd(tn,{children:[sd(I2,{children:[En(L2,{children:"Total (including fees)"}),En("div",{children:En(Jp,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&En(W2,{children:bt(n,o)})]})},I2=jp.div`
|
|
2384
2384
|
display: flex;
|
|
2385
2385
|
flex-direction: row;
|
|
2386
2386
|
justify-content: space-between;
|
|
@@ -2399,19 +2399,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2399
2399
|
font-size: 14px;
|
|
2400
2400
|
line-height: 22.4px;
|
|
2401
2401
|
font-weight: 400;
|
|
2402
|
-
`;import
|
|
2402
|
+
`;import Ob from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as li,useState as Db}from"react";import Tn from"styled-components";import{createContext as N2,useContext as tj}from"react";var va=N2(void 0);var xs=N2(void 0);import{Fragment as zb,jsx as ro,jsxs as O2}from"react/jsx-runtime";var D2=({defaultValue:e,children:t})=>{let[r,o]=Db(e||null),n=a=>{o(r===a?null:a)};return ro(va.Provider,{value:{activePanel:r,togglePanel:n},children:ro(Fb,{children:t})})},F2=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=li(va),n=r===e;return ro(xs.Provider,{value:{onToggle:()=>o(e),value:e},children:ro(Vb,{isActive:n,"data-open":n,children:t})})},U2=({children:e})=>{let{activePanel:t}=li(va),{onToggle:r,value:o}=li(xs),n=t===o;return O2(zb,{children:[O2(Ub,{onClick:r,"data-open":n,children:[ro(Hb,{children:e}),ro(qb,{isactive:n,children:ro(Ob,{height:"16px",width:"16px",strokeWidth:"2"})})]}),ro(Bb,{})]})},B2=({children:e})=>{let{activePanel:t}=li(va),{value:r}=li(xs);return ro(Gb,{"data-open":t===r,children:ro(V2,{children:e})})},H2=({children:e})=>{let{activePanel:t}=li(va),{value:r}=li(xs);return ro(V2,{children:typeof e=="function"?e({isActive:t===r}):e})},Fb=Tn.div`
|
|
2403
2403
|
display: flex;
|
|
2404
2404
|
flex-direction: column;
|
|
2405
2405
|
width: 100%;
|
|
2406
2406
|
gap: 8px;
|
|
2407
|
-
`,
|
|
2407
|
+
`,Ub=Tn.div`
|
|
2408
2408
|
display: flex;
|
|
2409
2409
|
justify-content: space-between;
|
|
2410
2410
|
align-items: center;
|
|
2411
2411
|
width: 100%;
|
|
2412
2412
|
cursor: pointer;
|
|
2413
2413
|
padding-bottom: 8px;
|
|
2414
|
-
`,
|
|
2414
|
+
`,Bb=Tn.div`
|
|
2415
2415
|
width: 100%;
|
|
2416
2416
|
|
|
2417
2417
|
&& {
|
|
@@ -2419,13 +2419,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2419
2419
|
border-color: var(--privy-color-foreground-4);
|
|
2420
2420
|
}
|
|
2421
2421
|
padding-bottom: 12px;
|
|
2422
|
-
`,
|
|
2422
|
+
`,Hb=Tn.div`
|
|
2423
2423
|
font-size: 14px;
|
|
2424
2424
|
font-weight: 500;
|
|
2425
2425
|
line-height: 19.6px;
|
|
2426
2426
|
width: 100%;
|
|
2427
2427
|
padding-right: 8px;
|
|
2428
|
-
`,
|
|
2428
|
+
`,Vb=Tn.div`
|
|
2429
2429
|
display: flex;
|
|
2430
2430
|
flex-direction: column;
|
|
2431
2431
|
width: 100%;
|
|
@@ -2437,7 +2437,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2437
2437
|
border-color: var(--privy-color-foreground-4);
|
|
2438
2438
|
border-radius: var(--privy-border-radius-md);
|
|
2439
2439
|
}
|
|
2440
|
-
`,
|
|
2440
|
+
`,Gb=Tn.div`
|
|
2441
2441
|
position: relative;
|
|
2442
2442
|
overflow: hidden;
|
|
2443
2443
|
transition: max-height 25ms ease-out;
|
|
@@ -2449,36 +2449,36 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2449
2449
|
&[data-open='false'] {
|
|
2450
2450
|
max-height: 0;
|
|
2451
2451
|
}
|
|
2452
|
-
`,V2=
|
|
2452
|
+
`,V2=Tn.div`
|
|
2453
2453
|
display: flex;
|
|
2454
2454
|
flex-direction: column;
|
|
2455
2455
|
gap: 12px;
|
|
2456
2456
|
flex: 1 1 auto;
|
|
2457
2457
|
min-height: 1px;
|
|
2458
|
-
`,
|
|
2458
|
+
`,qb=Tn.div`
|
|
2459
2459
|
transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
|
|
2460
|
-
`;import
|
|
2460
|
+
`;import Kb from"styled-components";import{jsx as Qb}from"react/jsx-runtime";var $p=({walletAddress:e,chainId:t=No})=>Qb(Yb,{href:hm(t,e),target:"_blank",children:Dt(e)}),Yb=Kb.a`
|
|
2461
2461
|
&:hover {
|
|
2462
2462
|
text-decoration: underline;
|
|
2463
2463
|
}
|
|
2464
|
-
`;import{jsx as Pr,jsxs as eu}from"react/jsx-runtime";var ld=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:
|
|
2464
|
+
`;import{jsx as Pr,jsxs as eu}from"react/jsx-runtime";var ld=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:a,tokenSymbol:i})=>{let l=r?.value||0,s=De();return Pr(D2,{...s.render.standalone?{defaultValue:"details"}:{},children:eu(F2,{value:"details",children:[Pr(U2,{children:eu(Xb,{children:[Pr("div",{children:o?.title||o?.actionDescription||"Details"}),Pr(Zb,{children:Pr(x2,{weiQuantities:[l],tokenPrice:n,tokenSymbol:i})})]})}),eu(B2,{children:[Pr(nd,{label:"From",children:Pr($p,{walletAddress:e,chainId:r.chainId||No})}),Pr(nd,{label:"To",children:Pr($p,{walletAddress:t,chainId:r.chainId||No})}),o&&o.action&&Pr(nd,{label:"Action",children:o.action}),a&&Pr(_2,{transactionData:r,gas:a,tokenPrice:n,tokenSymbol:i})]}),Pr(H2,{children:({isActive:d})=>Pr(M2,{transactionData:r,displayFee:d,gas:a||"0x0",tokenPrice:n,tokenSymbol:i})})]})})},Xb=G2.div`
|
|
2465
2465
|
display: flex;
|
|
2466
2466
|
flex-direction: row;
|
|
2467
2467
|
justify-content: space-between;
|
|
2468
|
-
`,
|
|
2468
|
+
`,Zb=G2.div`
|
|
2469
2469
|
flex-shrink: 0;
|
|
2470
2470
|
padding-left: 8px;
|
|
2471
|
-
`;import
|
|
2471
|
+
`;import Jb from"styled-components";var q2=Jb.img`
|
|
2472
2472
|
&& {
|
|
2473
2473
|
height: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2474
2474
|
width: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2475
2475
|
border-radius: 16px;
|
|
2476
2476
|
margin-bottom: 12px;
|
|
2477
2477
|
}
|
|
2478
|
-
`;import{jsx as K2}from"react/jsx-runtime";var ks=({pendingTransaction:e})=>{let{getAccessToken:t}=q(),{wallets:r}=
|
|
2478
|
+
`;import{jsx as K2}from"react/jsx-runtime";var ks=({pendingTransaction:e})=>{let{getAccessToken:t}=q(),{wallets:r}=zr(),{walletProxy:o,rpcConfig:n,chains:a,appId:i,nativeTokenSymbolForChainId:l}=_(),[s,d]=z2(null),[m,f]=z2(e),{tokenPrice:u}=So(m),C=l(e.chainId)||"ETH",v=jb(()=>r.find(g=>g.walletClientType==="privy"),[r]);return $b(()=>{async function g(){if(!await t()||!o||!v)return m;let T=_r(m.chainId,a,n,{appId:i}),R=await rE(v.address,m,T),{totalGasEstimate:S}=await tE(R,T);return d(S.toHexString()),R}g().then(f).catch(console.error)},[o]),v?K2(oE,{children:K2(ld,{from:v.address,to:m.to,txn:m,gas:s??void 0,tokenPrice:u,tokenSymbol:C})}):null},oE=eE.div`
|
|
2479
2479
|
width: 100%;
|
|
2480
2480
|
padding: 1rem 0;
|
|
2481
|
-
`;import
|
|
2481
|
+
`;import nE from"@heroicons/react/24/outline/CalendarIcon";import iE from"@heroicons/react/24/outline/ExclamationTriangleIcon";import aE from"@heroicons/react/24/outline/ShieldCheckIcon";import{Fragment as Y2,jsx as Nt,jsxs as Ca}from"react/jsx-runtime";var Q2=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:a,submitSuccess:i})=>{let{pendingTransaction:l}=_();return Ca(Y2,{children:[Nt(x,{onClose:r},"header"),Nt($e,{children:Ca("div",{children:[Nt(it,{success:i,fail:!!t}),t?Nt(iE,{style:{width:"38px",height:"38px"}}):Nt(ei,{style:{width:"38px",height:"38px"}})]})}),Nt(me,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),Ca(qn,{children:[Ca(ar,{children:[Nt(ir,{children:Nt(aE,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),Ca(ar,{children:[Nt(ir,{children:Nt(nE,{})}),"You last added a passkey on"," ",a?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&Nt(Lr,{children:Nt(ks,{pendingTransaction:l})}),t&&Ca(Y2,{children:[Nt(Gl,{style:{marginTop:"1.25rem"},children:t.message}),Nt(U,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&Nt(Ka,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),Nt(J,{})]})};import{Fragment as tu,jsx as we,jsxs as oo}from"react/jsx-runtime";var ru=({open:e,onClose:t})=>{let{user:r}=q(),[o,n]=Rs(null),{init:a,cancel:i,submit:l}=Es(),[s,d]=Rs(!1),[m,f]=Rs(!1),[u,C]=Rs(null),[v,g]=Rs(null);mE(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?R(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let b=k=>dp(k)?(d(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Jn(k)?(d(!1),new Error("The code you entered is not valid")):Zn(k)?(d(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(k),d(!1),new Error("Something went wrong."));async function T(k){g(null);try{if(!k||!o)return;await l(o,k),f(!0),d(!1),t()}catch(M){throw b(M)}}async function R(k){if(k==="passkey"){try{n(k);let M=await a(k);if(!M)throw new Error("something went wrong");C(M),await l(k,M),f(!0),d(!1),t()}catch(M){g(b(M))}return}try{n(k),await a(k)}catch(M){console.error(M)}}let S=()=>{n(null),g(null),i(),t()},P=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let k=r.linkedAccounts.filter(M=>M.type==="passkey"&&M.enrolledInMfa).sort((M,O)=>O.firstVerifiedAt.valueOf()-M.firstVerifiedAt.valueOf())[0];return we(Q2,{account:k,selectedMethod:o,submitSuccess:m,hasBlockingError:s,error:v,onClose:S,onBack:P,handleSubmit:()=>T(u).catch(g)})}return o?we(fE,{submitSuccess:m,hasBlockingError:s,handleSubmitCode:T,selectedMethod:o,onClose:S,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):oo(tu,{children:[we(x,{onClose:S},"header"),we(Le,{children:we(Ze,{children:we(dE,{})})}),we(me,{children:"Verify your identity"}),we(he,{children:"Choose a verification method"}),oo(Fl,{children:[r.mfaMethods.includes("totp")&&oo(Se,{onClick:()=>R("totp"),children:[we(sE,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&oo(Se,{onClick:()=>R("sms"),children:[we(cE,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&oo(Se,{onClick:()=>R("passkey"),children:[we(lE,{}),"Passkey"]},"passkey")]}),we(J,{})]})},fE=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:a})=>{let{app:i}=A(),{pendingTransaction:l}=_();switch(e){case"sms":return oo(tu,{children:[we(x,{onClose:o},"header"),we(Le,{children:we(Ze,{children:we(uE,{})})}),we(me,{children:"Enter verification code"}),oo(Lr,{children:[we(ai,{success:t,disabled:r,onChange:a}),oo(he,{children:["To continue, please enter the 6-digit code sent to your ",we("strong",{children:"mobile device"})]}),l&&we(ks,{pendingTransaction:l})]}),n&&we(Ka,{theme:i?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),we(Qr,{onClick:o,children:"Not now"}),we(J,{})]});case"totp":return oo(tu,{children:[we(x,{onClose:o},"header"),we(Le,{children:we(Ze,{children:we(pE,{})})}),we(me,{children:"Enter verification code"}),oo(Lr,{children:[we(ai,{success:t,disabled:r,onChange:a}),oo(he,{children:["To continue, please enter the 6-digit code generated from your"," ",we("strong",{children:"authenticator app"})]}),l&&we(ks,{pendingTransaction:l})]}),n&&we(Ka,{theme:i?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),we(Qr,{onClick:o,children:"Not now"}),we(J,{})]});default:return null}};import{useEffect as X2,useState as Z2}from"react";import hE from"styled-components";import{Fragment as gE,jsx as xo,jsxs as cd}from"react/jsx-runtime";var J2=()=>{let{authenticated:e,logout:t,ready:r,user:o}=q(),{app:n,setModalData:a,navigate:i,resetNavigation:l}=A(),{getAuthMeta:s,initLoginWithOAuth:d,loginWithOAuth:m,updateWallets:f,setReadyToTrue:u,closePrivyModal:C,createAnalyticsEvent:v}=_(),[g,b]=Z2(!1),[T,R]=Z2(void 0),S=s()?.provider||"google",{name:P,component:k}=Oa(S),M=wi(),O=Me;X2(()=>{m(S).then(X=>{b(!0),u(!0),X&&M("login","onOAuthLoginComplete",X)}).catch(X=>{if(u(!1),X?.privyErrorCode==="allowlist_rejected"){R(void 0),l(),i("ALLOWLIST_REJECTION_SCREEN");return}if(X?.privyErrorCode==="max_accounts_reached"){console.error(new lo(X).toString()),R(void 0),l(),i("USER_LIMIT_REACHED_SCREEN");return}if(X?.privyErrorCode==="user_does_not_exist"){R(void 0),l(),i("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:L,detail:Z}=Ef(X,S);R({retryable:L,detail:Z,message:"Authentication failed"})}).finally(()=>{Fn()})},[P,S]),X2(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let L=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},O);return()=>clearTimeout(L)}if(Ft(o,n?.embeddedWallets?.createOnLogin)){let L=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:Z=>{console.error(Z),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Z,provider:S,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},O);return()=>clearTimeout(L)}else{let L=setTimeout(()=>C({shouldCallAuthOnSuccess:!0,isSuccess:!0}),O);return f(),()=>clearTimeout(L)}}},[r,e,g,o]);let H=g?`Successfully connected with ${P}`:T?T.message:`Verifying connection to ${P}`,Y="";return g?Y="You\u2019re good to go!":T?Y=T.detail:Y="Just a few moments more",cd(gE,{children:[xo(x,{}),xo(ie,{}),cd(yE,{children:[xo($e,{children:cd("div",{children:[xo(it,{success:g,fail:!!T}),xo(k,{style:{width:"38px",height:"38px"}})]})}),cd(Ye,{children:[xo("h3",{children:H}),xo("p",{children:Y})]}),T&&T?.retryable?xo($o,{onClick:()=>{Fn(),d(S),R(void 0)},disabled:!g&&!T?.retryable,children:"Retry"}):null]}),xo(ae,{}),xo(J,{})]})},yE=hE.div`
|
|
2482
2482
|
display: flex;
|
|
2483
2483
|
flex-direction: column;
|
|
2484
2484
|
align-items: center;
|
|
@@ -2486,17 +2486,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2486
2486
|
margin-left: 27px;
|
|
2487
2487
|
margin-right: 27px;
|
|
2488
2488
|
gap: 24px;
|
|
2489
|
-
`;import{useEffect as ou,useRef as
|
|
2489
|
+
`;import{useEffect as ou,useRef as vE,useState as j2}from"react";import $2 from"styled-components";import{Fragment as wE,jsx as qo,jsxs as dd}from"react/jsx-runtime";var e3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=A(),{loginWithPasskey:o,closePrivyModal:n}=_(),a=Me,[i,l]=j2("loading"),[s,d]=j2(null),m=vE([]),f=b=>{m.current=[b,...m.current]};ou(()=>()=>{m.current.forEach(b=>clearTimeout(b)),m.current=[]},[]);let u=()=>{switch(i){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},C=()=>{switch(i){case"loading":return`Please follow prompts to verify your passkey.
|
|
2490
2490
|
You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof Jt){if(s.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(s.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
|
|
2491
2491
|
You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
|
|
2492
|
-
You will have to sign up with another method first to register a passkey for your account.`}},v=()=>{switch(
|
|
2492
|
+
You will have to sign up with another method first to register a passkey for your account.`}},v=()=>{switch(i){case"loading":case"success":return qo(U,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return qo(U,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{l("loading");try{await o(),l("success")}catch(b){d(b),l("error")}};return ou(()=>{i==="success"&&f(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},a))},[i]),ou(()=>{g()},[]),dd(wE,{children:[qo(x,{backFn:!e||t===e?void 0:r}),dd(CE,{children:[qo($e,{children:dd("div",{children:[qo(it,{success:i==="success",fail:i==="error"}),qo(ti,{style:{width:"38px",height:"38px"}})]})}),dd(Ye,{children:[qo("h3",{children:u()}),qo("p",{style:{whiteSpace:"pre-wrap"},children:C()})]}),v()]}),qo(J,{})]})},CE=$2.div`
|
|
2493
2493
|
display: flex;
|
|
2494
2494
|
flex-direction: column;
|
|
2495
2495
|
align-items: center;
|
|
2496
2496
|
justify-content: center;
|
|
2497
2497
|
gap: 24px;
|
|
2498
2498
|
width: 100%;
|
|
2499
|
-
`,
|
|
2499
|
+
`,j$=$2.div`
|
|
2500
2500
|
display: flex;
|
|
2501
2501
|
align-items: center;
|
|
2502
2502
|
justify-content: center;
|
|
@@ -2512,9 +2512,9 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2512
2512
|
stroke: var(--privy-color-accent) !important;
|
|
2513
2513
|
fill: var(--privy-color-accent) !important;
|
|
2514
2514
|
}
|
|
2515
|
-
`;import{useEffect as
|
|
2515
|
+
`;import{useEffect as EE,useState as r3}from"react";import TE from"styled-components";import{isMobile as bE}from"react-device-detect";var t3=(e,t)=>{let r=new URL(window.location.href),o=encodeURIComponent(r.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!Yo()&&bE)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as AE,jsx as zo,jsxs as o3}from"react/jsx-runtime";var n3=()=>{let{forkSession:e,ready:t,authenticated:r}=q(),[o,n]=r3(""),[a,i]=r3(!1);EE(()=>{t&&r&&e().then(n)},[t,r]);let l=t3(o,!a),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),a&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),o3(AE,{children:[zo(x,{},"header"),zo(ie,{}),zo(Co,{title:s.title,description:s.description}),o3(lr,{children:[zo(SE,{children:zo(ho,{style:{width:"72px",height:"72px"}})}),zo(Ll,{href:l,onClick:()=>{setTimeout(()=>i(!0),1e3)},loading:t&&!l,children:a?"Go to App Store":"Continue"}),s.footnote?zo("p",{children:s.footnote}):null]}),zo(ae,{}),zo(G,{})]})},SE=TE(Tt)`
|
|
2516
2516
|
margin: 16px auto;
|
|
2517
|
-
`;import
|
|
2517
|
+
`;import PE from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as xE,useState as pd}from"react";import ud,{css as kE}from"styled-components";import{Fragment as WE,jsx as Kt,jsxs as ci}from"react/jsx-runtime";var i3=()=>{let[e,t]=pd(!0),{authenticated:r,getAccessToken:o}=q(),{walletProxy:n,closePrivyModal:a,createAnalyticsEvent:i}=_(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:d}=A(),[m,f]=pd(void 0),[u,C]=pd(""),[v,g]=pd(!1),{privyWallet:b,onCompleteNavigateTo:T,onSuccess:R,onFailure:S}=s.recoverWallet,P=(O="User exited before their wallet could be recovered")=>{a({shouldCallAuthOnSuccess:!1}),S(typeof O=="string"?new fr(O):O)};d.current=P,xE(()=>{if(!r||!b)return P("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let k=O=>{O&&f(O)};return ci(WE,{children:[Kt(x,{onClose:P}),Kt(ie,{}),ci(_E,{children:[ci(RE,{children:[Kt(PE,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Kt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),Kt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),ci("div",{children:[ci(ln,{children:[Kt(ea,{type:e?"password":"text",onChange:O=>k(O.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),Kt(ta,{style:{right:"0.75rem"},children:e?Kt(ra,{onClick:()=>t(!1)}):Kt(oa,{onClick:()=>t(!0)})})]}),!!u&&Kt(ME,{children:u})]}),ci("div",{children:[ci(sh,{children:[Kt("h4",{children:"Why is this necessary?"}),Kt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),Kt(IE,{loading:v||!n,disabled:!m,onClick:async()=>{g(!0);let O=await o();if(O&&b&&m!==null)try{i({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:b.address}}),await n?.recover({address:b.address,accessToken:O,recoveryPin:m,recoveryMethod:b.recoveryMethod}),C(""),T?l(T):a({shouldCallAuthOnSuccess:!1}),R?.(b),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:b.address}})}catch(H){Kh(H)?C("Invalid recovery password, please try again."):C("An error has occurred, please try again.")}finally{g(!1)}else return P("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!b&&v,children:"Recover your account"})]})]}),Kt(ae,{}),Kt(G,{})]})},RE=ud.div`
|
|
2518
2518
|
display: flex;
|
|
2519
2519
|
flex-direction: column;
|
|
2520
2520
|
align-items: center;
|
|
@@ -2536,26 +2536,26 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2536
2536
|
font-weight: 400;
|
|
2537
2537
|
line-height: 20px;
|
|
2538
2538
|
}
|
|
2539
|
-
`,
|
|
2539
|
+
`,_E=ud.div`
|
|
2540
2540
|
display: flex;
|
|
2541
2541
|
flex-direction: column;
|
|
2542
2542
|
justify-content: space-between;
|
|
2543
|
-
`,
|
|
2543
|
+
`,ME=ud.div`
|
|
2544
2544
|
line-height: 20px;
|
|
2545
2545
|
height: 20px;
|
|
2546
2546
|
font-size: 13px;
|
|
2547
2547
|
color: var(--privy-color-error);
|
|
2548
2548
|
text-align: left;
|
|
2549
2549
|
margin-top: 0.5rem;
|
|
2550
|
-
`,
|
|
2551
|
-
${e=>e.hideAnimations&&
|
|
2550
|
+
`,IE=ud(U)`
|
|
2551
|
+
${e=>e.hideAnimations&&kE`
|
|
2552
2552
|
&& {
|
|
2553
2553
|
// Remove animations because the recoverWallet task on the iframe partially
|
|
2554
2554
|
// blocks the renderer, so the animation stutters and doesn't look good
|
|
2555
2555
|
transition: none;
|
|
2556
2556
|
}
|
|
2557
2557
|
`}
|
|
2558
|
-
`;import{useCallback as
|
|
2558
|
+
`;import{useCallback as LE,useEffect as d3,useState as nu}from"react";import{jsx as md,jsxs as a3}from"react/jsx-runtime";var fd=e=>a3("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[md("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),md("defs",{children:a3("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[md("stop",{stopColor:"#3E82F4"}),md("stop",{offset:1,stopColor:"#93DCF7"})]})})]});import{jsx as Ko,jsxs as s3}from"react/jsx-runtime";var hd=({style:e,...t})=>s3("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[s3("g",{clipPath:"url(#clip0_2115_829)",children:[Ko("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),Ko("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),Ko("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),Ko("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),Ko("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),Ko("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),Ko("defs",{children:Ko("clipPath",{id:"clip0_2115_829",children:Ko("rect",{width:"16",height:"14",fill:"white"})})})]});import l3 from"styled-components";var _s=l3.div`
|
|
2559
2559
|
display: flex;
|
|
2560
2560
|
flex-direction: column;
|
|
2561
2561
|
gap: 12px;
|
|
@@ -2563,13 +2563,13 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2563
2563
|
padding-bottom: 24px;
|
|
2564
2564
|
`,c3=l3.div`
|
|
2565
2565
|
padding-bottom: 24px;
|
|
2566
|
-
`;import{Fragment as u3,jsx as
|
|
2566
|
+
`;import{Fragment as u3,jsx as Sn,jsxs as yd}from"react/jsx-runtime";var p3={"google-drive":{name:"Google Drive",component:hd},icloud:{name:"iCloud",component:fd}},m3=()=>{let{logout:e}=q(),{navigate:t,setModalData:r,data:o}=A(),{recoveryOAuthFlow:n,closePrivyModal:a,createAnalyticsEvent:i}=_(),[l,s]=nu(!1),{provider:d,action:m,isInAccountCreateFlow:f}=o?.recoveryOAuthStatus,[u,C]=nu(void 0),[v,g]=nu(m==="create-wallet");if(d==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let b=p3[d].name,T=p3[d].component,R=o?.recoverWallet?.onCompleteNavigateTo,S=new Ke(async(X="create-wallet")=>(g(!0),new Promise((L,Z)=>{setTimeout(async()=>{try{let W=window.open();await n(d,X,W),s(!0),L()}catch{C({message:`${X==="recover"?"Recovery":"Back up"} with ${b} unsuccessful`,detail:m==="recover"?`Please verify that you are selecting the ${b} account associated with your backup.`:"",retryable:!0}),Z()}},0)})));d3(()=>{m!=="recover"&&S.execute(f?"create-wallet":"set-recovery")},[]),d3(()=>{if(!l)return;let X=setTimeout(()=>{f?(r({createWallet:{onSuccess:()=>{},onFailure:L=>{i({eventName:"embedded_wallet_creation_failure_logout",payload:{error:L,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):a({shouldCallAuthOnSuccess:!1})},Me);return()=>clearTimeout(X)},[l]);let P=LE(async()=>{await S.execute("recover"),R?t(R):s(!0)},[]),k=d==="google-drive"?"Google Drive":"Apple iCloud",M=m==="recover"?"recovered":"backed up",O=m==="recover"?"Recovering":"Backing up",H=l&&`Successfully ${M} with ${k}.`||u&&u.message||`${O} with ${k}...`,Y=u?u.detail:"";return yd(u3,{children:[Sn(x,{}),v?Sn(u3,{children:yd(_s,{children:[Sn(ge,{title:H,icon:Sn(T,{style:{width:"38px",height:"38px"}}),description:Y}),u&&u?.retryable?Sn(U,{onClick:()=>{Fn(),C(void 0),m==="create-wallet"?S.execute("create-wallet"):P()},disabled:!l&&!u?.retryable,children:"Try again"}):null]})}):yd(_s,{children:[Sn(ge,{title:"Confirm it's really you",icon:Sn(T,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${k} where your account is backed up.`}),yd(U,{onClick:P,children:["Confirm with ",k]})]}),Sn(G,{})]})};import{useEffect as f3,useState as Ms}from"react";import{jsx as NE}from"react/jsx-runtime";var h3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=A(),[n,a]=Ms(""),[i,l]=Ms(!1),[s,d]=Ms(),[m,f]=Ms(null),{authenticated:u}=q(),{closePrivyModal:C,isNewUserThisSession:v,initializeWalletProxy:g}=_(),{onSuccess:b,onFailure:T,callAuthOnSuccessOnClose:R}=r.createWallet,{createWallet:S}=sc(),[P,k]=Ms(null),M=new Ke(async()=>{try{let Y=await S(s);if(!Y)return;k(Y),v?t("EMBEDDED_WALLET_CREATED_SCREEN"):(b(Y),C({shouldCallAuthOnSuccess:R}))}catch(Y){a(Y.message)}});f3(()=>{m||g(3e4).then(Y=>f(Y))},[m]),f3(()=>{if(!u){t("LANDING"),T(new Error("User must be authenticated before creating a Privy wallet"));return}},[u]);let O=()=>{P&&P?.recoveryMethod!=="user-passcode"?(T(new fr("User created a wallet but failed to set a password for it")),C({shouldCallAuthOnSuccess:!1})):P?(b(P),C({shouldCallAuthOnSuccess:R})):(T(new fr("User wallet creation failed")),C({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let H=async()=>{l(!0);let Y=250;return M.execute().then(()=>new Promise(X=>setTimeout(X,Y))).finally(()=>l(!1))};return NE(pc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!m,buttonLoading:i,buttonHideAnimations:!P&&i,isResettingPassword:!1,error:n,password:s||"",onClose:O,onPasswordChange:d,onPasswordGenerate:()=>d(dc()),onSubmit:H})};import OE from"@heroicons/react/24/outline/LockClosedIcon";import DE from"@heroicons/react/24/outline/PencilSquareIcon";import FE from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as UE}from"react";import BE from"styled-components";import{Fragment as au,jsx as yt,jsxs as An}from"react/jsx-runtime";var iu=BE.div`
|
|
2567
2567
|
width: 24px;
|
|
2568
2568
|
height: 24px;
|
|
2569
2569
|
display: flex;
|
|
2570
2570
|
justify-content: center;
|
|
2571
2571
|
align-items: center;
|
|
2572
|
-
`,
|
|
2572
|
+
`,HE={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},VE=({onClose:e})=>An(c3,{children:[yt(ge,{title:"Why do I need to secure my account?",icon:yt(FE,{width:48}),description:An(au,{children:[yt("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),yt("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),yt(U,{onClick:e,children:"Select backup method"})]}),y3=()=>{let[e,t]=UE(!1),{navigate:r,lastScreen:o,navigateBack:n,setModalData:a,data:i,onUserCloseViaDialogOrKeybindRef:l}=A(),{user:s}=q(),{embeddedWallets:d}=De(),{closePrivyModal:m}=_(),f=be(s),u=f===null,{isInAccountCreateFlow:C,isResettingPassword:v}=i.recoverySelection,g=f&&f.recoveryMethod!=="privy",b=g?"Update backup method":"Secure your account",T=g?An("span",{children:["Your account is currently secured using"," ",yt("strong",{children:HE[f?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function R(P){a({recoveryOAuthStatus:{provider:P,action:u?"create-wallet":"set-recovery",isInAccountCreateFlow:C}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}function S(){i?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),m({shouldCallAuthOnSuccess:i?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return l.current=S,An(au,{children:[yt(x,{onClose:S,backFn:e?()=>t(!1):o?n:void 0,infoFn:o||e?void 0:()=>t(!0)},"header"),e?yt(VE,{onClose:()=>t(!1)}):An(au,{children:[yt(ge,{title:b,icon:yt(OE,{width:48}),description:T}),yt(_s,{children:d.userOwnedRecoveryOptions.filter(P=>["icloud","google-drive"].includes(f?.recoveryMethod||"")?P!==f?.recoveryMethod:!0).sort().map(P=>{switch(P){case"google-drive":return An(Se,{onClick:()=>R("google-drive"),children:[yt(iu,{children:yt(hd,{style:{width:18}})}),"Back up to Google Drive"]},P);case"icloud":return An(Se,{onClick:()=>R("icloud"),children:[yt(iu,{children:yt(fd,{style:{width:24}})}),"Back up to Apple iCloud"]},P);case"user-passcode":return An(Se,{onClick:()=>{let k=pp({isCreatingWallet:u,skipSplashScreen:!0});r(k)},children:[yt(iu,{children:yt(DE,{style:{width:18}})}),v?"Reset your":"Set a"," password"]},P);default:return null}})})]}),yt(G,{})]})};import qE from"@heroicons/react/24/outline/ExclamationTriangleIcon";import zE from"@heroicons/react/24/outline/LockClosedIcon";import{useState as su}from"react";import GE from"styled-components";var g3=GE.div`
|
|
2573
2573
|
&& {
|
|
2574
2574
|
border-width: 4px;
|
|
2575
2575
|
}
|
|
@@ -2582,9 +2582,9 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2582
2582
|
border-style: solid;
|
|
2583
2583
|
border-color: ${e=>e.$color??"var(--privy-color-accent)"};
|
|
2584
2584
|
border-radius: 50%;
|
|
2585
|
-
`;import{Fragment as v3,jsx as ur,jsxs as C3}from"react/jsx-runtime";var w3=()=>{let{user:e,getAccessToken:t}=q(),r=be(e),{walletProxy:o,refreshUser:n,closePrivyModal:
|
|
2585
|
+
`;import{Fragment as v3,jsx as ur,jsxs as C3}from"react/jsx-runtime";var w3=()=>{let{user:e,getAccessToken:t}=q(),r=be(e),{walletProxy:o,refreshUser:n,closePrivyModal:a}=_(),i=A(),[l,s]=su(!1),[d,m]=su(null),[f,u]=su(null);function C(){if(!l){if(f){i.data?.setWalletPassword?.onFailure(f),a();return}if(!d){i.data?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),a();return}}}i.onUserCloseViaDialogOrKeybindRef.current=C;async function v(){s(!0);try{let b=await t();if(!b||!o||!r)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:r.address,accessToken:b})).address)throw new Error("Unable to set recovery on wallet");let R=await n();if(!R)throw new Error("Unable to set recovery on wallet");let S=be(R);if(!S)throw new Error("Unabled to set recovery on wallet");m(!!R),setTimeout(()=>{i.data?.setWalletPassword?.onSuccess(S),a()},Me)}catch(b){u(b)}finally{s(!1)}}let g=!!(l||d);return f?C3(v3,{children:[ur(x,{onClose:C},"header"),ur(g3,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:ur(qE,{height:38,width:38,stroke:"var(--privy-color-error)"})}),ur($r,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),ur(gr,{style:{minHeight:"2rem"}}),ur(Fo,{onClick:()=>u(null),children:"Try again"}),ur(G,{})]}):C3(v3,{children:[ur(x,{onClose:C},"header"),ur(zE,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),ur($r,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),ur(Or,{style:{marginTop:"1rem"},children:"When you log into a new device, you\u2019ll only need to authenticate to access your account. Never get logged out if you forget your password."}),ur(gr,{style:{minHeight:"2rem"}}),ur(Fo,{loading:l,disabled:g,onClick:()=>v(),children:d?"Success":"Confirm"}),ur(G,{})]})};import{getAddress as L3}from"@ethersproject/address";import{useEffect as LT,useMemo as Ed,useState as Is}from"react";import{ProviderErrors as D3,QuantityToBigNumber as N3}from"@privy-io/js-sdk-core";import{EtherscanProvider as jte}from"@ethersproject/providers";import{QuantityToBigNumber as KE}from"@privy-io/js-sdk-core";async function gd(e,t,r,o,n,a){o=Object.assign({chainId:No},o),YE(o);let l=(await r.rpc({address:t,accessToken:e,requesterAppId:a,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(l)}async function vd(e,t,r,o){let n=await o.getBalance(e),a=t.value||0,l=!n.sub(KE(a)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function YE(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!QE(o))throw new Error(`Transaction request property '${r}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof e.chainId!="number")throw new Error("Transaction request property 'chainId' must be a number")}function QE(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&XE(e);return t||r||o}function XE(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Cd(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var lu=["FUNDING_METHOD_SELECTION_SCREEN","FUNDING_TRANSFER_FROM_WALLET_SCREEN","FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN","FUNDING_MANUAL_TRANSFER_SCREEN","MOONPAY_PROMPT_SCREEN","MOONPAY_STATUS_SCREEN"],b3={["FUNDING_METHOD_SELECTION_SCREEN"]:null,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:"external",["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:"external",["FUNDING_MANUAL_TRANSFER_SCREEN"]:"manual",["MOONPAY_PROMPT_SCREEN"]:"moonpay",["MOONPAY_STATUS_SCREEN"]:"moonpay"},ZE={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function wd({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?ZE[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}import E3 from"styled-components";import{Fragment as tT,jsx as Ge,jsxs as ko}from"react/jsx-runtime";var T3=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:a,title:i,subtitle:l,total:s,to:d,network:m,hasFunds:f,fee:u,from:C,cta:v,chain:g,isSubmitting:b,isPreparing:T,isTokenPriceLoading:R,isTokenContractInfoLoading:S,symbol:P,balance:k,onClick:M,spender:O})=>ko(tT,{children:[Ge(x,{onClose:o}),e&&Ge(eT,{children:e}),Ge($r,{style:{marginTop:e?"1.5rem":0},children:i}),Ge(Or,{children:l}),ko(Ec,{style:{marginTop:"2rem"},children:[s&&ko(It,{children:[Ge(Wt,{children:"Total"}),Ge(Ht,{$isLoading:T||R,children:s})]}),n&&n!=="transaction"&&ko(It,{children:[Ge(Wt,{children:"Action"}),Ge(Ht,{children:n})]}),a?ko(It,{children:[Ge(Wt,{children:"Amount"}),ko(Ht,{$isLoading:S,children:[$E(a)," ",P]})]}):null,O?ko(It,{children:[Ge(Wt,{children:"Spender"}),Ge(Ht,{children:Ge(Ma,{address:O,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,d&&ko(It,{children:[Ge(Wt,{children:"To"}),Ge(Ht,{children:Ge(Ma,{address:d,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),ko(It,{children:[Ge(Wt,{children:"Network"}),Ge(Ht,{children:m})]}),ko(It,{children:[Ge(Wt,{children:"Estimated fee"}),Ge(Ht,{$isLoading:T||R,children:u})]})]}),Ge(gr,{}),t?Ge(_a,{style:{marginTop:"2rem"},children:t.message}):r?Ge(_a,{style:{marginTop:"2rem"},children:jE}):null,Ge(JE,{$useSmallMargins:!!(r||t),address:C,balance:k,isLoading:T||R,errMsg:!T&&!r&&!t&&!f?`Add funds on ${g?.name} to complete transaction.`:void 0}),Ge(Fo,{style:{marginTop:"1rem"},loading:b,disabled:T,onClick:M,children:v}),Ge(G,{})]}),JE=E3(Ei)`
|
|
2586
2586
|
${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
|
|
2587
|
-
`,
|
|
2587
|
+
`,jE="There was an error preparing your transaction. Your transaction request will likely fail.",$E=e=>e.toLocaleString(),eT=E3.div`
|
|
2588
2588
|
display: flex;
|
|
2589
2589
|
width: 100%;
|
|
2590
2590
|
justify-content: center;
|
|
@@ -2594,12 +2594,12 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2594
2594
|
object-fit: contain;
|
|
2595
2595
|
border-radius: var(--privy-border-radius-sm);
|
|
2596
2596
|
}
|
|
2597
|
-
`;import
|
|
2597
|
+
`;import oT from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import nT from"@heroicons/react/24/outline/ClipboardDocumentIcon";import iT from"@heroicons/react/24/outline/ExclamationCircleIcon";import{useState as aT}from"react";import xr from"styled-components";import{ErrorCode as bd}from"@ethersproject/logger";var rT=new Set([bd.CALL_EXCEPTION,bd.NONCE_EXPIRED,bd.REPLACEMENT_UNDERPRICED,bd.TRANSACTION_REPLACED]),S3=e=>{let t;return e.code&&e.code!==-32e3&&rT.has(e.code)&&(t=e.transactionHash),t},A3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";import{Fragment as wT,jsx as Ot,jsxs as di}from"react/jsx-runtime";var sT=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=S3(e),o=A3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},lT=()=>di(uT,{children:[Ot(fT,{}),Ot(mT,{})]}),R3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=_(),[a,i]=aT(!1),{errorCode:l,transactionHash:s,errorMessage:d}=sT(e),m=n.find(f=>f.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return di(wT,{children:[Ot(x,{onClose:r}),di(cT,{children:[Ot(lT,{}),Ot(dT,{children:l}),Ot(pT,{children:"Please try again."}),di(x3,{children:[Ot(P3,{children:"Error message"}),Ot(k3,{clickable:!1,children:d})]}),s&&di(x3,{children:[Ot(P3,{children:"Transaction hash"}),di(yT,{children:["Copy this hash to view details about the transaction on a"," ",Ot("u",{children:Ot("a",{href:m,children:"block explorer"})}),"."]}),di(k3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),i(!0)},children:[s,Ot(CT,{clicked:a})]})]}),Ot(hT,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),Ot(J,{})]})},cT=xr.div`
|
|
2598
2598
|
display: flex;
|
|
2599
2599
|
flex-direction: column;
|
|
2600
2600
|
align-items: center;
|
|
2601
2601
|
justify-content: center;
|
|
2602
|
-
`,
|
|
2602
|
+
`,dT=xr.span`
|
|
2603
2603
|
color: var(--privy-color-foreground);
|
|
2604
2604
|
text-align: center;
|
|
2605
2605
|
font-size: 1.125rem;
|
|
@@ -2607,7 +2607,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2607
2607
|
line-height: 1.25rem; /* 111.111% */
|
|
2608
2608
|
text-align: center;
|
|
2609
2609
|
margin: 10px;
|
|
2610
|
-
`,
|
|
2610
|
+
`,pT=xr.span`
|
|
2611
2611
|
margin-top: 4px;
|
|
2612
2612
|
margin-bottom: 10px;
|
|
2613
2613
|
color: var(--privy-color-foreground-3);
|
|
@@ -2618,7 +2618,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2618
2618
|
font-weight: 400;
|
|
2619
2619
|
line-height: 20px; /* 142.857% */
|
|
2620
2620
|
letter-spacing: -0.008px;
|
|
2621
|
-
`,
|
|
2621
|
+
`,uT=xr.div`
|
|
2622
2622
|
position: relative;
|
|
2623
2623
|
width: 60px;
|
|
2624
2624
|
height: 60px;
|
|
@@ -2626,19 +2626,19 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2626
2626
|
display: flex;
|
|
2627
2627
|
justify-content: center;
|
|
2628
2628
|
align-items: center;
|
|
2629
|
-
`,
|
|
2629
|
+
`,mT=xr(iT)`
|
|
2630
2630
|
position: absolute;
|
|
2631
2631
|
width: 35px;
|
|
2632
2632
|
height: 35px;
|
|
2633
2633
|
color: var(--privy-color-error);
|
|
2634
|
-
`,
|
|
2634
|
+
`,fT=xr.div`
|
|
2635
2635
|
position: absolute;
|
|
2636
2636
|
width: 60px;
|
|
2637
2637
|
height: 60px;
|
|
2638
2638
|
border-radius: 50%;
|
|
2639
2639
|
background-color: var(--privy-color-error);
|
|
2640
2640
|
opacity: 0.1;
|
|
2641
|
-
`,
|
|
2641
|
+
`,hT=xr(U)`
|
|
2642
2642
|
&& {
|
|
2643
2643
|
margin-top: 24px;
|
|
2644
2644
|
}
|
|
@@ -2656,7 +2656,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2656
2656
|
flex-direction: column;
|
|
2657
2657
|
justify-content: center;
|
|
2658
2658
|
align-items: center;
|
|
2659
|
-
`,
|
|
2659
|
+
`,yT=xr.text`
|
|
2660
2660
|
position: relative;
|
|
2661
2661
|
width: 100%;
|
|
2662
2662
|
padding: 5px;
|
|
@@ -2682,24 +2682,24 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2682
2682
|
&:hover {
|
|
2683
2683
|
background-color: var(--privy-color-foreground-4);
|
|
2684
2684
|
}`}
|
|
2685
|
-
`,
|
|
2685
|
+
`,gT=xr(nT)`
|
|
2686
2686
|
position: absolute;
|
|
2687
2687
|
top: 13px;
|
|
2688
2688
|
right: 13px;
|
|
2689
2689
|
width: 24px;
|
|
2690
2690
|
height: 24px;
|
|
2691
|
-
`,
|
|
2691
|
+
`,vT=xr(oT)`
|
|
2692
2692
|
position: absolute;
|
|
2693
2693
|
top: 13px;
|
|
2694
2694
|
right: 13px;
|
|
2695
2695
|
width: 24px;
|
|
2696
2696
|
height: 24px;
|
|
2697
|
-
`,
|
|
2697
|
+
`,CT=({clicked:e})=>e?Ot(vT,{}):Ot(gT,{});import{BigNumber as cu}from"@ethersproject/bignumber";import bT from"styled-components";import{Fragment as ST,jsx as pi,jsxs as AT}from"react/jsx-runtime";var ET=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=cu.from(e.gasUsed),o=cu.from(e.effectiveGasPrice),n=r.mul(o);if(t){let a=cu.from(t);n=n.add(a)}return n.toString()}catch{return}else return},_3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:a,l1GasEstimate:i,receiptHeader:l,receiptDescription:s})=>AT(ST,{children:[pi(x,{onClose:o}),pi(Kn,{title:l??"Transaction complete!",description:s??"You're all set."}),pi(ld,{tokenPrice:n,from:t.from,to:t.to,gas:ET(t,i),txn:e,transactionInfo:r,tokenSymbol:a}),pi(gr,{}),pi(TT,{loading:!1,onClick:o,children:"All Done"}),pi(ae,{}),pi(G,{})]}),TT=bT(U)`
|
|
2698
2698
|
&& {
|
|
2699
2699
|
margin-top: 24px;
|
|
2700
2700
|
}
|
|
2701
2701
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2702
|
-
`;import{decodeFunctionData as M3}from"viem";var I3=e=>{let t=
|
|
2702
|
+
`;import{decodeFunctionData as M3}from"viem";var I3=e=>{let t=xT(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=kT(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},PT=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],xT=e=>{try{return M3({abi:PT,data:e})}catch{return null}},kT=e=>{try{return M3({abi:as,data:e})}catch{return null}};import{BigNumber as RT}from"@ethersproject/bignumber";import{useEffect as _T,useState as MT}from"react";import{calculateTotalGasEstimate as IT,populateTransactionRequest as WT}from"@privy-io/js-sdk-core";var W3=(e,t)=>{let[r,o]=MT(null),{getAccessToken:n,user:a}=q(),{walletProxy:i}=_(),l=be(a),s=async()=>{if(!await n()||!i||!l)return null;let m=[],f=await WT(l.address,e,t).catch(b=>(m.push(b),e)),{totalGasEstimate:u,l1ExecutionFeeEstimate:C}=await IT(f,t).catch(b=>(m.push(b),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:v,hasSufficientFunds:g}=await vd(l.address,f,u??RT.from(0),t).catch(b=>(m.push(b),{balance:null,hasSufficientFunds:!1}));return{tx:f,totalGasEstimate:u,l1ExecutionFeeEstimate:C,balance:v,hasFunds:g,errors:m}};return _T(()=>{r&&o(null),s().then(o)},[e]),r};import{jsx as Ws}from"react/jsx-runtime";var O3=new Et(new Ir("There was an issue preparing your transaction",D3.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),F3=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=A(),{rpcConfig:n,chains:a,closePrivyModal:i,walletProxy:l}=_(),{getAccessToken:s,user:d}=q(),{wallets:m}=zr(),f=De(),[u,C]=Is(e?.sendTransaction?.transactionRequest),[v,g]=Is(null),[b,T]=Is(!1),[R,S]=Is(null),[P,k]=Is(null);if(!u||!e?.sendTransaction)return Ws($n,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(O3),i({shouldCallAuthOnSuccess:!1})}});let M=Ed(()=>u.from?m.find(B=>L3(B.address)===L3(u.from)):be(d),[u.from]),O=Ed(()=>a.find(B=>Number(B.id)===Number(u.chainId)),[u.chainId]),H=O?.nativeCurrency.symbol??"ETH",{action:Y,amount:X,spender:L,isErc20Ish:Z}=Ed(()=>I3(u.data),[u.data]);LT(()=>{u.to&&O&&Z&&Ic({address:u.to,chain:O,rpcConfig:f.rpcConfig,privyAppId:f.id}).then(g).catch(console.error)},[u.to,O]);let{tokenPrice:W,isTokenPriceLoading:z}=So(u),Re=Ed(()=>_r(Number(u.chainId),a,n,{appId:f.id}),[u.chainId,n]),re=W3(u,Re),Q=()=>{if(!b)return R?(e?.sendTransaction?.onSuccess(R.response),i({shouldCallAuthOnSuccess:!1})):!P&&!re?.errors[0]?(e?.sendTransaction?.onFailure(new Et(new Ir("The user rejected the request",D3.E4001_USER_REJECTED_REQUEST.eipCode))),i({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(P??re?.errors[0]??O3),i({shouldCallAuthOnSuccess:!1}))};t.current=Q;let oe=async()=>{T(!0);try{let B=await s();if(b||!B||!M||!l)return;let se=await gd(B,M.address,l,re?.tx??u,Re,e.sendTransaction?.requesterAppId),rt=await se.wait();S({receipt:Cd(rt),response:se})}catch(B){console.warn({transaction:re?.tx??u,error:B}),k(B)}finally{T(!1)}},pe=async()=>{if(!be(d))return;if(!f.fundingConfig||f.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let se=wd({fundingMethods:f.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:se}}),o(se)},Ce=f.embeddedWallets.priceDisplay.primary==="fiat-currency",de=N3(re?.tx.value??0).add(N3(re?.totalGasEstimate?.toBigInt()??0)).toHexString(),Ae=bt(de,H),ut=Ce&&W?co(de,W):void 0,Je=bt(re?.totalGasEstimate?.toString()??0,H),le=Ce&&W?co(re?.totalGasEstimate?.toString()??0,W):void 0,Yt=bt(re?.balance?.toString()??0,H,void 0,!0),mr=Ce&&W?co(re?.balance?.toString()??0,W):void 0,Ct=e.sendTransaction?.uiOptions?.transactionInfo?.title||(Y==="approve"?"Confirm address":`Approve ${Y}`),I=e.sendTransaction?.uiOptions?.description||`${f.name} wants your permission to approve the following transaction.`,qe=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?Ws("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,Qt=re&&!re.errors[0]&&!re.hasFunds&&f.fundingConfig&&f.fundingConfig.methods.length>0,F=Qt?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return R?.receipt?Ws(_3,{txn:re?.tx??u,onClose:Q,receipt:R.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:W,tokenSymbol:H,l1GasEstimate:re?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):P?Ws(R3,{transactionError:P,chainId:re?.tx.chainId??u.chainId,onClose:Q,onRetry:({resetNonce:B})=>{k(null);let se={...re?.tx??u};B&&(se.nonce=void 0),C(se)}}):Ws(T3,{isSubmitting:b,submitError:P,isPreparing:!re,isTokenPriceLoading:z,isTokenContractInfoLoading:!v,prepareError:re?.errors[0],symbol:v?.symbol,chain:O,img:qe,title:Ct,subtitle:I,spender:L,total:u.value?ut??Ae:void 0,fee:le??Je,to:u.to,network:f.chains.find(B=>B.id===u.chainId)?.name??"",from:M?.address??"",cta:F,hasFunds:re?.hasFunds,action:Y,balance:mr??Yt,amount:X&&v?bc({amount:X,decimals:v.decimals}):X,onClose:Q,onClick:Qt?pe:oe})};import{isHexString as NT}from"@ethersproject/bytes";import{toUtf8String as OT}from"@ethersproject/strings";import{useEffect as U3,useState as Ls}from"react";import wa from"styled-components";import{ProviderErrors as du}from"@privy-io/js-sdk-core";import{Fragment as H3,jsx as tt,jsxs as Ns}from"react/jsx-runtime";var DT=e=>{if(!NT(e))return e;try{return OT(e)}catch{return e}},FT=e=>JSON.stringify(e,null,2),UT=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?tt(HT,{children:Object.entries(r).map(([o,n])=>Ns("li",{children:[Ns("strong",{children:[o,":"]})," ",t(n)]},o))}):tt("span",{children:String(r)});return tt("div",{children:t(e)})},BT=e=>{let{types:t,primaryType:r,...o}=e.typedData;return Ns(H3,{children:[tt(pu,{children:tt(UT,{data:o})}),tt(dn,{text:FT(e.typedData),itemName:"full payload to clipboard"})," "]})},B3=()=>{let{authenticated:e}=q(),{initializeWalletProxy:t,closePrivyModal:r}=_(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:a}=A(),[i,l]=Ls(!0),[s,d]=Ls(""),[m,f]=Ls(),[u,C]=Ls(null),[v,g]=Ls(!1),b=u!==null;U3(()=>{e||o("LANDING")},[e]),U3(()=>{t(vi).then(Y=>{l(!1),Y||(d("An error has occurred, please try again."),f(new Et(new Ir(s,du.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:T,data:R,confirmAndSign:S,onSuccess:P,onFailure:k,uiOptions:M}=n.signMessage,O={title:M.title||"Sign message",description:M.description||"Signing this message will not cost you any fees.",buttonText:M.buttonText||"Sign and continue"},H=Y=>{Y?P(Y):k(m||new Et(new Ir("The user rejected the request.",du.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{C(null),d(""),f(void 0)},200)};return a.current=()=>{H(u)},Ns(H3,{children:[tt(x,{onClose:()=>H(u)}),tt(ie,{}),M.iconUrl&&typeof M.iconUrl=="string"?tt(qT,{children:tt(q2,{size:"sm",src:M.iconUrl,alt:"app image"})}):null,tt($r,{children:O.title}),tt(Or,{children:O.description}),T==="personal_sign"&&tt(pu,{children:DT(R)}),T==="eth_signTypedData_v4"&&tt(BT,{typedData:R}),T==="solana_signMessage"&&tt(pu,{children:R}),tt(zT,{}),tt(VT,{fail:!0,children:s}),tt(Fo,{disabled:v||b||i,loading:v,onClick:async()=>{g(!0),d("");try{let Y=await S();C(Y),g(!1),setTimeout(()=>{H(Y)},Me)}catch(Y){console.error(Y),d("An error has occurred, please try again."),f(new Et(new Ir(s,du.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),g(!1)}},children:v?"Signing...":b?Ns(GT,{children:[tt(na,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",tt("span",{children:"Success"})]}):O.buttonText}),tt(ae,{}),tt(G,{})]})},pu=wa.div`
|
|
2703
2703
|
margin-top: 1.5rem;
|
|
2704
2704
|
background-color: var(--privy-color-background-2);
|
|
2705
2705
|
border-radius: var(--privy-border-radius-md);
|
|
@@ -2718,7 +2718,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2718
2718
|
display: none; /* Safari and Chrome */
|
|
2719
2719
|
}
|
|
2720
2720
|
}
|
|
2721
|
-
`,
|
|
2721
|
+
`,HT=wa.ul`
|
|
2722
2722
|
margin-left: 12px !important;
|
|
2723
2723
|
white-space: nowrap;
|
|
2724
2724
|
|
|
@@ -2730,7 +2730,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2730
2730
|
font-weight: 500 !important;
|
|
2731
2731
|
}
|
|
2732
2732
|
}
|
|
2733
|
-
`,
|
|
2733
|
+
`,VT=wa.div`
|
|
2734
2734
|
line-height: 20px;
|
|
2735
2735
|
height: 20px;
|
|
2736
2736
|
font-size: 13px;
|
|
@@ -2740,20 +2740,20 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2740
2740
|
width: 100%;
|
|
2741
2741
|
margin-top: 16px;
|
|
2742
2742
|
margin-bottom: 4px;
|
|
2743
|
-
`,
|
|
2743
|
+
`,GT=wa.span`
|
|
2744
2744
|
display: flex;
|
|
2745
2745
|
align-items: center;
|
|
2746
2746
|
gap: 8px;
|
|
2747
|
-
`,
|
|
2747
|
+
`,qT=wa.div`
|
|
2748
2748
|
display: flex;
|
|
2749
2749
|
flex-direction: column;
|
|
2750
2750
|
justify-content: center;
|
|
2751
2751
|
align-items: center;
|
|
2752
2752
|
width: 100%;
|
|
2753
2753
|
height: 82px;
|
|
2754
|
-
`,
|
|
2754
|
+
`,zT=wa.div`
|
|
2755
2755
|
flex-grow: 1;
|
|
2756
|
-
`;import{useEffect as V3,useState as G3}from"react";import
|
|
2756
|
+
`;import{useEffect as V3,useState as G3}from"react";import KT from"styled-components";import{Fragment as QT,jsx as Ro,jsxs as Td}from"react/jsx-runtime";var q3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=q(),{app:n,setModalData:a,navigate:i,resetNavigation:l}=A(),{initLoginWithTelegram:s,loginWithTelegram:d,updateWallets:m,setReadyToTrue:f,closePrivyModal:u,createAnalyticsEvent:C}=_(),[v,g]=G3(!1),[b,T]=G3(void 0),R=Me;async function S(){try{await d(),g(!0),f(!0)}catch(M){if(M?.privyErrorCode==="allowlist_rejected"){T(void 0),l(),i("ALLOWLIST_REJECTION_SCREEN");return}if(M?.privyErrorCode==="max_accounts_reached"){console.error(new lo(M).toString()),T(void 0),l(),i("USER_LIMIT_REACHED_SCREEN");return}if(M?.privyErrorCode==="user_does_not_exist"){T(void 0),l(),i("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:O,detail:H}=Fd(M);T({retryable:O,detail:H,message:"Authentication failed"})}}V3(()=>{S()},[]),V3(()=>{if(!(r&&e&&v&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(H)}if(Ft(o,n?.embeddedWallets?.createOnLogin)){let H=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:Y=>{console.error(Y),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Y,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},R);return()=>clearTimeout(H)}m();let O=setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R);return()=>clearTimeout(O)},[r,e,v,o]);let P=v?"Successfully connected with Telegram":b?b.message:"Verifying connection to Telegram",k="";return v?k="You\u2019re good to go!":b?k=b.detail:k="Just a few moments more",Td(QT,{children:[Ro(x,{}),Ro(ie,{}),Td(YT,{children:[Ro($e,{children:Td("div",{children:[Ro(it,{success:v,fail:!!b}),Ro(Xc,{style:{width:"38px",height:"38px"}})]})}),Td(Ye,{children:[Ro("h3",{children:P}),Ro("p",{children:k})]}),b&&b?.retryable?Ro($o,{onClick:()=>{s().then(async()=>S()).catch(M=>{let{retryable:O,detail:H}=Fd(M);T({retryable:O,detail:H,message:"Authentication failed"})}),T(void 0)},disabled:!v&&!b?.retryable,children:"Retry"}):null]}),Ro(ae,{}),Ro(J,{})]})},YT=KT.div`
|
|
2757
2757
|
display: flex;
|
|
2758
2758
|
flex-direction: column;
|
|
2759
2759
|
align-items: center;
|
|
@@ -2761,9 +2761,9 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2761
2761
|
margin-left: 27px;
|
|
2762
2762
|
margin-right: 27px;
|
|
2763
2763
|
gap: 24px;
|
|
2764
|
-
`;import
|
|
2764
|
+
`;import eS from"@heroicons/react/24/outline/EnvelopeIcon";import XT from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as ZT,useState as z3}from"react";import Y3 from"styled-components";import{Fragment as $T,jsx as Os,jsxs as K3}from"react/jsx-runtime";var Q3=ZT((e,t)=>{let[r,o]=z3(""),[n,a]=z3(!1),{authenticated:i,user:l}=q(),{initUpdateEmail:s}=_(),{navigate:d,setModalData:m,currentScreen:f}=A(),{enabled:u,token:C}=Te(),v=qs(r),g=n,b=n||!v,T=async S=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");a(!0);try{await s(l.email.address,r,S),d("AWAITING_PASSWORDLESS_CODE")}catch(P){m({errorModalData:{error:P,previousScreen:f||"LANDING"}})}a(!1)},R=()=>{u&&!C&&!i?(m({captchaModalData:{callback:S=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,S)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN")):T(C)};return K3($T,{children:[Os(JT,{children:K3(jT,{children:[Os(XT,{}),Os("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:S=>o(S.target.value),onKeyUp:S=>{S.key==="Enter"&&R()},value:r,autoComplete:"email"}),e.stacked?null:Os(Fi,{isSubmitting:g,onClick:R,disabled:b,children:"Submit"})]})}),e.stacked?Os(U,{loadingText:null,loading:g,disabled:b,onClick:R,children:"Submit"}):null]})}),JT=Y3.div`
|
|
2765
2765
|
width: 100%;
|
|
2766
|
-
`,
|
|
2766
|
+
`,jT=Y3.label`
|
|
2767
2767
|
display: block;
|
|
2768
2768
|
position: relative;
|
|
2769
2769
|
width: 100%;
|
|
@@ -2821,7 +2821,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2821
2821
|
&& > input::placeholder {
|
|
2822
2822
|
color: var(--privy-color-foreground-3);
|
|
2823
2823
|
}
|
|
2824
|
-
`;import{Fragment as
|
|
2824
|
+
`;import{Fragment as tS,jsx as Pn,jsxs as rS}from"react/jsx-runtime";var X3=()=>rS(tS,{children:[Pn(x,{},"header"),Pn(ie,{}),Pn(ge,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:Pn(eS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Pn(lr,{children:Pn(Q3,{stacked:!0})}),Pn(ae,{}),Pn(G,{})]});import oS from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as nS,jsx as xn,jsxs as iS}from"react/jsx-runtime";var Z3=()=>{let{currentScreen:e,data:t,navigate:r,setModalData:o}=A(),{user:n}=q(),{initUpdatePhone:a}=_();async function i({qualifiedPhoneNumber:l}){try{if(!n?.phone?.number)throw new Error("User is required to have an phone number to update it.");await a(n?.phone?.number,l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){o({errorModalData:{error:s,previousScreen:t?.errorModalData?.previousScreen||e||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return iS(nS,{children:[xn(x,{},"header"),xn(ie,{}),xn(ge,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:xn(oS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),xn(lr,{children:xn(gn,{stacked:!0,onSubmit:i,hideRecent:!0})}),xn(ae,{}),xn(G,{})]})};import mu from"styled-components";import{jsx as J3}from"react/jsx-runtime";var j3=({style:e,...t})=>J3("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:J3("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});import{Fragment as cS,jsx as ui,jsxs as uu}from"react/jsx-runtime";var $3=()=>{let{navigate:e}=A();return uu(cS,{children:[ui(x,{}),uu(aS,{children:[ui(sS,{children:ui(j3,{})}),uu(lS,{children:[ui("h3",{children:"Unable to sign in"}),ui("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),ui(U,{onClick:()=>{e("LANDING")},children:"Go back"})]}),ui(G,{})]})},aS=mu.div`
|
|
2825
2825
|
display: flex;
|
|
2826
2826
|
flex-direction: column;
|
|
2827
2827
|
align-items: center;
|
|
@@ -2830,7 +2830,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2830
2830
|
width: 100%;
|
|
2831
2831
|
padding-top: 8px;
|
|
2832
2832
|
padding-bottom: 32px;
|
|
2833
|
-
`,
|
|
2833
|
+
`,sS=mu.div`
|
|
2834
2834
|
display: flex;
|
|
2835
2835
|
align-items: center;
|
|
2836
2836
|
justify-content: center;
|
|
@@ -2839,11 +2839,11 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2839
2839
|
color: var(--privy-color-error);
|
|
2840
2840
|
background-color: var(--privy-color-error-light);
|
|
2841
2841
|
border-radius: 50%;
|
|
2842
|
-
`,
|
|
2842
|
+
`,lS=mu.div`
|
|
2843
2843
|
display: flex;
|
|
2844
2844
|
flex-direction: column;
|
|
2845
2845
|
gap: 8px;
|
|
2846
|
-
`;import
|
|
2846
|
+
`;import pS,{createGlobalStyle as uS}from"styled-components";var dS=`
|
|
2847
2847
|
*,
|
|
2848
2848
|
::before,
|
|
2849
2849
|
::after {
|
|
@@ -3073,7 +3073,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3073
3073
|
[hidden] {
|
|
3074
3074
|
display: none;
|
|
3075
3075
|
}
|
|
3076
|
-
`,e0=
|
|
3076
|
+
`,e0=dS;var t0=uS`
|
|
3077
3077
|
:root {
|
|
3078
3078
|
// Borders
|
|
3079
3079
|
--privy-border-radius-sm: 6px;
|
|
@@ -3108,7 +3108,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3108
3108
|
--privy-height-modal-full: 620px;
|
|
3109
3109
|
--privy-height-modal-compact: 480px;
|
|
3110
3110
|
};
|
|
3111
|
-
`,fu=
|
|
3111
|
+
`,fu=pS.div`
|
|
3112
3112
|
// css normalize only the privy application to avoid conflicts
|
|
3113
3113
|
// with consuming application
|
|
3114
3114
|
${e0}
|
|
@@ -3162,7 +3162,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3162
3162
|
opacity: 1;
|
|
3163
3163
|
}
|
|
3164
3164
|
}
|
|
3165
|
-
`;import{Dialog as r0,Transition as hu}from"@headlessui/react";import yu from"react";import Ds from"styled-components";import{jsx as
|
|
3165
|
+
`;import{Dialog as r0,Transition as hu}from"@headlessui/react";import yu from"react";import Ds from"styled-components";import{jsx as ba,jsxs as gS}from"react/jsx-runtime";var o0=({children:e,open:t,onClick:r,...o})=>ba(hu,{show:t,as:yu.Fragment,children:gS(r0,{onClose:r,...o,as:fS,children:[ba(hu.Child,{as:yu.Fragment,enterFrom:"entering",leaveTo:"leaving",children:ba(mS,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),ba(hS,{children:ba(hu.Child,{as:yu.Fragment,enterFrom:"entering",leaveTo:"leaving",children:ba(r0.Panel,{as:yS,children:e})})})]})}),mS=Ds.div`
|
|
3166
3166
|
position: fixed;
|
|
3167
3167
|
inset: 0;
|
|
3168
3168
|
|
|
@@ -3175,10 +3175,10 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3175
3175
|
backdrop-filter: unset;
|
|
3176
3176
|
-webkit-backdrop-filter: unset;
|
|
3177
3177
|
}
|
|
3178
|
-
`,
|
|
3178
|
+
`,fS=Ds.div`
|
|
3179
3179
|
position: relative;
|
|
3180
3180
|
z-index: 999999;
|
|
3181
|
-
`,
|
|
3181
|
+
`,hS=Ds.div`
|
|
3182
3182
|
position: fixed;
|
|
3183
3183
|
inset: 0;
|
|
3184
3184
|
display: flex;
|
|
@@ -3186,7 +3186,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3186
3186
|
justify-content: center;
|
|
3187
3187
|
width: 100vw;
|
|
3188
3188
|
min-height: 100vh;
|
|
3189
|
-
`,
|
|
3189
|
+
`,yS=Ds.div`
|
|
3190
3190
|
// reset some default dialog styles
|
|
3191
3191
|
padding: 0;
|
|
3192
3192
|
background: transparent;
|
|
@@ -3239,7 +3239,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3239
3239
|
align-items: center;
|
|
3240
3240
|
justify-content: center;
|
|
3241
3241
|
height: 100%;
|
|
3242
|
-
`;import{Fragment as a0,jsx as lt,jsxs as s0}from"react/jsx-runtime";var
|
|
3242
|
+
`;import{Fragment as a0,jsx as lt,jsxs as s0}from"react/jsx-runtime";var bS={["LANDING"]:r2,["CONNECT_OR_CREATE"]:e2,["AWAITING_PASSWORDLESS_CODE"]:fh,["AWAITING_CONNECTION"]:Dh,["AWAITING_CONNECT_ONLY_CONNECTION"]:Bh,["AWAITING_FARCASTER_CONNECTION"]:zy,["AWAITING_FARCASTER_SIGNER"]:Jy,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:e3,["PHANTOM_INTERSTITIAL_SCREEN"]:n3,["LOGIN_FAILED_SCREEN"]:c2,["AWAITING_OAUTH_SCREEN"]:J2,["CROSS_APP_AUTH_SCREEN"]:qh,["ALLOWLIST_REJECTION_SCREEN"]:ih,["ACCOUNT_NOT_FOUND_SCREEN"]:$f,["USER_LIMIT_REACHED_SCREEN"]:$3,["INSTALL_PHANTOM_SCREEN"]:Rg,["LINK_EMAIL_SCREEN"]:o2,["LINK_PHONE_SCREEN"]:n2,["LINK_WALLET_SCREEN"]:i2,["LINK_PASSKEY_SCREEN"]:M1,["UPDATE_EMAIL_SCREEN"]:X3,["UPDATE_PHONE_SCREEN"]:Z3,["CONNECT_ONLY_LANDING_SCREEN"]:Ih,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Mh,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:iy,["EMBEDDED_WALLET_CREATED_SCREEN"]:jh,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Zh,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:i3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:y3,["EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN"]:w3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:m3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:ry,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:B3,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:F3,["FUNDING_METHOD_SELECTION_SCREEN"]:sg,["MOONPAY_PROMPT_SCREEN"]:vg,["MOONPAY_STATUS_SCREEN"]:wg,["COINBASE_ONRAMP_STATUS_SCREEN"]:eg,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:Tg,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:q1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:lg,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:My,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:_y,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:h3,["MFA_ENROLLMENT_FLOW_SCREEN"]:T2,["CAPTCHA_SCREEN"]:vh,["ERROR_SCREEN"]:Wy,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Sg,["AFFIRMATIVE_CONSENT_SCREEN"]:rh,["TELEGRAM_AUTH_SCREEN"]:q3},ES=["LANDING","AWAITING_CONNECTION"],c0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=q(),{headless:n}=De(),{ready:a,currentScreen:i}=A(),{status:l,execute:s,reset:d,enabled:m}=Te(),f=o&&i&&ES.includes(i)&&!n&&l==="ready";if(i0(()=>{f&&s()},[f]),i0(()=>{!o&&m&&d()},[o,m]),(!r||!a)&&i!=="AWAITING_OAUTH_SCREEN"&&i!=="CROSS_APP_AUTH_SCREEN"&&i!=="TELEGRAM_AUTH_SCREEN")return s0(a0,{children:[lt(x,{}),lt(ie,{}),lt(n0,{children:lt(at,{})}),lt(ae,{}),lt(J,{})]});if(!i&&e)return lt(ru,{open:e,onClose:t});if(!i)return null;let u=bS[i];return s0(a0,{children:[lt(Xr,{if:!!e,children:lt(u,{})}),lt(Xr,{if:!e,children:lt(ru,{open:e,onClose:t})})]})},TS=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=CS(null),o=am(r);return lt(AS,{style:{height:o},id:"privy-modal-content",children:lt("div",{ref:r,children:lt(c0,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},SS=()=>{let{closePrivyModal:e}=_(),{onUserCloseViaDialogOrKeybindRef:t}=A();return{gracefulClosePrivyModal:vS(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},gu=({open:e})=>{let{app:t}=A(),{gracefulClosePrivyModal:r}=SS(),[o,n]=wS(!1);zd({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let a=e||o;return t.render.standalone?lt(fu,{children:lt(d0,{id:"privy-modal-content",children:lt(c0,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):lt(o0,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:lt(fu,{children:lt(TS,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},d0=l0.div`
|
|
3243
3243
|
display: flex;
|
|
3244
3244
|
flex-direction: column;
|
|
3245
3245
|
text-align: center;
|
|
@@ -3248,7 +3248,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3248
3248
|
width: 100%;
|
|
3249
3249
|
background: var(--privy-color-background);
|
|
3250
3250
|
padding: 0 16px;
|
|
3251
|
-
`,
|
|
3251
|
+
`,AS=l0(d0)`
|
|
3252
3252
|
transition: height 150ms ease-out;
|
|
3253
3253
|
overflow: hidden;
|
|
3254
3254
|
|
|
@@ -3262,4 +3262,4 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3262
3262
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
3263
3263
|
border-radius: var(--privy-border-radius-lg);
|
|
3264
3264
|
}
|
|
3265
|
-
`;import{useRef as p0,useEffect as kS}from"react";import{jsx as _S}from"react/jsx-runtime";function RS({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function u0(e){let t=p0(null),r=p0();return kS(()=>{r.current?.remove(),r.current=RS(e),t.current?.after(r.current)},[e]),_S("div",{ref:t,hidden:!0})}import{useState as MS}from"react";import{useEffect as m0,useRef as f0}from"react";var Sd=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;case"privy:solana-wallet:create":return o;case"privy:solana-wallet:connect":return o;case"privy:solana-wallet:recover":return o;case"privy:solana-wallet:rpc":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function xn(e,t,r,o,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Ne("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((u,C)=>{r.current={resolve:u,reject:C};let v=1e3*60*5;setTimeout(()=>{let g=new Ne("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),C(g)},v)});return await e(f)}return await e()},s=4,d=null;for(let m=0;m<s;m++)try{d=await l(m),o.current?.resolve(void 0);break}catch(f){if(f.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),f}if(d===null){let m=new Ne("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(m),m}return d}import{jsx as DS}from"react/jsx-runtime";var IS=function(e){return()=>`id-${e++}`}(0);function WS(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function gt(e){return e.error!==void 0}var pt=new Sd,vu=new Map,LS=(e,t)=>typeof t=="bigint"?t.toString():t,NS=(e,t)=>`${e}${JSON.stringify(t,LS)}`;function vt(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=NS(e,t);if(e==="privy:wallet:create"){let l=vu.get(i);if(l)return l}let a=new Promise((l,s)=>{let d=IS();pt.enqueue(d,{resolve:l,reject:s}),n.postMessage({id:d,event:e,data:t},o)}).finally(()=>{vu.delete(i)});return vu.set(i,a),a}function OS(e){switch(e.event){case"privy:iframe:ready":let t=pt.dequeue(e.event,e.id);return gt(e)?t.reject(new Ne(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=pt.dequeue(e.event,e.id);return gt(e)?r.reject(new Ne(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=pt.dequeue(e.event,e.id);return gt(e)?o.reject(new Ne(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=pt.dequeue(e.event,e.id);return gt(e)?n.reject(new Ne(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let i=pt.dequeue(e.event,e.id);return gt(e)?i.reject(new Ne(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let a=pt.dequeue(e.event,e.id);return gt(e)?a.reject(new Ne(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery":let l=pt.dequeue(e.event,e.id);return gt(e)?l.reject(new Ne(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:verify":let s=pt.dequeue(e.event,e.id);return gt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:init-enrollment":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:submit-enrollment":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:unenroll":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:clear":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:init-signer":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:sign":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:solana-wallet:create":let d=pt.dequeue(e.event,e.id);return gt(e)?d.reject(new Ne(e.error.type,e.error.message)):d.resolve(e.data);case"privy:solana-wallet:connect":let m=pt.dequeue(e.event,e.id);return gt(e)?m.reject(new Ne(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=pt.dequeue(e.event,e.id);return gt(e)?f.reject(new Ne(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function h0(e){let t=f0(null),r=f0(e.mfaMethods),o=vi(),[n,i]=MS(!1);return m0(()=>{r.current=e.mfaMethods},[e.mfaMethods]),m0(()=>{if(!n)return;let a=t.current;if(!a)return;function l(u){u&&u.origin===e.origin&&WS(u.data)&&OS(u.data)}let s={create(u){return vt("privy:wallet:create",u,a,e.origin)},import(u){return vt("privy:wallet:import",u,a,e.origin)},connect(u){return vt("privy:wallet:connect",u,a,e.origin)},recover(u){return xn(C=>vt("privy:wallet:recover",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!u.recoveryMethod||u.recoveryMethod==="privy")},rpc(u){return xn(C=>vt("privy:wallet:rpc",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(u){return vt("privy:solana-wallet:create",u,a,e.origin)},connectSolana(u){return vt("privy:solana-wallet:connect",u,a,e.origin)},recoverSolana(u){return vt("privy:solana-wallet:recover",u,a,e.origin)},rpcSolana(u){return vt("privy:solana-wallet:rpc",u,a,e.origin)},setRecovery(u){return xn(C=>vt("privy:wallet:set-recovery",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return xn(C=>vt("privy:mfa:verify",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return xn(C=>vt("privy:mfa:init-enrollment",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return xn(C=>vt("privy:mfa:submit-enrollment",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(u){return xn(C=>vt("privy:mfa:unenroll",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(u){return vt("privy:mfa:clear",u,a,e.origin)},initFarcasterSigner(u){return vt("privy:farcaster:init-signer",u,a,e.origin)},signFarcasterMessage(u){return vt("privy:farcaster:sign",u,a,e.origin)}};window.addEventListener("message",l);let d=()=>e.onLoad(s),m=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},f=new AbortController;return Aa(()=>vt("privy:iframe:ready",{},a,e.origin),{abortSignal:f.signal}).then(d,m),()=>{window.removeEventListener("message",l),f.abort()}},[n]),DS("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:zs(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Ad=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return await g0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await Ee())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await y0())throw new w("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};function v0(e){let r=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(r)return parseInt(r);throw new Error("Chain ID not compatible with CAIP-2 format.")}async function C0({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new w("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",m)}let s,d=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(d),clearTimeout(a),n(new w("User rejected request")))},300);function m(f){f.data&&(f.data.type==="PRIVY_OAUTH_RESPONSE"&&f.data.stateCode&&f.data.authorizationCode&&(clearTimeout(a),o(f.data),l()),f.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new w(f.data.error)),l()),f.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=m))}window.addEventListener("message",m)})}var FS="https://cdn.apple-cloudkit.com";async function Cu({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,i)=>{function a(){t?.close(),window.removeEventListener("message",l)}function l(s){s.data&&(s.data.type==="PRIVY_OAUTH_RESPONSE"&&s.data.stateCode&&s.data.authorizationCode&&(n(s.data),a()),s.origin===FS&&s.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:s.data.ckSession}),a()),s.data.type==="PRIVY_OAUTH_ERROR"&&(i(s.data.error),a()))}window.addEventListener("message",l)})}var w0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});import{jsx as kr,jsxs as b0}from"react/jsx-runtime";var Mo;function zS(e){return typeof e=="string"&&e.length===25}function Ee(){if(!Mo){let e=j.get(Mn);return Promise.resolve(e||null)}return Mo.getAccessToken()}var E0,xf=(e,t,r)=>E0(e,t,r),T0,kf=(e,t)=>T0(e,t),S0,Rf=(e,t)=>S0(e,t),A0,_f=()=>A0(),P0,y0=()=>P0(),x0,g0=({message:e})=>x0({message:e}),KS=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;j.put(xa,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},YS=({config:e,...t})=>{if(typeof window<"u"&&["localhost","127.0.0.1"].indexOf(window.location.hostname)<0&&window.location.protocol!=="https:")throw new w("Embedded wallet is only available over HTTPS");if(!zS(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");Mo||(Mo=new Va({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),kr(nm,{client:Mo,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:kr(QS,{...t,client:Mo})})},QS=e=>{let t=e.client,[r,o]=ct(!1),[n,i]=ct(!1),[a,l]=ct(!1),[s,d]=ct(null),[m,f]=ct([]),[u,C]=ct(null),v=wa(m),[g,b]=ct(!1),[T,R]=ct(null),[S,P]=ct(!1),[k,M]=ct({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:dt}),[O,H]=ct({status:"initial"}),[Y,Q]=ct(null),[L,X]=ct(null),W=De(),z=Js(),[_e,re]=ct(!0),[Z,oe]=ct({}),[pe,Ce]=ct(null),[de,Te]=ct(null),[ut,Je]=ct(!1),[le,Qt]=ct(!1),mr=wa(null),Ct=wa(null),I=wa(sm),[qe,Xt]=ct(!1);t.onStoreToken=c=>{c&&D(I,"accessToken","onAccessTokenGranted",c)},t.onDeleteToken=()=>{d(null),l(!1),D(I,"accessToken","onAccessTokenRemoved")};let F=wa(null),B=wa(null),se=c=>{R(c),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:c}})},rt=c=>{W.embeddedWallets.createOnLogin!=="off"&&re(!0),se(c)};io(()=>{let c=Un(s);if(!c||!L){C(null);return}let p={address:c.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:gi,id:"io.privy.solana.wallet"},getProvider:async()=>new Ad(L,c.address)};C(p)},[L,s]),io(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let c=be(s),p=Tl(s);if(c||t.connectors?.removeEmbeddedWalletConnector(),p||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!L){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}c&&t.connectors.addEmbeddedWalletConnector(L,c.address,W.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,W.defaultChain,e.appId)},[L,s]),io(()=>{L&&de?.(L)},[L]),io(()=>{(async()=>{if(!W.customAuth?.enabled)return;re(!0);let{getCustomAccessToken:p,isLoading:h}=W.customAuth;if(!(!n||h))try{let y=await p();if(!y&&a){await mi.logout();return}if(!y||a)return;t.startAuthFlow(new Ei(y));let{user:E,isNewUser:N}=await t.authenticate();if(!E){await mi.logout();return}N!==void 0&&D(I,"login","onComplete",E,N,!1,"custom",null),d(E||null),b(N||!1),l(!0),Qt(!0)}catch(y){throw console.warn(y),a&&await mi.logout(),D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}})()},[W.customAuth?.enabled,W.customAuth?.getCustomAccessToken,W.customAuth?.isLoading,n,a]),io(()=>{le&&L&&s&&Ut(s,W.embeddedWallets.createOnLogin)&&(Qt(!1),Ta(s,yi).catch(console.error))},[le&&L&&s]),io(()=>{async function c(){let p=kn(),h=ui();KS();let y=US();t.initializeConnectorManager({walletConnectCloudProjectId:W.walletConnectCloudProjectId,rpcConfig:W.rpcConfig,chains:W.chains,defaultChain:W.defaultChain,store:y,walletList:W.appearance.walletList,shouldEnforceDefaultChainOnConnect:W.shouldEnforceDefaultChainOnConnect,externalWalletConfig:W.externalWallets,appName:W.name??"Privy"});let E;t.connectors?.on("connectorInitialized",()=>{E&&clearTimeout(E);let K=t.connectors.walletConnectors.length,ee=t.connectors.walletConnectors.reduce((ue,Be)=>ue+(Be.initialized?1:0),0);ee===K?Xt(!0):E=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:ee,expected:K}),Xt(!0)},1500)}),t.connectors?.initialize().then(()=>{Io()});let N=await t.getAuthenticatedUser(),V=!!N;if(W.customAuth?.enabled||(l(!!N),N&&D(I,"login","onComplete",N,!1,!0,null,null),d(N)),p){B.current=V?"link":"login";return}if(h&&!V){B.current="login",rt("TELEGRAM_AUTH_SCREEN");return}ne.setReadyToTrue(!!N)}!n&&z&&c()},[t,pe,n,z]),io(()=>{if(!n)return;if(!s){Je(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){Je(!0);return}let p=!!m.find(h=>h.walletClientType==="privy");Je(p)},[n,s,m]);let kn=()=>{let c=Da();if(c.inProgress&&c.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if(c.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode});return}let p="privy:";function h(y){return y.startsWith(p)}return c.inProgress&&h(c.provider)&&!c.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode}),window.close()),!c.inProgress||c.headless?!1:(t.startAuthFlow(new po(c)),rt("AWAITING_OAUTH_SCREEN"),!0)},ui=()=>{let c=Sf();if(!c||!W.loginMethods.telegram||!W.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Pi;return t.startAuthFlow(p),c.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:c.id,first_name:c.first_name,last_name:c.last_name,auth_date:c.auth_date,username:c.username,photo_url:c.photo_url,hash:c.hash}),c.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:c.query_id,user:c.user,auth_date:c.auth_date,hash:c.hash,chat_instance:c.chat_instance,chat_type:c.chat_type,start_param:c.start_param}),!0},Fs=async(c,p,h,y)=>{let E=await t.connectors?.createWalletConnector(c,p)||null;qr(E,p,h,y)};async function qr(c,p,h,y){if(c)M({status:"disconnected",connectedWallet:null,connectError:null,connector:c,connectRetry:dt});else return M({status:"disconnected",connectedWallet:null,connectError:new ke("Unable to connect to wallet."),connector:null,connectRetry:dt}),y?.(null,h);c instanceof Qr&&p&&await c.resetConnection(p),M({connector:c,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>qr(c,p,h,y)});try{let E=await c.connect({showPrompt:!0});if(W.shouldEnforceDefaultChainOnConnect&&!W.chains.find(N=>N.id===Number(E?.chainId.replace("eip155:","")))&&!(E?.connectorType==="wallet_connect_v2"&&E?.walletClientType==="metamask")){M(N=>({...N,connector:c,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:dt}));try{await E?.switchChain(W.defaultChain.id),E&&(E.chainId=hi(_n(W.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${W.defaultChain.id}`)}}return M(N=>({...N,status:"connected",connectedWallet:E,connectError:null,connectRetry:dt})),E&&D(I,"connectWallet","onSuccess",E),y?.(E,h)}catch(E){return E instanceof Jt?(console.warn(E.cause?E.cause:E.message),D(I,"connectWallet","onError",E.privyErrorCode||"generic_connect_wallet_error")):(console.warn(E),D(I,"connectWallet","onError","unknown_connect_wallet_error")),M(N=>({...N,status:"disconnected",connectedWallet:null,connectError:E})),y?.(null,h)}}let wt=async(c,p)=>{if(c===null)return;let h=new No(c,t,p);t.startAuthFlow(h)},Io=()=>{let c=new URLSearchParams(window.location.search),p=c.get("privy_connector"),h=c.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!Ko()&&rt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");se("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),Fs(p,h,void 0,wt)};io(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(d)},[n,a,s,t]);let xe=c=>{if(!a)throw D(I,"linkAccount","onError","must_be_authenticated",{linkMethod:c}),new w("User must be authenticated before linking an account.")},Dt=()=>{xe("siwe"),F.current="siwe",B.current="link",se("LINK_WALLET_SCREEN")},zr=c=>{if(!a||!s)return!1;if(c.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===c.address&&p.walletClientType!=="privy")return!0;return!1},ba=async c=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(c.connectorType,c.walletClientType)||null;if(M(h=>({...h,connector:p,status:"connected",connectedWallet:c,connectError:null,connectRetry:dt})),W.captchaEnabled&&!a){let h={callback:y=>wt(c,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};oe({captchaModalData:h}),rt("CAPTCHA_SCREEN")}else await wt(c),rt("AWAITING_CONNECTION")},Ea=async(c,p)=>{let{signedUrl:h,externalTransactionId:y}=await yg(t,c,p??{},W.appearance.palette,W.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:y}},ao=()=>{f(c=>{let p=t.connectors?.wallets.map(h=>({...h,linked:zr(h),loginOrLink:async()=>{if(!await h.isConnected())throw new w("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");ba(h)},fund:async y=>{await ne.fundWallet(h.address,y)},unlink:async()=>{if(!a)throw new w("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let y=await t.unlinkWallet(h.address);d(y)}}))||[];return Sl(c,p)?c:p})};io(()=>{ao()},[s?.linkedAccounts,a,n]),io(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");ao(),t.connectors.on("walletsUpdated",ao)}},[n]);let Qe=c=>{if(c&&"suggestedAddress"in c&&c.suggestedAddress){let p=_o(c.suggestedAddress);Q(p)}se(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};io(()=>{if(!m[0])return;let c=m[0],p=v.current.find(y=>y.address===c.address),h;if(c.walletClientType==="privy"?h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address&&y.walletClientType==="privy"):h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address&&y.walletClientType!=="privy"),!p&&h){let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},d(y)}v.current=m},[m]);let Ta=async(c,p)=>{if(be(c))throw D(I,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[y,E]=await Promise.all([ne.initializeWalletProxy(p),Ee()]);if(!y&&W.customAuth?.enabled)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!y||!E||W.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((N,V)=>{re(!0),oe({createWallet:{onSuccess:ee=>{D(I,"createWallet","onSuccess",ee),N(ee)},onFailure:ee=>{D(I,"createWallet","onError","unknown_embedded_wallet_error"),V(ee)},callAuthOnSuccessOnClose:!1}}),se("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await y.create({accessToken:E});let N=await ne.refreshUser(),V=be(N);if(!V)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return D(I,"createWallet","onSuccess",V),V}},W0=c=>{if(!W.chains.map(p=>p.id).includes(c))throw new ke(`Chain ID ${c} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},bu=(c,p,h)=>new Promise(async(y,E)=>{let{requesterAppId:N}=p||{};if(!a||!s){D(I,"sendTransaction","onError","must_be_authenticated"),E(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=c.from,K=V?s?.linkedAccounts.find(je=>je.type==="wallet"&&je.walletClientType==="privy"&&_o(je.address)===_o(V)):be(s);if(!K){D(I,"sendTransaction","onError","embedded_wallet_not_found"),E(new Error("Must have a Privy wallet before signing"));return}re(!0);let ee=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,ue=c.chainId?Number(c.chainId):ee.chainId;W0(ue);let Be=Object.assign({},c,{chainId:ue}),ot=async()=>{let je=await Ee();if(!je||!L){D(I,"sendTransaction","onError","embedded_wallet_not_found"),E(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ne.recoverEmbeddedEthereumWallet()){D(I,"sendTransaction","onError","unknown_connect_wallet_error"),E(new Error("Unable to connect to wallet"));return}let fi=_r(Be.chainId,W.chains,W.rpcConfig,{appId:e.appId}),so=await qS(K.address,Be,fi);if(W.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:N0}=await GS(so,fi),{hasSufficientFunds:O0}=await vd(K.address,so,N0,fi);if(!O0)throw new Et(new Ir("Wallet has insufficient funds for this transaction.",VS.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Au=await gd(je,K.address,L,so,fi,N);D(I,"sendTransaction","onSuccess",Au),y(Au)}catch(Hs){D(I,"sendTransaction","onError","transaction_failure"),E(Hs)}};if(W.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),ot();else{let je={transactionRequest:Be,onSuccess:so=>{D(I,"sendTransaction","onSuccess",so),y(so)},onFailure:so=>{D(I,"sendTransaction","onError","transaction_failure"),E(so)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:N},Hs={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:so=>{D(I,"sendTransaction","onError","unknown_connect_wallet_error"),E(so)}},fi=Tu({address:K.address,fundWalletConfig:h,chainIdOverride:Be.chainId,comingFromSendTransactionScreen:!0});oe({connectWallet:Hs,sendTransaction:je,funding:fi}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Eu(){return new Promise(async(c,p)=>{let h=await Ee();if(!h||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:h}),c()}catch(y){p(y)}})}let Us=c=>c?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],Zt=c=>{let p=s?.linkedAccounts.filter(E=>E.type===c).length??0,{displayName:h,loginMethod:y}=hn(c);if(c==="passkey"&&p>=5||c!=="passkey"&&p>=1)throw D(I,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:y}),new w(`User already has an account of type ${h} linked.`)},Tu=({address:c,fundWalletConfig:p,methodScreen:h,chainIdOverride:y=null,comingFromSendTransactionScreen:E=!1})=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)return;let N=hs(p)&&p.chain?p.chain.id:v0(W.fundingConfig.defaultRecommendedCurrency.chain),V=hs(p)&&"asset"in p?p.asset.erc20:void 0,K=hs(p)&&p.chain?p.chain:W.chains.find(ue=>ue.id===N);if(y&&W.chains.find(ue=>ue.id===y)&&(K=W.chains.find(ue=>ue.id===y)),!K)throw new w("Funding chain is not in PrivyProvider chains list");let ee=hs(p)&&p.amount?p.amount:W.fundingConfig.defaultRecommendedAmount;return{address:c,amount:ee,chain:K,tokenAddress:V,methodScreen:h,comingFromSendTransactionScreen:E,...hg(p)?{moonpayConfigOverride:p.config}:{}}};async function Su({showAutomaticRecovery:c=!1,legacySetWalletPasswordFlow:p=!1}){R(null);let h=p?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw D(I,h,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let y=be(s);if(!y||!L)throw D(I,h,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(Un(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Eu()}catch(N){throw D(I,h,"onError","missing_or_invalid_mfa"),N}return new Promise((N,V)=>{re(!0);let K={onSuccess:ot=>{D(I,h,"onSuccess","user-passcode",ot),N(ot)},onFailure:ot=>{D(I,h,"onError","user_exited_set_password_flow"),V(ot)},callAuthOnSuccessOnClose:!1},ee=y.recoveryMethod==="user-passcode",Be={onCompleteNavigateTo:nc({walletAction:"update",availableRecoveryMethods:W.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:ee,showAutomaticRecovery:c}),shouldForceMFA:!1,onFailure:ot=>{D(I,h,"onError","unknown_connect_wallet_error"),V(ot)}};oe({setWalletPassword:K,createWallet:K,connectWallet:Be,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:ee}}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Bs({appId:c}){xe(`privy:${c}`),F.current=`privy:${c}`,B.current="link";let p=window.open(void 0,void 0,ms({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:c}}),new Promise(async(h,y)=>{let{name:E,logoUrl:N}=await _c({api:t.api,providerAppId:c,requesterAppId:W.id});oe({crossAppAuth:{appId:c,name:E,logoUrl:N,popup:p,onSuccess:h,onError:y}}),rt("CROSS_APP_AUTH_SCREEN")})}let mi={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Qe,importWallet:async({privateKey:c})=>{xe("siwe");let[p,h]=await Promise.all([ne.initializeWalletProxy(15e3),Ee()]);if(p&&h){await p.import({privateKey:c,accessToken:h});let y=await ne.refreshUser(),E=Tl(y);if(!E)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return D(I,"createWallet","onSuccess",E),E}else throw new w("User is not authenticated")},linkWallet:Dt,linkCrossAppAccount:Bs,linkEmail:()=>{xe("email"),Zt("email"),F.current="email",B.current="link",se("LINK_EMAIL_SCREEN")},linkPhone:()=>{xe("sms"),Zt("phone"),F.current="sms",B.current="link",se("LINK_PHONE_SCREEN")},linkGoogle:async()=>{xe("google"),Zt("google_oauth"),B.current="link",await ne.initLoginWithOAuth("google")},linkTwitter:async()=>{xe("twitter"),Zt("twitter_oauth"),B.current="link",await ne.initLoginWithOAuth("twitter")},linkDiscord:async()=>{xe("discord"),Zt("discord_oauth"),B.current="link",await ne.initLoginWithOAuth("discord")},linkGithub:async()=>{xe("github"),Zt("github_oauth"),B.current="link",await ne.initLoginWithOAuth("github")},linkSpotify:async()=>{xe("spotify"),Zt("spotify_oauth"),B.current="link",await ne.initLoginWithOAuth("spotify")},linkInstagram:async()=>{xe("instagram"),Zt("instagram_oauth"),B.current="link",await ne.initLoginWithOAuth("instagram")},linkTiktok:async()=>{xe("tiktok"),Zt("tiktok_oauth"),B.current="link",await ne.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{xe("linkedin"),Zt("linkedin_oauth"),B.current="link",await ne.initLoginWithOAuth("linkedin")},linkApple:async()=>{xe("apple"),Zt("apple_oauth"),B.current="link",await ne.initLoginWithOAuth("apple")},linkPasskey:async()=>{xe("passkey"),Zt("passkey"),await ne.initLinkWithPasskey(),se("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{xe("telegram"),Zt("telegram"),B.current="link",F.current="telegram",await ne.initLoginWithTelegram(),se("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{xe("farcaster"),Zt("farcaster"),await ne.initLoginWithFarcaster(),B.current="link",F.current="farcaster",se("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(xe("email"),!s?.email)throw new w("User does not have an email linked to their account.");B.current="link",F.current="email",se("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(xe("sms"),!s?.phone)throw new w("User does not have a phone number linked to their account.");B.current="link",F.current="sms",se("UPDATE_PHONE_SCREEN")},login:async c=>{c&&"target"in c&&c&&(c=void 0);let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let h=await new Promise(y=>{Ce(E=>y.bind(E))});if(Ce(null),h){console.warn(p);return}}if(s&&!s.isGuest){console.warn(p);return}B.current="login",oe({login:c}),rt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(c=>{Ce(()=>c)}),Ce(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}rt("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),R(null),await t.logout(),s&&L)try{await L.clearMfa({userId:s.id})}catch{}d(null),l(!1),D(I,"logout","onSuccess"),B.current=null,F.current=null,o(!1),j.del(ka),j.del(Xs(W.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Xe;let c=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new Xe:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new wu(new mo(new Xe));let c=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new wu(new mo(new Xe)):new wu(new mo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Zo(new Xe);let c=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new Zo(new Xe):new Zo(p.proxyProvider)},unlinkWallet:async c=>{let p=await t.unlinkWallet(c);return d(p),p},unlinkEmail:async c=>{let p=await t.unlinkEmail(c);return d(p),p},unlinkPhone:async c=>{let p=await t.unlinkPhone(c);return d(p),p},unlinkGoogle:async c=>{let p=await t.unlinkOAuth("google",c);return d(p),p},unlinkTwitter:async c=>{let p=await t.unlinkOAuth("twitter",c);return d(p),p},unlinkDiscord:async c=>{let p=await t.unlinkOAuth("discord",c);return d(p),p},unlinkGithub:async c=>{let p=await t.unlinkOAuth("github",c);return d(p),p},unlinkSpotify:async c=>{let p=await t.unlinkOAuth("spotify",c);return d(p),p},unlinkInstagram:async c=>{let p=await t.unlinkOAuth("instagram",c);return d(p),p},unlinkTiktok:async c=>{let p=await t.unlinkOAuth("tiktok",c);return d(p),p},unlinkLinkedIn:async c=>{let p=await t.unlinkOAuth("linkedin",c);return d(p),p},unlinkApple:async c=>{let p=await t.unlinkOAuth("apple",c);return d(p),p},unlinkFarcaster:async c=>{let p=await t.unlinkFarcaster(c);return d(p),p},unlinkTelegram:async c=>{let p=await t.unlinkTelegram(c);return d(p),p},unlinkPasskey:async c=>{let p=await t.unlinkPasskey(c);return d(p),p},unlinkCrossAppAccount:async({subject:c})=>{let p=s?.linkedAccounts.find(y=>y.type==="cross_app"&&y.subject===c)?.providerApp;if(!p)throw new w("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,c);return d(h),h},setActiveWallet:async c=>{let p=m.find(y=>_o(y.address)===_o(c)),h=s?.linkedAccounts.find(y=>y.type==="wallet"&&_o(y.address)===_o(c));if(!p||!await p.isConnected())Q(c),Dt();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},d(y)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw D(I,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ta(s,15e3)},setWalletRecovery:async c=>Su({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:c?.showAutomaticRecovery??!1}),setWalletPassword:async()=>Su({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(c,p,h)=>new Promise(async(y,E)=>{let{requesterAppId:N}=p||{};if(!a||!s){D(I,"signMessage","onError","must_be_authenticated"),E(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=h?s?.linkedAccounts.find(ee=>ee.type==="wallet"&&ee.walletClientType==="privy"&&_o(ee.address)===_o(h)):be(s);if(!V){D(I,"signMessage","onError","embedded_wallet_not_found"),E(new Error("Must have a Privy wallet before signing"));return}if(typeof c!="string"||c.length<1){D(I,"signMessage","onError","invalid_message"),E(new Error("Message must be a non-empty string"));return}re(!0);let K=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ee=await Ee();if(!L||!ee)throw new Error("Unable to connect to wallet");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:V.address,requesterAppId:N}});let{response:Be}=await L.rpc({accessToken:ee,address:V.address,requesterAppId:N,request:{method:"personal_sign",params:[c,V.address]}}),ot=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:V.address,requesterAppId:N}}),ot};if(W.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ee=await K();D(I,"signMessage","onSuccess",ee),y(ee)}catch(ee){D(I,"signMessage","onError","unable_to_sign"),E(ee??new Et("Unable to sign message"))}}else{let Be={method:"personal_sign",data:c,confirmAndSign:K,onSuccess:je=>{D(I,"signMessage","onSuccess",je),y(je)},onFailure:je=>{D(I,"signMessage","onError","unable_to_sign"),E(je)},uiOptions:p||{}},ot={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:je=>{D(I,"signMessage","onError","unknown_connect_wallet_error"),E(je)},address:V.address};oe({signMessage:Be,connectWallet:ot}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(c,p)=>new Promise(async(h,y)=>{let{requesterAppId:E}=p||{};if(!a||!s){D(I,"signTypedData","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let N=be(s);if(!N){D(I,"signTypedData","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}re(!0);let V=Pa(c),K=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ee=await Ee();if(!L||!ee)throw new Error("Unable to connect to wallet");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:N.address,requesterAppId:E}});let{response:Be}=await L.rpc({accessToken:ee,address:N.address,requesterAppId:E,request:{method:"eth_signTypedData_v4",params:[N.address,V]}}),ot=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:N.address,requesterAppId:E}}),ot};if(W.embeddedWallets.noPromptOnSignature||(W.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ee=await K();D(I,"signTypedData","onSuccess",ee),h(ee)}catch(ee){D(I,"signTypedData","onError","unable_to_sign"),y(ee??new Et("Unable to sign message"))}}else{let Be={method:"eth_signTypedData_v4",data:V,confirmAndSign:K,onSuccess:je=>{D(I,"signTypedData","onSuccess",je),h(je)},onFailure:je=>{D(I,"signTypedData","onError","unable_to_sign"),y(je)},uiOptions:p||{}},ot={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:je=>{D(I,"signMessage","onError","unknown_connect_wallet_error"),y(je)}};oe({signMessage:Be,connectWallet:ot}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(c,p,h)=>{let E=await(await bu(c,p,h)).wait();return Cd(E)},exportWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}c&&"target"in c&&c&&(c=void 0);let y=c?.address,E=s.linkedAccounts.filter(ue=>ue.type==="wallet"&&ue.walletClientType==="privy"&&ue.chainType==="ethereum"),N=y?E.find(ue=>ue.address===_o(y)):E.find(ue=>!ue.imported)||E[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}re(!0);let V={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:h,address:N.address,shouldForceMFA:!0};if(oe(Z),!await Ee()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}let ee={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};oe({keyExport:ee,connectWallet:V}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Eu,async init(c){switch(c){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${c}`)}},async submit(c,p){switch(c){case"totp":case"sms":if(typeof p!="string")throw new w("Invalid MFA code");mr.current?.resolve({mfaMethod:c,mfaCode:p,relyingParty:window.origin}),await new Promise((N,V)=>{Ct.current={resolve:N,reject:V}});break;case"passkey":if(typeof p=="string")throw new w("Invalid authenticator response");let y=await(await import("@simplewebauthn/browser")).startAuthentication(p),E=w0(y);mr.current?.resolve({mfaMethod:c,mfaCode:E,relyingParty:window.origin}),await new Promise((N,V)=>{Ct.current={resolve:N,reject:V}});break;default:throw mr.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${c}`)}},cancel(){mr.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(c){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber})},enrollInMfa(c){return new Promise((p,h)=>{if(!c){ne.closePrivyModal(),p();return}W.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),oe({mfaEnrollmentFlow:{mfaMethods:W.mfa.methods,onSuccess:p,onFailure:h}}),se("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let c=await Ee();if(!c||!L)throw new Error("Must have valid access token to enroll in MFA");let p=await L.initEnrollMfa({method:"totp",accessToken:c});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(c){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async submitEnrollmentWithTotp(c){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:p,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:c}){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:c});let h=await t.getAuthenticatedUser();d(h)},async unenroll(c){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to remove MFA");c==="passkey"?await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await L.unenrollMfa({method:c,accessToken:p});let h=await t.getAuthenticatedUser();d(h)},requestFarcasterSignerFromWarpcast:async()=>{let c=await Ee(),p=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let y=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:c,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(y.status==="approved"){let E=await t.getAuthenticatedUser();d(E||s||null)}oe({farcasterSigner:y}),se("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let c=await Ee(),p=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(E=>Uint8Array.from(E.match(/.{1,2}/g).map(N=>parseInt(N,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async c=>{let p=await Ee(),h=s?.linkedAccounts.find(V=>V.type==="wallet"&&V.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let E=await import("@simplewebauthn/browser"),N=await L.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:E.bufferToBase64URLString(c)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(E.base64URLStringToBuffer(N.signature))},createGuestAccount:async()=>{if(s&&!s.isGuest)throw new Error("User cannot already be authenticated to create a guest account");return s?.isGuest?s:ne.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:S,loginWithCode(c){return ne.loginWithCode(c)},initLoginWithEmail(c){return ne.initLoginWithEmail(c)},initLoginWithSms(c){return ne.initLoginWithSms(c)},otpState:O,fundWallet(c,p){return ne.fundWallet(c,p)},initLoginWithHeadlessOAuth(c,p){return ne.initLoginWithHeadlessOAuth(c,p)},loginWithHeadlessOAuth(c){return ne.loginWithHeadlessOAuth(c)},generateSiweMessage({address:c,chainId:p}){return ne.generateSiweMessage({address:c,chainId:p})},linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E}){return xe("siwe"),ne.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E})},signMessageWithCrossAppWallet(c,{address:p}){return Mc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"personal_sign",params:[c,p]},reconnect:Bs})},signTypedDataWithCrossAppWallet(c,{address:p}){let h=Pa(c);return Mc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:Bs})},sendTransactionWithCrossAppWallet(c,{address:p}){return Mc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_sendTransaction",params:[c]},reconnect:Bs})},isModalOpen:r,mfaMethods:W.mfa.methods};E0=mi.signMessage,T0=mi.signTypedData,S0=async(...c)=>{let p=await bu(...c);return W.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let ne=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:Y,pendingTransaction:null,walletConnectionStatus:k,connectors:t.connectors?.walletConnectors??[],rpcConfig:W.rpcConfig,chains:W.chains,appId:e.appId,showFiatPrices:W.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:c=>W.chains.find(p=>p.id===Number(c))?.nativeCurrency.symbol,initializeWalletProxy:async c=>{if(L)return L;let p=new Promise(E=>{Te(()=>N=>E(N))}),h=new Promise(E=>setTimeout(()=>E(null),c)),y=await Promise.race([p,h]);return Te(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(c={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;p&&F.current&&(h=Us(s)),B.current==="login"?c.shouldCallAuthOnSuccess&&p&&F.current?(D(I,"login","onComplete",s,g,!1,F.current,h??null),e.onSuccess?.(s,g)):D(I,"login","onError","exited_auth_flow"):B.current==="link"&&h&&(c.isSuccess&&p&&F.current?D(I,"linkAccount","onSuccess",s,F.current,h):F.current&&D(I,"linkAccount","onError","exited_link_flow",{linkMethod:F.current}));let y=T&&lu.includes(T),E=T==="ERROR_SCREEN"&&Z.errorModalData&&lu.includes(Z.errorModalData.previousScreen);if((y||E)&&Z.funding){let N=b3[T]??null,V=_r(Z.funding.chain.id,W.chains,W.rpcConfig,{appId:e.appId}),K;try{K=(await V.getBalance(Z.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}D(I,"fundWallet","onUserExited",{address:Z.funding.address,chain:Z.funding.chain,fundingMethod:N,balance:K})}Q(null),B.current=null,F.current=null,b(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:c})=>new Promise(async(p,h)=>{let y=async()=>{let E=await t.getAccessToken();if(!E)throw new Error("User must be authenticated to use their embedded wallet.");if(!u)throw new Error("User must have an embedded Solana wallet to sign messages for Solana.");let N=ne.walletProxy??await ne.initializeWalletProxy(15e3);if(!N)throw new Error("Failed to initialize embedded wallet proxy.");let{response:V}=await N.rpcSolana({accessToken:E,publicKey:u.address,request:{method:"signMessage",params:{message:c}}});return V.data.signature};if(W.embeddedWallets.noPromptOnSignature)try{let E=await y();p({signature:E})}catch(E){h(E)}else oe({signMessage:{method:"solana_signMessage",data:c,confirmAndSign:y,onSuccess:K=>{p({signature:K})},onFailure:K=>{h(K)},uiOptions:{}}}),rt("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:se,connectWallet:qr,initLoginWithWallet:async(c,p)=>{F.current="siwe",wt(c,p)},loginWithWallet:async()=>{if(!n)throw new Rn;if(!(t.authFlow instanceof No))throw new w("Must initialize SIWE flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),F.current="siwe"}catch(y){throw D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),F.current="siwe"}catch(y){throw D(I,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}d(p||s||null),b(h||!1),l(!0)},initLoginWithFarcaster:async c=>{let p=new Wa(c);t.startAuthFlow(p);try{F.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw B.current==="login"?D(I,"login","onError",h.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new Rn;if(!(t.authFlow instanceof Wa))throw new w("Must initialize Farcaster flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),F.current="farcaster"}catch(y){throw D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),F.current="farcaster"}catch(y){throw D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||null),b(h||!1),l(!0)},async loginWithGuestAccountFlow(){let c=new Ti(this.appId);t.startAuthFlow(c);try{B.current="login",F.current="guest";let p=await t.authenticate(),{user:h,isNewUser:y}=p;if(y=y||!1,!h)throw new w("Unable to authenticate guest account");if(Ut(h,W.embeddedWallets.createOnLogin))try{await Ta(h,15e3),h=await ne.refreshUser()}catch{d(h),console.warn("Unable to create embedded wallet for guest account")}else d(h);return b(y),l(!0),D(I,"login","onComplete",h,y,!1,"guest",null),h}catch(p){throw D(I,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:c,popup:p}){let h=`privy:${c}`;F.current=h;let{url:y,stateCode:E,codeVerifier:N}=await z1({api:t.api,appId:c});if(!y)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:c}}),new w("No authorization URL returned for cross-app auth.");try{let V=await C0({url:y,popup:p,provider:h}),K=V.stateCode,ee=V.authorizationCode;if(K!==E)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:E??"",returnedStateCode:K??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let ue=await K1({api:Mo.api,appId:c,codeVerifier:N,stateCode:K,authorizationCode:ee});ue&&t.storeProviderAccessToken(c,ue);let Be=await ne.refreshUser();if(!Be)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:c}}),Be}catch(V){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:V.toString(),provider:h}}),V}},async initLoginWithOAuth(c,p){if(F.current=c,Sa()){if(c==="google"&&Gi(window.navigator.userAgent)){rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}c==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),j.del(Ln);let h=new po({provider:c});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&(c==="twitter"&&HS&&(y.url=y.url.replace("x.com","twitter.com")),window.location.assign(y.url))},async initLoginWithTelegram(c){if(!n)throw new Rn;F.current="telegram";let p=new Pi(c);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,y)=>{if(!W.loginConfig.telegramAuthConfiguration)return y(new w("Telegram Auth configuration is not loaded"));if(!window.Telegram)return y(new w("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:W.loginConfig.telegramAuthConfiguration.botId,request_access:!0},E=>E?h(E):y(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Pi))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let c,p;if(B.current==="login")try{let h=await t.authenticate();c=h.user,p=h.isNewUser,F.current="telegram"}catch(h){throw D(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}else if(B.current==="link")try{c=(await t.link()).user,F.current="telegram"}catch(h){throw D(I,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else throw new w("Unknown auth intent");d(c),b(p||!1),l(!0)},async recoveryOAuthFlow(c,p,h){let y,E;function N(V){if(!V)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:c}}),new w("Recovery OAuth failed")}switch(c){case"google-drive":{let{url:V,codeVerifier:K,stateCode:ee}=await up({api:Mo.api,provider:c});N(V);let ue,Be;try{let ot=await Cu({url:V,popup:h,provider:c});if(ue=ot.stateCode,Be=ot.authorizationCode,ue!==ee)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:ee??"",returnedStateCode:ue??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(ot){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:ot.toString(),provider:c}}),new w("Recovery OAuth failed")}[y,E]=await Promise.all([Ee(),Yh({api:Mo.api,provider:c,codeVerifier:K,stateCode:ue,authorizationCode:Be})]);break}case"icloud":{let{url:V}=await up({api:Mo.api,provider:c});N(V);let{ckWebAuthToken:K}=await Cu({url:V,popup:h,provider:c});E=K,y=await Ee();break}}if(!L)throw new w("Cannot connect to wallet proxy");if(!y)throw new w("Unable to authorize user");switch(p){case"recover":let V=Z.recoverWallet?.privyWallet?.address;if(!V)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:V,recoveryMethod:c}}),await L.recover({address:V,accessToken:y,recoveryAccessToken:E,recoveryMethod:c}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:V,recoveryMethod:c}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:y,recoveryAccessToken:E,recoveryMethod:c});let K=await ne.refreshUser(),ee=be(K);if(!ee)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:ee.address}}),D(I,"createWallet","onSuccess",ee);break;case"set-recovery":let ue=be(s);if(!ue)throw D(I,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:ue.address,existingRecoveryMethod:ue.recoveryMethod,targetRecoveryMethod:c}}),await L.setRecovery({address:ue.address,accessToken:y,recoveryAccessToken:E,recoveryMethod:c});let Be=be(await ne.refreshUser());if(!Be)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:ue.address,existingRecoveryMethod:ue.recoveryMethod,targetRecoveryMethod:c}}),D(I,"setWalletRecovery","onSuccess",c,Be);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(c){if(!(t.authFlow instanceof po))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=j.get(In),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:p??"",returnedStateCode:h??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),E,N,V;if(y!==null)try{let K=await t.link();E=K.user,V=K.oAuthTokens,F.current=c}catch(K){throw D(I,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:c}),K}else try{let K=await t.authenticate();E=K.user,N=K.isNewUser,V=K.oAuthTokens,F.current=c}catch(K){throw B.current==="login"?D(I,"login","onError",K.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:c}),K}return d(E),b(N||!1),l(!0),V&&E&&D(I,"oAuthAuthorization","onOAuthTokenGrant",V,{user:E}),V},async initLoginWithPasskey(c){let p=new Fn(c);t.startAuthFlow(p),B.current="login";try{F.current="passkey",await p.initAuthenticationFlow()}catch(h){throw D(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new Rn;if(!(t.authFlow instanceof Fn))throw new w("Must initialize Passkey flow first.");if(F.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c,p;try{F.current="passkey",{user:c,isNewUser:p}=await t.authenticate()}catch(h){throw D(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}d(c),b(p||!1),l(!0)},async initLinkWithPasskey(c){let p=new Fn(c);t.startAuthFlow(p),B.current="link",F.current="passkey";try{await p.initLinkFlow()}catch(h){throw D(I,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new Rn;if(!(t.authFlow instanceof Fn))throw new w("Must initialize Passkey flow first.");if(F.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c;try{F.current="passkey",{user:c}=await t.link()}catch(p){throw D(I,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return d(c||s||null),c},async initLoginWithHeadlessOAuth(c,p){if(Sa()){if(c==="google"&&Gi(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let h=new po({provider:c,headless:!0});p&&h.addCaptchaToken(p);let y=await t.startAuthFlow(h).getAuthorizationUrl();y?.url&&window.location.assign(y.url)},async loginWithHeadlessOAuth(c){P(!0),t.startAuthFlow(new po(c));let p=j.get(In),h=c.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c.provider,storedStateCode:p??"",returnedStateCode:h??""}}),P(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),E,N,V;if(y!==null)try{({user:E,oAuthTokens:V}=await t.link()),F.current=c.provider;let K=Us(E);E&&K&&D(I,"linkAccount","onSuccess",E,F.current,K)}catch(K){throw D(I,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),K}else try{({user:E,isNewUser:N,oAuthTokens:V}=await t.authenticate()),F.current=c.provider;let K=Us(E);E&&K&&(B.current==="login"&&N!==void 0?D(I,"login","onComplete",E,N,!1,F.current,K):B.current==="link"&&D(I,"linkAccount","onSuccess",E,F.current,K))}catch(K){throw B.current==="login"?D(I,"login","onError",K.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),K}return d(E),b(N||!1),l(!0),P(!1),V&&E&&D(I,"oAuthAuthorization","onOAuthTokenGrant",V,{user:E}),E??void 0},initLoginWithEmail:async(c,p)=>{let h=new Yo(c,p);t.startAuthFlow(h);try{F.current="email",await h.sendCodeEmail()}catch(y){throw B.current==="login"?D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),y}},initUpdateEmail:async(c,p,h)=>{let y=new nl(c,p,h);t.startAuthFlow(y),await y.sendCodeEmail()},initUpdatePhone:async(c,p,h)=>{let y=new El(c,p,h);t.startAuthFlow(y),await y.sendSmsCode()},initLoginWithSms:async(c,p)=>{H({status:"sending-code"});let h=new Qo(c,p);t.startAuthFlow(h);try{F.current="sms",await h.sendSmsCode(),H({status:"awaiting-code-input"})}catch(y){throw H({status:"error",error:y}),B.current==="login"?D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),y}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async c=>{if(H({status:"submitting-code"}),!n){let y=new Rn;throw H({status:"error",error:y}),y}if(t.authFlow instanceof Yo)t.authFlow.meta.emailCode=c.trim();else if(t.authFlow instanceof Qo)t.authFlow.meta.smsCode=c.trim();else{let y=new w("Must initialize a passwordless code flow first");throw H({status:"error",error:y}),y}await Ee();let p,h;if(B.current==="link")try{({user:p}=await t.link())}catch(y){throw H({status:"error",error:y}),D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:F.current}),y}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(y){throw H({status:"error",error:y}),D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||s||null),b(h||!1),l(!0),H({status:"done"})},generateSiweMessage:async({address:c,chainId:p,captchaToken:h})=>{B.current="link",F.current="siwe";let y=await t.generateSiweNonce({address:c,captchaToken:h}),E=p.replace("eip155:","");return bl({address:c,chainId:E,nonce:y})},linkWithSiwe:async({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E})=>{let N;try{N=await t.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E}),N=await ne.refreshUser()??N;let V=Us(N);V&&D(I,"linkAccount","onSuccess",N,"siwe",V)}catch(V){throw D(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),B.current=null,F.current=null,V}d(N||s||null),B.current=null,F.current=null},refreshUser:async()=>{let c=await t.getAuthenticatedUser();return d(c),c},walletProxy:L,createAnalyticsEvent:({eventName:c,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:c,payload:p,timestamp:h}),acceptTerms:async()=>{let c=await t.acceptTerms();return d(c),c},getUsdTokenPrice:c=>t.getUsdTokenPrice(c),recoverEmbeddedEthereumWallet:async c=>new Promise(async(p,h)=>{let y=be(c?.user??s)||Tl(c?.user??s),E=await Ee();if(!E||!L||!y){h(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await L.connect({accessToken:E,address:y.address}),p(!0)}catch(N){if(Qn(N)&&y.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:y.address}}),(await L.recover({address:y.address,accessToken:E,recoveryMethod:y.recoveryMethod})).address||h(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:y.address}}),p(!0);else if(Qn(N)&&y.recoveryMethod!=="privy"){oe({recoverWallet:{privyWallet:y,onFailure:h,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:y.recoveryMethod,action:"recover"}});let V=ic(y.recoveryMethod);se(V)}else h(N)}}),embeddedSolanaWallet:u,createEmbeddedSolanaWallet:async()=>{re(!0);let c=await Ee(),p=await ne.refreshUser(),h=Un(p),y=be(p);if(!p||!c)throw new w("User must be logged in to create a Solana wallet");if(h)throw new w("User already has an embedded Solana wallet.");if(y)if(y.recoveryMethod==="privy")await ne.recoverEmbeddedEthereumWallet({user:p});else throw new w("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let E=await ne.initializeWalletProxy(15e3);if(!E)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await E.createSolana({accessToken:c,ethereumAddress:y?.address});let N=await ne.refreshUser(),V=Un(N);if(!V)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:V.address}}),V}catch(N){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",N)}},exportSolanaWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=c?.address,E=s.linkedAccounts.filter(ee=>ee.type==="wallet"&&ee.walletClientType==="privy"&&ee.chainType==="solana"),N=y?E.find(ee=>ee.address.toLowerCase()===y.toLowerCase()):E.find(ee=>!ee.imported)||E[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}if(re(!0),!await Ee()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}await ne.recoverEmbeddedSolanaWallet();let K={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};oe({keyExport:K}),se("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(c,p)=>{let h=Un(s),y=await Ee();if(!y||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await L.connectSolana({accessToken:y,publicKey:h.address}),c(!0)}catch(E){Qn(E)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recoverSolana({publicKey:h.address,accessToken:y})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),c(!0)):p(E)}}),getMoonpaySignedUrl:Ea,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:c=>{i(!0),pe?.(c)},updateWallets:()=>ao(),fundWallet:async(c,p)=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=wd({fundingMethods:W.fundingConfig.methods});oe({funding:Tu({address:c,fundWalletConfig:p,methodScreen:h})}),se(h)},requestFarcasterSignerStatus:async c=>{let p=await Ee(),h=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let y=await t.requestFarcasterSignerStatus(c);if(y.status==="approved"){let E=await t.getAuthenticatedUser();d(E||s||null)}return y},connectCoinbaseSmartWallet:async()=>{W.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let c=t.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||t.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(c)return c.updateConnectionPreference("smartWalletOnly"),qr(c);await Fs("coinbase_wallet","coinbase_smart_wallet")}}))();A0=ne.recoverEmbeddedEthereumWallet,P0=ne.recoverEmbeddedSolanaWallet,x0=ne.solanaSignMessage;let L0=BS(()=>({wallets:m,ready:ut&&qe}),[m,ut,qe]);return kr(Ie.Provider,{value:mi,children:kr(lm.Provider,{value:I,children:kr(fm.Provider,{value:L0,children:kr(qf,{...W,children:b0(im.Provider,{value:ne,children:[kr(dm,{children:b0(Df,{data:Z,setModalData:oe,setInitialScreen:R,initialScreen:T,authenticated:a,open:r,children:[e.children,!W.headless&&W.captchaEnabled&&n&&!a&&kr(qd,{delayedExecution:!1}),kr(t0,{theme:{...W.appearance.palette||{}}}),!W.render.standalone&&kr(gu,{open:r})]})}),_e&&z?kr(h0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:mr,mfaSubmitPromise:Ct,onLoad:X,onLoadFailed:()=>null}):null,W.loginConfig.telegramAuthConfiguration&&kr(Zr,{if:!0,children:kr(u0,{scriptHost:e.apiUrl||Ks,botUsername:W.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};import{useCallback as k0,useEffect as XS}from"react";var ZS=e=>{ze("login",e);let t=Se(),r=Js(),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:n,isHeadlessOAuthLoading:i,ready:a,user:l}=q(),s=k0(async m=>{if(t.enabled&&t.status!=="success")throw new yr(t.error,null,"captcha_failure");return o(m.provider,t.token)},[o,t]),d=k0(async()=>{let m=Da();if(l)return console.warn("Cannot login with OAuth when already logged in"),l;if(!m.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!m.popupFlow)try{return await n(m)}catch(f){throw f}finally{Dn()}},[n]);return XS(()=>{let m=Da();a&&r&&m.inProgress&&m.headless&&!m.popupFlow&&d()},[a,r]),{initOAuth:s,loginWithOAuth:d,loading:i}};import{useCallback as R0}from"react";var JS=()=>{let e=Se(),{initLoginWithEmail:t,loginWithCode:r}=q(),o=R0(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=R0(async({code:i})=>{if(e.enabled&&e.status==="error")throw new yr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as _0}from"react";var jS=()=>{let e=Se(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=q(),n=_0(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=_0(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new yr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};import{useCallback as M0}from"react";var $S=()=>{let e=Se(),{generateSiweMessage:t,linkWithSiwe:r}=q(),o=M0(async({address:i,chainId:a})=>{if(!i||!a)throw new Error("wallet address and chainId required to generate nonce");return t({address:i,chainId:a}).then(l=>l)},[t]),n=M0(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:d})=>{if(e.enabled&&e.status!=="success")throw new yr(e.error,null,"captcha_failure");return r({message:a,signature:i,chainId:l,walletClientType:s,connectorType:d})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};import{useContext as eA}from"react";function tA(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkTelegram:C,linkFarcaster:v}=eA(Ie);return ze("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkFarcaster:v,linkTelegram:C}}import{useContext as rA}from"react";function oA(e){let{connectWallet:t}=rA(Ie);return ze("connectWallet",e),{connectWallet:t}}import{useContext as nA}from"react";function iA(e){let{createWallet:t}=nA(Ie);return ze("createWallet",e),{createWallet:t}}var aA=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r}=_();return{createWallet:r,exportWallet:t,wallets:e?[e]:[]}};var sA=()=>{let{connectCoinbaseSmartWallet:e}=_();return{connectCoinbaseSmartWallet:e}};var lA=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=q();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};import{useContext as cA}from"react";function dA(e){let{sendTransaction:t}=cA(Ie);return ze("sendTransaction",e),{sendTransaction:t}}import{useContext as pA}from"react";function uA(e){let{setWalletPassword:t}=pA(Ie);return ze("setWalletPassword",e),{setWalletPassword:t}}import{useContext as mA}from"react";function fA(){let{createGuestAccount:e}=mA(Ie);return{createGuestAccount:e}}import{useContext as hA}from"react";function yA(e){let{setWalletRecovery:t}=hA(Ie);return ze("setWalletRecovery",e),{setWalletRecovery:t}}import{useContext as gA}from"react";function vA(e){let{signMessage:t}=gA(Ie);return ze("signMessage",e),{signMessage:t}}import{useContext as CA}from"react";function wA(e){let{signTypedData:t}=CA(Ie);return ze("signTypedData",e),{signTypedData:t}}import{useContext as bA}from"react";var EA=()=>{let{isModalOpen:e}=bA(Ie);return{isOpen:e}};import{useContext as TA}from"react";function SA(e){let{getAccessToken:t}=TA(Ie);return ze("accessToken",e),{getAccessToken:t}}function AA(e){let{authenticated:t,user:r}=q(),{initLoginWithOAuth:o}=_(),n=vi();return ze("oAuthAuthorization",e),{reauthorize:i=>PA(t,r,o,n,i.provider)}}var PA=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new w("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new w(`OAuth account of type ${n} not linked to the account.`);await r(n)};var xA=I0;function I0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=q();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function kA(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}export{mo as AsExternalProvider,qd as Captcha,Ha as ConnectorManager,gu as LoginModal,Va as PrivyClient,YS as PrivyProvider,Xe as PrivyProxyProvider,Ld as SUPPORTED_CHAINS,xd as VERSION,tr as WalletConnector,V5 as addRpcUrlOverrideToChain,dp as errorIndicatesMaxMfaRetries,Xn as errorIndicatesMfaTimeout,Zn as errorIndicatesMfaVerificationFailed,Ee as getAccessToken,kA as getEmbeddedConnectedWallet,sA as useConnectCoinbaseSmartWallet,oA as useConnectWallet,iA as useCreateWallet,lA as useCrossAppAccounts,xA as useExperimentalFarcasterSigner,I0 as useFarcasterSigner,U0 as useFundWallet,fA as useGuestAccounts,tA as useLinkAccount,$S as useLinkWithSiwe,D0 as useLogin,JS as useLoginWithEmail,ZS as useLoginWithOAuth,jS as useLoginWithSms,F0 as useLogout,Es as useMfa,ro as useMfaEnrollment,EA as useModalStatus,AA as useOAuthTokens,q as usePrivy,zd as useRegisterMfaListener,dA as useSendTransaction,uA as useSetWalletPassword,yA as useSetWalletRecovery,vA as useSignMessage,wA as useSignTypedData,aA as useSolanaWallets,SA as useToken,Kr as useWallets};
|
|
3265
|
+
`;import{useRef as p0,useEffect as PS}from"react";import{jsx as kS}from"react/jsx-runtime";function xS({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function u0(e){let t=p0(null),r=p0();return PS(()=>{r.current?.remove(),r.current=xS(e),t.current?.after(r.current)},[e]),kS("div",{ref:t,hidden:!0})}import{useState as RS}from"react";import{useEffect as m0,useRef as f0}from"react";var Sd=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;case"privy:solana-wallet:create":return o;case"privy:solana-wallet:connect":return o;case"privy:solana-wallet:recover":return o;case"privy:solana-wallet:rpc":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function kn(e,t,r,o,n,a=!1){let i=a,l=async m=>{if(i&&t&&t.length>0){m===(a?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Ne("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((u,C)=>{r.current={resolve:u,reject:C};let v=1e3*60*5;setTimeout(()=>{let g=new Ne("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),C(g)},v)});return await e(f)}return await e()},s=4,d=null;for(let m=0;m<s;m++)try{d=await l(m),o.current?.resolve(void 0);break}catch(f){if(f.type==="missing_or_invalid_mfa")i=!0;else throw o.current?.resolve(void 0),f}if(d===null){let m=new Ne("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(m),m}return d}import{jsx as NS}from"react/jsx-runtime";var _S=function(e){return()=>`id-${e++}`}(0);function MS(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function gt(e){return e.error!==void 0}var pt=new Sd,vu=new Map,IS=(e,t)=>typeof t=="bigint"?t.toString():t,WS=(e,t)=>`${e}${JSON.stringify(t,IS)}`;function vt(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let a=WS(e,t);if(e==="privy:wallet:create"){let l=vu.get(a);if(l)return l}let i=new Promise((l,s)=>{let d=_S();pt.enqueue(d,{resolve:l,reject:s}),n.postMessage({id:d,event:e,data:t},o)}).finally(()=>{vu.delete(a)});return vu.set(a,i),i}function LS(e){switch(e.event){case"privy:iframe:ready":let t=pt.dequeue(e.event,e.id);return gt(e)?t.reject(new Ne(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=pt.dequeue(e.event,e.id);return gt(e)?r.reject(new Ne(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=pt.dequeue(e.event,e.id);return gt(e)?o.reject(new Ne(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=pt.dequeue(e.event,e.id);return gt(e)?n.reject(new Ne(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let a=pt.dequeue(e.event,e.id);return gt(e)?a.reject(new Ne(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:rpc":let i=pt.dequeue(e.event,e.id);return gt(e)?i.reject(new Ne(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery":let l=pt.dequeue(e.event,e.id);return gt(e)?l.reject(new Ne(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:verify":let s=pt.dequeue(e.event,e.id);return gt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:init-enrollment":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:submit-enrollment":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:unenroll":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:clear":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:init-signer":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:sign":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:solana-wallet:create":let d=pt.dequeue(e.event,e.id);return gt(e)?d.reject(new Ne(e.error.type,e.error.message)):d.resolve(e.data);case"privy:solana-wallet:connect":let m=pt.dequeue(e.event,e.id);return gt(e)?m.reject(new Ne(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=pt.dequeue(e.event,e.id);return gt(e)?f.reject(new Ne(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let u=pt.dequeue(e.event,e.id);return gt(e)?u.reject(new Ne(e.error.type,e.error.message)):u.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function h0(e){let t=f0(null),r=f0(e.mfaMethods),o=wi(),[n,a]=RS(!1);return m0(()=>{r.current=e.mfaMethods},[e.mfaMethods]),m0(()=>{if(!n)return;let i=t.current;if(!i)return;function l(u){u&&u.origin===e.origin&&MS(u.data)&&LS(u.data)}let s={create(u){return vt("privy:wallet:create",u,i,e.origin)},import(u){return vt("privy:wallet:import",u,i,e.origin)},connect(u){return vt("privy:wallet:connect",u,i,e.origin)},recover(u){return kn(C=>vt("privy:wallet:recover",{...u,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!u.recoveryMethod||u.recoveryMethod==="privy")},rpc(u){return kn(C=>vt("privy:wallet:rpc",{...u,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(u){return vt("privy:solana-wallet:create",u,i,e.origin)},connectSolana(u){return vt("privy:solana-wallet:connect",u,i,e.origin)},recoverSolana(u){return vt("privy:solana-wallet:recover",u,i,e.origin)},rpcSolana(u){return vt("privy:solana-wallet:rpc",u,i,e.origin)},setRecovery(u){return kn(C=>vt("privy:wallet:set-recovery",{...u,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return kn(C=>vt("privy:mfa:verify",{...u,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return kn(C=>vt("privy:mfa:init-enrollment",{...u,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return kn(C=>vt("privy:mfa:submit-enrollment",{...u,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(u){return kn(C=>vt("privy:mfa:unenroll",{...u,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(u){return vt("privy:mfa:clear",u,i,e.origin)},initFarcasterSigner(u){return vt("privy:farcaster:init-signer",u,i,e.origin)},signFarcasterMessage(u){return vt("privy:farcaster:sign",u,i,e.origin)}};window.addEventListener("message",l);let d=()=>e.onLoad(s),m=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},f=new AbortController;return Aa(()=>vt("privy:iframe:ready",{},i,e.origin),{abortSignal:f.signal}).then(d,m),()=>{window.removeEventListener("message",l),f.abort()}},[n]),NS("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>a(!0),src:zs(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Ad=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return await g0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await Ee())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await y0())throw new w("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};function v0(e){let r=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(r)return parseInt(r);throw new Error("Chain ID not compatible with CAIP-2 format.")}async function C0({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let i=setTimeout(()=>{n(new w("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",m)}let s,d=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(d),clearTimeout(i),n(new w("User rejected request")))},300);function m(f){f.data&&(f.data.type==="PRIVY_OAUTH_RESPONSE"&&f.data.stateCode&&f.data.authorizationCode&&(clearTimeout(i),o(f.data),l()),f.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(i),n(new w(f.data.error)),l()),f.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=m))}window.addEventListener("message",m)})}var OS="https://cdn.apple-cloudkit.com";async function Cu({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,a)=>{function i(){t?.close(),window.removeEventListener("message",l)}function l(s){s.data&&(s.data.type==="PRIVY_OAUTH_RESPONSE"&&s.data.stateCode&&s.data.authorizationCode&&(n(s.data),i()),s.origin===OS&&s.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:s.data.ckSession}),i()),s.data.type==="PRIVY_OAUTH_ERROR"&&(a(s.data.error),i()))}window.addEventListener("message",l)})}var w0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});import{jsx as kr,jsxs as b0}from"react/jsx-runtime";var Mo;function GS(e){return typeof e=="string"&&e.length===25}function Ee(){if(!Mo){let e=j.get(In);return Promise.resolve(e||null)}return Mo.getAccessToken()}var E0,xf=(e,t,r)=>E0(e,t,r),T0,kf=(e,t)=>T0(e,t),S0,Rf=(e,t)=>S0(e,t),A0,_f=()=>A0(),P0,y0=()=>P0(),x0,g0=({message:e})=>x0({message:e}),qS=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;j.put(xa,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},zS=({config:e,...t})=>{if(typeof window<"u"&&["localhost","127.0.0.1"].indexOf(window.location.hostname)<0&&window.location.protocol!=="https:")throw new w("Embedded wallet is only available over HTTPS");if(!GS(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");Mo||(Mo=new Va({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),kr(nm,{client:Mo,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:kr(KS,{...t,client:Mo})})},KS=e=>{let t=e.client,[r,o]=ct(!1),[n,a]=ct(!1),[i,l]=ct(!1),[s,d]=ct(null),[m,f]=ct([]),[u,C]=ct(null),v=Ea(m),[g,b]=ct(!1),[T,R]=ct(null),[S,P]=ct(!1),[k,M]=ct({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:dt}),[O,H]=ct({status:"initial"}),[Y,X]=ct(null),[L,Z]=ct(null),W=De(),z=Js(),[Re,re]=ct(!0),[Q,oe]=ct({}),[pe,Ce]=ct(null),[de,Ae]=ct(null),[ut,Je]=ct(!1),[le,Yt]=ct(!1),mr=Ea(null),Ct=Ea(null),I=Ea(sm),[qe,Qt]=ct(!1);t.onStoreToken=c=>{c&&D(I,"accessToken","onAccessTokenGranted",c)},t.onDeleteToken=()=>{d(null),l(!1),D(I,"accessToken","onAccessTokenRemoved")};let F=Ea(null),B=Ea(null),se=c=>{R(c),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:c}})},rt=c=>{W.embeddedWallets.createOnLogin!=="off"&&re(!0),se(c)};no(()=>{let c=Bn(s);if(!c||!L){C(null);return}let p={address:c.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Ci,id:"io.privy.solana.wallet"},getProvider:async()=>new Ad(L,c.address)};C(p)},[L,s]),no(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let c=be(s),p=Tl(s);if(c||t.connectors?.removeEmbeddedWalletConnector(),p||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!L){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}c&&t.connectors.addEmbeddedWalletConnector(L,c.address,W.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,W.defaultChain,e.appId)},[L,s]),no(()=>{L&&de?.(L)},[L]),no(()=>{(async()=>{if(!W.customAuth?.enabled)return;re(!0);let{getCustomAccessToken:p,isLoading:h}=W.customAuth;if(!(!n||h))try{let y=await p();if(!y&&i){await hi.logout();return}if(!y||i)return;t.startAuthFlow(new Si(y));let{user:E,isNewUser:N}=await t.authenticate();if(!E){await hi.logout();return}N!==void 0&&D(I,"login","onComplete",E,N,!1,"custom",null),d(E||null),b(N||!1),l(!0),Yt(!0)}catch(y){throw console.warn(y),i&&await hi.logout(),D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}})()},[W.customAuth?.enabled,W.customAuth?.getCustomAccessToken,W.customAuth?.isLoading,n,i]),no(()=>{le&&L&&s&&Ft(s,W.embeddedWallets.createOnLogin)&&(Yt(!1),Ta(s,vi).catch(console.error))},[le&&L&&s]),no(()=>{async function c(){let p=Rn(),h=mi();qS();let y=DS();t.initializeConnectorManager({walletConnectCloudProjectId:W.walletConnectCloudProjectId,rpcConfig:W.rpcConfig,chains:W.chains,defaultChain:W.defaultChain,store:y,walletList:W.appearance.walletList,shouldEnforceDefaultChainOnConnect:W.shouldEnforceDefaultChainOnConnect,externalWalletConfig:W.externalWallets,appName:W.name??"Privy"});let E;t.connectors?.on("connectorInitialized",()=>{E&&clearTimeout(E);let K=t.connectors.walletConnectors.length,ee=t.connectors.walletConnectors.reduce((ue,Be)=>ue+(Be.initialized?1:0),0);ee===K?Qt(!0):E=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:ee,expected:K}),Qt(!0)},1500)}),t.connectors?.initialize().then(()=>{Io()});let N=await t.getAuthenticatedUser(),V=!!N;if(W.customAuth?.enabled||(l(!!N),N&&D(I,"login","onComplete",N,!1,!0,null,null),d(N)),p){B.current=V?"link":"login";return}if(h&&!V){B.current="login",rt("TELEGRAM_AUTH_SCREEN");return}ne.setReadyToTrue(!!N)}!n&&z&&c()},[t,pe,n,z]),no(()=>{if(!n)return;if(!s){Je(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){Je(!0);return}let p=!!m.find(h=>h.walletClientType==="privy");Je(p)},[n,s,m]);let Rn=()=>{let c=Da();if(c.inProgress&&c.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if(c.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode});return}let p="privy:";function h(y){return y.startsWith(p)}return c.inProgress&&h(c.provider)&&!c.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode}),window.close()),!c.inProgress||c.headless?!1:(t.startAuthFlow(new po(c)),rt("AWAITING_OAUTH_SCREEN"),!0)},mi=()=>{let c=Sf();if(!c||!W.loginMethods.telegram||!W.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new ki;return t.startAuthFlow(p),c.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:c.id,first_name:c.first_name,last_name:c.last_name,auth_date:c.auth_date,username:c.username,photo_url:c.photo_url,hash:c.hash}),c.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:c.query_id,user:c.user,auth_date:c.auth_date,hash:c.hash,chat_instance:c.chat_instance,chat_type:c.chat_type,start_param:c.start_param}),!0},Fs=async(c,p,h,y)=>{let E=await t.connectors?.createWalletConnector(c,p)||null;qr(E,p,h,y)};async function qr(c,p,h,y){if(c)M({status:"disconnected",connectedWallet:null,connectError:null,connector:c,connectRetry:dt});else return M({status:"disconnected",connectedWallet:null,connectError:new xe("Unable to connect to wallet."),connector:null,connectRetry:dt}),y?.(null,h);c instanceof Yr&&p&&await c.resetConnection(p),M({connector:c,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>qr(c,p,h,y)});try{let E=await c.connect({showPrompt:!0});if(W.shouldEnforceDefaultChainOnConnect&&!W.chains.find(N=>N.id===Number(E?.chainId.replace("eip155:","")))&&!(E?.connectorType==="wallet_connect_v2"&&E?.walletClientType==="metamask")){M(N=>({...N,connector:c,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:dt}));try{await E?.switchChain(W.defaultChain.id),E&&(E.chainId=gi(Mn(W.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${W.defaultChain.id}`)}}return M(N=>({...N,status:"connected",connectedWallet:E,connectError:null,connectRetry:dt})),E&&D(I,"connectWallet","onSuccess",E),y?.(E,h)}catch(E){return E instanceof Jt?(console.warn(E.cause?E.cause:E.message),D(I,"connectWallet","onError",E.privyErrorCode||"generic_connect_wallet_error")):(console.warn(E),D(I,"connectWallet","onError","unknown_connect_wallet_error")),M(N=>({...N,status:"disconnected",connectedWallet:null,connectError:E})),y?.(null,h)}}let wt=async(c,p)=>{if(c===null)return;let h=new Oo(c,t,p);t.startAuthFlow(h)},Io=()=>{let c=new URLSearchParams(window.location.search),p=c.get("privy_connector"),h=c.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!Yo()&&rt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");se("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),Fs(p,h,void 0,wt)};no(()=>{n&&i&&s===null&&t.getAuthenticatedUser().then(d)},[n,i,s,t]);let _e=c=>{if(!i)throw D(I,"linkAccount","onError","must_be_authenticated",{linkMethod:c}),new w("User must be authenticated before linking an account.")},Wo=()=>{_e("siwe"),F.current="siwe",B.current="link",se("LINK_WALLET_SCREEN")},Xt=c=>{if(!i||!s)return!1;if(c.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===c.address&&p.walletClientType!=="privy")return!0;return!1},io=async c=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(c.connectorType,c.walletClientType)||null;if(M(h=>({...h,connector:p,status:"connected",connectedWallet:c,connectError:null,connectRetry:dt})),W.captchaEnabled&&!i){let h={callback:y=>wt(c,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};oe({captchaModalData:h}),rt("CAPTCHA_SCREEN")}else await wt(c),rt("AWAITING_CONNECTION")},fi=async(c,p)=>{let{signedUrl:h,externalTransactionId:y}=await yg(t,c,p??{},W.appearance.palette,W.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:y}},ao=()=>{f(c=>{let p=t.connectors?.wallets.map(h=>({...h,linked:Xt(h),loginOrLink:async()=>{if(!await h.isConnected())throw new w("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");io(h)},fund:async y=>{await ne.fundWallet(h.address,y)},unlink:async()=>{if(!i)throw new w("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let y=await t.unlinkWallet(h.address);d(y)}}))||[];return Sl(c,p)?c:p})};no(()=>{ao()},[s?.linkedAccounts,i,n]),no(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");ao(),t.connectors.on("walletsUpdated",ao)}},[n]);let Qe=c=>{if(c&&"suggestedAddress"in c&&c.suggestedAddress){let p=_o(c.suggestedAddress);X(p)}se(i?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};no(()=>{if(!m[0])return;let c=m[0],p=v.current.find(y=>y.address===c.address),h;if(c.walletClientType==="privy"?h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address&&y.walletClientType==="privy"):h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address&&y.walletClientType!=="privy"),!p&&h){let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},d(y)}v.current=m},[m]);let Ta=async(c,p)=>{if(be(c))throw D(I,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[y,E]=await Promise.all([ne.initializeWalletProxy(p),Ee()]);if(!y&&W.customAuth?.enabled)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!y||!E||W.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((N,V)=>{re(!0),oe({createWallet:{onSuccess:ee=>{D(I,"createWallet","onSuccess",ee),N(ee)},onFailure:ee=>{D(I,"createWallet","onError","unknown_embedded_wallet_error"),V(ee)},callAuthOnSuccessOnClose:!1}}),se("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await y.create({accessToken:E});let N=await ne.refreshUser(),V=be(N);if(!V)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return D(I,"createWallet","onSuccess",V),V}},W0=c=>{if(!W.chains.map(p=>p.id).includes(c))throw new xe(`Chain ID ${c} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},bu=(c,p,h)=>new Promise(async(y,E)=>{let{requesterAppId:N}=p||{};if(!i||!s){D(I,"sendTransaction","onError","must_be_authenticated"),E(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=c.from,K=V?s?.linkedAccounts.find(je=>je.type==="wallet"&&je.walletClientType==="privy"&&_o(je.address)===_o(V)):be(s);if(!K){D(I,"sendTransaction","onError","embedded_wallet_not_found"),E(new Error("Must have a Privy wallet before signing"));return}re(!0);let ee=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,ue=c.chainId?Number(c.chainId):ee.chainId;W0(ue);let Be=Object.assign({},c,{chainId:ue}),ot=async()=>{let je=await Ee();if(!je||!L){D(I,"sendTransaction","onError","embedded_wallet_not_found"),E(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ne.recoverEmbeddedEthereumWallet()){D(I,"sendTransaction","onError","unknown_connect_wallet_error"),E(new Error("Unable to connect to wallet"));return}let yi=_r(Be.chainId,W.chains,W.rpcConfig,{appId:e.appId}),so=await VS(K.address,Be,yi);if(W.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:N0}=await HS(so,yi),{hasSufficientFunds:O0}=await vd(K.address,so,N0,yi);if(!O0)throw new Et(new Ir("Wallet has insufficient funds for this transaction.",BS.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Au=await gd(je,K.address,L,so,yi,N);D(I,"sendTransaction","onSuccess",Au),y(Au)}catch(Hs){D(I,"sendTransaction","onError","transaction_failure"),E(Hs)}};if(W.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),ot();else{let je={transactionRequest:Be,onSuccess:so=>{D(I,"sendTransaction","onSuccess",so),y(so)},onFailure:so=>{D(I,"sendTransaction","onError","transaction_failure"),E(so)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:N},Hs={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:so=>{D(I,"sendTransaction","onError","unknown_connect_wallet_error"),E(so)}},yi=Tu({address:K.address,fundWalletConfig:h,chainIdOverride:Be.chainId,comingFromSendTransactionScreen:!0});oe({connectWallet:Hs,sendTransaction:je,funding:yi}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Eu(){return new Promise(async(c,p)=>{let h=await Ee();if(!h||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:h}),c()}catch(y){p(y)}})}let Us=c=>c?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],Zt=c=>{let p=s?.linkedAccounts.filter(E=>E.type===c).length??0,{displayName:h,loginMethod:y}=yn(c);if(c==="passkey"&&p>=5||c!=="passkey"&&p>=1)throw D(I,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:y}),new w(`User already has an account of type ${h} linked.`)},Tu=({address:c,fundWalletConfig:p,methodScreen:h,chainIdOverride:y=null,comingFromSendTransactionScreen:E=!1})=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)return;let N=hs(p)&&p.chain?p.chain.id:v0(W.fundingConfig.defaultRecommendedCurrency.chain),V=hs(p)&&"asset"in p?p.asset.erc20:void 0,K=hs(p)&&p.chain?p.chain:W.chains.find(ue=>ue.id===N);if(y&&W.chains.find(ue=>ue.id===y)&&(K=W.chains.find(ue=>ue.id===y)),!K)throw new w("Funding chain is not in PrivyProvider chains list");let ee=hs(p)&&p.amount?p.amount:W.fundingConfig.defaultRecommendedAmount;return{address:c,amount:ee,chain:K,tokenAddress:V,methodScreen:h,comingFromSendTransactionScreen:E,...hg(p)?{moonpayConfigOverride:p.config}:{}}};async function Su({showAutomaticRecovery:c=!1,legacySetWalletPasswordFlow:p=!1}){R(null);let h=p?"setWalletPassword":"setWalletRecovery";if(!i||!s)throw D(I,h,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let y=be(s);if(!y||!L)throw D(I,h,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(Bn(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Eu()}catch(N){throw D(I,h,"onError","missing_or_invalid_mfa"),N}return new Promise((N,V)=>{re(!0);let K={onSuccess:ot=>{D(I,h,"onSuccess","user-passcode",ot),N(ot)},onFailure:ot=>{D(I,h,"onError","user_exited_set_password_flow"),V(ot)},callAuthOnSuccessOnClose:!1},ee=y.recoveryMethod==="user-passcode",Be={onCompleteNavigateTo:nc({walletAction:"update",availableRecoveryMethods:W.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:ee,showAutomaticRecovery:c}),shouldForceMFA:!1,onFailure:ot=>{D(I,h,"onError","unknown_connect_wallet_error"),V(ot)}};oe({setWalletPassword:K,createWallet:K,connectWallet:Be,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:ee}}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Bs({appId:c}){_e(`privy:${c}`),F.current=`privy:${c}`,B.current="link";let p=window.open(void 0,void 0,ms({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:c}}),new Promise(async(h,y)=>{let{name:E,logoUrl:N}=await _c({api:t.api,providerAppId:c,requesterAppId:W.id});oe({crossAppAuth:{appId:c,name:E,logoUrl:N,popup:p,onSuccess:h,onError:y}}),rt("CROSS_APP_AUTH_SCREEN")})}let hi={ready:n,authenticated:i,user:s,walletConnectors:t.connectors||null,connectWallet:Qe,importWallet:async({privateKey:c})=>{_e("siwe");let[p,h]=await Promise.all([ne.initializeWalletProxy(15e3),Ee()]);if(p&&h){await p.import({privateKey:c,accessToken:h});let y=await ne.refreshUser(),E=Tl(y);if(!E)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return D(I,"createWallet","onSuccess",E),E}else throw new w("User is not authenticated")},linkWallet:Wo,linkCrossAppAccount:Bs,linkEmail:()=>{_e("email"),Zt("email"),F.current="email",B.current="link",se("LINK_EMAIL_SCREEN")},linkPhone:()=>{_e("sms"),Zt("phone"),F.current="sms",B.current="link",se("LINK_PHONE_SCREEN")},linkGoogle:async()=>{_e("google"),Zt("google_oauth"),B.current="link",await ne.initLoginWithOAuth("google")},linkTwitter:async()=>{_e("twitter"),Zt("twitter_oauth"),B.current="link",await ne.initLoginWithOAuth("twitter")},linkDiscord:async()=>{_e("discord"),Zt("discord_oauth"),B.current="link",await ne.initLoginWithOAuth("discord")},linkGithub:async()=>{_e("github"),Zt("github_oauth"),B.current="link",await ne.initLoginWithOAuth("github")},linkSpotify:async()=>{_e("spotify"),Zt("spotify_oauth"),B.current="link",await ne.initLoginWithOAuth("spotify")},linkInstagram:async()=>{_e("instagram"),Zt("instagram_oauth"),B.current="link",await ne.initLoginWithOAuth("instagram")},linkTiktok:async()=>{_e("tiktok"),Zt("tiktok_oauth"),B.current="link",await ne.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{_e("linkedin"),Zt("linkedin_oauth"),B.current="link",await ne.initLoginWithOAuth("linkedin")},linkApple:async()=>{_e("apple"),Zt("apple_oauth"),B.current="link",await ne.initLoginWithOAuth("apple")},linkPasskey:async()=>{_e("passkey"),Zt("passkey"),await ne.initLinkWithPasskey(),se("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{_e("telegram"),Zt("telegram"),B.current="link",F.current="telegram",await ne.initLoginWithTelegram(),se("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{_e("farcaster"),Zt("farcaster"),await ne.initLoginWithFarcaster(),B.current="link",F.current="farcaster",se("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(_e("email"),!s?.email)throw new w("User does not have an email linked to their account.");B.current="link",F.current="email",se("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(_e("sms"),!s?.phone)throw new w("User does not have a phone number linked to their account.");B.current="link",F.current="sms",se("UPDATE_PHONE_SCREEN")},login:async c=>{c&&"target"in c&&c&&(c=void 0);let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let h=await new Promise(y=>{Ce(E=>y.bind(E))});if(Ce(null),h){console.warn(p);return}}if(s&&!s.isGuest){console.warn(p);return}B.current="login",oe({login:c}),rt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(c=>{Ce(()=>c)}),Ce(null)),i){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}rt("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),R(null),await t.logout(),s&&L)try{await L.clearMfa({userId:s.id})}catch{}d(null),l(!1),D(I,"logout","onSuccess"),B.current=null,F.current=null,o(!1),j.del(ka),j.del(Xs(W.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Xe;let c=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new Xe:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new wu(new mo(new Xe));let c=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new wu(new mo(new Xe)):new wu(new mo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Jo(new Xe);let c=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new Jo(new Xe):new Jo(p.proxyProvider)},unlinkWallet:async c=>{let p=await t.unlinkWallet(c);return d(p),p},unlinkEmail:async c=>{let p=await t.unlinkEmail(c);return d(p),p},unlinkPhone:async c=>{let p=await t.unlinkPhone(c);return d(p),p},unlinkGoogle:async c=>{let p=await t.unlinkOAuth("google",c);return d(p),p},unlinkTwitter:async c=>{let p=await t.unlinkOAuth("twitter",c);return d(p),p},unlinkDiscord:async c=>{let p=await t.unlinkOAuth("discord",c);return d(p),p},unlinkGithub:async c=>{let p=await t.unlinkOAuth("github",c);return d(p),p},unlinkSpotify:async c=>{let p=await t.unlinkOAuth("spotify",c);return d(p),p},unlinkInstagram:async c=>{let p=await t.unlinkOAuth("instagram",c);return d(p),p},unlinkTiktok:async c=>{let p=await t.unlinkOAuth("tiktok",c);return d(p),p},unlinkLinkedIn:async c=>{let p=await t.unlinkOAuth("linkedin",c);return d(p),p},unlinkApple:async c=>{let p=await t.unlinkOAuth("apple",c);return d(p),p},unlinkFarcaster:async c=>{let p=await t.unlinkFarcaster(c);return d(p),p},unlinkTelegram:async c=>{let p=await t.unlinkTelegram(c);return d(p),p},unlinkPasskey:async c=>{let p=await t.unlinkPasskey(c);return d(p),p},unlinkCrossAppAccount:async({subject:c})=>{let p=s?.linkedAccounts.find(y=>y.type==="cross_app"&&y.subject===c)?.providerApp;if(!p)throw new w("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,c);return d(h),h},setActiveWallet:async c=>{let p=m.find(y=>_o(y.address)===_o(c)),h=s?.linkedAccounts.find(y=>y.type==="wallet"&&_o(y.address)===_o(c));if(!p||!await p.isConnected())X(c),Wo();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},d(y)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!i||!s)throw D(I,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ta(s,15e3)},setWalletRecovery:async c=>Su({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:c?.showAutomaticRecovery??!1}),setWalletPassword:async()=>Su({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(c,p,h)=>new Promise(async(y,E)=>{let{requesterAppId:N}=p||{};if(!i||!s){D(I,"signMessage","onError","must_be_authenticated"),E(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=h?s?.linkedAccounts.find(ee=>ee.type==="wallet"&&ee.walletClientType==="privy"&&_o(ee.address)===_o(h)):be(s);if(!V){D(I,"signMessage","onError","embedded_wallet_not_found"),E(new Error("Must have a Privy wallet before signing"));return}if(typeof c!="string"||c.length<1){D(I,"signMessage","onError","invalid_message"),E(new Error("Message must be a non-empty string"));return}re(!0);let K=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let ee=await Ee();if(!L||!ee)throw new Error("Unable to connect to wallet");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:V.address,requesterAppId:N}});let{response:Be}=await L.rpc({accessToken:ee,address:V.address,requesterAppId:N,request:{method:"personal_sign",params:[c,V.address]}}),ot=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:V.address,requesterAppId:N}}),ot};if(W.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ee=await K();D(I,"signMessage","onSuccess",ee),y(ee)}catch(ee){D(I,"signMessage","onError","unable_to_sign"),E(ee??new Et("Unable to sign message"))}}else{let Be={method:"personal_sign",data:c,confirmAndSign:K,onSuccess:je=>{D(I,"signMessage","onSuccess",je),y(je)},onFailure:je=>{D(I,"signMessage","onError","unable_to_sign"),E(je)},uiOptions:p||{}},ot={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:je=>{D(I,"signMessage","onError","unknown_connect_wallet_error"),E(je)},address:V.address};oe({signMessage:Be,connectWallet:ot}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(c,p)=>new Promise(async(h,y)=>{let{requesterAppId:E}=p||{};if(!i||!s){D(I,"signTypedData","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let N=be(s);if(!N){D(I,"signTypedData","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}re(!0);let V=Pa(c),K=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let ee=await Ee();if(!L||!ee)throw new Error("Unable to connect to wallet");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:N.address,requesterAppId:E}});let{response:Be}=await L.rpc({accessToken:ee,address:N.address,requesterAppId:E,request:{method:"eth_signTypedData_v4",params:[N.address,V]}}),ot=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:N.address,requesterAppId:E}}),ot};if(W.embeddedWallets.noPromptOnSignature||(W.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ee=await K();D(I,"signTypedData","onSuccess",ee),h(ee)}catch(ee){D(I,"signTypedData","onError","unable_to_sign"),y(ee??new Et("Unable to sign message"))}}else{let Be={method:"eth_signTypedData_v4",data:V,confirmAndSign:K,onSuccess:je=>{D(I,"signTypedData","onSuccess",je),h(je)},onFailure:je=>{D(I,"signTypedData","onError","unable_to_sign"),y(je)},uiOptions:p||{}},ot={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:je=>{D(I,"signMessage","onError","unknown_connect_wallet_error"),y(je)}};oe({signMessage:Be,connectWallet:ot}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(c,p,h)=>{let E=await(await bu(c,p,h)).wait();return Cd(E)},exportWallet:c=>new Promise(async(p,h)=>{if(!i||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}c&&"target"in c&&c&&(c=void 0);let y=c?.address,E=s.linkedAccounts.filter(ue=>ue.type==="wallet"&&ue.walletClientType==="privy"&&ue.chainType==="ethereum"),N=y?E.find(ue=>ue.address===_o(y)):E.find(ue=>!ue.imported)||E[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}re(!0);let V={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:h,address:N.address,shouldForceMFA:!0};if(oe(Q),!await Ee()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}let ee={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};oe({keyExport:ee,connectWallet:V}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Eu,async init(c){switch(c){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${c}`)}},async submit(c,p){switch(c){case"totp":case"sms":if(typeof p!="string")throw new w("Invalid MFA code");mr.current?.resolve({mfaMethod:c,mfaCode:p,relyingParty:window.origin}),await new Promise((N,V)=>{Ct.current={resolve:N,reject:V}});break;case"passkey":if(typeof p=="string")throw new w("Invalid authenticator response");let y=await(await import("@simplewebauthn/browser")).startAuthentication(p),E=w0(y);mr.current?.resolve({mfaMethod:c,mfaCode:E,relyingParty:window.origin}),await new Promise((N,V)=>{Ct.current={resolve:N,reject:V}});break;default:throw mr.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${c}`)}},cancel(){mr.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(c){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber})},enrollInMfa(c){return new Promise((p,h)=>{if(!c){ne.closePrivyModal(),p();return}W.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),oe({mfaEnrollmentFlow:{mfaMethods:W.mfa.methods,onSuccess:p,onFailure:h}}),se("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let c=await Ee();if(!c||!L)throw new Error("Must have valid access token to enroll in MFA");let p=await L.initEnrollMfa({method:"totp",accessToken:c});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(c){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async submitEnrollmentWithTotp(c){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:p,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:c}){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:c});let h=await t.getAuthenticatedUser();d(h)},async unenroll(c){let p=await Ee();if(!p||!L)throw new Error("Must have valid access token to remove MFA");c==="passkey"?await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await L.unenrollMfa({method:c,accessToken:p});let h=await t.getAuthenticatedUser();d(h)},requestFarcasterSignerFromWarpcast:async()=>{let c=await Ee(),p=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let y=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:c,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(y.status==="approved"){let E=await t.getAuthenticatedUser();d(E||s||null)}oe({farcasterSigner:y}),se("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let c=await Ee(),p=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(E=>Uint8Array.from(E.match(/.{1,2}/g).map(N=>parseInt(N,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async c=>{let p=await Ee(),h=s?.linkedAccounts.find(V=>V.type==="wallet"&&V.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await ne.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let E=await import("@simplewebauthn/browser"),N=await L.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:E.bufferToBase64URLString(c)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(E.base64URLStringToBuffer(N.signature))},createGuestAccount:async()=>{if(s&&!s.isGuest)throw new Error("User cannot already be authenticated to create a guest account");return s?.isGuest?s:ne.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:S,loginWithCode(c){return ne.loginWithCode(c)},initLoginWithEmail(c){return ne.initLoginWithEmail(c)},initLoginWithSms(c){return ne.initLoginWithSms(c)},otpState:O,fundWallet(c,p){return ne.fundWallet(c,p)},initLoginWithHeadlessOAuth(c,p){return ne.initLoginWithHeadlessOAuth(c,p)},loginWithHeadlessOAuth(c){return ne.loginWithHeadlessOAuth(c)},generateSiweMessage({address:c,chainId:p}){return ne.generateSiweMessage({address:c,chainId:p})},linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E}){return _e("siwe"),ne.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E})},signMessageWithCrossAppWallet(c,{address:p}){return Mc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"personal_sign",params:[c,p]},reconnect:Bs})},signTypedDataWithCrossAppWallet(c,{address:p}){let h=Pa(c);return Mc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:Bs})},sendTransactionWithCrossAppWallet(c,{address:p}){return Mc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_sendTransaction",params:[c]},reconnect:Bs})},isModalOpen:r,mfaMethods:W.mfa.methods};E0=hi.signMessage,T0=hi.signTypedData,S0=async(...c)=>{let p=await bu(...c);return W.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let ne=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:Y,pendingTransaction:null,walletConnectionStatus:k,connectors:t.connectors?.walletConnectors??[],rpcConfig:W.rpcConfig,chains:W.chains,appId:e.appId,showFiatPrices:W.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:c=>W.chains.find(p=>p.id===Number(c))?.nativeCurrency.symbol,initializeWalletProxy:async c=>{if(L)return L;let p=new Promise(E=>{Ae(()=>N=>E(N))}),h=new Promise(E=>setTimeout(()=>E(null),c)),y=await Promise.race([p,h]);return Ae(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(c={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&i&&s,h;p&&F.current&&(h=Us(s)),B.current==="login"?c.shouldCallAuthOnSuccess&&p&&F.current?(D(I,"login","onComplete",s,g,!1,F.current,h??null),e.onSuccess?.(s,g)):D(I,"login","onError","exited_auth_flow"):B.current==="link"&&h&&(c.isSuccess&&p&&F.current?D(I,"linkAccount","onSuccess",s,F.current,h):F.current&&D(I,"linkAccount","onError","exited_link_flow",{linkMethod:F.current}));let y=T&&lu.includes(T),E=T==="ERROR_SCREEN"&&Q.errorModalData&&lu.includes(Q.errorModalData.previousScreen);if((y||E)&&Q.funding){let N=b3[T]??null,V=_r(Q.funding.chain.id,W.chains,W.rpcConfig,{appId:e.appId}),K;try{K=(await V.getBalance(Q.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}D(I,"fundWallet","onUserExited",{address:Q.funding.address,chain:Q.funding.chain,fundingMethod:N,balance:K})}X(null),B.current=null,F.current=null,b(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:c})=>new Promise(async(p,h)=>{let y=async()=>{let E=await t.getAccessToken();if(!E)throw new Error("User must be authenticated to use their embedded wallet.");if(!u)throw new Error("User must have an embedded Solana wallet to sign messages for Solana.");let N=ne.walletProxy??await ne.initializeWalletProxy(15e3);if(!N)throw new Error("Failed to initialize embedded wallet proxy.");let{response:V}=await N.rpcSolana({accessToken:E,publicKey:u.address,request:{method:"signMessage",params:{message:c}}});return V.data.signature};if(W.embeddedWallets.noPromptOnSignature)try{let E=await y();p({signature:E})}catch(E){h(E)}else oe({signMessage:{method:"solana_signMessage",data:c,confirmAndSign:y,onSuccess:K=>{p({signature:K})},onFailure:K=>{h(K)},uiOptions:{}}}),rt("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:se,connectWallet:qr,initLoginWithWallet:async(c,p)=>{F.current="siwe",wt(c,p)},loginWithWallet:async()=>{if(!n)throw new _n;if(!(t.authFlow instanceof Oo))throw new w("Must initialize SIWE flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),F.current="siwe"}catch(y){throw D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),F.current="siwe"}catch(y){throw D(I,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}d(p||s||null),b(h||!1),l(!0)},initLoginWithFarcaster:async c=>{let p=new Wa(c);t.startAuthFlow(p);try{F.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw B.current==="login"?D(I,"login","onError",h.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new _n;if(!(t.authFlow instanceof Wa))throw new w("Must initialize Farcaster flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),F.current="farcaster"}catch(y){throw D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),F.current="farcaster"}catch(y){throw D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||null),b(h||!1),l(!0)},async loginWithGuestAccountFlow(){let c=new Ai(this.appId);t.startAuthFlow(c);try{B.current="login",F.current="guest";let p=await t.authenticate(),{user:h,isNewUser:y}=p;if(y=y||!1,!h)throw new w("Unable to authenticate guest account");if(Ft(h,W.embeddedWallets.createOnLogin))try{await Ta(h,15e3),h=await ne.refreshUser()}catch{d(h),console.warn("Unable to create embedded wallet for guest account")}else d(h);return b(y),l(!0),D(I,"login","onComplete",h,y,!1,"guest",null),h}catch(p){throw D(I,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:c,popup:p}){let h=`privy:${c}`;F.current=h;let{url:y,stateCode:E,codeVerifier:N}=await z1({api:t.api,appId:c});if(!y)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:c}}),new w("No authorization URL returned for cross-app auth.");try{let V=await C0({url:y,popup:p,provider:h}),K=V.stateCode,ee=V.authorizationCode;if(K!==E)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:E??"",returnedStateCode:K??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let ue=await K1({api:Mo.api,appId:c,codeVerifier:N,stateCode:K,authorizationCode:ee});ue&&t.storeProviderAccessToken(c,ue);let Be=await ne.refreshUser();if(!Be)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:c}}),Be}catch(V){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:V.toString(),provider:h}}),V}},async initLoginWithOAuth(c,p){if(F.current=c,Sa()){if(c==="google"&&zi(window.navigator.userAgent)){rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}c==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),j.del(Nn);let h=new po({provider:c});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&(c==="twitter"&&US&&(y.url=y.url.replace("x.com","twitter.com")),window.location.assign(y.url))},async initLoginWithTelegram(c){if(!n)throw new _n;F.current="telegram";let p=new ki(c);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,y)=>{if(!W.loginConfig.telegramAuthConfiguration)return y(new w("Telegram Auth configuration is not loaded"));if(!window.Telegram)return y(new w("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:W.loginConfig.telegramAuthConfiguration.botId,request_access:!0},E=>E?h(E):y(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof ki))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let c,p;if(B.current==="login")try{let h=await t.authenticate();c=h.user,p=h.isNewUser,F.current="telegram"}catch(h){throw D(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}else if(B.current==="link")try{c=(await t.link()).user,F.current="telegram"}catch(h){throw D(I,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else throw new w("Unknown auth intent");d(c),b(p||!1),l(!0)},async recoveryOAuthFlow(c,p,h){let y,E;function N(V){if(!V)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:c}}),new w("Recovery OAuth failed")}switch(c){case"google-drive":{let{url:V,codeVerifier:K,stateCode:ee}=await up({api:Mo.api,provider:c});N(V);let ue,Be;try{let ot=await Cu({url:V,popup:h,provider:c});if(ue=ot.stateCode,Be=ot.authorizationCode,ue!==ee)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:ee??"",returnedStateCode:ue??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(ot){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:ot.toString(),provider:c}}),new w("Recovery OAuth failed")}[y,E]=await Promise.all([Ee(),Yh({api:Mo.api,provider:c,codeVerifier:K,stateCode:ue,authorizationCode:Be})]);break}case"icloud":{let{url:V}=await up({api:Mo.api,provider:c});N(V);let{ckWebAuthToken:K}=await Cu({url:V,popup:h,provider:c});E=K,y=await Ee();break}}if(!L)throw new w("Cannot connect to wallet proxy");if(!y)throw new w("Unable to authorize user");switch(p){case"recover":let V=Q.recoverWallet?.privyWallet?.address;if(!V)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:V,recoveryMethod:c}}),await L.recover({address:V,accessToken:y,recoveryAccessToken:E,recoveryMethod:c}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:V,recoveryMethod:c}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:y,recoveryAccessToken:E,recoveryMethod:c});let K=await ne.refreshUser(),ee=be(K);if(!ee)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:ee.address}}),D(I,"createWallet","onSuccess",ee);break;case"set-recovery":let ue=be(s);if(!ue)throw D(I,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:ue.address,existingRecoveryMethod:ue.recoveryMethod,targetRecoveryMethod:c}}),await L.setRecovery({address:ue.address,accessToken:y,recoveryAccessToken:E,recoveryMethod:c});let Be=be(await ne.refreshUser());if(!Be)throw D(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:ue.address,existingRecoveryMethod:ue.recoveryMethod,targetRecoveryMethod:c}}),D(I,"setWalletRecovery","onSuccess",c,Be);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(c){if(!(t.authFlow instanceof po))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=j.get(Wn),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:p??"",returnedStateCode:h??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),E,N,V;if(y!==null)try{let K=await t.link();E=K.user,V=K.oAuthTokens,F.current=c}catch(K){throw D(I,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:c}),K}else try{let K=await t.authenticate();E=K.user,N=K.isNewUser,V=K.oAuthTokens,F.current=c}catch(K){throw B.current==="login"?D(I,"login","onError",K.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:c}),K}return d(E),b(N||!1),l(!0),V&&E&&D(I,"oAuthAuthorization","onOAuthTokenGrant",V,{user:E}),V},async initLoginWithPasskey(c){let p=new Un(c);t.startAuthFlow(p),B.current="login";try{F.current="passkey",await p.initAuthenticationFlow()}catch(h){throw D(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new _n;if(!(t.authFlow instanceof Un))throw new w("Must initialize Passkey flow first.");if(F.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c,p;try{F.current="passkey",{user:c,isNewUser:p}=await t.authenticate()}catch(h){throw D(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}d(c),b(p||!1),l(!0)},async initLinkWithPasskey(c){let p=new Un(c);t.startAuthFlow(p),B.current="link",F.current="passkey";try{await p.initLinkFlow()}catch(h){throw D(I,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new _n;if(!(t.authFlow instanceof Un))throw new w("Must initialize Passkey flow first.");if(F.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c;try{F.current="passkey",{user:c}=await t.link()}catch(p){throw D(I,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return d(c||s||null),c},async initLoginWithHeadlessOAuth(c,p){if(Sa()){if(c==="google"&&zi(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let h=new po({provider:c,headless:!0});p&&h.addCaptchaToken(p);let y=await t.startAuthFlow(h).getAuthorizationUrl();y?.url&&window.location.assign(y.url)},async loginWithHeadlessOAuth(c){P(!0),t.startAuthFlow(new po(c));let p=j.get(Wn),h=c.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c.provider,storedStateCode:p??"",returnedStateCode:h??""}}),P(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),E,N,V;if(y!==null)try{({user:E,oAuthTokens:V}=await t.link()),F.current=c.provider;let K=Us(E);E&&K&&D(I,"linkAccount","onSuccess",E,F.current,K)}catch(K){throw D(I,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),K}else try{({user:E,isNewUser:N,oAuthTokens:V}=await t.authenticate()),F.current=c.provider;let K=Us(E);E&&K&&(B.current==="login"&&N!==void 0?D(I,"login","onComplete",E,N,!1,F.current,K):B.current==="link"&&D(I,"linkAccount","onSuccess",E,F.current,K))}catch(K){throw B.current==="login"?D(I,"login","onError",K.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),K}return d(E),b(N||!1),l(!0),P(!1),V&&E&&D(I,"oAuthAuthorization","onOAuthTokenGrant",V,{user:E}),E??void 0},initLoginWithEmail:async(c,p)=>{let h=new Qo(c,p);t.startAuthFlow(h);try{F.current="email",await h.sendCodeEmail()}catch(y){throw B.current==="login"?D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),y}},initUpdateEmail:async(c,p,h)=>{let y=new nl(c,p,h);t.startAuthFlow(y),await y.sendCodeEmail()},initUpdatePhone:async(c,p,h)=>{let y=new El(c,p,h);t.startAuthFlow(y),await y.sendSmsCode()},initLoginWithSms:async(c,p)=>{H({status:"sending-code"});let h=new Xo(c,p);t.startAuthFlow(h);try{F.current="sms",await h.sendSmsCode(),H({status:"awaiting-code-input"})}catch(y){throw H({status:"error",error:y}),B.current==="login"?D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),y}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async c=>{if(H({status:"submitting-code"}),!n){let y=new _n;throw H({status:"error",error:y}),y}if(t.authFlow instanceof Qo)t.authFlow.meta.emailCode=c.trim();else if(t.authFlow instanceof Xo)t.authFlow.meta.smsCode=c.trim();else{let y=new w("Must initialize a passwordless code flow first");throw H({status:"error",error:y}),y}await Ee();let p,h;if(B.current==="link")try{({user:p}=await t.link())}catch(y){throw H({status:"error",error:y}),D(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:F.current}),y}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(y){throw H({status:"error",error:y}),D(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||s||null),b(h||!1),l(!0),H({status:"done"})},generateSiweMessage:async({address:c,chainId:p,captchaToken:h})=>{B.current="link",F.current="siwe";let y=await t.generateSiweNonce({address:c,captchaToken:h}),E=p.replace("eip155:","");return bl({address:c,chainId:E,nonce:y})},linkWithSiwe:async({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E})=>{let N;try{N=await t.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E}),N=await ne.refreshUser()??N;let V=Us(N);V&&D(I,"linkAccount","onSuccess",N,"siwe",V)}catch(V){throw D(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),B.current=null,F.current=null,V}d(N||s||null),B.current=null,F.current=null},refreshUser:async()=>{let c=await t.getAuthenticatedUser();return d(c),c},walletProxy:L,createAnalyticsEvent:({eventName:c,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:c,payload:p,timestamp:h}),acceptTerms:async()=>{let c=await t.acceptTerms();return d(c),c},getUsdTokenPrice:c=>t.getUsdTokenPrice(c),recoverEmbeddedEthereumWallet:async c=>new Promise(async(p,h)=>{let y=be(c?.user??s)||Tl(c?.user??s),E=await Ee();if(!E||!L||!y){h(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await L.connect({accessToken:E,address:y.address}),p(!0)}catch(N){if(Xn(N)&&y.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:y.address}}),(await L.recover({address:y.address,accessToken:E,recoveryMethod:y.recoveryMethod})).address||h(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:y.address}}),p(!0);else if(Xn(N)&&y.recoveryMethod!=="privy"){oe({recoverWallet:{privyWallet:y,onFailure:h,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:y.recoveryMethod,action:"recover"}});let V=ic(y.recoveryMethod);se(V)}else h(N)}}),embeddedSolanaWallet:u,createEmbeddedSolanaWallet:async()=>{re(!0);let c=await Ee(),p=await ne.refreshUser(),h=Bn(p),y=be(p);if(!p||!c)throw new w("User must be logged in to create a Solana wallet");if(h)throw new w("User already has an embedded Solana wallet.");if(y)if(y.recoveryMethod==="privy")await ne.recoverEmbeddedEthereumWallet({user:p});else throw new w("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let E=await ne.initializeWalletProxy(15e3);if(!E)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await E.createSolana({accessToken:c,ethereumAddress:y?.address});let N=await ne.refreshUser(),V=Bn(N);if(!V)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:V.address}}),V}catch(N){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",N)}},exportSolanaWallet:c=>new Promise(async(p,h)=>{if(!i||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=c?.address,E=s.linkedAccounts.filter(ee=>ee.type==="wallet"&&ee.walletClientType==="privy"&&ee.chainType==="solana"),N=y?E.find(ee=>ee.address.toLowerCase()===y.toLowerCase()):E.find(ee=>!ee.imported)||E[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}if(re(!0),!await Ee()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}await ne.recoverEmbeddedSolanaWallet();let K={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};oe({keyExport:K}),se("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(c,p)=>{let h=Bn(s),y=await Ee();if(!y||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await L.connectSolana({accessToken:y,publicKey:h.address}),c(!0)}catch(E){Xn(E)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recoverSolana({publicKey:h.address,accessToken:y})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),c(!0)):p(E)}}),getMoonpaySignedUrl:fi,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:c=>{a(!0),pe?.(c)},updateWallets:()=>ao(),fundWallet:async(c,p)=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=wd({fundingMethods:W.fundingConfig.methods});oe({funding:Tu({address:c,fundWalletConfig:p,methodScreen:h})}),se(h)},requestFarcasterSignerStatus:async c=>{let p=await Ee(),h=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let y=await t.requestFarcasterSignerStatus(c);if(y.status==="approved"){let E=await t.getAuthenticatedUser();d(E||s||null)}return y},connectCoinbaseSmartWallet:async()=>{W.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let c=t.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||t.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(c)return c.updateConnectionPreference("smartWalletOnly"),qr(c);await Fs("coinbase_wallet","coinbase_smart_wallet")}}))();A0=ne.recoverEmbeddedEthereumWallet,P0=ne.recoverEmbeddedSolanaWallet,x0=ne.solanaSignMessage;let L0=FS(()=>({wallets:m,ready:ut&&qe}),[m,ut,qe]);return kr(Ie.Provider,{value:hi,children:kr(lm.Provider,{value:I,children:kr(fm.Provider,{value:L0,children:kr(qf,{...W,children:b0(im.Provider,{value:ne,children:[kr(dm,{children:b0(Df,{data:Q,setModalData:oe,setInitialScreen:R,initialScreen:T,authenticated:i,open:r,children:[e.children,!W.headless&&W.captchaEnabled&&n&&!i&&kr(qd,{delayedExecution:!1}),kr(t0,{theme:{...W.appearance.palette||{}}}),!W.render.standalone&&kr(gu,{open:r})]})}),Re&&z?kr(h0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:mr,mfaSubmitPromise:Ct,onLoad:Z,onLoadFailed:()=>null}):null,W.loginConfig.telegramAuthConfiguration&&kr(Xr,{if:!0,children:kr(u0,{scriptHost:e.apiUrl||Ks,botUsername:W.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};import{useCallback as k0,useEffect as YS}from"react";var QS=e=>{ze("login",e);let t=Te(),r=Js(),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:n,isHeadlessOAuthLoading:a,ready:i,user:l}=q(),s=k0(async m=>{if(t.enabled&&t.status!=="success")throw new yr(t.error,null,"captcha_failure");return o(m.provider,t.token)},[o,t]),d=k0(async()=>{let m=Da();if(l)return console.warn("Cannot login with OAuth when already logged in"),l;if(!m.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!m.popupFlow)try{return await n(m)}catch(f){throw f}finally{Fn()}},[n]);return YS(()=>{let m=Da();i&&r&&m.inProgress&&m.headless&&!m.popupFlow&&d()},[i,r]),{initOAuth:s,loginWithOAuth:d,loading:a}};import{useCallback as R0}from"react";var XS=()=>{let e=Te(),{initLoginWithEmail:t,loginWithCode:r}=q(),o=R0(async({email:a})=>{if(!a)throw new Error("Email required to send OTP code");return t(a)},[t]),n=R0(async({code:a})=>{if(e.enabled&&e.status==="error")throw new yr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as _0}from"react";var ZS=()=>{let e=Te(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=q(),n=_0(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return t(i)},[t]),a=_0(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new yr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:n,loginWithCode:a,state:o}};import{useCallback as M0}from"react";var JS=()=>{let e=Te(),{generateSiweMessage:t,linkWithSiwe:r}=q(),o=M0(async({address:a,chainId:i})=>{if(!a||!i)throw new Error("wallet address and chainId required to generate nonce");return t({address:a,chainId:i}).then(l=>l)},[t]),n=M0(async({signature:a,message:i,chainId:l,walletClientType:s,connectorType:d})=>{if(e.enabled&&e.status!=="success")throw new yr(e.error,null,"captcha_failure");return r({message:i,signature:a,chainId:l,walletClientType:s,connectorType:d})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};import{useContext as jS}from"react";function $S(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkTelegram:C,linkFarcaster:v}=jS(Ie);return ze("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkFarcaster:v,linkTelegram:C}}import{useContext as eA}from"react";function tA(e){let{connectWallet:t}=eA(Ie);return ze("connectWallet",e),{connectWallet:t}}import{useContext as rA}from"react";function oA(e){let{createWallet:t}=rA(Ie);return ze("createWallet",e),{createWallet:t}}var nA=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r}=_();return{createWallet:r,exportWallet:t,wallets:e?[e]:[]}};var iA=()=>{let{connectCoinbaseSmartWallet:e}=_();return{connectCoinbaseSmartWallet:e}};var aA=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=q();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};import{useContext as sA}from"react";function lA(e){let{sendTransaction:t}=sA(Ie);return ze("sendTransaction",e),{sendTransaction:t}}import{useContext as cA}from"react";function dA(e){let{setWalletPassword:t}=cA(Ie);return ze("setWalletPassword",e),{setWalletPassword:t}}import{useContext as pA}from"react";function uA(){let{createGuestAccount:e}=pA(Ie);return{createGuestAccount:e}}import{useContext as mA}from"react";function fA(e){let{setWalletRecovery:t}=mA(Ie);return ze("setWalletRecovery",e),{setWalletRecovery:t}}import{useContext as hA}from"react";function yA(e){let{signMessage:t}=hA(Ie);return ze("signMessage",e),{signMessage:t}}import{useContext as gA}from"react";function vA(e){let{signTypedData:t}=gA(Ie);return ze("signTypedData",e),{signTypedData:t}}import{useContext as CA}from"react";var wA=()=>{let{isModalOpen:e}=CA(Ie);return{isOpen:e}};import{useContext as bA}from"react";function EA(e){let{getAccessToken:t}=bA(Ie);return ze("accessToken",e),{getAccessToken:t}}function TA(e){let{authenticated:t,user:r}=q(),{initLoginWithOAuth:o}=_(),n=wi();return ze("oAuthAuthorization",e),{reauthorize:a=>SA(t,r,o,n,a.provider)}}var SA=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new w("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(i=>i.type.includes(n)))throw new w(`OAuth account of type ${n} not linked to the account.`);await r(n)};var AA=I0;function I0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=q();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function PA(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}export{mo as AsExternalProvider,qd as Captcha,Ha as ConnectorManager,gu as LoginModal,Va as PrivyClient,zS as PrivyProvider,Xe as PrivyProxyProvider,Ld as SUPPORTED_CHAINS,xd as VERSION,tr as WalletConnector,V5 as addRpcUrlOverrideToChain,dp as errorIndicatesMaxMfaRetries,Zn as errorIndicatesMfaTimeout,Jn as errorIndicatesMfaVerificationFailed,Ee as getAccessToken,PA as getEmbeddedConnectedWallet,iA as useConnectCoinbaseSmartWallet,tA as useConnectWallet,oA as useCreateWallet,aA as useCrossAppAccounts,AA as useExperimentalFarcasterSigner,I0 as useFarcasterSigner,U0 as useFundWallet,uA as useGuestAccounts,$S as useLinkAccount,JS as useLinkWithSiwe,D0 as useLogin,XS as useLoginWithEmail,QS as useLoginWithOAuth,ZS as useLoginWithSms,F0 as useLogout,Es as useMfa,to as useMfaEnrollment,wA as useModalStatus,TA as useOAuthTokens,q as usePrivy,zd as useRegisterMfaListener,lA as useSendTransaction,dA as useSetWalletPassword,fA as useSetWalletRecovery,yA as useSignMessage,vA as useSignTypedData,nA as useSolanaWallets,EA as useToken,zr as useWallets};
|