@privy-io/react-auth 1.60.7 → 1.61.0-beta-20240423144828
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/esm/index.js +330 -298
- package/dist/index.d.ts +20 -11
- package/dist/index.js +329 -297
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var R2=Object.create;var Ha=Object.defineProperty;var I2=Object.getOwnPropertyDescriptor;var M2=Object.getOwnPropertyNames;var W2=Object.getPrototypeOf,L2=Object.prototype.hasOwnProperty;var O2=(e,t)=>{for(var r in t)Ha(e,r,{get:t[r],enumerable:!0})},ip=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of M2(t))!L2.call(e,n)&&n!==r&&Ha(e,n,{get:()=>t[n],enumerable:!(o=I2(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?R2(W2(e)):{},ip(t||!e||!e.__esModule?Ha(r,"default",{value:e,enumerable:!0}):r,e)),N2=e=>ip(Ha({},"__esModule",{value:!0}),e);var cc=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var ap=(e,t,r)=>(cc(e,t,"read from private field"),r?r.call(e):t.get(e)),Ga=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},dc=(e,t,r,o)=>(cc(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var sp=(e,t,r)=>(cc(e,t,"access private method"),r);var E4={};O2(E4,{AsExternalProvider:()=>Rr,Captcha:()=>Zs,ConnectorManager:()=>ni,PrivyClient:()=>ii,PrivyProvider:()=>Jg,PrivyProxyProvider:()=>Ue,SUPPORTED_CHAINS:()=>ri,VERSION:()=>Xa,WalletConnector:()=>Lt,addRpcUrlOverrideToChain:()=>S2,errorIndicatesMaxMfaRetries:()=>hl,errorIndicatesMfaTimeout:()=>Pn,errorIndicatesMfaVerificationFailed:()=>Sn,getAccessToken:()=>_e,useConnectWallet:()=>l2,useCreateWallet:()=>d2,useExperimentalFarcasterSigner:()=>P2,useFundWallet:()=>p2,useLinkAccount:()=>a2,useLogin:()=>Xg,useLoginWithEmail:()=>o2,useLoginWithOAuth:()=>r2,useLoginWithSms:()=>n2,useLogout:()=>t2,useMfa:()=>Mn,useMfaEnrollment:()=>Oi,useModalStatus:()=>b2,usePrivy:()=>V,useRegisterMfaListener:()=>el,useSendTransaction:()=>m2,useSetWalletPassword:()=>h2,useSignMessage:()=>g2,useSignTypedData:()=>C2,useToken:()=>T2,useWallets:()=>Vi});module.exports=N2(E4);var Fa=require("@ethersproject/address"),ac=require("@ethersproject/providers"),$g=require("mipd"),te=require("react");var lp=require("ofetch"),Ze=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},kr=class extends Ze{constructor(r,o,n,a,i){super(n,a,i);this.type=r;this.status=o}},P=class extends Ze{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Va=class extends P{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var ne=class extends Ze{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},ye=e=>{if(e instanceof Ze)return e;if(!(e instanceof lp.FetchError))return Tt(e);if(!e.response)return new kr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new kr(t||"ApiError",e.response.status,r||o,e,n)},Tt=e=>e instanceof Ze?e:e instanceof Error?new P(e.message,e):new P(`Internal error: ${e}`);var Uo=class extends P{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Xt=class extends P{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},za=class extends P{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Jr=class extends P{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var qa="/api/v1/sessions",$a="/api/v1/sessions/logout",cp="/api/v1/sessions/fork",ja="/api/v1/sessions/fork/recover",dp="/api/v1/siwe/init",pp="/api/v1/siwe/authenticate",up="/api/v1/siwe/link",mp="/api/v1/siwe/unlink",fp="/api/v1/farcaster/init",hp="/api/v1/farcaster/authenticate",yp="/api/v1/farcaster/link",gp="/api/v1/farcaster/status",vp="/api/v1/farcaster/unlink",Cp="/api/v1/passwordless/init",wp="/api/v1/passwordless/authenticate",bp="/api/v1/passwordless/link",Ep="/api/v1/passwordless/unlink",Tp="/api/v1/passwordless/update",Pp="/api/v1/passwordless_sms/init",Sp="/api/v1/passwordless_sms/link",xp="/api/v1/passwordless_sms/unlink",kp="/api/v1/passwordless_sms/authenticate",_p="/api/v1/oauth/init",Ap="/api/v1/oauth/authenticate",Rp="/api/v1/oauth/link",Ip="/api/v1/oauth/unlink",Mp="/api/v1/passkeys/link/init",Wp="/api/v1/passkeys/authenticate/init",Lp="/api/v1/passkeys/link",Op="/api/v1/passkeys/authenticate",Np="/api/v1/passkeys/unlink";var Dp="/api/v1/mfa/passwordless_sms/init",Fp="/api/v1/mfa/passwordless_sms/enroll";var Up="/api/v1/users/me/accept_terms",Ka="/api/v1/analytics_events",Bp="/api/v1/plugins/moonpay_on_ramp/sign",Hp="/api/v1/custom_jwt_account/authenticate";var Gn=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");try{let t=await this.api.post(Hp,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw ye(t)}}async link(){throw new Error("Unimplemented")}};var Bo=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(wp,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw ye(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(bp,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ye(t)}}async sendCodeEmail(t,r){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new P("Email must be set when initialzing authentication.");try{return await this.api.post(Cp,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ye(o)}}},Ya=class extends Bo{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new P("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Tp,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ye(r)}}};var ds=require("react-device-detect");var pc=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},Za=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function uc(){try{let e="privy:__session_storage__test",t="blobby",r=new Za;return r.put(e,t),r.del(e),!0}catch{return!1}}function D2(){return typeof window<"u"&&window.localStorage?new Za:new pc}var X=D2();var mn=require("@ethersproject/providers");function Gp(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var Ja=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var mc=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Ja(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!mc(r))return!1}return!0},Ho=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Vp=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var zp="1.60.7";var fc="4df5e2316331463a9130964bd6078dfa",hc="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",qp="34357d3c125c2bcf2ce2bc3309d98715",Qa="https://auth.privy.io",$p=2e4,Qe=1400,jp=2500,Xa=zp;var cn="privy:token",yc="privy-token",es="privy:refresh_token",gc="privy-refresh-token",ts="privy-session",Zi="privy:session_transfer_token",U2="privy:wallet",Ji="privy:caid",dn="privy:state_code",Vn="privy:code_verifier",pn="privy:headless_oauth",rs=e=>`${U2}:${e}`,vc="privy:connectors",Cc="privy:connections";var un=12e4,vo=1,wc="0x1",zn=3e4,Kp="https://api.moonpay.com/v1",Yp="https://api.moonpay.com/v1",Zp="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Jp="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",Qp="0x420000000000000000000000000000000000000F",Xp=["function getL1Fee(bytes memory _data) external view returns (uint256)"];var eu=(e,t)=>{let r=[],o=[];for(let[n,a]of e.entries())n<t?r.push(a):o.push(a);return[r,o]},os=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),tu=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Go=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let a=e.slice(0,o+t),i=e.slice(e.length-r,e.length);return`${a}...${i}`},bc=e=>new Promise(t=>setTimeout(t,e));function ru(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let a=0,i,l=()=>{if(a>=r){n("Max attempts reached without result");return}if(i=e(),a+=t,i!=null){o(i);return}setTimeout(l,t)};l()})}var ou=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,a)=>{let i=!1,l=0;for(;!i&&l<o;){if(t.abortSignal?.aborted)return;e().then(()=>{i=!0,n()},(...s)=>{i=!0,a(...s)}),l+=1,await bc(r)}i||a(new Error("Exceeded max attempts before resolving function"))})},ns=(e,t,r={})=>{let o=new URL(t,e);for(let[n,a]of Object.entries(r))o.searchParams.set(n,a);return o.href};var nu=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),fn=e=>typeof e=="string"?e:"0x"+e.toString(16);async function iu(e,t,r=3e3){let o=!1,n=window;return new Promise(a=>{n.ethereum?i():(window.addEventListener("ethereum#initialized",i,{once:!0}),setTimeout(()=>{i()},r));function i(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",i);let l=e.getProviders(),s=[];for(let c of l)t.includes("coinbase_wallet")&&c.info.rdns==="com.coinbase.wallet"||s.push({type:c.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:c});for(let c of Gp()){let u=Ja(c);if(!l.some(g=>g.info.name===u)){if(mc(c,!0)&&!s.find(g=>g.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(g=>g.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}if(u==="Coinbase Wallet"&&!s.find(g=>g.type==="coinbase_wallet")){s.push({type:"coinbase_wallet",legacyInjectedProvider:c});continue}s.find(g=>g.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}a(s)}})}function qn(e){return`eip155:${String(Number(e))}`}var is=(e,t,r,o)=>{let n=Number(e),a=t.find(l=>l.id===n);if(!a)throw new ne(`Unsupported chainId ${e}`,4901);let i;if(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0])i=a.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[n])i=r.rpcUrls[n];else if(a.rpcUrls.privy?.http[0]){let l=new URL(a.rpcUrls.privy.http[0]);l.searchParams.append("privyAppId",o),i=l.toString()}else a.rpcUrls.infura?.http[0]?i=a.rpcUrls.infura.http[0]+"/"+fc:a.rpcUrls.blast?.http[0]?i=a.rpcUrls.blast.http[0]+"/"+hc:i=a.rpcUrls.default?.http[0];if(!i)throw new ne(`No RPC url found for ${e}`);return i},au=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new ne(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Co=(e,t,r,o)=>{let n=Number(e),a=t.find(l=>l.id===n);if(!a)throw new ne(`Unsupported chainId ${e}`,4901);let i;if(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0]?i=new mn.StaticJsonRpcProvider(a.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?i=new mn.StaticJsonRpcProvider(r.rpcUrls[n]):a.rpcUrls.privy?.http[0]?i=new mn.StaticJsonRpcProvider({url:a.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):a.rpcUrls.infura?.http[0]?i=new mn.StaticJsonRpcProvider(a.rpcUrls.infura.http[0]+"/"+fc):a.rpcUrls.blast?.http[0]?i=new mn.StaticJsonRpcProvider(a.rpcUrls.blast.http[0]+"/"+hc):i=new mn.StaticJsonRpcProvider(a.rpcUrls.default?.http[0]),!i)throw new ne(`No RPC url found for ${e}`);return i},as=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var ss=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(ls))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var ls={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"}}};function B2(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function su(e,t){let r=B2(t);if(r.deepLink)return uu(r.deepLink,e);if(r.universalLink)return mu(r.universalLink,e);throw new P(`Unsupported wallet ${t.id}`)}var lu="WALLETCONNECT_DEEPLINK_CHOICE";function cu(){try{localStorage.removeItem(lu)}catch{}}function du({href:e,name:t}){try{localStorage.setItem(lu,JSON.stringify({href:e,name:t}))}catch{}}function pu(e){return e.startsWith("http://")||e.startsWith("https://")}function uu(e,t){if(pu(e))return mu(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 mu(e,t){if(!pu(e))return uu(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function cs(e,t){window.open(e,t,"noreferrer noopener")}var it=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 Qi=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new it(this._startChannelOnce.bind(this)),this.pollForReady=new it(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.channelToken)throw new P("Auth flow must be initialized first");try{let t=await this.api.post(hp,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new P("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw ye(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{return await this.api.post(yp,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ye(t)}}async _startChannelOnce(){if(!this.api)throw new P("Auth flow has no API instance");let t=await this.api.post(fp,{token:this.captchaToken});ds.isMobile&&!ds.isIOS&&t.connect_uri&&cs(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new P("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.channelToken)throw new P("Auth flow must be initialized first");let t=await this.api.get(gp,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var Ec=require("jose");async function fu(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function hu(e){return crypto.getRandomValues(new Uint8Array(e))}function ps(){return!!X.get(pn)}var H2="S256",G2="S256",Qr=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:ps();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 P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");let t=X.get(Vn);if(!t)throw new P("Authentication error.");try{let r=await this.api.post(Ap,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(Vn),this.meta.headless&&X.del(pn),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(r){let o=ye(r);throw o.privyErrorCode?new P(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new P("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new P("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");let t=X.get(Vn);if(!t)throw new P("Authentication error.");try{let r=await this.api.post(Rp,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(Vn),r}catch(r){throw ye(r)}}createCodeVerifier(){return Ec.base64url.encode(hu(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,r=H2){if(r==G2){let o=await fu(t);return Ec.base64url.encode(o)}else return t}async getAuthorizationUrl(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.provider)throw new P("Provider must be set when initializing OAuth authentication.");let t=this.createCodeVerifier();X.put(Vn,t);let r=this.createStateCode();X.put(dn,r);let o=await this.deriveCodeChallengeFromCodeVerifier(t);this.meta.headless&&X.put(pn,!0);try{return await this.api.post(_p,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw ye(n)}}};function Tc(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Xi=require("react/jsx-runtime"),us=({style:e,...t})=>(0,Xi.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,Xi.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,Xi.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var Vo=require("react/jsx-runtime"),ms=({style:e,...t})=>(0,Vo.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,Vo.jsx)("g",{clipPath:"url(#clip0)",children:(0,Vo.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,Vo.jsx)("defs",{children:(0,Vo.jsx)("clipPath",{id:"clip0",children:(0,Vo.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Pc=require("react/jsx-runtime"),fs=({style:e,...t})=>(0,Pc.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,Pc.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"#171515"})});var hn=require("react/jsx-runtime"),hs=({style:e,...t})=>(0,hn.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,hn.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,hn.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,hn.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,hn.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var ea=require("react/jsx-runtime");function ys({style:e,...t}){return(0,ea.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,ea.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ea.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ea.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var ta=require("react/jsx-runtime");function gs(e){return(0,ta.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,ta.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,ta.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var $n=require("react/jsx-runtime");function vs(e){return(0,$n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,$n.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,$n.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,$n.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Sc=require("react/jsx-runtime"),Cs=({style:e,...t})=>(0,Sc.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Sc.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"#000000"})});var V2={google:{name:"Google",component:hs},discord:{name:"Discord",component:ms},github:{name:"Github",component:fs},linkedin:{name:"LinkedIn",component:ys},twitter:{name:"Twitter",component:Cs},spotify:{name:"Spotify",component:gs},tiktok:{name:"Tiktok",component:vs},apple:{name:"Apple",component:us}},ra=e=>V2[e];function yu(e,t){let r={detail:"",retryable:!1},o=Tc(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=ra(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ra(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return r}function oa(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");return!t||!r||!o?{inProgress:!1}:{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:ps()}}function na(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),X.del(dn),window.history.replaceState({},"",e)}var yn=class{constructor(t){this.initAuthenticateOnce=new it(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new it(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new P("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new P("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 P("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new P("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(Op,{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 P("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ye(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new P("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new P("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(Lp,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new P("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ye(r)}}async _initAuthenticateOnce(){if(!this.api)throw new P("Auth flow has no API instance");return await this.api.post(Wp,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new P("Auth flow has no API instance");return await this.api.post(Mp,{})}_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 gn=class{constructor(t,r){this.createSiweMessage=(t,r,o,n,a,i,l)=>`${o} wants you to sign in with your Ethereum account:
|
|
1
|
+
"use strict";var J2=Object.create;var ja=Object.defineProperty;var Q2=Object.getOwnPropertyDescriptor;var X2=Object.getOwnPropertyNames;var e3=Object.getPrototypeOf,t3=Object.prototype.hasOwnProperty;var r3=(e,t)=>{for(var r in t)ja(e,r,{get:t[r],enumerable:!0})},yp=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of X2(t))!t3.call(e,n)&&n!==r&&ja(e,n,{get:()=>t[n],enumerable:!(o=Q2(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?J2(e3(e)):{},yp(t||!e||!e.__esModule?ja(r,"default",{value:e,enumerable:!0}):r,e)),o3=e=>yp(ja({},"__esModule",{value:!0}),e);var Cc=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var gp=(e,t,r)=>(Cc(e,t,"read from private field"),r?r.call(e):t.get(e)),Ka=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},wc=(e,t,r,o)=>(Cc(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var vp=(e,t,r)=>(Cc(e,t,"access private method"),r);var qw={};r3(qw,{AsExternalProvider:()=>Mr,Captcha:()=>ol,ConnectorManager:()=>ci,PrivyClient:()=>di,PrivyProvider:()=>v2,PrivyProxyProvider:()=>Ve,SUPPORTED_CHAINS:()=>si,VERSION:()=>is,WalletConnector:()=>Dt,addRpcUrlOverrideToChain:()=>$2,errorIndicatesMaxMfaRetries:()=>bl,errorIndicatesMfaTimeout:()=>Rn,errorIndicatesMfaVerificationFailed:()=>In,getAccessToken:()=>ge,useConnectWallet:()=>A2,useCreateWallet:()=>I2,useExperimentalFarcasterSigner:()=>q2,useFundWallet:()=>M2,useLinkAccount:()=>_2,useLogin:()=>w2,useLoginWithEmail:()=>P2,useLoginWithOAuth:()=>T2,useLoginWithSms:()=>S2,useLogout:()=>E2,useMfa:()=>Nn,useMfaEnrollment:()=>Gi,useModalStatus:()=>G2,usePrivy:()=>H,useRegisterMfaListener:()=>sl,useSendTransaction:()=>L2,useSetWalletPassword:()=>N2,useSignMessage:()=>F2,useSignTypedData:()=>B2,useToken:()=>z2,useWallets:()=>Zi});module.exports=o3(qw);var za=require("@ethersproject/address"),yc=require("@ethersproject/providers"),m2=require("mipd"),re=require("react");var Cp=require("ofetch"),et=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Rr=class extends et{constructor(r,o,n,a,i){super(n,a,i);this.type=r;this.status=o}},E=class extends et{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Ya=class extends E{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var oe=class extends et{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},pe=e=>{if(e instanceof et)return e;if(!(e instanceof Cp.FetchError))return xt(e);if(!e.response)return new Rr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new Rr(t||"ApiError",e.response.status,r||o,e,n)},xt=e=>e instanceof et?e:e instanceof Error?new E(e.message,e):new E(`Internal error: ${e}`);var Ho=class extends E{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Nt=class extends E{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},Za=class extends E{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Qr=class extends E{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var Ja="/api/v1/sessions",Qa="/api/v1/sessions/logout",wp="/api/v1/sessions/fork",Xa="/api/v1/sessions/fork/recover",bp="/api/v1/siwe/init",Ep="/api/v1/siwe/authenticate",Tp="/api/v1/siwe/link",Pp="/api/v1/siwe/unlink",Sp="/api/v1/farcaster/init",xp="/api/v1/farcaster/authenticate",_p="/api/v1/farcaster/link",kp="/api/v1/farcaster/status",Ap="/api/v1/farcaster/unlink",Rp="/api/v1/passwordless/init",Ip="/api/v1/passwordless/authenticate",Mp="/api/v1/passwordless/link",Wp="/api/v1/passwordless/unlink",Lp="/api/v1/passwordless/update",Op="/api/v1/passwordless_sms/init",Np="/api/v1/passwordless_sms/link",Dp="/api/v1/passwordless_sms/unlink",Fp="/api/v1/passwordless_sms/authenticate",Up="/api/v1/oauth/init",Bp="/api/v1/oauth/authenticate",Hp="/api/v1/oauth/link",Gp="/api/v1/oauth/unlink",Vp="/api/v1/recovery/oauth/init",zp="/api/v1/recovery/oauth/authenticate",qp="/api/v1/passkeys/link/init",$p="/api/v1/passkeys/authenticate/init",jp="/api/v1/passkeys/link",Kp="/api/v1/passkeys/authenticate",Yp="/api/v1/passkeys/unlink";var Zp="/api/v1/mfa/passwordless_sms/init",Jp="/api/v1/mfa/passwordless_sms/enroll";var Qp="/api/v1/users/me/accept_terms",es="/api/v1/analytics_events",Xp="/api/v1/plugins/moonpay_on_ramp/sign",eu="/api/v1/custom_jwt_account/authenticate";var Kn=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");try{let t=await this.api.post(eu,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){throw new Error("Unimplemented")}};var Go=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Ip,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Mp,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw pe(t)}}async sendCodeEmail(t,r){if(!this.api)throw new E("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new E("Email must be set when initialzing authentication.");try{return await this.api.post(Rp,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw pe(o)}}},ts=class extends Go{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new E("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Lp,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw pe(r)}}};var ys=require("react-device-detect");var bc=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},rs=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function Ec(){try{let e="privy:__session_storage__test",t="blobby",r=new rs;return r.put(e,t),r.del(e),!0}catch{return!1}}function n3(){return typeof window<"u"&&window.localStorage?new rs:new bc}var X=n3();var vn=require("@ethersproject/providers");function tu(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var os=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var Tc=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||os(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!Tc(r))return!1}return!0},Vo=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),ru=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var ou="1.61.0-beta-20240423144828";var Pc="4df5e2316331463a9130964bd6078dfa",Sc="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",nu="34357d3c125c2bcf2ce2bc3309d98715",ns="https://auth.privy.io",iu=2e4,Ke=1400,au=2500,is=ou;var mn="privy:token",xc="privy-token",as="privy:refresh_token",_c="privy-refresh-token",ss="privy-session",ra="privy:session_transfer_token",a3="privy:wallet",oa="privy:caid",fn="privy:state_code",hn="privy:code_verifier",yn="privy:headless_oauth",ls=e=>`${a3}:${e}`,kc="privy:connectors",Ac="privy:connections";var gn=12e4,vo=1,Rc="0x1",Yn=3e4,su="https://api.moonpay.com/v1",lu="https://api.moonpay.com/v1",cu="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",du="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",pu="0x420000000000000000000000000000000000000F",uu=["function getL1Fee(bytes memory _data) external view returns (uint256)"];var mu=(e,t)=>{let r=[],o=[];for(let[n,a]of e.entries())n<t?r.push(a):o.push(a);return[r,o]},cs=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),fu=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},zo=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let a=e.slice(0,o+t),i=e.slice(e.length-r,e.length);return`${a}...${i}`},Ic=e=>new Promise(t=>setTimeout(t,e));function hu(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let a=0,i,l=()=>{if(a>=r){n("Max attempts reached without result");return}if(i=e(),a+=t,i!=null){o(i);return}setTimeout(l,t)};l()})}var yu=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,a)=>{let i=!1,l=0;for(;!i&&l<o;){if(t.abortSignal?.aborted)return;e().then(()=>{i=!0,n()},(...s)=>{i=!0,a(...s)}),l+=1,await Ic(r)}i||a(new Error("Exceeded max attempts before resolving function"))})},ds=(e,t,r={})=>{let o=new URL(t,e);for(let[n,a]of Object.entries(r))o.searchParams.set(n,a);return o.href};var gu=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Cn=e=>typeof e=="string"?e:"0x"+e.toString(16);async function vu(e,t,r=3e3){let o=!1,n=window;return new Promise(a=>{n.ethereum?i():(window.addEventListener("ethereum#initialized",i,{once:!0}),setTimeout(()=>{i()},r));function i(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",i);let l=e.getProviders(),s=[];for(let c of l)t.includes("coinbase_wallet")&&c.info.rdns==="com.coinbase.wallet"||s.push({type:c.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:c});for(let c of tu()){let u=os(c);if(!l.some(g=>g.info.name===u)){if(Tc(c,!0)&&!s.find(g=>g.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(g=>g.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}if(u==="Coinbase Wallet"&&!s.find(g=>g.type==="coinbase_wallet")){s.push({type:"coinbase_wallet",legacyInjectedProvider:c});continue}s.find(g=>g.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}a(s)}})}function Zn(e){return`eip155:${String(Number(e))}`}var ps=(e,t,r,o)=>{let n=Number(e),a=t.find(l=>l.id===n);if(!a)throw new oe(`Unsupported chainId ${e}`,4901);let i;if(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0])i=a.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[n])i=r.rpcUrls[n];else if(a.rpcUrls.privy?.http[0]){let l=new URL(a.rpcUrls.privy.http[0]);l.searchParams.append("privyAppId",o),i=l.toString()}else a.rpcUrls.infura?.http[0]?i=a.rpcUrls.infura.http[0]+"/"+Pc:a.rpcUrls.blast?.http[0]?i=a.rpcUrls.blast.http[0]+"/"+Sc:i=a.rpcUrls.default?.http[0];if(!i)throw new oe(`No RPC url found for ${e}`);return i},Cu=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new oe(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Co=(e,t,r,o)=>{let n=Number(e),a=t.find(l=>l.id===n);if(!a)throw new oe(`Unsupported chainId ${e}`,4901);let i;if(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0]?i=new vn.StaticJsonRpcProvider(a.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?i=new vn.StaticJsonRpcProvider(r.rpcUrls[n]):a.rpcUrls.privy?.http[0]?i=new vn.StaticJsonRpcProvider({url:a.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):a.rpcUrls.infura?.http[0]?i=new vn.StaticJsonRpcProvider(a.rpcUrls.infura.http[0]+"/"+Pc):a.rpcUrls.blast?.http[0]?i=new vn.StaticJsonRpcProvider(a.rpcUrls.blast.http[0]+"/"+Sc):i=new vn.StaticJsonRpcProvider(a.rpcUrls.default?.http[0]),!i)throw new oe(`No RPC url found for ${e}`);return i},us=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var ms=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(fs))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var fs={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"}}};function s3(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function wu(e,t){let r=s3(t);if(r.deepLink)return Su(r.deepLink,e);if(r.universalLink)return xu(r.universalLink,e);throw new E(`Unsupported wallet ${t.id}`)}var bu="WALLETCONNECT_DEEPLINK_CHOICE";function Eu(){try{localStorage.removeItem(bu)}catch{}}function Tu({href:e,name:t}){try{localStorage.setItem(bu,JSON.stringify({href:e,name:t}))}catch{}}function Pu(e){return e.startsWith("http://")||e.startsWith("https://")}function Su(e,t){if(Pu(e))return xu(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 xu(e,t){if(!Pu(e))return Su(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function hs(e,t){window.open(e,t,"noreferrer noopener")}var qe=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var na=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new qe(this._startChannelOnce.bind(this)),this.pollForReady=new qe(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.channelToken)throw new E("Auth flow must be initialized first");try{let t=await this.api.post(xp,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new E("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post(_p,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw pe(t)}}async _startChannelOnce(){if(!this.api)throw new E("Auth flow has no API instance");let t=await this.api.post(Sp,{token:this.captchaToken});ys.isMobile&&!ys.isIOS&&t.connect_uri&&hs(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new E("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.channelToken)throw new E("Auth flow must be initialized first");let t=await this.api.get(kp,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var Mc=require("jose");async function _u(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function ku(e){return crypto.getRandomValues(new Uint8Array(e))}var l3="S256",c3="S256";function ia(){return Mc.base64url.encode(ku(36))}function gs(){return ia()}async function vs(e,t=l3){if(t==c3){let r=await _u(e);return Mc.base64url.encode(r)}else return e}function Au(){let e=X.get(hn);if(!e)throw new E("Authentication error.");return e}function Cs(){return!!X.get(yn)}var Xr=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Cs();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 E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new E("User denied confirmation during OAuth flow");let t=Au();try{let r=await this.api.post(Bp,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(hn),this.meta.headless&&X.del(yn),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(r){let o=pe(r);throw o.privyErrorCode?new E(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new E("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new E("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new E("User denied confirmation during OAuth flow");let t=X.get(hn);if(!t)throw new E("Authentication error.");try{let r=await this.api.post(Hp,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(hn),r}catch(r){throw pe(r)}}async getAuthorizationUrl(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.provider)throw new E("Provider must be set when initializing OAuth authentication.");let t=ia();X.put(hn,t);let r=gs();X.put(fn,r);let o=await vs(t);this.meta.headless&&X.put(yn,!0);try{return await this.api.post(Up,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw pe(n)}}};function Wc(e){return e.charAt(0).toUpperCase()+e.slice(1)}var aa=require("react/jsx-runtime"),ws=({style:e,...t})=>(0,aa.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,aa.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,aa.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var qo=require("react/jsx-runtime"),bs=({style:e,...t})=>(0,qo.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,qo.jsx)("g",{clipPath:"url(#clip0)",children:(0,qo.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,qo.jsx)("defs",{children:(0,qo.jsx)("clipPath",{id:"clip0",children:(0,qo.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Lc=require("react/jsx-runtime"),Es=({style:e,...t})=>(0,Lc.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,Lc.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"#171515"})});var wn=require("react/jsx-runtime"),Ts=({style:e,...t})=>(0,wn.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,wn.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,wn.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,wn.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,wn.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var sa=require("react/jsx-runtime");function Ps({style:e,...t}){return(0,sa.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,sa.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,sa.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,sa.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var la=require("react/jsx-runtime");function Ss(e){return(0,la.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,la.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,la.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Jn=require("react/jsx-runtime");function xs(e){return(0,Jn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Jn.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Jn.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Jn.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Oc=require("react/jsx-runtime"),_s=({style:e,...t})=>(0,Oc.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Oc.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"#000000"})});var d3={google:{name:"Google",component:Ts},discord:{name:"Discord",component:bs},github:{name:"Github",component:Es},linkedin:{name:"LinkedIn",component:Ps},twitter:{name:"Twitter",component:_s},spotify:{name:"Spotify",component:Ss},tiktok:{name:"Tiktok",component:xs},apple:{name:"Apple",component:ws}},ca=e=>d3[e];function Ru(e,t){let r={detail:"",retryable:!1},o=Wc(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=ca(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ca(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return 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");return!t||!r||!o?{inProgress:!1}:{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Cs(),popupFlow:window.opener!==null}}function bn(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),X.del(fn),window.history.replaceState({},"",e)}var En=class{constructor(t){this.initAuthenticateOnce=new qe(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new qe(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new E("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new E("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 E("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new E("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(Kp,{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 E("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):pe(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new E("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new E("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(jp,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new E("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):pe(r)}}async _initAuthenticateOnce(){if(!this.api)throw new E("Auth flow has no API instance");return await this.api.post($p,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new E("Auth flow has no API instance");return await this.api.post(qp,{})}_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 Tn=class{constructor(t,r){this.createSiweMessage=(t,r,o,n,a,i,l)=>`${o} wants you to sign in with your Ethereum account:
|
|
2
2
|
${r}
|
|
3
3
|
|
|
4
4
|
${l}
|
|
@@ -9,7 +9,7 @@ Chain ID: ${t}
|
|
|
9
9
|
Nonce: ${i}
|
|
10
10
|
Issued At: ${a}
|
|
11
11
|
Resources:
|
|
12
|
-
- https://privy.io`;this.getNonceOnce=new it(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign(),o=await this.api.post(pp,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw ye(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign();return await this.api.post(up,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ye(t)}}async sign(){if(!this.api)throw new P("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new P("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.api)throw new P("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(dp,{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new P("Auth flow has no API instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=this.prepareMessage(r,t,this.nonce),this.preparedMessage}prepareMessage(t,r,o){let n=window.location.host,a=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.",l=new Date().toISOString();return this.createSiweMessage(t,r,n,a,l,o,i)}};var vn=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(kp,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw ye(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Sp,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ye(t)}}async sendSmsCode(t,r){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new P("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Pp,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ye(o)}}};var sm=require("uuid");function Pt(e){return new Date(e*1e3)}function z2(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,verifiedAt:Pt(r.verified_at),chainType:"ethereum",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"email":let a={address:r.address,type:r.type,verifiedAt:Pt(r.verified_at)};t.push(a);break;case"phone":let i={number:r.phoneNumber,type:r.type,verifiedAt:Pt(r.verified_at)};t.push(i);break;case"google_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:Pt(r.verified_at)};t.push(l);break;case"spotify_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:Pt(r.verified_at)};t.push(s);break;case"twitter_oauth":let c={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:Pt(r.verified_at)};t.push(c);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:Pt(r.verified_at)};t.push(u);break;case"github_oauth":let g={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:Pt(r.verified_at)};t.push(g);break;case"tiktok_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:Pt(r.verified_at)};t.push(f);break;case"linkedin_oauth":let C={subject:r.subject,name:r.name,email:r.email,type:r.type,verifiedAt:Pt(r.verified_at)};t.push(C);break;case"apple_oauth":let E={subject:r.subject,email:r.email,type:r.type,verifiedAt:Pt(r.verified_at)};t.push(E);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:Pt(r.verified_at)});break;case"farcaster":let w={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:Pt(r.verified_at),signerPublicKey:r.signer_public_key};t.push(w);break;case"passkey":let k={type:r.type,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:Pt(r.verified_at)};t.push(k);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function mr(e,t){return e.sort((r,o)=>o.verifiedAt.getTime()-r.verifiedAt.getTime()),e.find(r=>r.type===t)}var Ge=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,q2=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),fr=(e,t)=>t==="all-users"&&!Ge(e)||t==="users-without-wallets"&&!q2(e)?.length;function Ht(e){if(!e)return null;let t=z2(e.linked_accounts),r=mr(t,"wallet"),o=mr(t,"email"),n=mr(t,"phone"),a=mr(t,"google_oauth"),i=mr(t,"twitter_oauth"),l=mr(t,"discord_oauth"),s=mr(t,"github_oauth"),c=mr(t,"spotify_oauth"),u=mr(t,"tiktok_oauth"),g=mr(t,"linkedin_oauth"),f=mr(t,"apple_oauth"),C=mr(t,"farcaster"),E=e.mfa_methods.map(({type:k,verified_at:T})=>({type:k,verifiedAt:Pt(T)}));return{id:e.id,createdAt:Pt(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},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:c&&{subject:c.subject,email:c.email,name:c.name},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email},apple:f&&{subject:f.subject,email:f.email},farcaster:C&&{fid:C.fid,ownerAddress:C.ownerAddress,displayName:C.displayName,username:C.username,bio:C.bio,pfp:C.pfp,url:C.url,signerPublicKey:C.signerPublicKey},mfaMethods:E.map(k=>k.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Mc=require("@ethersproject/address"),rm=require("@ethersproject/bytes"),om=y(require("eventemitter3"));var Su=y(require("@coinbase/wallet-sdk"));var ia=require("react/jsx-runtime"),ws=({style:e,...t})=>(0,ia.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,ia.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,ia.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var Ir=require("@ethersproject/address"),xc=require("@ethersproject/providers"),Pu=y(require("eventemitter3"));var Cu=y(require("eventemitter3"));var $2=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],gu=e=>$2.includes(e);var vu=require("@ethersproject/logger");var jn=class extends ne{constructor(){super("Wallet timeout");this.type="wallet_error"}},Kn=class extends ne{constructor(){super("User rejected connection");this.type="wallet_error"}},Ar=e=>{if(e instanceof ne)return e;if(e?.code&&e?.reason){let t=new $e(e);return e.code===vu.ErrorCode.ACTION_REJECTED&&(t.details=St.E4001_USER_REJECTED_REQUEST),t}return e?.code?new $e(e):new ne("Unknown connector error",e)},hr=class extends Ze{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},$e=class extends hr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(St).find(a=>a.eipCode===o.code);this.details=n||St.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=St.E32002_CONNECTION_ALREADY_PENDING:this.details=St.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=St.E32002_WALLET_LOCKED))}},j2={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}},K2={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},Y2={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},St={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Y2,...K2},wo={...j2,...St};var Ue=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 jn,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||un,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 ne(`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 Ar(r)})}},zo=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},bs=class extends Cu.default{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=Co(l,this.chains,n,{appId:i}),this.rpcTimeoutDuration=Yn(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 _e()||!this.address)throw new zo("Disconnected",4900);return(await Eu(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=Co(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];return await wu(o)}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 bu(as(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:fn(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch{return delete o.from,await this.provider.send("eth_estimateGas",[o])}}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 fn(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(gu(r.method)){let o=await _e();if(await Tu(),!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 _e();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}}},Rr=class extends Ue{constructor(r){super(r,r.rpcTimeoutDuration)}},qo=class extends Ue{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 Z2=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},Lt=class extends Pu.default{constructor(r,o,n,a){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=qn(r),this.walletClientType==="privy"&&X.put(rs(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=Yn(a,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n){let a=async()=>!!this.wallets.find(i=>(0,Ir.getAddress)(i.address)===(0,Ir.getAddress)(r));return{address:(0,Ir.getAddress)(r),chainId:o,meta:n,switchChain:async i=>{if(!a)throw new ne("Wallet is not currently connected.");let l=this.wallets.find(f=>(0,Ir.getAddress)(f.address)===(0,Ir.getAddress)(r))?.chainId;if(!l)throw new ne("Unable to determine current chainId.");let s,c;if(typeof i=="number"?(s=`0x${i.toString(16)}`,c=i):(s=i,c=Number(i)),l===qn(s))return;let u=this.chains.find(f=>f.id===c);if(!u)throw new ne(`Unsupported chainId: ${i}`);let g=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await g()}catch(f){if(Z2(f,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[u.rpcUrls.default?.http[0]??""],blockExplorerUrls:[u.blockExplorers?.default.url??""]}]}),g();throw this.walletClientType==="rainbow"&&f.message?.includes("wallet_switchEthereumChain")?new ne(`Rainbow does not support the chainId ${o}`):f}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new ne("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new ne("Wallet is not currently connected.");return new xc.Web3Provider(new Rr(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new ne("Wallet is not currently connected.");return new qo(this.proxyProvider)},sign:async i=>{if(!await a())throw new ne("Wallet is not currently connected.");return await this.sign(i)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await this.proxyProvider.request({method:"eth_accounts"});Array.isArray(c)&&(o=c)}}catch{console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.")}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],a=(0,Ir.getAddress)(n),i=[],l;if(this.walletClientType==="privy"){let c=X.get(rs(a));this.chains.find(u=>u.id===Number(c))||(X.del(rs(a)),c=null),l=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let c=await this.proxyProvider.request({method:"eth_chainId"});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${wc}`,c),l=wc}let s=qn(l);if(!i.find(c=>(0,Ir.getAddress)(c.address)===a)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};i.push(this.buildConnectedWallet((0,Ir.getAddress)(n),s,c))}Es(i,this.wallets)||(this.wallets=i,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,Ir.getAddress)(n)===(0,Ir.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new xc.Web3Provider(new Rr(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 Zn={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var J2=(e,t)=>{let o=is(1,[Zn],{},t);return e.makeWeb3Provider(o,1)},Ts,Ps=class extends Lt{constructor(r,o,n,a,i){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.proxyProvider=new Ue(void 0,this.rpcTimeoutDuration),this.subscribeListeners();let l=window.matchMedia("(display-mode: standalone)").matches;Ts||(Ts=new Su.default({appName:i,darkMode:!1,headlessMode:!1,enableMobileWalletLink:l})),this.proxyProvider.setWalletProvider(J2(Ts,a))}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){Ts.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:ws,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 ne("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Ar(r)}}};var kc=require("react/jsx-runtime"),Ss=({...e})=>(0,kc.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,kc.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var xs=class extends Lt{constructor(r,o,n,a){super("privy",o,n,a);this.connectorType="embedded";this.proxyProvider=r,this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[fn(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Ss,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var _c=require("react/jsx-runtime"),Jn=({style:e,...t})=>(0,_c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,_c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var xt=require("react/jsx-runtime"),Qn=({style:e,...t})=>(0,xt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,xt.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,xt.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,xt.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,xt.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,xt.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,xt.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,xt.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,xt.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,xt.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,xt.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,xt.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,xt.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,xt.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var aa=require("react/jsx-runtime"),Xr=({style:e,...t})=>(0,aa.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,aa.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,aa.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var ei=class extends Lt{constructor(r,o,n,a,i){super(i||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Ue(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=a;let l=a.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}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 ne("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Ar(r)}}},Xn,ti=class extends Lt{constructor(r,o,n,a,i){super(i??"unknown",r,o,n);this.connectorType="injected";Ga(this,Xn,void 0);this.proxyProvider=new Ue(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(a),i==="metamask"?dc(this,Xn,{name:"MetaMask",icon:Qn,id:"io.metamask"}):i==="phantom"&&dc(this,Xn,{name:"Phantom",icon:Xr,id:"phantom"})}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return ap(this,Xn)??{name:"Browser Extension",icon:Jn,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 ne("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Ar(r)}}};Xn=new WeakMap;var Q2=require("@ethersproject/address"),X2=require("@ethersproject/providers"),xu=require("react-device-detect");var ks=class extends ei{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{xu.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new ne("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Ar(t)}}};var _s=class extends Lt{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Ue(void 0,un);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.emit("initialized"),this.initialized=!0}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 As=class extends _s{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Xr,id:"phantom"}}};var oi=require("@walletconnect/ethereum-provider"),tm=require("react-device-detect");var gr=require("react");var ku=require("react/jsx-runtime");function Rs({src:e,...t}){return(0,ku.jsx)("img",{src:e,...t,style:{display:"none"}})}var eo=require("react"),Yu=require("react");var yr={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:qp,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var _u=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let o of e.primary.slice(1))t.includes(o)?console.warn(`Duplicated login method: ${o}`):t.push(o);for(let o of e.overflow??[])!t.includes(o)&&!r.includes(o)?r.push(o):console.warn(`Duplicated login method: ${o}`);return{primary:t,overflow:r}};var e3=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),Au=e=>e3.has(e),Ru=(e,t,r)=>r.indexOf(e)===t,Iu=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Au).filter(Ru):e?e.filter(Au).filter(Ru):yr.appearance.walletList;var Is={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var Ms={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var Ws={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var Mu={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var Wu={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var Ls={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var Os={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-goerli.blastapi.io"],webSocket:["wss://base-goerli.blastapi.io"]},default:{http:["https://goerli.base.org"]},public:{http:["https://goerli.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://goerli.basescan.org"},default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var Ns={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var Lu={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://artio.rpc.berachain.com"]},public:{http:["https://artio.rpc.berachain.com"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var Ou={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var Nu={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var Du={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}};var Fu={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var Uu={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://goerli.rpc.privy.systems"]},alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var Bu={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var Hu={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-mainnet.infura.io/v3"],webSocket:["wss://linea-mainnet.infura.io/ws/v3"]},default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var Gu={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var Ds={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var Fs={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var Us={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var sa={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var la={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mumbai.rpc.privy.systems"]},alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"],webSocket:["wss://polygon-mumbai.g.alchemy.com/v2"]},infura:{http:["https://polygon-mumbai.infura.io/v3"],webSocket:["wss://polygon-mumbai.infura.io/ws/v3"]},default:{http:["https://matic-mumbai.chainstacklabs.com"]},public:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var Vu={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var zu={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var Bs={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var Hs={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var Gs={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var ri=[Is,Ms,Ws,Uu,zu,Zn,Ds,Fs,Us,sa,la,Ou,Nu,Du,Fu,Ls,Os,Ns,Lu,Hu,Gu,Mu,Wu,Bs,Gs,Hs,Bu,Vu],n7=new Set(ri.map(e=>e.id));var $o=y(require("tinycolor2")),qu="#FFFFFF",t3="#000000",r3=qu,o3="#1E1E1D";function n3(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}function bo(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,$o.default)({...e.toHsl(),l:r})}function $u({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:a=qu,blackHex:i=t3}){let l;switch(e){case"light":l=r3;break;case"dark":l=o3;break;default:l=e;break}let s=(0,$o.default)(l),c=(0,$o.default)(t),u=(0,$o.default)(r),g=(0,$o.default)(o),f=(0,$o.default)(n),C=n3(s.getLuminance()),E=bo(s,C==="light"?-.04:.11),w=bo(s,C==="light"?-.88:.87),k=bo(s,C==="light"?-.77:.75),T=bo(s,C==="light"?-.43:.45).desaturate(C==="light"?60:20),S=bo(s,C==="light"?-.08:.25).desaturate(C==="light"?60:20),L=bo(c,.15),M=bo(c,-.06),F=bo(f,.3),I=(0,$o.default)(c.getLuminance()>.5?i:a),H=bo(u,-.16);return{colorScheme:C,background:s.toHslString(),background2:E.toHslString(),foreground:w.toHslString(),foreground2:k.toHslString(),foreground3:T.toHslString(),foreground4:S.toHslString(),accent:c.toHslString(),accentLight:L.toHslString(),accentDark:M.toHslString(),foregroundAccent:I.toHslString(),success:u.toHslString(),successDark:H.toHslString(),error:f.toHslString(),errorLight:F.toHslString(),warn:g.toHslString()}}function Ac(e,t,r){let o=r?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],a=t?.loginMethods?.filter(qe=>n.includes(qe)),i,l,s,c,u,g,f,C,E,w,k,T,S;t?.loginMethods?(i=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),c=t.loginMethods.includes("wallet"),u=a?.includes("google"),g=a?.includes("twitter"),f=a?.includes("discord"),E=a?.includes("spotify"),C=a?.includes("tiktok"),k=a?.includes("github"),w=a?.includes("linkedin"),T=a?.includes("apple"),S=a?.includes("farcaster")):(i=e.emailAuth,l=e.smsAuth,c=e.walletAuth,u=e.googleOAuth,g=e.twitterOAuth,f=e.discordOAuth,k=e.githubOAuth,E=e.spotifyOAuth,C=e.tiktokOAuth,w=e.linkedinOAuth,T=e.appleOAuth,S=e.farcasterAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?s=!1:e.passkeyAuth&&(s=!0);let L=[i,l].filter(Boolean),M=[u,g,f,k,E,C,w,T,S].filter(Boolean),F=[c].filter(Boolean);if(L.length+M.length+F.length===0)throw new Error("You must enable at least one login method");let I=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;I&&F.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):!I&&M.length+L.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0),t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let H=Iu({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=_u({input:t?.loginMethodsAndOrder}),q=t?.intl?.defaultCountry??"US",{chains:$,defaultChain:R}=i3({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),ce=!!t?.defaultChain,U=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,ue,ie=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?U?ue=t?.embeddedWallets?.noPromptOnSignature??!0:ue=t?.embeddedWallets?.noPromptOnSignature??ie:ue=ie,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&ue!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,palette:$u({backgroundTheme:t?.appearance?.theme??yr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??yr.appearance.accentColor}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:H},loginMethods:{wallet:c,email:i,sms:l,passkey:s,google:u,twitter:g,discord:f,github:k,spotify:E,tiktok:C,linkedin:w,apple:T,farcaster:S},loginMethodsAndOrder:Y,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??yr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??yr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??yr.rpcConfig.rpcTimeouts},chains:$,defaultChain:R,intl:{defaultCountry:q},shouldEnforceDefaultChainOnConnect:ce,captchaEnabled:e.captchaEnabled??yr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...U?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:ue},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:U?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??yr.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??yr._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??yr._render.inParentNodeId}}}function ju(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:a,...i}=e;return{...i,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...a?{defaultChain:a.id}:void 0,...r?{...r,...r.logo&&typeof r.logo?{logo:"component"}:void 0}:void 0,legacyCreateEmbeddedWalletFlag:t}}function i3({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&o&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map(s=>s.rpcUrls.privyWalletOverride?s:ri.find(u=>u.id===s.id)??s)}else n=ri.concat(e??[]);let a=t?n[0]:Zn,i=r??a;if(!n.find(l=>l.id===i.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:i}}var Ku=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,a;n<e.length;n++)a=e.charCodeAt(n),r=Math.imul(r^a,2654435761),o=Math.imul(o^a,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var Qu=require("react/jsx-runtime"),Zu={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserPasswordOnCreate:!1},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},Rc=Ac(Zu,void 0,!1),Ic=(0,Yu.createContext)({appConfig:Rc,isServerConfigLoaded:!1}),Ju=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,a]=(0,eo.useState)(null),i=(0,eo.useMemo)(()=>Ac(n??Zu,o,!!n),[n,o]);return(0,eo.useEffect)(()=>{if(!n)return;let l=ju(o,t),s=Ku(JSON.stringify(l)).toString(),c=`privy:sent:${n.id}:${s}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:l}),localStorage.setItem(c,"t"))},[o,t,n]),(0,eo.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),a(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,Qu.jsx)(Ic.Provider,{value:{appConfig:i,isServerConfigLoaded:!!n},children:e})},Vs=()=>{let{appConfig:e}=(0,eo.useContext)(Ic);return e},zs=()=>{let{isServerConfigLoaded:e}=(0,eo.useContext)(Ic);return e};var b=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var qs=require("react/jsx-runtime"),Xu=(0,gr.createContext)({ready:!1,app:Rc,currentScreen:null,lastScreen:null,navigate:b,navigateBack:b,resetNavigation:b,setModalData:b,onUserCloseViaDialogOrKeybindRef:void 0}),a3=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],em=e=>{let t=Vs(),r=e.authenticated,[o,n]=(0,gr.useState)(e.initialScreen);(0,gr.useEffect)(()=>{!r&&!a3.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let a=(0,gr.useRef)(null);(0,gr.useEffect)(()=>{e.open||(a.current=null)},[e.open]),(0,gr.useEffect)(()=>{a.current=null},[e.initialScreen]);let i={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:a};return(0,qs.jsxs)(Xu.Provider,{value:i,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,qs.jsx)(Rs,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},A=()=>(0,gr.useContext)(Xu);var Eo=require("react/jsx-runtime"),ca=({style:e,...t})=>{let{app:r}=A();return(0,Eo.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Eo.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,Eo.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,Eo.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,Eo.jsx)("defs",{children:(0,Eo.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,Eo.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var to=class extends Lt{constructor(r,o,n,a,i,l,s){super(s||"unknown",n,a,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new Ue(void 0,this.rpcTimeoutDuration),s&&(this.walletEntry=ls[s],this.walletClientType=s)}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=ss(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.emit("initialized"),this.initialized=!0;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:Qn,id:"io.metamask"}:{name:nu(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||ca,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=ls[r],this.walletClientType=r,this.redirectUri=void 0,cu(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Kn)};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 ne("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=ss(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Yn(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(i=>{if(i){o(Ar(i));return}o(new ne("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=is(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 oi.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:oi.OPTIONAL_EVENTS,optionalMethods:oi.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1});return a.on("display_uri",i=>{if(a.signer.abortPairingAttempt(),tm.isMobile&&this.walletEntry){let{redirect:l,href:s}=su(i,this.walletEntry);du({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,cs(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=ss(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 Wc=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,rm.isHexString)(o)).map(o=>(0,Mc.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Yn=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||un:un,ni=class extends om.default{constructor(r,o,n,a,i,l,s,c,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 Ue: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=c,this.privyAppName=u,this.initializedWalletConnectors=0,this.walletsReady=!1,this.storedConnections=this.loadConnectionHistory()}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;X.get(vc)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(vc));let r=iu(this.store,this.walletList).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"),!Ho()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),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.initializedWalletConnectors++,this.walletsReady=this.initializedWalletConnectors===this.walletConnectors.length,this.emit("walletsUpdated")}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 bs(r,o,this.rpcConfig,this.chains,a,n.id),s=new xs(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=this.loadConnectionHistory(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let a=this.findWalletConnector(r,o);if(a)return a instanceof to&&a.resetConnection(o),a;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new ks(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new ti(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new ti(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new ti(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new ei(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Ps(this.chains,this.defaultChain,this.rpcConfig,this.privyAppId,this.privyAppName):r==="phantom"?new As(this.defaultChain):new to(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,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()}loadConnectionHistory(){let r=i=>i&&typeof i.address=="string"&&typeof i.connectorType=="string"&&typeof i.walletClientType=="string"&&typeof i.connectedAt=="number",o=X.get(Cc);return o&&Array.isArray(o)&&o.map(i=>r(i)).every(Boolean)?o:[]}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));X.put(Cc,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Mc.getAddress)(r),this.emit("walletsUpdated")}};function Es(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 nm=require("ofetch");var s3=[qa,ja,$a,Ka],$s=class{constructor(t,r,o){this.appId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=Xa,this.client=r,this.defaults=o,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=nm.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:n,options:a})=>{let i=new Headers(a.headers);i.set("privy-app-id",this.appId),i.set("privy-ca-id",this.clientAnalyticsId||""),i.set("privy-client",`react-auth:${this.sdkVersion}`);let l=s3.includes(n.toString());if(!i.has("authorization")){let s=await this.client.getAccessToken({disableAutoRefresh:l});s!==null&&i.set("authorization",`Bearer ${s}`)}a.headers=i,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new Va}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw ye(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw ye(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw ye(o)}}};var jo=y(require("js-cookie"));function im(e){return e instanceof Bo?"email":e instanceof vn?"sms":e instanceof gn?"siwe":e instanceof Gn?"custom_auth":e instanceof Qr?e.meta.provider:null}var am=y(require("jose")),ro=class{static parse(t){try{return new ro(t)}catch{return null}}constructor(t){this.value=t,this._decoded=am.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 l3=30,js=class{constructor(){this.authenticateOnce=new it(async t=>this._authenticate(t)),this.linkOnce=new it(async t=>this._link(t)),this.refreshOnce=new it(this._refresh.bind(this)),this.destroyOnce=new it(this._destroy.bind(this)),this.forkSessionOnce=new it(this._forkSession.bind(this))}get token(){try{let t=X.get(cn);return typeof t=="string"?new ro(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(es);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(Zi);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=jo.default.get(ts);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"}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=ro.parse(this.token);return t!==null&&!t.isExpired(l3)}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()}async _authenticate(t){try{let{token:r,refresh_token:o,user:n,is_new_user:a}=await t.authenticate();this.storeToken(r),this.storeRefreshToken(o);let i=im(t);return i&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:i,isNewUser:a}}),i==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:Ht(n),isNewUser:a}}catch(r){throw console.warn("Error authenticating session"),Tt(r)}}async _link(t){try{let r=await t.link();return Ht(r)}catch(r){throw console.warn("Error linking account"),Tt(r)}}async _refresh(){if(!this.api)throw new P("Session has no API instance");if(!this.client)throw new P("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;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(qa,i,{headers:a}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(ja,{refresh_token:o}),this.clearForkedToken();else return null;return n.session_update_action==="set"&&(this.storeToken(n.token),this.storeRefreshToken(n.refresh_token)),n.session_update_action==="clear"&&this.destroyLocalState(),n.session_update_action==="ignore"&&n.token&&this.storeToken(n.token),Ht(n.user)}catch(n){if(n instanceof kr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Tt(n)}}async _destroy(){try{await this.api?.post($a,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new P("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(cp,{refresh_token:t});return this.storeToken(r.token),this.storeRefreshToken(r.refresh_token),r.new_session_refresh_token}catch(r){throw Tt(r)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let r=X.get(cn);if(X.put(cn,t),!this.client?.useServerCookies){let o=ro.parse(t)?.expiration;jo.default.set(yc,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(cn),jo.default.remove(yc)}storeRefreshToken(t){typeof t=="string"?(X.put(es,t),this.client?.useServerCookies||(jo.default.set(ts,"t",{sameSite:"Strict",secure:!0,expires:30}),jo.default.set(gc,t,{sameSite:"Strict",secure:!0,expires:30}))):(X.del(es),jo.default.remove(gc),jo.default.remove(ts))}clearForkedToken(){X.del(Zi)}};var Lc,Ks,lm,ii=class{constructor(t){Ga(this,Ks);this.apiUrl=t.apiUrl||Qa,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||$p,this.appId=t.appId,this.clientAnalyticsId=sp(this,Ks,lm).call(this),Lc||(Lc=new js),this.session=Lc,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:a,walletList:i,shouldEnforceDefaultChainOnConnect:l,appName:s}){this.connectors||(this.connectors=new ni(this.appId,t,r,o,n,a,i,l,s))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new $s(this.appId,this,{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 P("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new P("No auth flow in progress.");return this.session.link(this.authFlow)}async logout(){await this.session.destroy(),this.authFlow=void 0}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}startMfaFlow(t){t.api=this.api,this.mfaFlow=t}async unlinkEmail(t){try{let r=await this.api.post(Ep,{address:t});return Ht(r)}catch(r){throw Tt(r)}}async acceptTerms(){try{let t=await this.api.post(Up,{});return Ht(t)}catch(t){throw Tt(t)}}async unlinkPhone(t){try{let r=await this.api.post(xp,{phoneNumber:t});return Ht(r)}catch(r){throw Tt(r)}}async unlinkWallet(t){try{let r=await this.api.post(mp,{address:t});return Ht(r)}catch(r){throw Tt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Ip,{provider:t,subject:r});return Ht(o)}catch(o){throw Tt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(vp,{fid:t});return Ht(r)}catch(r){throw Tt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Np,{credential_id:t});return Ht(r)}catch(r){throw Tt(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(Ka,{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(Bp,t)}catch(r){throw Tt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?ro.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t});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,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,requireUserPasswordOnCreate:o.embedded_wallet_config?.require_user_password_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}}catch(t){throw Tt(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()}};Ks=new WeakSet,lm=function(){if(typeof window>"u")return null;try{let r=X.get(Ji);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,sm.v4)();try{return X.put(Ji,t),t}catch{return t}};var um=require("@marsidev/react-turnstile"),Ys=require("react");var vr=require("react");var pm=require("react/jsx-runtime"),cm=(0,vr.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:b,setError:b,setExecuting:b,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:b,reset:b,execute:b}),Mr=class extends Ze{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},dm=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,vr.useRef)(null),[a,i]=(0,vr.useState)(),[l,s]=(0,vr.useState)(),[c,u]=(0,vr.useState)(!1),g=(0,vr.useMemo)(()=>o?!c&&!a&&!l?{status:"ready"}:c&&!a&&!l?{status:"loading"}:a&&!l?{status:"success",token:a}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,a,l,c]);return(0,pm.jsx)(cm.Provider,{value:{...g,ref:n,enabled:o,siteKey:r,appId:t,setToken:i,setError:s,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),s(void 0),i(void 0))},reset(){o&&(n.current?.reset(),u(!1),s(void 0),i(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await ru(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Mr("Captcha failed",null,"captcha_timeout")}}},children:e})},Pe=()=>(0,vr.useContext)(cm);var Oc=require("react/jsx-runtime"),Zs=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:a,setExecuting:i,ref:l}=Pe(),[,s]=(0,Ys.useMemo)(()=>r?.split("t:")||[],[r]);if((0,Ys.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Oc.jsx)("div",{className:"hidden h-0 w-0",children:(0,Oc.jsx)(um.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),i(!1)},onSuccess:c=>{e.onSuccess?.(c),a(c),i(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),a(void 0)}catch{n("expired_and_failed_reset")}}})})};var No=require("react"),Hg=y(require("react-dom"));var Js=require("react");var Nc=(0,Js.createContext)({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:b,initializeWalletProxy:b,getAuthMeta:b,getAuthFlow:b,closePrivyModal:b,openPrivyModal:b,connectWallet:b,initLoginWithWallet:b,loginWithWallet:b,initLoginWithFarcaster:b,loginWithFarcaster:b,loginWithCode:b,initLoginWithEmail:b,initLoginWithSms:b,initUpdateEmail:b,resendEmailCode:b,resendSmsCode:b,initLoginWithHeadlessOAuth:b,loginWithHeadlessOAuth:b,initLoginWithOAuth:b,loginWithOAuth:b,initLoginWithPasskey:b,loginWithPasskey:b,initLinkWithPasskey:b,linkWithPasskey:b,refreshUser:b,walletProxy:null,createAnalyticsEvent:b,acceptTerms:b,getUsdTokenPrice:b,recoverEmbeddedWallet:b,getFiatOnRampConfig:b,updateWallets:b,fundWallet:b,setReadyToTrue:b,requestFarcasterSignerStatus:b}),W=()=>(0,Js.useContext)(Nc);var Qs=require("react");var we=(0,Qs.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:b,login:b,connectOrCreateWallet:b,linkEmail:b,linkPhone:b,linkFarcaster:b,linkWallet:b,linkGoogle:b,linkTwitter:b,linkDiscord:b,linkGithub:b,linkSpotify:b,linkTiktok:b,linkLinkedIn:b,linkApple:b,linkPasskey:b,updateEmail:b,logout:b,getAccessToken:b,getEthereumProvider:b,getEthersProvider:b,getWeb3jsProvider:b,unlinkEmail:b,unlinkPhone:b,unlinkWallet:b,unlinkGoogle:b,unlinkTwitter:b,unlinkDiscord:b,unlinkGithub:b,unlinkSpotify:b,unlinkTiktok:b,unlinkLinkedIn:b,unlinkApple:b,unlinkFarcaster:b,unlinkPasskey:b,setActiveWallet:b,forkSession:b,createWallet:b,signMessage:b,signTypedData:b,enrollInMfa:b,initEnrollmentWithSms:b,initEnrollmentWithTotp:b,promptMfa:b,init:b,submitEnrollmentWithSms:b,submitEnrollmentWithTotp:b,unenroll:b,submit:b,cancel:b,sendTransaction:b,exportWallet:b,setWalletPassword:b,requestFarcasterSigner:b,submitCast:b,removeCast:b,likeCast:b,recastCast:b,followUser:b,unfollowUser:b,initLoginWithEmail:b,initLoginWithSms:b,otpState:{status:"initial"},loginWithCode:b,fundWallet:b,initLoginWithHeadlessOAuth:b,loginWithHeadlessOAuth:b,isHeadlessOAuthLoading:!1,isModalOpen:!1}),V=()=>(0,Qs.useContext)(we);var Xs=require("react"),mm=e=>{let[t,r]=(0,Xs.useState)("auto");return(0,Xs.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var ai=require("react"),fm={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},Dc=(0,ai.createContext)(void 0),hm=()=>(0,ai.useContext)(Dc);function Ve(e,t){if(!t)return;let o=hm().current[e];return(0,ai.useEffect)(()=>{for(let[n,a]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(a);return()=>{for(let[n,a]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(i=>i!==a)}},[t])}function N(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function ym(){let e=hm();return(t,r,...o)=>N(e,t,r,...o)}function el(e){Ve("configureMfa",e)}var qc=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),Pm=y(require("@heroicons/react/24/solid/DocumentCheckIcon")),Sm=y(require("styled-components"));var Cr=y(require("styled-components"));var tl=y(require("styled-components")),Ko=require("react/jsx-runtime"),Gt=({success:e,fail:t})=>(0,Ko.jsxs)(Ko.Fragment,{children:[(0,Ko.jsx)(Vt,{className:e?"success":t?"fail":""}),(0,Ko.jsx)(Fc,{className:e?"success":t?"fail":""})]}),Vt=tl.default.span`
|
|
12
|
+
- https://privy.io`;this.getNonceOnce=new qe(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign(),o=await this.api.post(Ep,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw pe(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign();return await this.api.post(Tp,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw pe(t)}}async sign(){if(!this.api)throw new E("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new E("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.api)throw new E("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(bp,{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new E("Auth flow has no API instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=this.prepareMessage(r,t,this.nonce),this.preparedMessage}prepareMessage(t,r,o){let n=window.location.host,a=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.",l=new Date().toISOString();return this.createSiweMessage(t,r,n,a,l,o,i)}};var Pn=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Fp,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Np,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw pe(t)}}async sendSmsCode(t,r){if(!this.api)throw new E("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new E("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Op,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw pe(o)}}};var bm=require("uuid");function _t(e){return new Date(e*1e3)}function p3(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,verifiedAt:_t(r.verified_at),chainType:"ethereum",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"email":let a={address:r.address,type:r.type,verifiedAt:_t(r.verified_at)};t.push(a);break;case"phone":let i={number:r.phoneNumber,type:r.type,verifiedAt:_t(r.verified_at)};t.push(i);break;case"google_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:_t(r.verified_at)};t.push(l);break;case"spotify_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:_t(r.verified_at)};t.push(s);break;case"twitter_oauth":let c={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:_t(r.verified_at)};t.push(c);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:_t(r.verified_at)};t.push(u);break;case"github_oauth":let g={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:_t(r.verified_at)};t.push(g);break;case"tiktok_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:_t(r.verified_at)};t.push(f);break;case"linkedin_oauth":let v={subject:r.subject,name:r.name,email:r.email,type:r.type,verifiedAt:_t(r.verified_at)};t.push(v);break;case"apple_oauth":let b={subject:r.subject,email:r.email,type:r.type,verifiedAt:_t(r.verified_at)};t.push(b);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:_t(r.verified_at)});break;case"farcaster":let w={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:_t(r.verified_at),signerPublicKey:r.signer_public_key};t.push(w);break;case"passkey":let x={type:r.type,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:_t(r.verified_at)};t.push(x);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function yr(e,t){return e.sort((r,o)=>o.verifiedAt.getTime()-r.verifiedAt.getTime()),e.find(r=>r.type===t)}var We=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,u3=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),gr=(e,t)=>t==="all-users"&&!We(e)||t==="users-without-wallets"&&!u3(e)?.length;function Vt(e){if(!e)return null;let t=p3(e.linked_accounts),r=yr(t,"wallet"),o=yr(t,"email"),n=yr(t,"phone"),a=yr(t,"google_oauth"),i=yr(t,"twitter_oauth"),l=yr(t,"discord_oauth"),s=yr(t,"github_oauth"),c=yr(t,"spotify_oauth"),u=yr(t,"tiktok_oauth"),g=yr(t,"linkedin_oauth"),f=yr(t,"apple_oauth"),v=yr(t,"farcaster"),b=e.mfa_methods.map(({type:x,verified_at:T})=>({type:x,verifiedAt:_t(T)}));return{id:e.id,createdAt:_t(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},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:c&&{subject:c.subject,email:c.email,name:c.name},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email},apple:f&&{subject:f.subject,email:f.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},mfaMethods:b.map(x=>x.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Gc=require("@ethersproject/address"),ym=require("@ethersproject/bytes"),gm=y(require("eventemitter3"));var Uu=y(require("@coinbase/wallet-sdk"));var pa=require("react/jsx-runtime"),ks=({style:e,...t})=>(0,pa.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,pa.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,pa.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var Wr=require("@ethersproject/address"),Nc=require("@ethersproject/providers"),Fu=y(require("eventemitter3"));var Wu=y(require("eventemitter3"));var m3=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Iu=e=>m3.includes(e);var Mu=require("@ethersproject/logger");var Qn=class extends oe{constructor(){super("Wallet timeout");this.type="wallet_error"}},Xn=class extends oe{constructor(){super("User rejected connection");this.type="wallet_error"}},Ir=e=>{if(e instanceof oe)return e;if(e?.code&&e?.reason){let t=new Ye(e);return e.code===Mu.ErrorCode.ACTION_REJECTED&&(t.details=kt.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Ye(e):new oe("Unknown connector error",e)},vr=class extends et{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Ye=class extends vr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(kt).find(a=>a.eipCode===o.code);this.details=n||kt.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=kt.E32002_CONNECTION_ALREADY_PENDING:this.details=kt.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=kt.E32002_WALLET_LOCKED))}},f3={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}},h3={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},y3={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},kt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...y3,...h3},wo={...f3,...kt};var Ve=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 Qn,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||gn,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 oe(`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 Ir(r)})}},$o=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},As=class extends Wu.default{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=Co(l,this.chains,n,{appId:i}),this.rpcTimeoutDuration=ei(n,"privy"),this.appId=i}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new $o(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await ge()||!this.address)throw new $o("Disconnected",4900);return(await Nu(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new $o(`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 $o(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Co(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];return await Lu(o)}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 Ou(us(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:Cn(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch{return delete o.from,await this.provider.send("eth_estimateGas",[o])}}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 Cn(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(Iu(r.method)){let o=await ge();if(await Du(),!o||!this.address)throw new $o("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 $o("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await ge();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}}},Mr=class extends Ve{constructor(r){super(r,r.rpcTimeoutDuration)}},jo=class extends Ve{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 g3=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},Dt=class extends Fu.default{constructor(r,o,n,a){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=Zn(r),this.walletClientType==="privy"&&X.put(ls(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=ei(a,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n){let a=async()=>!!this.wallets.find(i=>(0,Wr.getAddress)(i.address)===(0,Wr.getAddress)(r));return{address:(0,Wr.getAddress)(r),chainId:o,meta:n,switchChain:async i=>{if(!a)throw new oe("Wallet is not currently connected.");let l=this.wallets.find(f=>(0,Wr.getAddress)(f.address)===(0,Wr.getAddress)(r))?.chainId;if(!l)throw new oe("Unable to determine current chainId.");let s,c;if(typeof i=="number"?(s=`0x${i.toString(16)}`,c=i):(s=i,c=Number(i)),l===Zn(s))return;let u=this.chains.find(f=>f.id===c);if(!u)throw new oe(`Unsupported chainId: ${i}`);let g=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await g()}catch(f){if(g3(f,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[u.rpcUrls.default?.http[0]??""],blockExplorerUrls:[u.blockExplorers?.default.url??""]}]}),g();throw this.walletClientType==="rainbow"&&f.message?.includes("wallet_switchEthereumChain")?new oe(`Rainbow does not support the chainId ${o}`):f}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new oe("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new oe("Wallet is not currently connected.");return new Nc.Web3Provider(new Mr(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new oe("Wallet is not currently connected.");return new jo(this.proxyProvider)},sign:async i=>{if(!await a())throw new oe("Wallet is not currently connected.");return await this.sign(i)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await this.proxyProvider.request({method:"eth_accounts"});Array.isArray(c)&&(o=c)}}catch{console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.")}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],a=(0,Wr.getAddress)(n),i=[],l;if(this.walletClientType==="privy"){let c=X.get(ls(a));this.chains.find(u=>u.id===Number(c))||(X.del(ls(a)),c=null),l=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let c=await this.proxyProvider.request({method:"eth_chainId"});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${Rc}`,c),l=Rc}let s=Zn(l);if(!i.find(c=>(0,Wr.getAddress)(c.address)===a)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};i.push(this.buildConnectedWallet((0,Wr.getAddress)(n),s,c))}Rs(i,this.wallets)||(this.wallets=i,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,Wr.getAddress)(n)===(0,Wr.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new Nc.Web3Provider(new Mr(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 ti={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var v3=(e,t)=>{let o=ps(1,[ti],{},t);return e.makeWeb3Provider(o,1)},Is,Ms=class extends Dt{constructor(r,o,n,a,i){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.proxyProvider=new Ve(void 0,this.rpcTimeoutDuration),this.subscribeListeners();let l=window.matchMedia("(display-mode: standalone)").matches;Is||(Is=new Uu.default({appName:i,darkMode:!1,headlessMode:!1,enableMobileWalletLink:l})),this.proxyProvider.setWalletProvider(v3(Is,a))}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){Is.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:ks,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 oe("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Ir(r)}}};var Dc=require("react/jsx-runtime"),Ws=({...e})=>(0,Dc.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Dc.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var Ls=class extends Dt{constructor(r,o,n,a){super("privy",o,n,a);this.connectorType="embedded";this.proxyProvider=r,this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Cn(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Ws,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Fc=require("react/jsx-runtime"),ri=({style:e,...t})=>(0,Fc.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Fc.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var At=require("react/jsx-runtime"),oi=({style:e,...t})=>(0,At.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,At.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,At.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,At.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,At.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,At.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,At.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,At.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,At.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,At.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,At.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,At.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,At.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,At.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var ua=require("react/jsx-runtime"),eo=({style:e,...t})=>(0,ua.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,ua.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,ua.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var ii=class extends Dt{constructor(r,o,n,a,i){super(i||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Ve(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=a;let l=a.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}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 oe("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Ir(r)}}},ni,ai=class extends Dt{constructor(r,o,n,a,i){super(i??"unknown",r,o,n);this.connectorType="injected";Ka(this,ni,void 0);this.proxyProvider=new Ve(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(a),i==="metamask"?wc(this,ni,{name:"MetaMask",icon:oi,id:"io.metamask"}):i==="phantom"&&wc(this,ni,{name:"Phantom",icon:eo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return gp(this,ni)??{name:"Browser Extension",icon:ri,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 oe("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Ir(r)}}};ni=new WeakMap;var C3=require("@ethersproject/address"),w3=require("@ethersproject/providers"),Bu=require("react-device-detect");var Os=class extends ii{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Bu.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new oe("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Ir(t)}}};var Ns=class extends Dt{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Ve(void 0,gn);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.emit("initialized"),this.initialized=!0}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 Ds=class extends Ns{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:eo,id:"phantom"}}};var li=require("@walletconnect/ethereum-provider"),hm=require("react-device-detect");var wr=require("react");var Hu=require("react/jsx-runtime");function Fs({src:e,...t}){return(0,Hu.jsx)("img",{src:e,...t,style:{display:"none"}})}var to=require("react"),cm=require("react");var Cr={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:nu,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Gu=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let o of e.primary.slice(1))t.includes(o)?console.warn(`Duplicated login method: ${o}`):t.push(o);for(let o of e.overflow??[])!t.includes(o)&&!r.includes(o)?r.push(o):console.warn(`Duplicated login method: ${o}`);return{primary:t,overflow:r}};var b3=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),Vu=e=>b3.has(e),zu=(e,t,r)=>r.indexOf(e)===t,qu=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Vu).filter(zu):e?e.filter(Vu).filter(zu):Cr.appearance.walletList;var Us={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var Bs={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var Hs={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var $u={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var ju={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var Gs={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var Vs={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-goerli.blastapi.io"],webSocket:["wss://base-goerli.blastapi.io"]},default:{http:["https://goerli.base.org"]},public:{http:["https://goerli.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://goerli.basescan.org"},default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var zs={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var Ku={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://artio.rpc.berachain.com"]},public:{http:["https://artio.rpc.berachain.com"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var Yu={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var Zu={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var Ju={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}};var Qu={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var Xu={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://goerli.rpc.privy.systems"]},alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var em={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var tm={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-mainnet.infura.io/v3"],webSocket:["wss://linea-mainnet.infura.io/ws/v3"]},default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var rm={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var qs={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var $s={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var js={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var ma={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var fa={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mumbai.rpc.privy.systems"]},alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"],webSocket:["wss://polygon-mumbai.g.alchemy.com/v2"]},infura:{http:["https://polygon-mumbai.infura.io/v3"],webSocket:["wss://polygon-mumbai.infura.io/ws/v3"]},default:{http:["https://matic-mumbai.chainstacklabs.com"]},public:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var om={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var nm={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var Ks={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var Ys={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var Zs={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var si=[Us,Bs,Hs,Xu,nm,ti,qs,$s,js,ma,fa,Yu,Zu,Ju,Qu,Gs,Vs,zs,Ku,tm,rm,$u,ju,Ks,Zs,Ys,em,om],Mb=new Set(si.map(e=>e.id));var Ko=y(require("tinycolor2")),im="#FFFFFF",E3="#000000",T3=im,P3="#1E1E1D";function S3(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}function bo(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Ko.default)({...e.toHsl(),l:r})}function am({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:a=im,blackHex:i=E3}){let l;switch(e){case"light":l=T3;break;case"dark":l=P3;break;default:l=e;break}let s=(0,Ko.default)(l),c=(0,Ko.default)(t),u=(0,Ko.default)(r),g=(0,Ko.default)(o),f=(0,Ko.default)(n),v=S3(s.getLuminance()),b=bo(s,v==="light"?-.04:.11),w=bo(s,v==="light"?-.88:.87),x=bo(s,v==="light"?-.77:.75),T=bo(s,v==="light"?-.43:.45).desaturate(v==="light"?60:20),S=bo(s,v==="light"?-.08:.25).desaturate(v==="light"?60:20),L=bo(c,.15),I=bo(c,-.06),U=bo(f,.3),M=(0,Ko.default)(c.getLuminance()>.5?i:a),G=bo(u,-.16);return{colorScheme:v,background:s.toHslString(),background2:b.toHslString(),foreground:w.toHslString(),foreground2:x.toHslString(),foreground3:T.toHslString(),foreground4:S.toHslString(),accent:c.toHslString(),accentLight:L.toHslString(),accentDark:I.toHslString(),foregroundAccent:M.toHslString(),success:u.toHslString(),successDark:G.toHslString(),error:f.toHslString(),errorLight:U.toHslString(),warn:g.toHslString()}}function Uc(e,t,r){let o=r?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],a=t?.loginMethods?.filter(Ar=>n.includes(Ar)),i,l,s,c,u,g,f,v,b,w,x,T,S;t?.loginMethods?(i=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),c=t.loginMethods.includes("wallet"),u=a?.includes("google"),g=a?.includes("twitter"),f=a?.includes("discord"),b=a?.includes("spotify"),v=a?.includes("tiktok"),x=a?.includes("github"),w=a?.includes("linkedin"),T=a?.includes("apple"),S=a?.includes("farcaster")):(i=e.emailAuth,l=e.smsAuth,c=e.walletAuth,u=e.googleOAuth,g=e.twitterOAuth,f=e.discordOAuth,x=e.githubOAuth,b=e.spotifyOAuth,v=e.tiktokOAuth,w=e.linkedinOAuth,T=e.appleOAuth,S=e.farcasterAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?s=!1:e.passkeyAuth&&(s=!0);let L=[i,l].filter(Boolean),I=[u,g,f,x,b,v,w,T,S].filter(Boolean),U=[c].filter(Boolean);if(L.length+I.length+U.length===0)throw new Error("You must enable at least one login method");let M=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;M&&U.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),M=!1):!M&&I.length+L.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),M=!0),t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=qu({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=Gu({input:t?.loginMethodsAndOrder}),z=t?.intl?.defaultCountry??"US",{chains:j,defaultChain:R}=x3({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),fe=!!t?.defaultChain,B=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,he,ye=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?B?he=t?.embeddedWallets?.noPromptOnSignature??!0:he=t?.embeddedWallets?.noPromptOnSignature??ye:he=ye,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&he!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:se,...Xe}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,palette:am({backgroundTheme:t?.appearance?.theme??Cr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Cr.appearance.accentColor}),loginGroupPriority:M?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:G},loginMethods:{wallet:c,email:i,sms:l,passkey:s,google:u,twitter:g,discord:f,github:x,spotify:b,tiktok:v,linkedin:w,apple:T,farcaster:S},loginMethodsAndOrder:Y,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Cr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Cr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Cr.rpcConfig.rpcTimeouts},chains:j,defaultChain:R,intl:{defaultCountry:z},shouldEnforceDefaultChainOnConnect:fe,captchaEnabled:e.captchaEnabled??Cr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...typeof se=="boolean"?{requireUserOwnedRecoveryOnCreate:se}:{},...B?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...Xe,noPromptOnSignature:he},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:B?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Cr.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??Cr._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Cr._render.inParentNodeId}}}function sm(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:a,...i}=e;return{...i,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...a?{defaultChain:a.id}:void 0,...r?{...r,...r.logo&&typeof r.logo?{logo:"component"}:void 0}:void 0,legacyCreateEmbeddedWalletFlag:t}}function x3({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&o&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map(s=>s.rpcUrls.privyWalletOverride?s:si.find(u=>u.id===s.id)??s)}else n=si.concat(e??[]);let a=t?n[0]:ti,i=r??a;if(!n.find(l=>l.id===i.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:i}}var lm=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,a;n<e.length;n++)a=e.charCodeAt(n),r=Math.imul(r^a,2654435761),o=Math.imul(o^a,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var um=require("react/jsx-runtime"),dm={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},Bc=Uc(dm,void 0,!1),Hc=(0,cm.createContext)({appConfig:Bc,isServerConfigLoaded:!1}),pm=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,a]=(0,to.useState)(null),i=(0,to.useMemo)(()=>Uc(n??dm,o,!!n),[n,o]);return(0,to.useEffect)(()=>{if(!n)return;let l=sm(o,t),s=lm(JSON.stringify(l)).toString(),c=`privy:sent:${n.id}:${s}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:l}),localStorage.setItem(c,"t"))},[o,t,n]),(0,to.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),a(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,um.jsx)(Hc.Provider,{value:{appConfig:i,isServerConfigLoaded:!!n},children:e})},Yo=()=>{let{appConfig:e}=(0,to.useContext)(Hc);return e},Js=()=>{let{isServerConfigLoaded:e}=(0,to.useContext)(Hc);return e};var P=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var Qs=require("react/jsx-runtime"),mm=(0,wr.createContext)({ready:!1,app:Bc,currentScreen:null,lastScreen:null,navigate:P,navigateBack:P,resetNavigation:P,setModalData:P,onUserCloseViaDialogOrKeybindRef:void 0}),_3=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],fm=e=>{let t=Yo(),r=e.authenticated,[o,n]=(0,wr.useState)(e.initialScreen);(0,wr.useEffect)(()=>{!r&&!_3.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let a=(0,wr.useRef)(null);(0,wr.useEffect)(()=>{e.open||(a.current=null)},[e.open]),(0,wr.useEffect)(()=>{a.current=null},[e.initialScreen]);let i={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:a};return(0,Qs.jsxs)(mm.Provider,{value:i,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,Qs.jsx)(Fs,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},_=()=>(0,wr.useContext)(mm);var Eo=require("react/jsx-runtime"),ha=({style:e,...t})=>{let{app:r}=_();return(0,Eo.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Eo.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,Eo.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,Eo.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,Eo.jsx)("defs",{children:(0,Eo.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,Eo.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var ro=class extends Dt{constructor(r,o,n,a,i,l,s){super(s||"unknown",n,a,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new Ve(void 0,this.rpcTimeoutDuration),s&&(this.walletEntry=fs[s],this.walletClientType=s)}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=ms(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.emit("initialized"),this.initialized=!0;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:oi,id:"io.metamask"}:{name:gu(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||ha,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=fs[r],this.walletClientType=r,this.redirectUri=void 0,Eu(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Xn)};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 oe("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=ms(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=ei(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(i=>{if(i){o(Ir(i));return}o(new oe("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=ps(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 li.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:li.OPTIONAL_EVENTS,optionalMethods:li.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1});return a.on("display_uri",i=>{if(a.signer.abortPairingAttempt(),hm.isMobile&&this.walletEntry){let{redirect:l,href:s}=wu(i,this.walletEntry);Tu({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,hs(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=ms(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 Vc=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,ym.isHexString)(o)).map(o=>(0,Gc.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},ei=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||gn:gn,ci=class extends gm.default{constructor(r,o,n,a,i,l,s,c,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 Ve: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=c,this.privyAppName=u,this.initializedWalletConnectors=0,this.walletsReady=!1,this.storedConnections=this.loadConnectionHistory()}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;X.get(kc)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(kc));let r=vu(this.store,this.walletList).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"),!Vo()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),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.initializedWalletConnectors++,this.walletsReady=this.initializedWalletConnectors===this.walletConnectors.length,this.emit("walletsUpdated")}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 As(r,o,this.rpcConfig,this.chains,a,n.id),s=new Ls(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=this.loadConnectionHistory(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let a=this.findWalletConnector(r,o);if(a)return a instanceof ro&&a.resetConnection(o),a;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Os(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new ai(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new ai(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new ai(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new ii(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Ms(this.chains,this.defaultChain,this.rpcConfig,this.privyAppId,this.privyAppName):r==="phantom"?new Ds(this.defaultChain):new ro(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,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()}loadConnectionHistory(){let r=i=>i&&typeof i.address=="string"&&typeof i.connectorType=="string"&&typeof i.walletClientType=="string"&&typeof i.connectedAt=="number",o=X.get(Ac);return o&&Array.isArray(o)&&o.map(i=>r(i)).every(Boolean)?o:[]}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));X.put(Ac,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Gc.getAddress)(r),this.emit("walletsUpdated")}};function Rs(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 vm=require("ofetch");var k3=[Ja,Xa,Qa,es],Xs=class{constructor(t,r,o){this.appId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=is,this.client=r,this.defaults=o,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=vm.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:n,options:a})=>{let i=new Headers(a.headers);i.set("privy-app-id",this.appId),i.set("privy-ca-id",this.clientAnalyticsId||""),i.set("privy-client",`react-auth:${this.sdkVersion}`);let l=k3.includes(n.toString());if(!i.has("authorization")){let s=await this.client.getAccessToken({disableAutoRefresh:l});s!==null&&i.set("authorization",`Bearer ${s}`)}a.headers=i,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new Ya}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw pe(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw pe(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw pe(o)}}};var Zo=y(require("js-cookie"));function Cm(e){return e instanceof Go?"email":e instanceof Pn?"sms":e instanceof Tn?"siwe":e instanceof Kn?"custom_auth":e instanceof Xr?e.meta.provider:null}var wm=y(require("jose")),oo=class{static parse(t){try{return new oo(t)}catch{return null}}constructor(t){this.value=t,this._decoded=wm.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 A3=30,el=class{constructor(){this.authenticateOnce=new qe(async t=>this._authenticate(t)),this.linkOnce=new qe(async t=>this._link(t)),this.refreshOnce=new qe(this._refresh.bind(this)),this.destroyOnce=new qe(this._destroy.bind(this)),this.forkSessionOnce=new qe(this._forkSession.bind(this))}get token(){try{let t=X.get(mn);return typeof t=="string"?new oo(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(as);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(ra);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=Zo.default.get(ss);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"}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=oo.parse(this.token);return t!==null&&!t.isExpired(A3)}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()}async _authenticate(t){try{let{token:r,refresh_token:o,user:n,is_new_user:a}=await t.authenticate();this.storeToken(r),this.storeRefreshToken(o);let i=Cm(t);return i&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:i,isNewUser:a}}),i==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:Vt(n),isNewUser:a}}catch(r){throw console.warn("Error authenticating session"),xt(r)}}async _link(t){try{let r=await t.link();return Vt(r)}catch(r){throw console.warn("Error linking account"),xt(r)}}async _refresh(){if(!this.api)throw new E("Session has no API instance");if(!this.client)throw new E("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;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(Ja,i,{headers:a}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(Xa,{refresh_token:o}),this.clearForkedToken();else return null;return n.session_update_action==="set"&&(this.storeToken(n.token),this.storeRefreshToken(n.refresh_token)),n.session_update_action==="clear"&&this.destroyLocalState(),n.session_update_action==="ignore"&&n.token&&this.storeToken(n.token),Vt(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 xt(n)}}async _destroy(){try{await this.api?.post(Qa,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new E("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(wp,{refresh_token:t});return this.storeToken(r.token),this.storeRefreshToken(r.refresh_token),r.new_session_refresh_token}catch(r){throw xt(r)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let r=X.get(mn);if(X.put(mn,t),!this.client?.useServerCookies){let o=oo.parse(t)?.expiration;Zo.default.set(xc,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(mn),Zo.default.remove(xc)}storeRefreshToken(t){typeof t=="string"?(X.put(as,t),this.client?.useServerCookies||(Zo.default.set(ss,"t",{sameSite:"Strict",secure:!0,expires:30}),Zo.default.set(_c,t,{sameSite:"Strict",secure:!0,expires:30}))):(X.del(as),Zo.default.remove(_c),Zo.default.remove(ss))}clearForkedToken(){X.del(ra)}};var zc,tl,Em,di=class{constructor(t){Ka(this,tl);this.apiUrl=t.apiUrl||ns,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||iu,this.appId=t.appId,this.clientAnalyticsId=vp(this,tl,Em).call(this),zc||(zc=new el),this.session=zc,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:a,walletList:i,shouldEnforceDefaultChainOnConnect:l,appName:s}){this.connectors||(this.connectors=new ci(this.appId,t,r,o,n,a,i,l,s))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Xs(this.appId,this,{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 E("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new E("No auth flow in progress.");return this.session.link(this.authFlow)}async logout(){await this.session.destroy(),this.authFlow=void 0}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}startMfaFlow(t){t.api=this.api,this.mfaFlow=t}async unlinkEmail(t){try{let r=await this.api.post(Wp,{address:t});return Vt(r)}catch(r){throw xt(r)}}async acceptTerms(){try{let t=await this.api.post(Qp,{});return Vt(t)}catch(t){throw xt(t)}}async unlinkPhone(t){try{let r=await this.api.post(Dp,{phoneNumber:t});return Vt(r)}catch(r){throw xt(r)}}async unlinkWallet(t){try{let r=await this.api.post(Pp,{address:t});return Vt(r)}catch(r){throw xt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Gp,{provider:t,subject:r});return Vt(o)}catch(o){throw xt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Ap,{fid:t});return Vt(r)}catch(r){throw xt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Yp,{credential_id:t});return Vt(r)}catch(r){throw xt(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(es,{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(Xp,t)}catch(r){throw xt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?oo.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t});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,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_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}}catch(t){throw xt(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()}};tl=new WeakSet,Em=function(){if(typeof window>"u")return null;try{let r=X.get(oa);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,bm.v4)();try{return X.put(oa,t),t}catch{return t}};var xm=require("@marsidev/react-turnstile"),rl=require("react");var br=require("react");var Sm=require("react/jsx-runtime"),Tm=(0,br.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:P,setError:P,setExecuting:P,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:P,reset:P,execute:P}),Lr=class extends et{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Pm=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,br.useRef)(null),[a,i]=(0,br.useState)(),[l,s]=(0,br.useState)(),[c,u]=(0,br.useState)(!1),g=(0,br.useMemo)(()=>o?!c&&!a&&!l?{status:"ready"}:c&&!a&&!l?{status:"loading"}:a&&!l?{status:"success",token:a}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,a,l,c]);return(0,Sm.jsx)(Tm.Provider,{value:{...g,ref:n,enabled:o,siteKey:r,appId:t,setToken:i,setError:s,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),s(void 0),i(void 0))},reset(){o&&(n.current?.reset(),u(!1),s(void 0),i(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await hu(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Lr("Captcha failed",null,"captcha_timeout")}}},children:e})},Se=()=>(0,br.useContext)(Tm);var qc=require("react/jsx-runtime"),ol=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:a,setExecuting:i,ref:l}=Se(),[,s]=(0,rl.useMemo)(()=>r?.split("t:")||[],[r]);if((0,rl.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,qc.jsx)("div",{className:"hidden h-0 w-0",children:(0,qc.jsx)(xm.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),i(!1)},onSuccess:c=>{e.onSuccess?.(c),a(c),i(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),a(void 0)}catch{n("expired_and_failed_reset")}}})})};var Fo=require("react"),s2=y(require("react-dom"));var nl=require("react");var $c=(0,nl.createContext)({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:P,initializeWalletProxy:P,getAuthMeta:P,getAuthFlow:P,closePrivyModal:P,openPrivyModal:P,connectWallet:P,initLoginWithWallet:P,loginWithWallet:P,initLoginWithFarcaster:P,loginWithFarcaster:P,loginWithCode:P,initLoginWithEmail:P,initLoginWithSms:P,initUpdateEmail:P,resendEmailCode:P,resendSmsCode:P,initLoginWithHeadlessOAuth:P,loginWithHeadlessOAuth:P,initLoginWithOAuth:P,recoveryOAuthFlow:P,loginWithOAuth:P,initLoginWithPasskey:P,loginWithPasskey:P,initLinkWithPasskey:P,linkWithPasskey:P,refreshUser:P,walletProxy:null,createAnalyticsEvent:P,acceptTerms:P,getUsdTokenPrice:P,recoverEmbeddedWallet:P,getFiatOnRampConfig:P,updateWallets:P,fundWallet:P,setReadyToTrue:P,requestFarcasterSignerStatus:P}),W=()=>(0,nl.useContext)($c);var il=require("react");var we=(0,il.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:P,login:P,connectOrCreateWallet:P,linkEmail:P,linkPhone:P,linkFarcaster:P,linkWallet:P,linkGoogle:P,linkTwitter:P,linkDiscord:P,linkGithub:P,linkSpotify:P,linkTiktok:P,linkLinkedIn:P,linkApple:P,linkPasskey:P,updateEmail:P,logout:P,getAccessToken:P,getEthereumProvider:P,getEthersProvider:P,getWeb3jsProvider:P,unlinkEmail:P,unlinkPhone:P,unlinkWallet:P,unlinkGoogle:P,unlinkTwitter:P,unlinkDiscord:P,unlinkGithub:P,unlinkSpotify:P,unlinkTiktok:P,unlinkLinkedIn:P,unlinkApple:P,unlinkFarcaster:P,unlinkPasskey:P,setActiveWallet:P,forkSession:P,createWallet:P,signMessage:P,signTypedData:P,enrollInMfa:P,initEnrollmentWithSms:P,initEnrollmentWithTotp:P,promptMfa:P,init:P,submitEnrollmentWithSms:P,submitEnrollmentWithTotp:P,unenroll:P,submit:P,cancel:P,sendTransaction:P,exportWallet:P,setWalletPassword:P,requestFarcasterSigner:P,submitCast:P,removeCast:P,likeCast:P,recastCast:P,followUser:P,unfollowUser:P,initLoginWithEmail:P,initLoginWithSms:P,otpState:{status:"initial"},loginWithCode:P,fundWallet:P,initLoginWithHeadlessOAuth:P,loginWithHeadlessOAuth:P,isHeadlessOAuthLoading:!1,isModalOpen:!1}),H=()=>(0,il.useContext)(we);var al=require("react"),_m=e=>{let[t,r]=(0,al.useState)("auto");return(0,al.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var pi=require("react"),km={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},jc=(0,pi.createContext)(void 0),Am=()=>(0,pi.useContext)(jc);function $e(e,t){if(!t)return;let o=Am().current[e];return(0,pi.useEffect)(()=>{for(let[n,a]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(a);return()=>{for(let[n,a]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(i=>i!==a)}},[t])}function N(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function Rm(){let e=Am();return(t,r,...o)=>N(e,t,r,...o)}function sl(e){$e("configureMfa",e)}var td=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),Fm=y(require("@heroicons/react/24/solid/DocumentCheckIcon")),Um=y(require("styled-components"));var Er=y(require("styled-components"));var ll=y(require("styled-components")),Jo=require("react/jsx-runtime"),Rt=({success:e,fail:t})=>(0,Jo.jsxs)(Jo.Fragment,{children:[(0,Jo.jsx)(zt,{className:e?"success":t?"fail":""}),(0,Jo.jsx)(Kc,{className:e?"success":t?"fail":""})]}),zt=ll.default.span`
|
|
13
13
|
&& {
|
|
14
14
|
width: 82px;
|
|
15
15
|
height: 82px;
|
|
@@ -42,13 +42,13 @@ Resources:
|
|
|
42
42
|
border-color: var(--privy-color-error);
|
|
43
43
|
border-bottom-color: var(--privy-color-error);
|
|
44
44
|
}
|
|
45
|
-
`,
|
|
45
|
+
`,Kc=(0,ll.default)(zt)`
|
|
46
46
|
&& {
|
|
47
47
|
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
48
48
|
animation: none;
|
|
49
49
|
opacity: 0.5;
|
|
50
50
|
}
|
|
51
|
-
`,To=e=>(0,
|
|
51
|
+
`,To=e=>(0,Jo.jsx)(R3,{color:e.color||"var(--privy-color-foreground-3)"}),R3=(0,ll.default)(zt)`
|
|
52
52
|
&& {
|
|
53
53
|
height: 0.9rem;
|
|
54
54
|
width: 0.9rem;
|
|
@@ -57,7 +57,7 @@ Resources:
|
|
|
57
57
|
/* Override default Loader to match button transitions */
|
|
58
58
|
transition: border-color 200ms ease;
|
|
59
59
|
}
|
|
60
|
-
`;var
|
|
60
|
+
`;var ct=require("react/jsx-runtime"),cl=Er.default.button`
|
|
61
61
|
display: flex;
|
|
62
62
|
flex-direction: row;
|
|
63
63
|
align-items: center;
|
|
@@ -85,13 +85,13 @@ Resources:
|
|
|
85
85
|
color: var(--privy-color-foreground-3);
|
|
86
86
|
cursor: not-allowed;
|
|
87
87
|
}
|
|
88
|
-
`,D=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,
|
|
89
|
-
${e=>e.hideAnimations&&
|
|
88
|
+
`,D=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,ct.jsx)(Im,{disabled:t||r,...n,children:t?(0,ct.jsxs)("span",{children:[(0,ct.jsx)(To,{}),o?(0,ct.jsx)("span",{children:o}):null]}):e}),gE=(0,Er.default)(D)`
|
|
89
|
+
${e=>e.hideAnimations&&Er.css`
|
|
90
90
|
&& {
|
|
91
91
|
transition: none;
|
|
92
92
|
}
|
|
93
93
|
`}
|
|
94
|
-
`,
|
|
94
|
+
`,dl=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,ct.jsx)(Im,{as:"a",disabled:t||r,...n,children:t?(0,ct.jsxs)("span",{children:[(0,ct.jsx)(To,{}),o?(0,ct.jsx)("span",{children:o}):null]}):e}),Im=(0,Er.default)(cl)`
|
|
95
95
|
position: relative;
|
|
96
96
|
|
|
97
97
|
&& {
|
|
@@ -117,7 +117,7 @@ Resources:
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/* If an anchor tag, :disabled isn't a thing, so manually set state */
|
|
120
|
-
${e=>e.disabled?
|
|
120
|
+
${e=>e.disabled?Er.css`
|
|
121
121
|
&&&,
|
|
122
122
|
&&&:hover,
|
|
123
123
|
&&&:active {
|
|
@@ -136,7 +136,7 @@ Resources:
|
|
|
136
136
|
opacity: 1;
|
|
137
137
|
animation: fadein 200ms ease;
|
|
138
138
|
}
|
|
139
|
-
`,
|
|
139
|
+
`,Or=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,ct.jsx)(I3,{disabled:t||r,...n,children:t?(0,ct.jsxs)("span",{children:[(0,ct.jsx)(To,{}),o?(0,ct.jsx)("span",{children:o}):null]}):e}),I3=(0,Er.default)(cl)`
|
|
140
140
|
&& {
|
|
141
141
|
border-width: 1px;
|
|
142
142
|
border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
|
|
@@ -165,7 +165,7 @@ Resources:
|
|
|
165
165
|
opacity: 1;
|
|
166
166
|
animation: fadein 200ms ease;
|
|
167
167
|
}
|
|
168
|
-
`,
|
|
168
|
+
`,ui=Er.default.button`
|
|
169
169
|
&& {
|
|
170
170
|
padding: 12px 16px;
|
|
171
171
|
font-weight: 500;
|
|
@@ -178,7 +178,7 @@ Resources:
|
|
|
178
178
|
transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
|
|
179
179
|
user-select: none;
|
|
180
180
|
|
|
181
|
-
${e=>e.invisible&&
|
|
181
|
+
${e=>e.invisible&&Er.css`
|
|
182
182
|
pointer-events: none;
|
|
183
183
|
`}
|
|
184
184
|
|
|
@@ -196,10 +196,10 @@ Resources:
|
|
|
196
196
|
cursor: not-allowed;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
`,
|
|
199
|
+
`,vE=Er.default.div`
|
|
200
200
|
/* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
|
|
201
201
|
height: 44px;
|
|
202
|
-
`,
|
|
202
|
+
`,mi=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>(0,ct.jsxs)(M3,{isSubmitting:o,onClick:t,disabled:r,...n,children:[(0,ct.jsx)("span",{children:e}),(0,ct.jsx)("span",{children:(0,ct.jsx)(To,{})})]}),M3=Er.default.button`
|
|
203
203
|
&& {
|
|
204
204
|
color: var(--privy-color-accent);
|
|
205
205
|
font-size: 16px;
|
|
@@ -241,7 +241,7 @@ Resources:
|
|
|
241
241
|
cursor: not-allowed;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
`;var
|
|
244
|
+
`;var Zc=y(require("styled-components"));var qt=require("react/jsx-runtime"),Yc=Zc.default.div`
|
|
245
245
|
margin-top: 16px;
|
|
246
246
|
font-size: 13px;
|
|
247
247
|
text-align: center;
|
|
@@ -250,7 +250,7 @@ Resources:
|
|
|
250
250
|
&& > a {
|
|
251
251
|
color: var(--privy-color-accent);
|
|
252
252
|
}
|
|
253
|
-
`;function
|
|
253
|
+
`;function fi(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return(0,qt.jsx)(Yc,{});if(!r&&!t)return(0,qt.jsx)(Yc,{});let n=!!(t&&r);return(0,qt.jsxs)(Yc,{children:["By logging in I agree to the"," ",r&&(0,qt.jsx)("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,qt.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var q=({protectedByPrivy:e})=>(0,qt.jsx)(ee,{children:e?(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(Ws,{className:"hide-on-mobile"}),(0,qt.jsx)("span",{className:"hide-on-mobile",children:(0,qt.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),ee=Zc.default.div`
|
|
254
254
|
display: flex;
|
|
255
255
|
align-items: center;
|
|
256
256
|
justify-content: center;
|
|
@@ -277,7 +277,7 @@ Resources:
|
|
|
277
277
|
@media all and (display-mode: standalone) {
|
|
278
278
|
padding-bottom: 30px;
|
|
279
279
|
}
|
|
280
|
-
`;var
|
|
280
|
+
`;var Mm=y(require("@heroicons/react/24/outline/ArrowLeftIcon")),Wm=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),Lm=y(require("@heroicons/react/24/outline/XMarkIcon")),Sn=y(require("styled-components"));var dt=require("react/jsx-runtime"),W3=({backFn:e})=>(0,dt.jsx)("div",{children:(0,dt.jsx)(Jc,{onClick:e,children:(0,dt.jsx)(Mm.default,{height:"16px",width:"16px",strokeWidth:2})})}),L3=({infoFn:e})=>(0,dt.jsx)("div",{children:(0,dt.jsx)(N3,{"aria-label":"info",onClick:e,children:(0,dt.jsx)(Wm.default,{height:"22px",width:"22px",strokeWidth:2})})}),O3=e=>(0,dt.jsx)("div",{children:(0,dt.jsx)(Jc,{"aria-label":"close modal",onClick:e.onClose,children:(0,dt.jsx)(Lm.default,{height:"16px",width:"16px",strokeWidth:2})})});var k=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:a}=W(),{app:i}=_();return(0,dt.jsxs)(D3,{children:[(0,dt.jsxs)(F3,{children:[e&&(0,dt.jsx)(W3,{backFn:e}),t&&(0,dt.jsx)(L3,{infoFn:t})]}),o&&(0,dt.jsx)(B3,{id:"privy-dialog-title",children:o}),(0,dt.jsx)(U3,{children:i?.render.inDialog&&n&&(0,dt.jsx)(O3,{onClose:r||(()=>a())})})]})},Jc=Sn.default.button`
|
|
281
281
|
&& {
|
|
282
282
|
cursor: pointer;
|
|
283
283
|
display: flex;
|
|
@@ -296,11 +296,11 @@ Resources:
|
|
|
296
296
|
opacity: 1;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
`,
|
|
299
|
+
`,N3=(0,Sn.default)(Jc)`
|
|
300
300
|
&& {
|
|
301
301
|
background-color: transparent;
|
|
302
302
|
}
|
|
303
|
-
`,
|
|
303
|
+
`,D3=Sn.default.div`
|
|
304
304
|
padding: 16px 0;
|
|
305
305
|
display: flex;
|
|
306
306
|
align-items: center;
|
|
@@ -312,31 +312,31 @@ Resources:
|
|
|
312
312
|
font-weight: 600;
|
|
313
313
|
color: var(--privy-color-foreground);
|
|
314
314
|
}
|
|
315
|
-
`,
|
|
315
|
+
`,F3=Sn.default.div`
|
|
316
316
|
flex: 1;
|
|
317
317
|
align-items: center;
|
|
318
318
|
display: flex;
|
|
319
319
|
gap: 8px;
|
|
320
|
-
`,
|
|
320
|
+
`,U3=Sn.default.div`
|
|
321
321
|
flex: 1;
|
|
322
322
|
display: flex;
|
|
323
323
|
justify-content: flex-end;
|
|
324
|
-
`,
|
|
324
|
+
`,B3=Sn.default.div`
|
|
325
325
|
overflow: hidden;
|
|
326
326
|
white-space: nowrap;
|
|
327
327
|
max-width: 100%;
|
|
328
328
|
text-overflow: ellipsis;
|
|
329
329
|
text-align: center;
|
|
330
330
|
color: var(--privy-color-foreground-2);
|
|
331
|
-
`;var Po=y(require("styled-components")),
|
|
331
|
+
`;var Po=y(require("styled-components")),pl=Po.default.div`
|
|
332
332
|
text-align: left;
|
|
333
333
|
flex-grow: 1;
|
|
334
|
-
`,
|
|
334
|
+
`,ul=Po.default.div`
|
|
335
335
|
display: flex;
|
|
336
336
|
flex-direction: column;
|
|
337
337
|
justify-content: flex-end;
|
|
338
338
|
flex-grow: 1;
|
|
339
|
-
`,
|
|
339
|
+
`,Tr=Po.default.div`
|
|
340
340
|
display: flex;
|
|
341
341
|
flex-direction: column;
|
|
342
342
|
gap: 12px;
|
|
@@ -351,7 +351,7 @@ Resources:
|
|
|
351
351
|
&::-webkit-scrollbar {
|
|
352
352
|
display: none;
|
|
353
353
|
}
|
|
354
|
-
`,
|
|
354
|
+
`,Om=Po.css`
|
|
355
355
|
&& {
|
|
356
356
|
width: 100%;
|
|
357
357
|
font-size: 16px;
|
|
@@ -389,14 +389,14 @@ Resources:
|
|
|
389
389
|
max-width: 24px;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
`,
|
|
393
|
-
${
|
|
394
|
-
`,
|
|
395
|
-
${
|
|
392
|
+
`,ze=Po.default.button`
|
|
393
|
+
${Om}
|
|
394
|
+
`,Qc=Po.default.a`
|
|
395
|
+
${Om}
|
|
396
396
|
`,So=Po.default.div`
|
|
397
397
|
width: 100%;
|
|
398
398
|
${e=>e.if?"display: none;":""}
|
|
399
|
-
`;var
|
|
399
|
+
`;var pt=y(require("styled-components")),ot=pt.default.div`
|
|
400
400
|
display: flex;
|
|
401
401
|
flex-direction: column;
|
|
402
402
|
align-items: center;
|
|
@@ -404,17 +404,17 @@ Resources:
|
|
|
404
404
|
@media (max-width: 440px) {
|
|
405
405
|
padding: 10px 10px 20px;
|
|
406
406
|
}
|
|
407
|
-
`,
|
|
407
|
+
`,Le=pt.default.div`
|
|
408
408
|
font-size: 18px;
|
|
409
409
|
line-height: 18px;
|
|
410
410
|
text-align: center;
|
|
411
411
|
font-weight: 600;
|
|
412
412
|
margin-bottom: 10px;
|
|
413
|
-
`,be=
|
|
413
|
+
`,be=pt.default.div`
|
|
414
414
|
font-size: 0.875rem;
|
|
415
415
|
|
|
416
416
|
text-align: center;
|
|
417
|
-
`,
|
|
417
|
+
`,Qo=pt.default.div`
|
|
418
418
|
display: flex;
|
|
419
419
|
flex-direction: column;
|
|
420
420
|
align-items: center;
|
|
@@ -424,7 +424,7 @@ Resources:
|
|
|
424
424
|
@media (max-width: 440px) {
|
|
425
425
|
padding: 10px 10px 20px;
|
|
426
426
|
}
|
|
427
|
-
`,
|
|
427
|
+
`,Nm=pt.default.div`
|
|
428
428
|
display: flex;
|
|
429
429
|
flex-direction: column;
|
|
430
430
|
align-items: stretch;
|
|
@@ -432,7 +432,7 @@ Resources:
|
|
|
432
432
|
padding: 1rem 0rem 0rem;
|
|
433
433
|
flex-grow: 1;
|
|
434
434
|
width: 100%;
|
|
435
|
-
`,
|
|
435
|
+
`,xn=pt.default.div`
|
|
436
436
|
width: 25px;
|
|
437
437
|
display: flex;
|
|
438
438
|
align-items: center;
|
|
@@ -444,19 +444,19 @@ Resources:
|
|
|
444
444
|
width: 25px !important;
|
|
445
445
|
color: var(--privy-color-accent);
|
|
446
446
|
}
|
|
447
|
-
`,
|
|
447
|
+
`,_n=pt.default.div`
|
|
448
448
|
display: flex;
|
|
449
449
|
align-items: center;
|
|
450
450
|
gap: 10px;
|
|
451
451
|
font-size: 0.875rem;
|
|
452
452
|
line-height: 1rem;
|
|
453
453
|
text-align: left;
|
|
454
|
-
`,
|
|
454
|
+
`,Nr=pt.default.div`
|
|
455
455
|
display: flex;
|
|
456
456
|
flex-direction: column;
|
|
457
457
|
gap: 10px;
|
|
458
458
|
padding-top: 20px;
|
|
459
|
-
`,
|
|
459
|
+
`,ml=pt.default.div`
|
|
460
460
|
display: flex;
|
|
461
461
|
flex-direction: column;
|
|
462
462
|
align-items: stretch;
|
|
@@ -464,7 +464,7 @@ Resources:
|
|
|
464
464
|
padding: 1rem 0rem 0rem;
|
|
465
465
|
flex-grow: 1;
|
|
466
466
|
width: 100%;
|
|
467
|
-
`,
|
|
467
|
+
`,fl=pt.default.div`
|
|
468
468
|
display: flex;
|
|
469
469
|
gap: 5px;
|
|
470
470
|
width: 100%;
|
|
@@ -472,7 +472,7 @@ Resources:
|
|
|
472
472
|
& > button:not(#remove) {
|
|
473
473
|
width: 100%;
|
|
474
474
|
}
|
|
475
|
-
`,
|
|
475
|
+
`,Xc=pt.default.button`
|
|
476
476
|
&& {
|
|
477
477
|
background-color: transparent;
|
|
478
478
|
color: var(--privy-color-foreground-3);
|
|
@@ -491,7 +491,7 @@ Resources:
|
|
|
491
491
|
&&:hover {
|
|
492
492
|
color: var(--privy-color-error);
|
|
493
493
|
}
|
|
494
|
-
`,
|
|
494
|
+
`,hl=pt.default.div`
|
|
495
495
|
display: flex;
|
|
496
496
|
align-items: center;
|
|
497
497
|
gap: 0.5rem;
|
|
@@ -501,7 +501,7 @@ Resources:
|
|
|
501
501
|
height: 20px !important;
|
|
502
502
|
width: 20px !important;
|
|
503
503
|
}
|
|
504
|
-
`,
|
|
504
|
+
`,hi=pt.default.div`
|
|
505
505
|
display: flex;
|
|
506
506
|
align-items: center;
|
|
507
507
|
gap: 6px;
|
|
@@ -515,15 +515,15 @@ Resources:
|
|
|
515
515
|
display: flex !important;
|
|
516
516
|
align-items: flex-end;
|
|
517
517
|
}
|
|
518
|
-
`,
|
|
518
|
+
`,yl=pt.default.div`
|
|
519
519
|
width: 100%;
|
|
520
520
|
display: flex;
|
|
521
521
|
justify-content: space-between;
|
|
522
|
-
`,
|
|
522
|
+
`,Dm=pt.default.p`
|
|
523
523
|
text-align: left;
|
|
524
524
|
width: 100%;
|
|
525
525
|
color: var(--privy-color-foreground-3) !important;
|
|
526
|
-
`,
|
|
526
|
+
`,ed=pt.default.button`
|
|
527
527
|
display: flex;
|
|
528
528
|
flex-direction: row;
|
|
529
529
|
align-items: center;
|
|
@@ -553,7 +553,7 @@ Resources:
|
|
|
553
553
|
&:hover {
|
|
554
554
|
text-decoration: underline;
|
|
555
555
|
}
|
|
556
|
-
`,
|
|
556
|
+
`,Ct=pt.default.div`
|
|
557
557
|
display: flex;
|
|
558
558
|
align-items: center;
|
|
559
559
|
justify-content: center;
|
|
@@ -568,10 +568,10 @@ Resources:
|
|
|
568
568
|
width: auto !important;
|
|
569
569
|
color: white;
|
|
570
570
|
}
|
|
571
|
-
`;var
|
|
571
|
+
`;var nt=require("react/jsx-runtime"),Bm=()=>{let{user:e,logout:t}=H(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:a}=_(),{acceptTerms:i,closePrivyModal:l,createAnalyticsEvent:s}=W(),c=g=>{g?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let u=async g=>{g.preventDefault(),await i(),e&&gr(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:f=>{console.error(f),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:f,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,nt.jsx)(H3,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:c})},H3=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(k,{closeable:!1}),(0,nt.jsx)(Fm.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,nt.jsx)(Le,{style:{marginTop:24},children:"One last step"}),(0,nt.jsx)(be,{children:"By signing up, you agree to our terms and privacy policy."}),(0,nt.jsxs)(Tr,{style:{marginTop:24},children:[e&&(0,nt.jsxs)(Qc,{target:"_blank",href:e,children:["View Terms ",(0,nt.jsx)(td.default,{style:{marginLeft:"auto"}})]}),t&&(0,nt.jsxs)(Qc,{target:"_blank",href:t,children:["View Privacy Policy ",(0,nt.jsx)(td.default,{style:{marginLeft:"auto"}})]})]}),(0,nt.jsxs)(G3,{style:{marginTop:24},children:[(0,nt.jsx)(Or,{onClick:o,children:"No thanks"}),(0,nt.jsx)(D,{onClick:r,children:"Accept"})]}),(0,nt.jsx)(q,{protectedByPrivy:!0})]}),G3=Um.default.div`
|
|
572
572
|
display: flex;
|
|
573
573
|
gap: 10px;
|
|
574
|
-
`;var
|
|
574
|
+
`;var od=y(require("styled-components"));var Hm=y(require("styled-components")),gl=Hm.default.span`
|
|
575
575
|
&& {
|
|
576
576
|
width: 82px;
|
|
577
577
|
height: 82px;
|
|
@@ -586,7 +586,7 @@ Resources:
|
|
|
586
586
|
transition: border-color 800ms;
|
|
587
587
|
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
588
588
|
}
|
|
589
|
-
`;var
|
|
589
|
+
`;var Gm=y(require("styled-components")),V3=Gm.default.div`
|
|
590
590
|
display: flex;
|
|
591
591
|
flex-direction: column;
|
|
592
592
|
justify-content: center;
|
|
@@ -609,7 +609,7 @@ Resources:
|
|
|
609
609
|
left: -19px;
|
|
610
610
|
top: -19px;
|
|
611
611
|
}
|
|
612
|
-
|
|
612
|
+
`,$t=V3;var rd=require("react/jsx-runtime"),vl=({style:e,...t})=>(0,rd.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,rd.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var tt=require("react/jsx-runtime"),Vm=()=>{let{navigate:e,app:t}=_(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(k,{}),(0,tt.jsxs)(z3,{children:[(0,tt.jsx)($t,{children:(0,tt.jsxs)("div",{children:[(0,tt.jsx)(gl,{}),(0,tt.jsx)(vl,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,tt.jsxs)(q3,{children:[typeof r=="string"?(0,tt.jsx)("h3",{children:r}):(0,tt.jsx)(tt.Fragment,{children:r}),typeof o=="string"?(0,tt.jsx)("p",{children:o}):(0,tt.jsx)(tt.Fragment,{children:o})]}),t?.allowlistConfig.errorCtaLink?(0,tt.jsx)(D,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,tt.jsx)(D,{onClick:()=>{e("LANDING")},children:n})]})]})},z3=od.default.div`
|
|
613
613
|
display: flex;
|
|
614
614
|
flex-direction: column;
|
|
615
615
|
align-items: center;
|
|
@@ -617,11 +617,11 @@ Resources:
|
|
|
617
617
|
gap: 24px;
|
|
618
618
|
width: 100%;
|
|
619
619
|
padding-bottom: 16px;
|
|
620
|
-
`,
|
|
620
|
+
`,q3=od.default.div`
|
|
621
621
|
display: flex;
|
|
622
622
|
flex-direction: column;
|
|
623
623
|
gap: 8px;
|
|
624
|
-
`;var
|
|
624
|
+
`;var Jm=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Qm=y(require("@heroicons/react/24/outline/PhoneIcon")),Xo=require("react"),Xm=require("react-device-detect"),gi=y(require("styled-components"));var jt=y(require("styled-components")),Pr=jt.default.div`
|
|
625
625
|
display: flex;
|
|
626
626
|
flex-direction: column;
|
|
627
627
|
align-items: flex-start;
|
|
@@ -629,36 +629,36 @@ Resources:
|
|
|
629
629
|
margin-top: auto;
|
|
630
630
|
gap: 16px;
|
|
631
631
|
flex-grow: 100;
|
|
632
|
-
`,
|
|
632
|
+
`,Ft=jt.default.div`
|
|
633
633
|
display: flex;
|
|
634
634
|
flex-direction: column;
|
|
635
635
|
align-items: center;
|
|
636
636
|
justify-content: center;
|
|
637
637
|
flex-grow: 1;
|
|
638
638
|
width: 100%;
|
|
639
|
-
`,
|
|
639
|
+
`,zm=jt.default.div`
|
|
640
640
|
display: flex;
|
|
641
641
|
flex-direction: column;
|
|
642
642
|
align-items: center;
|
|
643
643
|
width: 100%;
|
|
644
|
-
`,
|
|
644
|
+
`,yi=(0,jt.default)(Ft)`
|
|
645
645
|
padding: 20px 0;
|
|
646
|
-
`,
|
|
646
|
+
`,Dr=(0,jt.default)(Ft)`
|
|
647
647
|
gap: 16px;
|
|
648
|
-
`,
|
|
648
|
+
`,nd=jt.default.div`
|
|
649
649
|
display: flex;
|
|
650
650
|
flex-direction: column;
|
|
651
651
|
width: 100%;
|
|
652
|
-
`,
|
|
652
|
+
`,rt=jt.default.div`
|
|
653
653
|
display: flex;
|
|
654
654
|
flex-direction: column;
|
|
655
655
|
gap: 8px;
|
|
656
|
-
`,
|
|
656
|
+
`,jE=jt.default.div`
|
|
657
657
|
display: flex;
|
|
658
658
|
flex-direction: column;
|
|
659
659
|
justify-content: space-between;
|
|
660
660
|
height: 100%;
|
|
661
|
-
`,
|
|
661
|
+
`,qm=jt.default.div`
|
|
662
662
|
display: flex;
|
|
663
663
|
flex-direction: column;
|
|
664
664
|
justify-content: flex-start;
|
|
@@ -681,13 +681,13 @@ Resources:
|
|
|
681
681
|
color: var(--privy-color-foreground-3);
|
|
682
682
|
font-size: 14px;
|
|
683
683
|
}
|
|
684
|
-
`,
|
|
684
|
+
`,te=jt.default.div`
|
|
685
685
|
height: 16px;
|
|
686
|
-
`,
|
|
686
|
+
`,ne=jt.default.div`
|
|
687
687
|
height: 12px;
|
|
688
|
-
|
|
688
|
+
`,$m=jt.default.div`
|
|
689
689
|
position: relative;
|
|
690
|
-
`,
|
|
690
|
+
`,jm=jt.default.div`
|
|
691
691
|
background-color: var(--privy-color-accent);
|
|
692
692
|
display: flex;
|
|
693
693
|
justify-content: center;
|
|
@@ -695,9 +695,9 @@ Resources:
|
|
|
695
695
|
border-radius: 50%;
|
|
696
696
|
border-color: white;
|
|
697
697
|
border-width: 2px !important;
|
|
698
|
-
`;var
|
|
698
|
+
`;var Cl=y(require("styled-components")),Fr=require("react/jsx-runtime"),ya=({title:e,description:t,children:r,...o})=>(0,Fr.jsx)(Km,{...o,children:(0,Fr.jsxs)(Fr.Fragment,{children:[(0,Fr.jsx)("h3",{children:e}),typeof t=="string"?(0,Fr.jsx)("p",{children:t}):t,r]})}),no=(0,Cl.default)(ya)`
|
|
699
699
|
margin-bottom: 24px;
|
|
700
|
-
`,
|
|
700
|
+
`,Oe=({title:e,description:t,icon:r,children:o,...n})=>(0,Fr.jsxs)($3,{...n,children:[r||null,(0,Fr.jsx)("h3",{children:e}),typeof t=="string"?(0,Fr.jsx)("p",{children:t}):t,o]}),Km=Cl.default.div`
|
|
701
701
|
display: flex;
|
|
702
702
|
flex-direction: column;
|
|
703
703
|
justify-content: flex-start;
|
|
@@ -717,7 +717,7 @@ Resources:
|
|
|
717
717
|
color: var(--privy-color-foreground-2);
|
|
718
718
|
font-size: 14px;
|
|
719
719
|
}
|
|
720
|
-
|
|
720
|
+
`,$3=(0,Cl.default)(Km)`
|
|
721
721
|
align-items: center;
|
|
722
722
|
text-align: center;
|
|
723
723
|
gap: 16px;
|
|
@@ -725,7 +725,7 @@ Resources:
|
|
|
725
725
|
h3 {
|
|
726
726
|
margin-bottom: 24px;
|
|
727
727
|
}
|
|
728
|
-
`;var
|
|
728
|
+
`;var ve=require("react/jsx-runtime"),id=6,Ym=new Array(id).fill(""),j3=1400;var ef=()=>{let{app:e,navigate:t,navigateBack:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=_(),{closePrivyModal:a,resendEmailCode:i,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:u,createAnalyticsEvent:g}=W(),{authenticated:f,logout:v,user:b}=H(),[w,x]=(0,Xo.useState)(Ym),[T,S]=(0,Xo.useState)(!1),[L,I]=(0,Xo.useState)(null),[U,M]=(0,Xo.useState)(null);n.current=()=>null;let G=s()?.email?0:1,Y=e?.render.inDialog?Ke:0,z=e?.render.inDialog?Y-500:0;(0,Xo.useEffect)(()=>{if(f&&T&&b){if(e?.legal.requireUsersAcceptTerms&&!b.hasAcceptedTerms){let ye=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},z);return()=>clearTimeout(ye)}if(gr(b,e?.embeddedWallets?.createOnLogin)){let ye=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:se=>{console.error(se),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:se,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},z);return()=>clearTimeout(ye)}else{u();let ye=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Y);return()=>clearTimeout(ye)}}},[f,T,b]),(0,Xo.useEffect)(()=>{if(L&&U===0){let he=setTimeout(()=>{x(Ym),I(null),document.querySelector("input[name=code-0]")?.focus()},j3);return()=>clearTimeout(he)}},[L]);let j=he=>{he.preventDefault();let ye=he.currentTarget.value.replace(" ","");if(ye==="")return;if(isNaN(Number(ye))){I("Code should be numeric"),M(1);return}I(null),M(null);let se=Number(he.currentTarget.name?.charAt(5)),Xe=[...ye||[""]].slice(0,id-se),le=[...w.slice(0,se),...Xe,...w.slice(se+Xe.length)];x(le);let Ar=Xe.length,dr=Math.min(Math.max(se+Ar,0),id-1);isNaN(Number(he.currentTarget.value))||document.querySelector(`input[name=code-${dr}]`)?.focus(),le.every(pr=>pr&&!isNaN(+pr))&&(document.querySelector(`input[name=code-${dr}]`)?.blur(),c(le.join("")).then(()=>S(!0)).catch(Pe=>{if(Pe?.status===422)I("Invalid or expired verification code");else if(Pe instanceof Rr&&Pe.privyErrorCode==="cannot_link_more_of_type")I(Pe.message);else if(Pe instanceof Rr&&Pe.privyErrorCode==="max_accounts_reached"){console.error(new Qr(Pe).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else I("Issue verifying code");M(0)}))},R=he=>{U===1&&(I(null),M(null));let ye=[...w.slice(0,he),"",...w.slice(he+1)];x(ye),he>0&&document.querySelector(`input[name=code-${he-1}]`)?.focus()},fe=G==0?(0,ve.jsx)(Jm.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,ve.jsx)(Qm.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),B=G==0?(0,ve.jsxs)("p",{children:["Please check ",(0,ve.jsx)(Zm,{children:s()?.email})," for an email from privy.io and enter your code below."]}):(0,ve.jsxs)("p",{children:["Please check ",(0,ve.jsx)(Zm,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(k,{backFn:()=>r()},"header"),(0,ve.jsxs)(K3,{children:[(0,ve.jsx)(Oe,{title:"Enter confirmation code",description:B,icon:fe}),(0,ve.jsxs)(zm,{children:[(0,ve.jsxs)(Y3,{children:[(0,ve.jsx)(Z3,{fail:!!L,success:T,children:(0,ve.jsx)("span",{children:L||(T?"Success!":"")})}),(0,ve.jsx)("div",{children:w.map((he,ye)=>(0,ve.jsx)("input",{name:`code-${ye}`,type:"text",value:w[ye],onChange:j,onKeyUp:se=>{se.key==="Backspace"&&R(ye)},inputMode:"numeric",autoFocus:ye===0,pattern:"[0-9]",className:`${T?"success":""} ${L?"fail":""}`,autoComplete:Xm.isMobile?"one-time-code":"off"},ye))})]}),(0,ve.jsx)(J3,{children:G==0?(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)("span",{children:"Didn't get an email?"}),(0,ve.jsx)("button",{onClick:i,children:"Resend code"})]}):(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)("span",{children:"Didn't get a message?"}),(0,ve.jsx)("button",{onClick:l,children:"Resend code"})]})})]})]}),(0,ve.jsx)(q,{protectedByPrivy:!0})]})},K3=gi.default.div`
|
|
729
729
|
display: flex;
|
|
730
730
|
flex-direction: column;
|
|
731
731
|
align-items: flex-start;
|
|
@@ -733,7 +733,7 @@ Resources:
|
|
|
733
733
|
margin: auto;
|
|
734
734
|
gap: 16px;
|
|
735
735
|
flex-grow: 1;
|
|
736
|
-
`,
|
|
736
|
+
`,Y3=gi.default.div`
|
|
737
737
|
display: flex;
|
|
738
738
|
flex-direction: column;
|
|
739
739
|
width: 100%;
|
|
@@ -789,7 +789,7 @@ Resources:
|
|
|
789
789
|
transform: translate(1px, 0px);
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
|
-
`,
|
|
792
|
+
`,Z3=gi.default.div`
|
|
793
793
|
line-height: 20px;
|
|
794
794
|
height: 20px;
|
|
795
795
|
font-size: 13px;
|
|
@@ -797,7 +797,7 @@ Resources:
|
|
|
797
797
|
display: flex;
|
|
798
798
|
justify-content: flex-end;
|
|
799
799
|
width: 100%;
|
|
800
|
-
`,
|
|
800
|
+
`,J3=gi.default.div`
|
|
801
801
|
font-size: 13px;
|
|
802
802
|
color: var(--privy-color-foreground-3);
|
|
803
803
|
display: flex;
|
|
@@ -811,10 +811,10 @@ Resources:
|
|
|
811
811
|
> button {
|
|
812
812
|
text-decoration: underline;
|
|
813
813
|
}
|
|
814
|
-
`,
|
|
814
|
+
`,Zm=gi.default.span`
|
|
815
815
|
font-weight: 500;
|
|
816
816
|
word-break: break-all;
|
|
817
|
-
`;var
|
|
817
|
+
`;var nf=y(require("@heroicons/react/24/solid/CheckCircleIcon")),af=y(require("@heroicons/react/24/solid/XCircleIcon")),tr=require("react"),sf=y(require("styled-components"));var tf=y(require("styled-components"));var Ur=require("react/jsx-runtime"),rf=({icon:e})=>{let t=e;return(0,Ur.jsx)(Ur.Fragment,{children:(0,Ur.jsx)(Q3,{children:(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)(Rt,{}),typeof t=="string"?(0,Ur.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,Ur.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,Ur.jsx)("span",{})]})})})},Q3=tf.default.div`
|
|
818
818
|
display: flex;
|
|
819
819
|
flex-direction: column;
|
|
820
820
|
justify-content: center;
|
|
@@ -837,14 +837,14 @@ Resources:
|
|
|
837
837
|
left: -19px;
|
|
838
838
|
top: -19px;
|
|
839
839
|
}
|
|
840
|
-
`;var
|
|
840
|
+
`;var ut=require("react/jsx-runtime"),lf=500,of=lf*2,cf=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:a}=_(),{status:i,token:l,waitForResult:s,reset:c,execute:u}=Se(),g=(0,tr.useRef)([]),f=fe=>{g.current=[fe,...g.current]},[v,b]=(0,tr.useState)(!0);(0,tr.useEffect)(()=>{let fe=setTimeout(b,of,!1);return f(fe),()=>{g.current.forEach(B=>clearTimeout(B)),g.current=[]}},[]);let[w,x]=(0,tr.useState)(""),[T,S]=(0,tr.useState)("Checking that you are a human..."),[L,I]=(0,tr.useState)((0,ut.jsx)(D,{onClick:()=>{},disabled:!0,children:"Continue"})),[U,M]=(0,tr.useState)(!1),[G,Y]=(0,tr.useState)(3),z=r?.captchaModalData,j=async fe=>{try{await z?.callback(fe),z?.onSuccessNavigateTo&&n(z?.onSuccessNavigateTo,!1)}catch(B){if(B instanceof Lr)return;{let he={error:B,previousScreen:e||"LANDING"};a({errorModalData:he}),n(z?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,tr.useEffect)(()=>{if(i==="success"){let fe=setTimeout(async()=>{let B=await s();!B||z?.userIntentRequired||j(B)},of);f(fe)}else if(i==="ready"){let fe=setTimeout(()=>{i==="ready"&&u()},lf);f(fe)}},[i]),(0,tr.useEffect)(()=>{if(!v)switch(i){case"success":x("Success!"),S("CAPTCHA passed successfully."),I((0,ut.jsx)(D,{onClick:()=>{M(!0),j(l)},disabled:!z?.userIntentRequired,loading:U,children:z?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":x(""),S("Checking that you are a human..."),I((0,ut.jsx)(D,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":x("Something went wrong"),G<=0?(S("If you use an adblocker or VPN, try disabling and re-attempting."),I(null)):(S("You did not pass CAPTCHA. Please try again."),I((0,ut.jsx)(D,{onClick:R,children:"Retry"})));break;case"ready":default:break}},[i,v,U]);let R=async()=>{if(G<=0)return;Y(B=>B-1),c(),u();let fe=await s();!fe||z?.userIntentRequired||j(fe)};return(0,ut.jsxs)(ut.Fragment,{children:[(0,ut.jsx)(k,{backFn:!e||t===e?void 0:o}),(0,ut.jsxs)(X3,{children:[i==="success"?(0,ut.jsx)(nf.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):i==="error"?(0,ut.jsx)(af.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,ut.jsx)(rf,{}),(0,ut.jsxs)(rt,{children:[w?(0,ut.jsx)("h3",{children:w}):null,(0,ut.jsx)("p",{children:T})]}),L]}),(0,ut.jsx)(ee,{})]})},X3=sf.default.div`
|
|
841
841
|
display: flex;
|
|
842
842
|
flex-direction: column;
|
|
843
843
|
align-items: center;
|
|
844
844
|
justify-content: center;
|
|
845
845
|
gap: 24px;
|
|
846
846
|
width: 100%;
|
|
847
|
-
`;var ef=y(require("@heroicons/react/24/outline/WalletIcon")),tf=require("react-device-detect"),rf=y(require("styled-components"));var Nt=require("react/jsx-runtime"),Ym=({...e})=>(0,Nt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,Nt.jsx)("defs",{children:(0,Nt.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,Nt.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,Nt.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,Nt.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,Nt.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,Nt.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,Nt.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,Nt.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,Nt.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,Nt.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,Nt.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var pt=require("react/jsx-runtime"),Zm=({style:e,...t})=>(0,pt.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,pt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,pt.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,pt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,pt.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,pt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,pt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,pt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,pt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,pt.jsxs)("defs",{children:[(0,pt.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,pt.jsx)("stop",{"stop-color":"#002D72"}),(0,pt.jsx)("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),(0,pt.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,pt.jsx)("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),(0,pt.jsx)("stop",{offset:"1","stop-color":"#002D72"})]})]})]});var K=require("react/jsx-runtime"),Jm=({style:e,...t})=>(0,K.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,K.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,K.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,K.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,K.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,K.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,K.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,K.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,K.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,K.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,K.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,K.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,K.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,K.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,K.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,K.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,K.jsxs)("defs",{children:[(0,K.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#174299"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,K.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,K.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,K.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#FF4000"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,K.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#8754C9"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,K.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,K.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,K.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#FFF700"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,K.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#FFF700"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,K.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,K.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,K.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,K.jsx)("stop",{stopColor:"#00AAFF"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,K.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,K.jsx)("stop",{stopColor:"#00AAFF"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,K.jsx)("clipPath",{id:"clip0_5_32",children:(0,K.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,K.jsx)("clipPath",{id:"clip1_5_32",children:(0,K.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var jt=require("react/jsx-runtime"),Qm=({style:e,...t})=>(0,jt.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,jt.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,jt.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,jt.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,jt.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,jt.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,jt.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,jt.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,jt.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,jt.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,jt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,jt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var xo=require("react/jsx-runtime"),Xm=({style:e,...t})=>(0,xo.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,xo.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,xo.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,xo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,xo.jsx)("defs",{children:(0,xo.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,xo.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var ko=require("react/jsx-runtime"),no={coinbase_wallet:{logo:ws,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Qn,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Xr,displayName:"Phantom"},rainbow:{logo:Jm,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:ca,displayName:"WalletConnect"},zerion:{logo:Xm,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Ym,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Zm,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:Qm,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="}},En=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:a}=A(),{connectWallet:i}=W(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{Ho()?(i(n,l),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):a(tf.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{i(n,l),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,ko.jsxs)(N3,{onClick:s,children:[(0,ko.jsx)(O3,{icon:L3(e,n.connectorType)??r,name:n.walletClientType}),(0,ko.jsx)("span",{children:W3(e,n.connectorType)||t||n.walletClientType}),(0,ko.jsx)("span",{id:"connect-text",children:"Connect"})]})},W3=(e,t)=>{if(no[e]?.displayName)return no[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},L3=(e,t)=>{if(no[e]?.logo)return no[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return ca},O3=({icon:e,name:t})=>typeof e=="string"?(0,ko.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,ko.jsx)(ef.default,{}):e?(0,ko.jsx)(e,{}):null,N3=(0,rf.default)(Be)`
|
|
847
|
+
`;var hf=y(require("@heroicons/react/24/outline/WalletIcon")),yf=require("react-device-detect"),gf=y(require("styled-components"));var Ut=require("react/jsx-runtime"),df=({...e})=>(0,Ut.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,Ut.jsx)("defs",{children:(0,Ut.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,Ut.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,Ut.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,Ut.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,Ut.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,Ut.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,Ut.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,Ut.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,Ut.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var mt=require("react/jsx-runtime"),pf=({style:e,...t})=>(0,mt.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,mt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,mt.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,mt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,mt.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,mt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,mt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,mt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,mt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,mt.jsxs)("defs",{children:[(0,mt.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,mt.jsx)("stop",{"stop-color":"#002D72"}),(0,mt.jsx)("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),(0,mt.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,mt.jsx)("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),(0,mt.jsx)("stop",{offset:"1","stop-color":"#002D72"})]})]})]});var K=require("react/jsx-runtime"),uf=({style:e,...t})=>(0,K.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,K.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,K.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,K.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,K.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,K.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,K.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,K.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,K.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,K.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,K.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,K.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,K.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,K.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,K.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,K.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,K.jsxs)("defs",{children:[(0,K.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#174299"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,K.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,K.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,K.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#FF4000"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,K.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#8754C9"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,K.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,K.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,K.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#FFF700"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,K.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,K.jsx)("stop",{stopColor:"#FFF700"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,K.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,K.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,K.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,K.jsx)("stop",{stopColor:"#00AAFF"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,K.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,K.jsx)("stop",{stopColor:"#00AAFF"}),(0,K.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,K.jsx)("clipPath",{id:"clip0_5_32",children:(0,K.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,K.jsx)("clipPath",{id:"clip1_5_32",children:(0,K.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var Kt=require("react/jsx-runtime"),mf=({style:e,...t})=>(0,Kt.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Kt.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,Kt.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,Kt.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,Kt.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,Kt.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,Kt.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,Kt.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,Kt.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,Kt.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,Kt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,Kt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var xo=require("react/jsx-runtime"),ff=({style:e,...t})=>(0,xo.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,xo.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,xo.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,xo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,xo.jsx)("defs",{children:(0,xo.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,xo.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var _o=require("react/jsx-runtime"),io={coinbase_wallet:{logo:ks,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:oi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:eo,displayName:"Phantom"},rainbow:{logo:uf,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:ha,displayName:"WalletConnect"},zerion:{logo:ff,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:df,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:pf,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:mf,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="}},kn=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:a}=_(),{connectWallet:i}=W(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{Vo()?(i(n,l),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):a(yf.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{i(n,l),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,_o.jsxs)(ov,{onClick:s,children:[(0,_o.jsx)(rv,{icon:tv(e,n.connectorType)??r,name:n.walletClientType}),(0,_o.jsx)("span",{children:ev(e,n.connectorType)||t||n.walletClientType}),(0,_o.jsx)("span",{id:"connect-text",children:"Connect"})]})},ev=(e,t)=>{if(io[e]?.displayName)return io[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},tv=(e,t)=>{if(io[e]?.logo)return io[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return ha},rv=({icon:e,name:t})=>typeof e=="string"?(0,_o.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,_o.jsx)(hf.default,{}):e?(0,_o.jsx)(e,{}):null,ov=(0,gf.default)(ze)`
|
|
848
848
|
/* Show "Connect" on hover */
|
|
849
849
|
> #connect-text {
|
|
850
850
|
font-weight: 500;
|
|
@@ -866,23 +866,23 @@ Resources:
|
|
|
866
866
|
display: none;
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
|
-
`;var
|
|
869
|
+
`;var Br=require("react/jsx-runtime"),nv=["coinbase_wallet"],iv=["metamask","okx_wallet","rainbow","uniswap","zerion"],av=["cryptocom"],sv=["phantom"],vi=({connectOnly:e})=>{let{connectors:t}=W(),{app:r}=_(),o=ga(r.appearance.walletList,t,e,r.appearance.walletList);return(0,Br.jsxs)(Br.Fragment,{children:[...o]})},ga=(e,t,r,o)=>{let n=[],a=[],i=[],l=t.find(s=>s.connectorType==="wallet_connect_v2");for(let s of e)if(s==="detected_wallets"){let c=t.filter(({connectorType:u,walletClientType:g})=>g==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="injected"&&!o.includes(g));for(let u of c){let{walletClientType:g,walletBranding:f}=u;(g==="unknown"?a:n).push((0,Br.jsx)(kn,{connectOnly:r,provider:g,logo:f.icon,displayName:f.name,connector:u},`${s}-${g}`))}}else if(sv.includes(s)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===s||u.connectorType===s);c&&n.push((0,Br.jsx)(kn,{connectOnly:r,provider:s,connector:c},s))}else if(iv.includes(s)){let c=t.find(u=>s==="uniswap"?u.walletClientType==="uniswap_wallet_extension":u.connectorType==="injected"&&u.walletClientType===s)??l;c&&n.push((0,Br.jsx)(kn,{connectOnly:r,provider:s,connector:c},s))}else if(nv.includes(s)){let c=t.find(({connectorType:u})=>u===s);c&&n.push((0,Br.jsx)(kn,{connectOnly:r,provider:s,connector:c},s))}else av.includes(s)?l&&i.push((0,Br.jsx)(kn,{connectOnly:r,provider:s,connector:l},s)):s==="wallet_connect"&&l&&i.push((0,Br.jsx)(kn,{connectOnly:r,provider:s,connector:l},s));return[...a,...n,...i]};var ao=require("react/jsx-runtime"),vf=()=>{let{app:e}=_(),t=`Connect a wallet to ${e?.name}`;return(0,ao.jsxs)(ao.Fragment,{children:[(0,ao.jsx)(k,{},"header"),(0,ao.jsx)(no,{title:"Connect your wallet",description:t}),(0,ao.jsx)(Tr,{children:(0,ao.jsx)(vi,{connectOnly:!0})}),(0,ao.jsx)(q,{protectedByPrivy:!0})]})};var Tf=y(require("styled-components"));var Ef=y(require("styled-components"));var Cf=y(require("react"));var bf=require("react/jsx-runtime"),wf=()=>{let{app:e}=_(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,bf.jsx)("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?Cf.default.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var ad=require("react/jsx-runtime"),Ci=e=>{let{app:t}=_();return t?.appearance.logo?(0,ad.jsx)(lv,{...e,children:(0,ad.jsx)(wf,{})}):null},lv=Ef.default.div`
|
|
870
870
|
display: flex;
|
|
871
871
|
flex-direction: column;
|
|
872
872
|
align-items: center;
|
|
873
873
|
padding: 24px 0;
|
|
874
874
|
flex-grow: 1;
|
|
875
875
|
justify-content: center;
|
|
876
|
-
`;var
|
|
876
|
+
`;var Hr=require("react/jsx-runtime"),Pf=()=>{let{app:e}=_();return(0,Hr.jsxs)(Hr.Fragment,{children:[(0,Hr.jsx)(k,{},"header"),(0,Hr.jsx)(cv,{}),(0,Hr.jsx)(Tr,{children:(0,Hr.jsx)(vi,{connectOnly:!0})}),e&&(0,Hr.jsx)(fi,{app:e,alwaysShowImplicitConsent:!0}),(0,Hr.jsx)(q,{protectedByPrivy:!0})]})},cv=(0,Tf.default)(Ci)`
|
|
877
877
|
margin-bottom: 16px;
|
|
878
|
-
`;var
|
|
878
|
+
`;var bi=require("react"),kf=require("react-device-detect"),Af=y(require("styled-components"));var Sr=require("react"),va=require("react-device-detect"),xf=require("react-use"),ld=y(require("styled-components"));var wi=require("react");function Sf(){let[e,t]=(0,wi.useState)(!1),r=(0,wi.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,wi.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var Ae=require("react/jsx-runtime"),sd=2,cd=e=>e?.privyErrorCode==="linked_to_another_user"?wo.ERROR_USER_EXISTS:e instanceof Ye&&!e.details.default?e.details:e instanceof Qn?wo.ERROR_TIMED_OUT:e instanceof Xn?wo.ERROR_USER_REJECTED_CONNECTION:wo.ERROR_WALLET_CONNECTION,_f=()=>{let[e,t]=(0,Sr.useState)(!1),[r,o]=(0,Sr.useState)(!1),[n,a]=(0,Sr.useState)(void 0),{authenticated:i,logout:l}=H(),{app:s,navigate:c,navigateBack:u,lastScreen:g,currentScreen:f,setModalData:v}=_(),{getAuthFlow:b,walletConnectionStatus:w,closePrivyModal:x,initLoginWithWallet:T,loginWithWallet:S,updateWallets:L,createAnalyticsEvent:I}=W(),{walletConnectors:U}=H(),[M,G]=(0,Sr.useState)(0),{user:Y}=H(),[z]=(0,Sr.useState)(Y?.linkedAccounts.length||0),[j,R]=(0,Sr.useState)(""),[fe,B]=(0,Sr.useState)(!1),{hasTabbedAway:he}=Sf(),{enabled:ye,token:se}=Se(),Xe=va.isMobile&&w?.connector?.connectorType==="wallet_connect_v2"||va.isMobile&&w?.connector?.connectorType==="coinbase_wallet"||va.isMobile&&w?.connector?.connectorType==="injected"&&w?.connector?.walletClientType==="phantom",le=w?.status==="connected",Ar=w?.status==="switching_to_supported_chain";(0,Sr.useEffect)(()=>{let V=b();if(le&&!V&&(ye&&!se&&!i?(v({captchaModalData:{callback:Jr=>T(w.connectedWallet,Jr).then(()=>{B(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):T(w.connectedWallet,se).then(()=>{B(!0)})),V&&Xe&&le&&!V.preparedMessage){V.buildSiweMessage();return}!V||Xe||!le||r||(async()=>{o(!0),a(void 0);try{w?.connector?.connectorType==="wallet_connect_v2"&&w?.connector?.walletClientType==="metamask"&&await Ic(2500),await pr()}catch(Jr){console.warn("Auto-prompted signature failed",Jr)}finally{o(!1)}})()},[M,le,fe]),(0,Sr.useEffect)(()=>{if(Y&&e){let V=s?.render.inDialog?Ke:0,Jr=s?.render.inDialog?V-500:0;if(s?.legal.requireUsersAcceptTerms&&!Y.hasAcceptedTerms){let Gt=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},Jr);return()=>clearTimeout(Gt)}if(gr(Y,s?.embeddedWallets?.createOnLogin)){let Gt=setTimeout(()=>{v({createWallet:{onSuccess:()=>{},onFailure:go=>{console.error(go),I({eventName:"embedded_wallet_creation_failure_logout",payload:{error:go,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Jr);return()=>clearTimeout(Gt)}L();let ce=setTimeout(()=>x({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Ke);return()=>clearTimeout(ce)}},[Y,e]);let dr=V=>{if(V?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(V?.privyErrorCode==="max_accounts_reached"){console.error(new Qr(V).toString()),c("USER_LIMIT_REACHED_SCREEN");return}a(cd(V))};async function pr(){try{if(await S(),!s?.render.inDialog)return x({shouldCallAuthOnSuccess:!0,isSuccess:!0});t(!0)}catch(V){dr(V)}finally{o(!1)}}(0,Sr.useEffect)(()=>{w?.connectError&&dr(w?.connectError)},[w]),(0,xf.useInterval)(()=>{let V=Pe==="wallet_connect_v2"&&w?.connector instanceof ro?w.connector.redirectUri:void 0;V&&R(V)},w?.connector instanceof ro&&!j?500:null);let Pe=w?.connector?.connectorType||"injected",Kr=w?.connector?.walletClientType||"unknown",Yr=io[Kr]?.displayName||w?.connector?.walletBranding.name||"Browser Extension",zn=io[Kr]?.logo||w?.connector?.walletBranding.icon||(V=>(0,Ae.jsx)(ri,{...V})),Zr=Yr==="Browser Extension"?Yr.toLowerCase():Yr,Ht;e?Ht=`Successfully connected with ${Zr}`:n?Ht=n.message:Ar?Ht="Switching networks":le?Ht=r&&Xe?"Signing":"Sign to verify":Ht=`Waiting for ${Zr}`;let st="Don\u2019t see your wallet? Check your other browser windows.";if(e){let V=Y?.linkedAccounts.length||0;z===V?st="Wallet was already linked.":st="You\u2019re good to go!"}else M>=sd&&n?st="Unable to connect wallet":n?st=n.detail:Ar?st="Switch your wallet to the requested network.":le&&Xe?st="Sign the message in your wallet to verify it belongs to you.":Kr==="metamask"&&va.isMobile?st="Click continue to open and connect MetaMask.":Kr==="metamask"?st="For the best experience, connect only one wallet at a time.":Pe==="wallet_connect"?st="Open your mobile wallet app to continue":Pe==="coinbase_wallet"&&(ru()||(Vc(Y)?st="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":st="Open the Coinbase app on your phone to continue."));let O=U?.walletConnectors?.find(V=>V.walletClientType==="coinbase_wallet"),me=Kr==="coinbase_wallet"&&(Vc(Y)||n===wo.ERROR_USER_EXISTS);return(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)(k,{backFn:!g||f===g?void 0:u}),(0,Ae.jsxs)(dv,{children:[(0,Ae.jsx)(dd,{walletLogo:zn,success:e,fail:!!n}),(0,Ae.jsxs)(rt,{children:[(0,Ae.jsx)("h3",{children:Ht}),(0,Ae.jsx)("p",{children:st}),!le&&j&&!he?(0,Ae.jsxs)("p",{children:["Still here?"," ",(0,Ae.jsx)("a",{href:j,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),me?(0,Ae.jsx)(D,{onClick:()=>O&&O?.disconnect(),disabled:e,children:"Use a different wallet"}):n==wo.ERROR_USER_EXISTS&&f!==g?(0,Ae.jsx)(D,{onClick:u,children:"Use a different wallet"}):le&&!e&&Xe?(0,Ae.jsx)(D,{onClick:()=>{o(!0),pr()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<sd?(0,Ae.jsx)(D,{onClick:()=>{G(M+1),a(void 0),le?(o(!0),pr()):w?.connectRetry()},disabled:!e&&(!n?.retryable||M>=sd),children:"Retry"}):!e&&!n?(0,Ae.jsx)(D,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,Ae.jsx)(ee,{})]})},dv=ld.default.div`
|
|
879
879
|
display: flex;
|
|
880
880
|
flex-direction: column;
|
|
881
881
|
align-items: center;
|
|
882
882
|
justify-content: center;
|
|
883
883
|
gap: 24px;
|
|
884
884
|
width: 100%;
|
|
885
|
-
`,
|
|
885
|
+
`,pv=ld.default.div`
|
|
886
886
|
display: flex;
|
|
887
887
|
flex-direction: column;
|
|
888
888
|
justify-content: center;
|
|
@@ -905,14 +905,14 @@ Resources:
|
|
|
905
905
|
left: -19px;
|
|
906
906
|
top: -19px;
|
|
907
907
|
}
|
|
908
|
-
`,
|
|
908
|
+
`,dd=e=>{let t=e.walletLogo;return(0,Ae.jsx)(Ae.Fragment,{children:(0,Ae.jsx)(pv,{children:(0,Ae.jsxs)("div",{children:[(0,Ae.jsx)(Rt,{success:e.success,fail:e.fail}),typeof t=="string"?(0,Ae.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,Ae.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var It=require("react/jsx-runtime"),wl=2,Rf=()=>{let{navigateBack:e,lastScreen:t,currentScreen:r}=_(),{walletConnectionStatus:o,closePrivyModal:n}=W(),[a,i]=(0,bi.useState)(void 0),[l,s]=(0,bi.useState)(0),c=o?.status==="connected",u=o?.status==="switching_to_supported_chain";(0,bi.useEffect)(()=>{if(c){let L=setTimeout(n,Ke);return()=>clearTimeout(L)}},[c]);let g=L=>{i(cd(L))};(0,bi.useEffect)(()=>{o?.connectError&&g(o?.connectError)},[o]);let f=o?.connector?.connectorType||"injected",v=o?.connector?.walletClientType||"unknown",b=io[v]?.displayName||o?.connector?.walletBranding.name||"Browser Extension",w=io[v]?.logo||o?.connector?.walletBranding.icon||(L=>(0,It.jsx)(ri,{...L})),x=b==="Browser Extension"?b.toLowerCase():b,T;c?T=`Successfully connected with ${x}`:a?T=a.message:u?T="Switching networks":T=`Waiting for ${x}`;let S="Don\u2019t see your wallet? Check your other browser windows.";return c?S="You\u2019re good to go!":l>=wl&&a?S="Unable to connect wallet":a?S=a.detail:u?S="Switch your wallet to the requested network.":v==="metamask"&&kf.isMobile?S="Click to continue to open and connect MetaMask.":v==="metamask"?S="For the best experience, connect only one wallet at a time.":f==="wallet_connect_v2"?S="Open your mobile wallet app to continue":f==="coinbase_wallet"&&(S="Open the Coinbase app on your phone to continue."),(0,It.jsxs)(It.Fragment,{children:[(0,It.jsx)(k,{backFn:r===t?void 0:e}),(0,It.jsxs)(uv,{children:[(0,It.jsx)(dd,{walletLogo:w,success:c,fail:!!a}),(0,It.jsxs)(rt,{children:[(0,It.jsx)("h3",{children:T}),(0,It.jsx)("p",{children:S})]}),a==wo.ERROR_USER_EXISTS?(0,It.jsx)(D,{onClick:e,children:"Use a different wallet"}):!c&&a?.retryable&&l<wl?(0,It.jsx)(D,{onClick:()=>{s(l+1),i(void 0),o?.connectRetry()},disabled:!c&&(!a?.retryable||l>=wl),children:"Retry"}):!c&&a&&l>=wl?(0,It.jsx)(D,{onClick:e,children:"Use a different wallet"}):null]}),(0,It.jsx)(ee,{})]})},uv=Af.default.div`
|
|
909
909
|
display: flex;
|
|
910
910
|
flex-direction: column;
|
|
911
911
|
align-items: center;
|
|
912
912
|
justify-content: center;
|
|
913
913
|
gap: 24px;
|
|
914
914
|
width: 100%;
|
|
915
|
-
`;var
|
|
915
|
+
`;var Df=y(require("@heroicons/react/24/solid/XCircleIcon")),Si=require("react"),Ff=y(require("styled-components"));var Ca=y(require("styled-components")),Ei=require("react/jsx-runtime"),Ti=()=>(0,Ei.jsx)(mv,{children:(0,Ei.jsxs)(fv,{children:[(0,Ei.jsx)(hv,{}),(0,Ei.jsx)(yv,{})]})}),mv=Ca.default.div`
|
|
916
916
|
display: flex;
|
|
917
917
|
justify-content: center;
|
|
918
918
|
align-items: center;
|
|
@@ -924,14 +924,14 @@ Resources:
|
|
|
924
924
|
@media all and (display-mode: standalone) {
|
|
925
925
|
margin-bottom: 30px;
|
|
926
926
|
}
|
|
927
|
-
`,
|
|
927
|
+
`,fv=Ca.default.div`
|
|
928
928
|
position: relative;
|
|
929
929
|
height: 140px;
|
|
930
930
|
width: 140px;
|
|
931
931
|
|
|
932
932
|
opacity: 1;
|
|
933
933
|
animation: fadein 200ms ease;
|
|
934
|
-
`,
|
|
934
|
+
`,hv=Ca.default.div`
|
|
935
935
|
position: absolute;
|
|
936
936
|
top: 0;
|
|
937
937
|
right: 0;
|
|
@@ -944,7 +944,7 @@ Resources:
|
|
|
944
944
|
border: 4px solid var(--privy-color-accent-light);
|
|
945
945
|
border-radius: 50%;
|
|
946
946
|
}
|
|
947
|
-
`,
|
|
947
|
+
`,yv=Ca.default.div`
|
|
948
948
|
position: absolute;
|
|
949
949
|
top: 0;
|
|
950
950
|
right: 0;
|
|
@@ -968,20 +968,20 @@ Resources:
|
|
|
968
968
|
transform: rotate(360deg);
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
|
-
`;var
|
|
971
|
+
`;var If=["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 Pi(e){let t=e.type;return typeof t=="string"&&If.includes(t)}function gv(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function An(e){return Pi(e)&&e.type==="wallet_not_on_device"}function Mf(e){return Pi(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Rn(e){return!!(Pi(e)&&e.type==="mfa_timeout")}function In(e){return!!(Pi(e)&&e.type==="missing_or_invalid_mfa")}function bl(e){return!!(Pi(e)&&e.type==="mfa_verification_max_attempts_reached")}function pd(e){return!!(Pi(e)&&e.message.includes("code 429"))}function ud(e){return!!(gv(e)&&e.message==="MFA canceled")}function Wf(e,t,r=!1){return t.length>0&&!r?"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN":e==="create"?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function El(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function Lf({api:e,provider:t}){let r=ia(),o=gs(),n=await vs(r);try{return{url:(await e.post(Vp,{redirect_to:window.location.href,code_challenge:n,state_code:o,provider:t})).url,codeVerifier:r,stateCode:o}}catch(a){throw pe(a)}}async function Of({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new E("User denied confirmation during OAuth flow");try{return(await e.post(zp,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(a){let i=pe(a);throw i.privyErrorCode?new E(i.message||"Invalid code during OAuth flow.",void 0,i.privyErrorCode):i.message==="User denied confirmation during OAuth flow"?new E("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new E("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}var Yt=require("react/jsx-runtime"),Nf=1,Uf=()=>{let{authenticated:e,user:t,getAccessToken:r}=H(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:a}=W(),{navigate:i,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=_(),u=(0,Si.useMemo)(()=>Date.now(),[]),[g,f]=(0,Si.useState)(!1),{onCompleteNavigateTo:v,onFailure:b}=l?.connectWallet,w=T=>{g||(f(!0),b(typeof T=="string"?new Error(T):T))};(0,Si.useEffect)(()=>{let T=We(t),S;return!e||!T?w("User must be authenticated and have a Privy wallet before it can be connected"):a?((async()=>{let I=await r();if(!I)return w("User must be authenticated and have a Privy wallet before it can be connected");try{await a.connect({accessToken:I,address:T.address});let U=(Date.now()-u)/1e3;v==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&U<Nf?S=setTimeout(()=>{i(v)},(Nf-U)*1e3):i(v)}catch(U){if(An(U)&&T.recoveryMethod==="privy"){let M=await r();if(!M)return w("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:T.address}}),(await a?.recover({address:T.address,accessToken:M}))?.address||w(new Error("Unable to recover wallet")),v?i(v):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:T.address}}),i(v)}catch{w("An error has occurred, please try again.")}}else if(An(U)){s({...l,recoverWallet:{privyWallet:T,onCompleteNavigateTo:v,onFailure:b},recoveryOAuthStatus:{provider:"google-drive",action:"recover"}});let M=El(T.recoveryMethod);i(M)}else w(U)}})(),()=>clearTimeout(S)):void 0},[e,t,a]);let x=()=>{w("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=x,(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(k,{onClose:x}),g?(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsxs)(Dr,{children:[(0,Yt.jsx)(Df.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Yt.jsx)(Oe,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,Yt.jsx)(D,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,Yt.jsx)(Ti,{}),(0,Yt.jsx)(vv,{})]})},vv=Ff.default.div`
|
|
972
972
|
height: 44px;
|
|
973
|
-
`;var
|
|
973
|
+
`;var Bf=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Hf=require("react");var xr=require("react/jsx-runtime"),Gf=()=>{let{user:e}=H(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=W(),{app:n,data:a,onUserCloseViaDialogOrKeybindRef:i}=_(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=a.createWallet,u=()=>{let g=We(e);g?(o(),l(g)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,Hf.useEffect)(()=>{let g=setTimeout(u,au);return()=>clearTimeout(g)},[]),i.current=u,(0,xr.jsxs)(xr.Fragment,{children:[(0,xr.jsx)(k,{onClose:u}),(0,xr.jsx)(te,{}),(0,xr.jsxs)(Dr,{children:[(0,xr.jsx)(Bf.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,xr.jsx)(Oe,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,xr.jsx)(ne,{}),(0,xr.jsx)(q,{protectedByPrivy:!0})]})};var qf=y(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),$f=y(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),ko=require("react"),Ao=y(require("styled-components"));var ue=require("react/jsx-runtime"),jf=()=>{let[e,t]=(0,ko.useState)(null),{authenticated:r,user:o,getAccessToken:n}=H(),{closePrivyModal:a,createAnalyticsEvent:i,clientAnalyticsId:l}=W(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),u=We(o)?.address,{onFailure:g,onSuccess:f,origin:v,appId:b}=s.keyExport,w=T=>{a({shouldCallAuthOnSuccess:!1}),g(typeof T=="string"?new Error(T):T)},x=()=>{a({shouldCallAuthOnSuccess:!1}),f(),i({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:u}})};return(0,ko.useEffect)(()=>{let T=We(o);if(!r||!T)return w("User must be authenticated before exporting their wallet");n().then(t,w)},[r,o]),c.current=x,(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(k,{onClose:x}),(0,ue.jsxs)(bv,{children:[(0,ue.jsxs)(Oe,{icon:(0,ue.jsx)($f.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,ue.jsxs)(Sv,{children:[(0,ue.jsx)(wv,{style:{marginRight:6}}),zo(u)]}),(0,ue.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,ue.jsxs)(Ev,{children:[(0,ue.jsxs)(Vf,{children:[(0,ue.jsx)(zf,{children:"1"}),(0,ue.jsxs)("span",{children:[(0,ue.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,ue.jsxs)(Vf,{children:[(0,ue.jsx)(zf,{children:"2"}),(0,ue.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,ue.jsx)("div",{style:{width:"100%"},children:e&&(0,ue.jsx)(Cv,{origin:v,appId:b,accessToken:e,clientAnalyticsId:l,address:u,dimensions:{height:"44px"}})}),(0,ue.jsxs)(xv,{children:[(0,ue.jsxs)("div",{children:[(0,ue.jsx)(qf.default,{viewBox:"0 0 20 18"}),(0,ue.jsx)("h4",{children:"Warning"})]}),(0,ue.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,ue.jsx)(q,{protectedByPrivy:!0})]})};function Cv(e){let[t,r]=(0,ko.useState)(e.dimensions.width),[o,n]=(0,ko.useState)(void 0),a=(0,ko.useRef)(null);return(0,ko.useEffect)(()=>{if(a.current&&t===void 0){let{width:l}=a.current.getBoundingClientRect();r(l)}let i=getComputedStyle(document.documentElement);n({background2:i.getPropertyValue("--privy-color-background-2"),foreground3:i.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:i.getPropertyValue("--privy-color-foreground-accent"),accent:i.getPropertyValue("--privy-color-accent"),accentDark:i.getPropertyValue("--privy-color-accent-dark"),success:i.getPropertyValue("--privy-color-success")})},[]),(0,ue.jsx)("div",{ref:a,children:t&&(0,ue.jsxs)(Tv,{children:[(0,ue.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:ds(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o})}),(0,ue.jsx)(Pv,{children:"Loading..."})]})})}function wv(e){return(0,ue.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,ue.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var bv=Ao.default.div`
|
|
974
974
|
display: flex;
|
|
975
975
|
flex-direction: column;
|
|
976
976
|
text-align: left;
|
|
977
|
-
`,
|
|
977
|
+
`,Ev=Ao.default.div`
|
|
978
978
|
display: flex;
|
|
979
979
|
flex-direction: column;
|
|
980
980
|
gap: 24px;
|
|
981
981
|
padding-bottom: 16px;
|
|
982
982
|
margin-left: 11px;
|
|
983
983
|
border-left: 1px solid var(--privy-color-foreground-4) !important;
|
|
984
|
-
`,
|
|
984
|
+
`,Vf=Ao.default.div`
|
|
985
985
|
display: flex;
|
|
986
986
|
align-items: top;
|
|
987
987
|
gap: 8px;
|
|
@@ -990,7 +990,7 @@ Resources:
|
|
|
990
990
|
color: var(--privy-color-accent);
|
|
991
991
|
text-decoration: underline;
|
|
992
992
|
}
|
|
993
|
-
`,
|
|
993
|
+
`,zf=Ao.default.div`
|
|
994
994
|
display: flex;
|
|
995
995
|
align-items: center;
|
|
996
996
|
justify-content: center;
|
|
@@ -1004,11 +1004,11 @@ Resources:
|
|
|
1004
1004
|
border-radius: 100%;
|
|
1005
1005
|
background: var(--privy-color-background);
|
|
1006
1006
|
color: var(--privy-color-accent);
|
|
1007
|
-
`,
|
|
1007
|
+
`,Tv=Ao.default.div`
|
|
1008
1008
|
overflow: visible;
|
|
1009
1009
|
position: relative;
|
|
1010
1010
|
height: 44px;
|
|
1011
|
-
`,
|
|
1011
|
+
`,Pv=Ao.default.div`
|
|
1012
1012
|
position: absolute;
|
|
1013
1013
|
display: flex;
|
|
1014
1014
|
align-items: center;
|
|
@@ -1020,7 +1020,7 @@ Resources:
|
|
|
1020
1020
|
border-radius: var(--privy-border-radius-md);
|
|
1021
1021
|
background-color: var(--privy-color-background-2);
|
|
1022
1022
|
color: var(--privy-color-foreground-3);
|
|
1023
|
-
`,
|
|
1023
|
+
`,Sv=Ao.default.div`
|
|
1024
1024
|
display: flex;
|
|
1025
1025
|
align-items: center;
|
|
1026
1026
|
padding-top: 1px;
|
|
@@ -1033,7 +1033,7 @@ Resources:
|
|
|
1033
1033
|
font-size: 12px;
|
|
1034
1034
|
font-weight: 500;
|
|
1035
1035
|
margin: auto;
|
|
1036
|
-
`,
|
|
1036
|
+
`,xv=Ao.default.div`
|
|
1037
1037
|
border: 1px solid var(--privy-color-background-2) !important;
|
|
1038
1038
|
border-radius: var(--privy-border-radius-md);
|
|
1039
1039
|
padding: 16px;
|
|
@@ -1055,7 +1055,9 @@ Resources:
|
|
|
1055
1055
|
color: var(--privy-color-error);
|
|
1056
1056
|
}
|
|
1057
1057
|
}
|
|
1058
|
-
`;var
|
|
1058
|
+
`;var Kf=y(require("@heroicons/react/24/solid/XCircleIcon")),wa=require("react"),Yf=y(require("styled-components"));var Tl=require("react");function Pl(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=W(),o=(0,Tl.useRef)(!1);return{createWallet:(0,Tl.useCallback)(async a=>{let i=await ge();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(Yn);if(!l)throw new Error("walletProxy does not exist.");let s=1e4,c=new Promise((v,b)=>{setTimeout(()=>{b(new Error("walletProxy.create timed out."))},s)});if(!await Promise.race([l.create({accessToken:i,recoveryPassword:a}),c]))throw new Error("walletProxy.create did not send a response.");let g=await e();if(!g)throw new Error("Failed to refresh user.");let f=We(g);if(!f)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:f.address}}),o.current=!0,f}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}var _r=require("react/jsx-runtime"),Zf=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=_(),[n,a]=(0,wa.useState)(""),{embeddedWallets:i}=Yo(),{authenticated:l}=H(),{closePrivyModal:s}=W(),{onSuccess:c,onFailure:u,callAuthOnSuccessOnClose:g}=r.createWallet,f=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:v}=Pl(),[b,w]=(0,wa.useState)(null),x=new qe(async()=>{try{let S=await v();if(!S)return;w(S),t("EMBEDDED_WALLET_CREATED_SCREEN")}catch(S){a(S.message)}});(0,wa.useEffect)(()=>{if(!l){t("LANDING"),u(new Error("User must be authenticated before creating a Privy wallet"));return}if(f){let S=Wf("create",i.userOwnedRecoveryOptions);return t(S)}x.execute()},[f,l]);let T=()=>{b?(c(b),s({shouldCallAuthOnSuccess:g})):(u(new Nt("User wallet creation failed")),s({shouldCallAuthOnSuccess:!1}))};return o.current=()=>null,n?(0,_r.jsxs)(_r.Fragment,{children:[(0,_r.jsx)(k,{closeable:!1}),(0,_r.jsxs)(Dr,{children:[(0,_r.jsx)(Kf.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,_r.jsx)(Oe,{title:"Something went wrong",description:n})]}),(0,_r.jsx)(D,{onClick:T,children:"Close"}),(0,_r.jsx)(_v,{})]}):(0,_r.jsx)(Ti,{})},_v=Yf.default.div`
|
|
1059
|
+
height: 44px;
|
|
1060
|
+
`;var Mn=require("react");var Mi=require("react");var nh=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Ri=require("react");var Jf=y(require("@heroicons/react/24/outline/ArrowPathIcon")),Qf=y(require("@heroicons/react/24/outline/EyeIcon")),Xf=y(require("@heroicons/react/24/outline/EyeSlashIcon")),Ze=y(require("styled-components"));var kv=Ze.css`
|
|
1059
1061
|
font-size: 14px;
|
|
1060
1062
|
font-style: normal;
|
|
1061
1063
|
font-weight: 400;
|
|
@@ -1063,8 +1065,8 @@ Resources:
|
|
|
1063
1065
|
letter-spacing: -0.008px;
|
|
1064
1066
|
text-align: left;
|
|
1065
1067
|
transition: color 0.1s ease-in;
|
|
1066
|
-
`,
|
|
1067
|
-
${
|
|
1068
|
+
`,Sl=Ze.default.span`
|
|
1069
|
+
${kv}
|
|
1068
1070
|
transition: color 0.1s ease-in;
|
|
1069
1071
|
color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
1070
1072
|
text-transform: ${({error:e})=>e?"":"capitalize"};
|
|
@@ -1072,18 +1074,18 @@ Resources:
|
|
|
1072
1074
|
&[aria-hidden='true'] {
|
|
1073
1075
|
visibility: hidden;
|
|
1074
1076
|
}
|
|
1075
|
-
`,
|
|
1077
|
+
`,en=Ze.default.div`
|
|
1076
1078
|
display: flex;
|
|
1077
1079
|
flex-direction: column;
|
|
1078
1080
|
justify-content: center;
|
|
1079
1081
|
flex-grow: 1;
|
|
1080
|
-
`,
|
|
1081
|
-
${e=>e.hideAnimations&&
|
|
1082
|
+
`,tn=(0,Ze.default)(D)`
|
|
1083
|
+
${e=>e.hideAnimations&&Ze.css`
|
|
1082
1084
|
&& {
|
|
1083
1085
|
transition: none;
|
|
1084
1086
|
}
|
|
1085
1087
|
`}
|
|
1086
|
-
`,
|
|
1088
|
+
`,eh=Ze.css`
|
|
1087
1089
|
&& {
|
|
1088
1090
|
width: 100%;
|
|
1089
1091
|
border-width: 1px;
|
|
@@ -1098,8 +1100,8 @@ Resources:
|
|
|
1098
1100
|
font-weight: 300;
|
|
1099
1101
|
line-height: 22px; /* 137.5% */
|
|
1100
1102
|
}
|
|
1101
|
-
`,
|
|
1102
|
-
${
|
|
1103
|
+
`,xi=Ze.default.input`
|
|
1104
|
+
${eh}
|
|
1103
1105
|
|
|
1104
1106
|
&::placeholder {
|
|
1105
1107
|
color: var(--privy-color-foreground-3);
|
|
@@ -1110,15 +1112,15 @@ Resources:
|
|
|
1110
1112
|
overflow: hidden;
|
|
1111
1113
|
text-overflow: ellipsis;
|
|
1112
1114
|
white-space: nowrap;
|
|
1113
|
-
`,
|
|
1114
|
-
${
|
|
1115
|
-
`,
|
|
1115
|
+
`,th=Ze.default.div`
|
|
1116
|
+
${eh}
|
|
1117
|
+
`,rn=Ze.default.div`
|
|
1116
1118
|
position: relative;
|
|
1117
1119
|
width: 100%;
|
|
1118
1120
|
display: flex;
|
|
1119
1121
|
align-items: center;
|
|
1120
1122
|
justify-content: ${({centered:e})=>e?"center":"space-between"};
|
|
1121
|
-
`,
|
|
1123
|
+
`,on=Ze.default.div`
|
|
1122
1124
|
display: flex;
|
|
1123
1125
|
flex-direction: column;
|
|
1124
1126
|
align-items: center;
|
|
@@ -1140,12 +1142,12 @@ Resources:
|
|
|
1140
1142
|
font-weight: 400;
|
|
1141
1143
|
line-height: 20px;
|
|
1142
1144
|
}
|
|
1143
|
-
`,
|
|
1145
|
+
`,ba=Ze.default.div`
|
|
1144
1146
|
display: flex;
|
|
1145
1147
|
flex-direction: column;
|
|
1146
1148
|
gap: 10px;
|
|
1147
1149
|
padding-bottom: 1rem;
|
|
1148
|
-
`,
|
|
1150
|
+
`,Ea=Ze.default.div`
|
|
1149
1151
|
display: flex;
|
|
1150
1152
|
text-align: left;
|
|
1151
1153
|
align-items: center;
|
|
@@ -1165,13 +1167,13 @@ Resources:
|
|
|
1165
1167
|
> :first-child {
|
|
1166
1168
|
min-width: 24px;
|
|
1167
1169
|
}
|
|
1168
|
-
`,
|
|
1170
|
+
`,qT=Ze.default.div`
|
|
1169
1171
|
height: var(--privy-height-modal-full);
|
|
1170
1172
|
|
|
1171
1173
|
@media (max-width: 440px) {
|
|
1172
1174
|
height: var(--privy-height-modal-compact);
|
|
1173
1175
|
}
|
|
1174
|
-
`,
|
|
1176
|
+
`,md=(0,Ze.default)(cl)`
|
|
1175
1177
|
display: flex;
|
|
1176
1178
|
flex: 1;
|
|
1177
1179
|
gap: 4px;
|
|
@@ -1183,7 +1185,7 @@ Resources:
|
|
|
1183
1185
|
border-color: var(--privy-color-foreground-3);
|
|
1184
1186
|
border-width: 1px;
|
|
1185
1187
|
}
|
|
1186
|
-
`,
|
|
1188
|
+
`,_i=Ze.default.div`
|
|
1187
1189
|
position: absolute;
|
|
1188
1190
|
right: 0.5rem;
|
|
1189
1191
|
|
|
@@ -1191,7 +1193,7 @@ Resources:
|
|
|
1191
1193
|
flex-direction: row;
|
|
1192
1194
|
justify-content: space-around;
|
|
1193
1195
|
align-items: center;
|
|
1194
|
-
`,
|
|
1196
|
+
`,rh=(0,Ze.default)(Jf.default)`
|
|
1195
1197
|
height: 1.25rem;
|
|
1196
1198
|
width: 1.25rem;
|
|
1197
1199
|
stroke: var(--privy-color-accent);
|
|
@@ -1200,7 +1202,7 @@ Resources:
|
|
|
1200
1202
|
:active {
|
|
1201
1203
|
stroke: var(--privy-color-accent-light);
|
|
1202
1204
|
}
|
|
1203
|
-
`,
|
|
1205
|
+
`,ki=(0,Ze.default)(Xf.default)`
|
|
1204
1206
|
height: 1.25rem;
|
|
1205
1207
|
width: 1.25rem;
|
|
1206
1208
|
stroke: var(--privy-color-accent);
|
|
@@ -1209,7 +1211,7 @@ Resources:
|
|
|
1209
1211
|
:active {
|
|
1210
1212
|
stroke: var(--privy-color-accent-light);
|
|
1211
1213
|
}
|
|
1212
|
-
`,
|
|
1214
|
+
`,Ai=(0,Ze.default)(Qf.default)`
|
|
1213
1215
|
height: 1.25rem;
|
|
1214
1216
|
width: 1.25rem;
|
|
1215
1217
|
stroke: var(--privy-color-accent);
|
|
@@ -1218,7 +1220,7 @@ Resources:
|
|
|
1218
1220
|
:active {
|
|
1219
1221
|
stroke: var(--privy-color-accent-light);
|
|
1220
1222
|
}
|
|
1221
|
-
`,
|
|
1223
|
+
`,oh=Ze.default.progress`
|
|
1222
1224
|
height: 4px;
|
|
1223
1225
|
width: 100%;
|
|
1224
1226
|
margin: 8px 0;
|
|
@@ -1234,14 +1236,14 @@ Resources:
|
|
|
1234
1236
|
transition: all 0.1s ease-out;
|
|
1235
1237
|
background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
|
|
1236
1238
|
}
|
|
1237
|
-
`;var
|
|
1239
|
+
`;var Je=require("react/jsx-runtime"),ih=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[a,i]=(0,Ri.useState)(!0),[l,s]=(0,Ri.useState)(!1),[c,u]=(0,Ri.useState)(""),g=r===c;return(0,Ri.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(k,{title:"Confirm Password",closeable:!1,backFn:n}),(0,Je.jsx)(te,{}),(0,Je.jsxs)(en,{children:[(0,Je.jsxs)(on,{children:[(0,Je.jsx)(nh.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Je.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,Je.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,Je.jsxs)(rn,{children:[(0,Je.jsx)(xi,{value:c,onChange:f=>u(f.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:a?"password":"text",style:{paddingRight:"2.3rem"}}),(0,Je.jsx)(_i,{style:{right:"0.75rem"},children:a?(0,Je.jsx)(ki,{onClick:()=>i(!1)}):(0,Je.jsx)(Ai,{onClick:()=>i(!0)})})]}),(0,Je.jsx)(Sl,{"aria-hidden":!l||g,error:!0,children:"Passwords do not match"})]}),(0,Je.jsx)(tn,{onClick:o,loading:t,disabled:!g,hideAnimations:e,children:"Continue"}),(0,Je.jsx)(ne,{}),(0,Je.jsx)(q,{protectedByPrivy:!0})]})};var ch=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),dh=require("react"),ph=y(require("styled-components"));var Ta=y(require("styled-components")),nn=require("react/jsx-runtime"),ah=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>(0,nn.jsx)("label",{children:(0,nn.jsxs)(Av,{className:e,children:[(0,nn.jsx)(lh,{checked:t,...o}),(0,nn.jsx)(Rv,{color:r,checked:t,children:(0,nn.jsx)(sh,{viewBox:"0 0 24 24",children:(0,nn.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})}),Av=Ta.default.div`
|
|
1238
1240
|
display: inline-block;
|
|
1239
1241
|
vertical-align: middle;
|
|
1240
|
-
`,
|
|
1242
|
+
`,sh=Ta.default.svg`
|
|
1241
1243
|
fill: none;
|
|
1242
1244
|
stroke: white;
|
|
1243
1245
|
stroke-width: 3px;
|
|
1244
|
-
`,
|
|
1246
|
+
`,lh=Ta.default.input.attrs({type:"checkbox"})`
|
|
1245
1247
|
border: 0;
|
|
1246
1248
|
clip: rect(0 0 0 0);
|
|
1247
1249
|
clippath: inset(50%);
|
|
@@ -1252,7 +1254,7 @@ Resources:
|
|
|
1252
1254
|
position: absolute;
|
|
1253
1255
|
white-space: nowrap;
|
|
1254
1256
|
width: 1px;
|
|
1255
|
-
`,
|
|
1257
|
+
`,Rv=Ta.default.div`
|
|
1256
1258
|
display: inline-block;
|
|
1257
1259
|
width: 18px;
|
|
1258
1260
|
height: 18px;
|
|
@@ -1267,71 +1269,28 @@ Resources:
|
|
|
1267
1269
|
border-width: 1px;
|
|
1268
1270
|
}
|
|
1269
1271
|
|
|
1270
|
-
${
|
|
1272
|
+
${lh}:focus + & {
|
|
1271
1273
|
box-shadow: 0 0 0 1px ${e=>e.color};
|
|
1272
1274
|
}
|
|
1273
1275
|
|
|
1274
|
-
${
|
|
1276
|
+
${sh} {
|
|
1275
1277
|
visibility: ${e=>e.checked?"visible":"hidden"};
|
|
1276
1278
|
}
|
|
1277
|
-
`;var
|
|
1279
|
+
`;var je=require("react/jsx-runtime"),uh=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[a,i]=(0,dh.useState)(!1);return(0,je.jsxs)(je.Fragment,{children:[(0,je.jsx)(k,{title:"Confirm Password",closeable:!1,backFn:o}),(0,je.jsx)(te,{}),(0,je.jsxs)(en,{children:[(0,je.jsxs)(on,{children:[(0,je.jsx)(ch.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,je.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,je.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,je.jsx)(ba,{children:(0,je.jsxs)(Ea,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),i(s=>!s)},children:[(0,je.jsx)(ah,{color:"var(--privy-color-error)",checked:a}),(0,je.jsx)(je.Fragment,{children:"I understand losing my password means losing my account."})]})})]}),(0,je.jsxs)(Iv,{children:[n.initiatedBy==="user"&&(0,je.jsx)(Or,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,je.jsx)(tn,{onClick:r,loading:t,hideAnimations:e,disabled:!a,children:"Set Password"})]}),(0,je.jsx)(ne,{}),(0,je.jsx)(q,{protectedByPrivy:!0})]})},Iv=ph.default.div`
|
|
1278
1280
|
display: flex;
|
|
1279
1281
|
gap: 10px;
|
|
1280
|
-
`;var
|
|
1282
|
+
`;var bh=y(require("@heroicons/react/24/outline/KeyIcon")),fd=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Ro=require("react"),hd=y(require("styled-components"));var mh=y(require("fast-password-entropy")),fh=y(require("secure-password-utilities")),hh=require("secure-password-utilities/wordlists"),Mv=95,Wv=8,Lv=3,Ov=.3,Nv=/[a-z]/,Dv=/[A-Z]/,Fv=/[0-9]/,Uv="a-zA-Z0-9",yh="!@#$%^&*()\\-_+.",gh=`${Uv}${yh}`,Bv=new RegExp(`[${yh}]`),Hv=new RegExp(`[${gh}]`),vh=new RegExp(`^[${gh}]{6,}$`),Ch=(e="")=>{let t=e.split("").filter(r=>!Hv.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},xl=()=>fh.generatePassphrase(4,hh.DEFAULT_WORDLIST);function Gv(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function Vv(e){if(e.length<Wv)return 0;let t=0;Nv.test(e)&&(t+=1),Dv.test(e)&&(t+=1),Fv.test(e)&&(t+=1),Bv.test(e)&&(t+=1);let r=t/Lv;return Math.max(0,Math.min(1,r))}function zv(e=""){let t=Vv(e),r=(0,mh.default)(e)/Mv;return(t*Ov+r)/2}function wh(e=""){let t=zv(e);return{value:t,label:Gv(t)}}var Ce=require("react/jsx-runtime"),Eh=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,onSubmit:n,onClose:a,onBack:i,onPasswordChange:l,onPasswordGenerate:s})=>{let[c,u]=(0,Ro.useState)(!1),[g,f]=(0,Ro.useState)(!1);(0,Ro.useEffect)(()=>{r&&!g&&f(!0)},[r]);let v=(0,Ro.useMemo)(()=>g?(r?.length||0)<6?"Password must be at least 6 characters":vh.test(r||"")?null:`Invalid characters used ( ${Ch(r).join(" ")} )`:null,[r,g]),b=(0,Ro.useMemo)(()=>v?{value:0,label:"Weak"}:wh(r),[r,v]),w=(0,Ro.useMemo)(()=>!!(!r?.length||v),[v,r]);return(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)(k,{onClose:a,title:"Secure your account",closeable:o.initiatedBy==="user",backFn:i}),(0,Ce.jsx)(te,{}),(0,Ce.jsxs)(en,{children:[(0,Ce.jsxs)(on,{children:[(0,Ce.jsx)(bh.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ce.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),(0,Ce.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,Ce.jsxs)(rn,{children:[(0,Ce.jsx)(xi,{value:r,onChange:x=>l(x.target.value),placeholder:"enter or generate a strong password",type:c?"password":"text",style:{paddingRight:"3.8rem"}}),(0,Ce.jsxs)(_i,{style:{width:"3.5rem"},children:[c?(0,Ce.jsx)(ki,{onClick:()=>u(!1)}):(0,Ce.jsx)(Ai,{onClick:()=>u(!0)}),(0,Ce.jsx)(rh,{onClick:s})]})]}),(0,Ce.jsx)(oh,{value:b.value===0?.01:b.value,label:b.label}),(0,Ce.jsx)(Sl,{error:!!v,children:v||`Password Strength: ${g?b.label:"--"}`}),(0,Ce.jsxs)($v,{children:[(0,Ce.jsx)(qv,{children:(0,Ce.jsxs)(ba,{children:[(0,Ce.jsxs)(Ea,{children:[(0,Ce.jsx)(fd.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,Ce.jsxs)(Ea,{children:[(0,Ce.jsx)(fd.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"You will only be asked to enter it when signing on to a new device."]})]})}),(0,Ce.jsx)(tn,{onClick:n,loading:t,disabled:w,hideAnimations:e,children:"Continue"})]})]}),(0,Ce.jsx)(ne,{}),(0,Ce.jsx)(q,{protectedByPrivy:!0})]})},qv=(0,hd.default)(ba)`
|
|
1281
1283
|
flex: 1;
|
|
1282
1284
|
padding-top: 1rem;
|
|
1283
|
-
|
|
1285
|
+
`,$v=hd.default.div`
|
|
1284
1286
|
display: flex;
|
|
1285
1287
|
flex-direction: column;
|
|
1286
1288
|
height: 100%;
|
|
1287
|
-
`;var
|
|
1289
|
+
`;var Th=y(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),Ph=y(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),Sh=y(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),xh=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Pa=require("react");var Re=require("react/jsx-runtime"),_h=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:a})=>{let[i,l]=(0,Pa.useState)(!1),s=(0,Pa.useCallback)(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=(0,Pa.useCallback)(()=>{let u=document.createElement("a"),g=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),f=new Blob([jv(r,o)],{type:"text/plain"}),v=URL.createObjectURL(f);u.href=v,u.target="_blank",u.download=`${g}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(v)},5e3)},[o]);return(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(k,{backFn:a,title:"Save Password",closeable:!1}),(0,Re.jsx)(te,{}),(0,Re.jsxs)(en,{children:[(0,Re.jsxs)(on,{children:[(0,Re.jsx)(xh.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Re.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,Re.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset if you lose your device. Make sure to secure it to keep your assets safe."})]}),(0,Re.jsx)(rn,{centered:!0,children:(0,Re.jsx)(th,{children:o})}),(0,Re.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,Re.jsx)(md,{onClick:s,children:i?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(Ph.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(Sh.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,Re.jsxs)(md,{onClick:c,children:[(0,Re.jsx)(Th.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,Re.jsx)(tn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,Re.jsx)(ne,{}),(0,Re.jsx)(q,{protectedByPrivy:!0})]})},jv=(e,t)=>`Your wallet recovery password for ${e} is
|
|
1288
1290
|
|
|
1289
1291
|
${t}
|
|
1290
1292
|
|
|
1291
|
-
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var
|
|
1292
|
-
height: 44px;
|
|
1293
|
-
`;var xn=require("react");var gh=require("react/jsx-runtime"),yh=()=>{let[e,t]=(0,xn.useState)(null),[r,o]=(0,xn.useState)(!1),[n,a]=(0,xn.useState)(null),[i,l]=(0,xn.useState)(""),{authenticated:s,getAccessToken:c,user:u}=V(),{walletProxy:g,refreshUser:f,closePrivyModal:C,createAnalyticsEvent:E}=W(),{app:w,navigate:k,data:T,onUserCloseViaDialogOrKeybindRef:S}=A(),{onSuccess:L,onFailure:M}=T.createWallet,F=Ge(u),I=e?.recoveryMethod==="user-passcode";(0,xn.useEffect)(()=>{s||(k("LANDING"),M(new za("User must be authenticated before setting a password on a Privy wallet")))},[s]);let H=()=>{if(n){M(n),C({shouldCallAuthOnSuccess:!1});return}if(!I){M(new Xt("Exited before password was added to wallet")),C({shouldCallAuthOnSuccess:!1});return}L(e),C({shouldCallAuthOnSuccess:!1})};S.current=H;let Y=async()=>{let $=await c();if($&&F?.address&&i&&g)try{if(E({eventName:"embedded_wallet_set_password_started",payload:{walletAddress:F.address}}),!(await g.setRecoveryPassword({accessToken:$,address:F.address,recoveryPassword:i})).address){a(new Xt("Error setting password on privy wallet")),E({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:F.address,reason:"error setting password"}});return}let ce=await f(),U=Ge(ce);if(!U){a(new Xt("Error setting password on privy wallet")),E({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:F.address,reason:"wallet disconnected"}});return}t(U),E({eventName:"embedded_wallet_set_password_completed",payload:{walletAddress:F.address}})}catch(R){console.warn(R),a(R instanceof Error?R:new Error("Error setting password on privy wallet")),E({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:F.address,reason:R}})}},q=async()=>{I?(L(e),C({shouldCallAuthOnSuccess:!1})):(o(!0),a(null),await Y(),o(!1))};return(0,gh.jsx)(vl,{appName:w?.name||"privy",config:{initiatedBy:"user",onCancel:H},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:i,onPasswordGenerate:()=>l(gl()),onPasswordChange:l,onSubmit:q,onClose:H})};var vh=y(require("@heroicons/react/24/outline/UserCircleIcon")),Ch=y(require("@heroicons/react/24/solid/LockClosedIcon"));var gt=require("react/jsx-runtime"),wh=()=>{let{user:e}=V(),{closePrivyModal:t,createAnalyticsEvent:r}=W(),{data:o,setModalData:n,navigate:a,onUserCloseViaDialogOrKeybindRef:i}=A(),{onSuccess:l,onFailure:s}=o.setWalletPassword,c=()=>{s(new Xt("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return i.current=c,(0,gt.jsxs)(gt.Fragment,{children:[(0,gt.jsx)(x,{onClose:c}),(0,gt.jsx)(oe,{}),(0,gt.jsxs)(Or,{children:[(0,gt.jsxs)(Mm,{children:[(0,gt.jsx)(vh.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,gt.jsx)(Wm,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,gt.jsx)(Ch.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,gt.jsxs)(He,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,gt.jsx)("p",{children:"Losing this password will make your account inaccessible on new devices. You will only be asked for it when you log on to a new device."})]})]}),(0,gt.jsx)(D,{onClick:()=>{let g=Ge(e);r({eventName:"embedded_wallet_set_password_started",payload:{walletAddress:g?.address}}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),a("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,gt.jsx)(le,{}),(0,gt.jsx)(j,{protectedByPrivy:!0})]})};var bh=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),kn=require("react"),_n=y(require("styled-components"));var Oe=require("react/jsx-runtime"),Eh=()=>{let[e,t]=(0,kn.useState)(!0),{authenticated:r,getAccessToken:o}=V(),{walletProxy:n,closePrivyModal:a,createAnalyticsEvent:i}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),[u,g]=(0,kn.useState)(void 0),[f,C]=(0,kn.useState)(""),[E,w]=(0,kn.useState)(!1),{privyWallet:k,onCompleteNavigateTo:T,onSuccess:S,onFailure:L}=s.recoverWallet,M=(H="User exited before their wallet could be recovered")=>{a({shouldCallAuthOnSuccess:!1}),L(typeof H=="string"?new Xt(H):H)};c.current=M,(0,kn.useEffect)(()=>{if(!r||!k)return M("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let F=H=>{H&&g(H)};return(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(x,{onClose:M}),(0,Oe.jsx)(oe,{}),(0,Oe.jsxs)(A0,{children:[(0,Oe.jsxs)(_0,{children:[(0,Oe.jsx)(bh.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Oe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),(0,Oe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,Oe.jsxs)("div",{children:[(0,Oe.jsxs)(Xo,{children:[(0,Oe.jsx)(wi,{type:e?"password":"text",onChange:H=>F(H.target.value),disabled:E,style:{paddingRight:"2.3rem"}}),(0,Oe.jsx)(bi,{style:{right:"0.75rem"},children:e?(0,Oe.jsx)(Ei,{onClick:()=>t(!1)}):(0,Oe.jsx)(Ti,{onClick:()=>t(!0)})})]}),!!f&&(0,Oe.jsx)(R0,{children:f})]}),(0,Oe.jsxs)("div",{children:[(0,Oe.jsxs)(Im,{children:[(0,Oe.jsx)("h4",{children:"Why is this necessary?"}),(0,Oe.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Oe.jsx)(I0,{loading:E||!n,disabled:!u,onClick:async()=>{w(!0);let H=await o();if(H&&k&&u!==null)try{i({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:k.address}}),await n?.recover({address:k.address,accessToken:H,recoveryPin:u}),C(""),T?l(T):a({shouldCallAuthOnSuccess:!1}),S?.(k),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:k.address}})}catch(Y){vf(Y)?C("Invalid recovery password, please try again."):C("An error has occurred, please try again.")}finally{w(!1)}else return M("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!k&&E,children:"Recover your account"})]})]}),(0,Oe.jsx)(le,{}),(0,Oe.jsx)(j,{protectedByPrivy:!0})]})},_0=_n.default.div`
|
|
1294
|
-
display: flex;
|
|
1295
|
-
flex-direction: column;
|
|
1296
|
-
align-items: center;
|
|
1297
|
-
justify-content: center;
|
|
1298
|
-
margin: 20px 0;
|
|
1299
|
-
gap: 4px;
|
|
1300
|
-
|
|
1301
|
-
& h3 {
|
|
1302
|
-
font-size: 18px;
|
|
1303
|
-
font-style: normal;
|
|
1304
|
-
font-weight: 600;
|
|
1305
|
-
line-height: 24px;
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
& p {
|
|
1309
|
-
max-width: 300px;
|
|
1310
|
-
font-size: 14px;
|
|
1311
|
-
font-style: normal;
|
|
1312
|
-
font-weight: 400;
|
|
1313
|
-
line-height: 20px;
|
|
1314
|
-
}
|
|
1315
|
-
`,A0=_n.default.div`
|
|
1316
|
-
display: flex;
|
|
1317
|
-
flex-direction: column;
|
|
1318
|
-
justify-content: space-between;
|
|
1319
|
-
`,R0=_n.default.div`
|
|
1320
|
-
line-height: 20px;
|
|
1321
|
-
height: 20px;
|
|
1322
|
-
font-size: 13px;
|
|
1323
|
-
color: var(--privy-color-error);
|
|
1324
|
-
text-align: left;
|
|
1325
|
-
margin-top: 0.5rem;
|
|
1326
|
-
`,I0=(0,_n.default)(D)`
|
|
1327
|
-
${e=>e.hideAnimations&&_n.css`
|
|
1328
|
-
&& {
|
|
1329
|
-
// Remove animations because the recoverWallet task on the iframe partially
|
|
1330
|
-
// blocks the renderer, so the animation stutters and doesn't look good
|
|
1331
|
-
transition: none;
|
|
1332
|
-
}
|
|
1333
|
-
`}
|
|
1334
|
-
`;var Th=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Ph=y(require("@heroicons/react/24/outline/PhoneIcon")),ad=y(require("styled-components"));var tt=require("react/jsx-runtime"),M0=e=>{let t=(0,tt.jsx)(Th.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof P)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof Le&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,tt.jsx)(Ph.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof Ze)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,tt.jsx)(ul,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,tt.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,tt.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof kr&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},Sh=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=A(),{reset:a}=Pe(),i=r?.errorModalData,l=M0(i?.error||new Error),s=c=>{if(c instanceof Ze)switch(c.privyErrorCode){case"invalid_captcha":return()=>a()}return()=>{}};return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(x,{backFn:!o||n===o?void 0:t}),(0,tt.jsxs)(W0,{children:[(0,tt.jsx)(qt,{children:(0,tt.jsxs)("div",{children:[(0,tt.jsx)(pl,{color:"var(--privy-color-error)"}),l.icon]})}),(0,tt.jsxs)(L0,{children:[(0,tt.jsx)("h3",{children:l.title}),(0,tt.jsx)("p",{children:l.detail})]}),(0,tt.jsx)(D,{color:"var(--privy-color-error)",onClick:()=>{s(i?.error||new Error)(),e(o||"LANDING",!1)},children:l.ctaText})]})]})},W0=ad.default.div`
|
|
1293
|
+
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var kh=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Ah=y(require("@heroicons/react/24/solid/XCircleIcon"));var Mt=require("react/jsx-runtime"),Rh=({error:e,onClose:t})=>(0,Mt.jsxs)(Mt.Fragment,{children:[(0,Mt.jsx)(k,{closeable:!1}),(0,Mt.jsx)(te,{}),e?(0,Mt.jsxs)(Dr,{children:[(0,Mt.jsx)(Ah.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Mt.jsx)(Oe,{title:"Something went wrong",description:e})]}):(0,Mt.jsxs)(Dr,{children:[(0,Mt.jsx)(kh.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,Mt.jsx)(Oe,{title:"Success"})]}),(0,Mt.jsx)(D,{onClick:t,children:"Close"}),(0,Mt.jsx)(ne,{}),(0,Mt.jsx)(q,{protectedByPrivy:!0})]});var Ih=require("react"),Kv=(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}},Mh=()=>{let[e,t]=(0,Ih.useReducer)(Kv,"creating");return{send:t,state:e}};var Ii=require("react/jsx-runtime"),_l=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=_(),{send:n,state:a}=Mh(),i=(0,Mi.useCallback)(async()=>{a==="finalizing"&&await e(),n("next")},[a,n,e]);(0,Mi.useEffect)(()=>{let c;return a==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),Ke)),()=>{c&&clearTimeout(c)}},[a,t.config.initiatedBy,t.onClose]);let l=(0,Mi.useCallback)(()=>{n("back")},[n]),s=(0,Mi.useCallback)(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return a==="creating"?(0,Ii.jsx)(Eh,{...t,onSubmit:i,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):a==="saving"?(0,Ii.jsx)(_h,{...t,onSubmit:i,onBack:l}):a==="confirming"?(0,Ii.jsx)(ih,{...t,onSubmit:i,onBack:l}):a==="finalizing"?(0,Ii.jsx)(uh,{...t,onSubmit:i,onBack:l}):a==="done"?(0,Ii.jsx)(Rh,{...t,onSubmit:i}):null};var Lh=require("react/jsx-runtime"),Wh=()=>{let[e,t]=(0,Mn.useState)(null),[r,o]=(0,Mn.useState)(!1),[n,a]=(0,Mn.useState)(null),[i,l]=(0,Mn.useState)(""),{authenticated:s,getAccessToken:c,user:u}=H(),{walletProxy:g,refreshUser:f,closePrivyModal:v,createAnalyticsEvent:b}=W(),{app:w,navigate:x,data:T,onUserCloseViaDialogOrKeybindRef:S}=_(),{onSuccess:L,onFailure:I}=T.createWallet,U=We(u),M=e?.recoveryMethod==="user-passcode";(0,Mn.useEffect)(()=>{s||(x("LANDING"),I(new Za("User must be authenticated before setting a password on a Privy wallet")))},[s]);let G=()=>{if(n){I(n),v({shouldCallAuthOnSuccess:!1});return}if(!M){I(new Nt("Exited before password was added to wallet")),v({shouldCallAuthOnSuccess:!1});return}L(e),v({shouldCallAuthOnSuccess:!1})};S.current=G;let Y=async()=>{let j=await c();if(j&&U?.address&&i&&g)try{if(b({eventName:"embedded_wallet_set_password_started",payload:{walletAddress:U.address}}),!(await g.setRecoveryPassword({accessToken:j,address:U.address,recoveryPassword:i})).address){a(new Nt("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:U.address,reason:"error setting password"}});return}let fe=await f(),B=We(fe);if(!B){a(new Nt("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:U.address,reason:"wallet disconnected"}});return}t(B),b({eventName:"embedded_wallet_set_password_completed",payload:{walletAddress:U.address}})}catch(R){console.warn(R),a(R instanceof Error?R:new Error("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:U.address,reason:R}})}},z=async()=>{M?(L(e),v({shouldCallAuthOnSuccess:!1})):(o(!0),a(null),await Y(),o(!1))};return(0,Lh.jsx)(_l,{appName:w?.name||"privy",config:{initiatedBy:"user",onCancel:G},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:i,onPasswordGenerate:()=>l(xl()),onPasswordChange:l,onSubmit:z,onClose:G})};var Oh=y(require("@heroicons/react/24/outline/UserCircleIcon")),Nh=y(require("@heroicons/react/24/solid/LockClosedIcon"));var wt=require("react/jsx-runtime"),Dh=()=>{let{user:e}=H(),{closePrivyModal:t,createAnalyticsEvent:r}=W(),{data:o,setModalData:n,navigate:a,onUserCloseViaDialogOrKeybindRef:i}=_(),{onSuccess:l,onFailure:s}=o.setWalletPassword,c=()=>{s(new Nt("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return i.current=c,(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(k,{onClose:c}),(0,wt.jsx)(te,{}),(0,wt.jsxs)(Dr,{children:[(0,wt.jsxs)($m,{children:[(0,wt.jsx)(Oh.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,wt.jsx)(jm,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,wt.jsx)(Nh.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,wt.jsxs)(Oe,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,wt.jsx)("p",{children:"Losing this password will make your account inaccessible on new devices. You will only be asked for it when you log on to a new device."})]})]}),(0,wt.jsx)(D,{onClick:()=>{let g=We(e);r({eventName:"embedded_wallet_set_password_started",payload:{walletAddress:g?.address}}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),a("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,wt.jsx)(ne,{}),(0,wt.jsx)(q,{protectedByPrivy:!0})]})};var Fh=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Uh=y(require("@heroicons/react/24/outline/PhoneIcon")),yd=y(require("styled-components"));var it=require("react/jsx-runtime"),Yv=e=>{let t=(0,it.jsx)(Fh.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof E)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof Ne&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,it.jsx)(Uh.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof et)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,it.jsx)(vl,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,it.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,it.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof Rr&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},Bh=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=_(),{reset:a}=Se(),i=r?.errorModalData,l=Yv(i?.error||new Error),s=c=>{if(c instanceof et)switch(c.privyErrorCode){case"invalid_captcha":return()=>a()}return()=>{}};return(0,it.jsxs)(it.Fragment,{children:[(0,it.jsx)(k,{backFn:!o||n===o?void 0:t}),(0,it.jsxs)(Zv,{children:[(0,it.jsx)($t,{children:(0,it.jsxs)("div",{children:[(0,it.jsx)(gl,{color:"var(--privy-color-error)"}),l.icon]})}),(0,it.jsxs)(Jv,{children:[(0,it.jsx)("h3",{children:l.title}),(0,it.jsx)("p",{children:l.detail})]}),(0,it.jsx)(D,{color:"var(--privy-color-error)",onClick:()=>{s(i?.error||new Error)(),e(o||"LANDING",!1)},children:l.ctaText})]})]})},Zv=yd.default.div`
|
|
1335
1294
|
display: flex;
|
|
1336
1295
|
flex-direction: column;
|
|
1337
1296
|
align-items: center;
|
|
@@ -1339,11 +1298,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1339
1298
|
gap: 24px;
|
|
1340
1299
|
width: 100%;
|
|
1341
1300
|
padding-bottom: 16px;
|
|
1342
|
-
`,
|
|
1301
|
+
`,Jv=yd.default.div`
|
|
1343
1302
|
display: flex;
|
|
1344
1303
|
flex-direction: column;
|
|
1345
1304
|
gap: 8px;
|
|
1346
|
-
`;var Io=require("react"),
|
|
1305
|
+
`;var Io=require("react"),xa=require("react-device-detect"),wd=y(require("styled-components"));var Gh=require("react"),Vh=y(require("styled-components"));var gd=require("react/jsx-runtime"),kl=({style:e,color:t,...r})=>(0,gd.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:(0,gd.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var Al=require("react/jsx-runtime"),Hh=({color:e,...t})=>(0,Al.jsx)("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:(0,Al.jsx)("g",{children:(0,Al.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});var Sa=require("react/jsx-runtime"),an=e=>{let[t,r]=(0,Gh.useState)(!1);return(0,Sa.jsxs)(Qv,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,Sa.jsx)(kl,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,Sa.jsx)(Hh,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},Qv=Vh.default.button`
|
|
1347
1306
|
display: flex;
|
|
1348
1307
|
align-items: center;
|
|
1349
1308
|
gap: 6px;
|
|
@@ -1381,7 +1340,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1381
1340
|
width: 14px;
|
|
1382
1341
|
height: 14px;
|
|
1383
1342
|
}
|
|
1384
|
-
`;var
|
|
1343
|
+
`;var zh=require("react"),qh=y(require("styled-components")),$h=require("react/jsx-runtime"),Rl=e=>{let[t,r]=(0,zh.useState)(!1);return(0,$h.jsx)(Xv,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},Xv=qh.default.a`
|
|
1385
1344
|
display: flex;
|
|
1386
1345
|
align-items: center;
|
|
1387
1346
|
gap: 6px;
|
|
@@ -1419,7 +1378,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1419
1378
|
width: 14px;
|
|
1420
1379
|
height: 14px;
|
|
1421
1380
|
}
|
|
1422
|
-
`;var
|
|
1381
|
+
`;var Yh=y(require("qrcode")),Zh=y(require("react")),Jh=y(require("styled-components"));var vd=require("react/jsx-runtime"),jh=()=>(0,vd.jsx)("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:(0,vd.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var Be=require("react/jsx-runtime"),rr=7,Cd=(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},e0=e=>{let t=Yh.default.create(e,{errorCorrectionLevel:"high"}).modules,r=fu(Array.from(t.data),t.size);return r=Cd(r,0,0,rr,rr),r=Cd(r,r.length-rr,0,rr,rr),r=Cd(r,0,r.length-rr,rr,rr),r},t0=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>(0,Be.jsx)(Be.Fragment,{children:[0,1,2].map(a=>(0,Be.jsx)("circle",{r:r*(rr-a*2)/2,cx:e+r*rr/2,cy:t+r*rr/2,fill:a%2!==0?o:n},`finder-${e}-${t}-${a}`))}),r0=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-rr)*e,0],[0,(t-rr)*e]];return(0,Be.jsx)(Be.Fragment,{children:n.map(([a,i])=>(0,Be.jsx)(t0,{x:a,y:i,cellSize:e,bgColor:r,fgColor:o},`finder-${a}-${i}`))})},o0=({matrix:e,cellSize:t,color:r})=>(0,Be.jsx)(Be.Fragment,{children:e.map((o,n)=>o.map((a,i)=>a?(0,Be.jsx)("circle",{r:t/2.5,cx:n*t+t/2,cy:i*t+t/2,fill:r},`circle-${n}-${i}`):(0,Be.jsx)(Zh.default.Fragment,{},`circle-${n}-${i}`)))}),Kh=(e,t)=>e-e%t,n0=({outputSize:e,cellSize:t,element:r,size:o,padding:n,bgColor:a})=>{if(!r)return(0,Be.jsx)(Be.Fragment,{});let i=o||40,l=n||4,s=r,c=e/2-i/2-l;return(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)("rect",{x:Kh(c,t),y:Kh(c,t),width:i+l*2+(c%t?t+.5:.5),height:i+l*2+(c%t?t+.5:.5),fill:a}),(0,Be.jsx)(s,{x:e/2-i/2,y:e/2-i/2,height:i,width:i})]})},i0=e=>{let t=e.outputSize,r=e0(e.url),o=t/r.length;return(0,Be.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,Be.jsx)(o0,{matrix:r,cellSize:o,color:e.fgColor}),(0,Be.jsx)(r0,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,Be.jsx)(n0,{outputSize:e.outputSize,cellSize:o,element:e.logo?.element,bgColor:e.bgColor})]})},a0=Jh.default.div`
|
|
1423
1382
|
display: flex;
|
|
1424
1383
|
justify-content: center;
|
|
1425
1384
|
align-items: center;
|
|
@@ -1434,7 +1393,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1434
1393
|
border-color: ${e=>e.fgColor};
|
|
1435
1394
|
border-radius: var(--privy-border-radius-md);
|
|
1436
1395
|
}
|
|
1437
|
-
`,
|
|
1396
|
+
`,Wi=e=>{let t=e.bgColor||"#FFFFFF",r=e.fgColor||"#000000",o=e.size||160;return(0,Be.jsx)(a0,{size:o,bgColor:t,fgColor:r,children:(0,Be.jsx)(i0,{url:e.url,logo:{element:e.squareLogoElement??jh},outputSize:o,bgColor:t,fgColor:r})})};var Wn=require("react/jsx-runtime"),so=({style:e,...t})=>(0,Wn.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,Wn.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,Wn.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,Wn.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,Wn.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var J=require("react/jsx-runtime"),Qh="#8a63d2",ey=1e3,s0=ey*2,l0=ey*120,ty=()=>{let{authenticated:e,logout:t,ready:r,user:o}=H(),{lastScreen:n,navigate:a,navigateBack:i,setModalData:l,app:s}=_(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:g,createAnalyticsEvent:f}=W(),[v,b]=(0,Io.useState)(void 0),[w,x]=(0,Io.useState)(!1),[T,S]=(0,Io.useState)(!1),L=(0,Io.useRef)([]),I=s?.render.inDialog?Ke:0,U=c(),M=U?.meta.connectUri;return(0,Io.useEffect)(()=>{let G=Date.now(),Y=setInterval(async()=>{let z=await U.pollForReady.execute(),j=Date.now()-G;if(z){clearInterval(Y),x(!0);try{await u(),S(!0)}catch(R){let fe={retryable:!1,message:"Authentication failed"};if(R?.privyErrorCode==="allowlist_rejected"){a("ALLOWLIST_REJECTION_SCREEN");return}else if(R?.privyErrorCode==="max_accounts_reached"){console.error(new Qr(R).toString()),a("USER_LIMIT_REACHED_SCREEN");return}else R?.privyErrorCode==="linked_to_another_user"?fe.detail="This account has already been linked to another user.":R?.privyErrorCode==="invalid_credentials"?(fe.retryable=!0,fe.detail="Something went wrong. Try again."):R?.privyErrorCode==="too_many_requests"&&(fe.detail="Too many requests. Please wait before trying again.");b(fe)}}else j>l0&&(clearInterval(Y),b({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},s0);return()=>{clearInterval(Y),L.current.forEach(z=>clearTimeout(z))}},[]),(0,Io.useEffect)(()=>{if(r&&e&&T&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let Y=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},I);return()=>clearTimeout(Y)}T&&(gr(o,s?.embeddedWallets.createOnLogin)?L.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:Y=>{console.error(Y),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Y,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},I)):L.current.push(setTimeout(()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0}),I)))}},[T,r,e,o]),xa.isMobile||w?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(k,{backFn:n?i:void 0,onClose:g},"header"),(0,J.jsx)(te,{}),xa.isIOS?(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(c0,{children:[(0,J.jsx)($t,{children:(0,J.jsxs)("div",{children:[(0,J.jsx)(Rt,{success:T,fail:!!v}),(0,J.jsx)(so,{style:{width:"38px",height:"38px"}})]})}),(0,J.jsxs)(rt,{children:[(0,J.jsx)(Le,{children:v?v.message:"Sign in with Farcaster"}),(0,J.jsx)(be,{children:v?v.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&(0,J.jsx)(D,{onClick:G=>{G.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(Xh,{children:[(0,J.jsx)($t,{children:(0,J.jsxs)("div",{children:[(0,J.jsx)(Rt,{success:T,fail:!!v}),(0,J.jsx)(so,{style:{width:"38px",height:"38px"}})]})}),(0,J.jsxs)(rt,{children:[(0,J.jsx)(Le,{children:v?v.message:"Signing in with Farcaster"}),(0,J.jsx)(be,{children:v?v.detail:"This should only take a moment"}),(0,J.jsx)(Ft,{children:M&&xa.isMobile&&(0,J.jsx)(Rl,{text:"Take me to Warpcast",url:M,color:Qh})})]})]})}),(0,J.jsx)(ee,{})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(k,{backFn:n?i:void 0,onClose:g},"header"),(0,J.jsx)(te,{}),(0,J.jsx)(Xh,{children:(0,J.jsxs)("div",{children:[(0,J.jsx)(Le,{children:"Sign in with Farcaster"}),(0,J.jsx)(be,{children:"Scan with your phone's camera to continue."}),(0,J.jsx)(yi,{children:M?(0,J.jsx)(Wi,{url:M,size:275,squareLogoElement:so}):(0,J.jsx)(zt,{})}),(0,J.jsxs)(Ft,{children:[(0,J.jsx)(be,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&(0,J.jsx)(an,{text:M,itemName:"link",color:Qh})]})]})}),(0,J.jsx)(ee,{})]})},Xh=wd.default.div`
|
|
1438
1397
|
display: flex;
|
|
1439
1398
|
flex-direction: column;
|
|
1440
1399
|
align-items: center;
|
|
@@ -1442,14 +1401,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1442
1401
|
margin-left: 27px;
|
|
1443
1402
|
margin-right: 27px;
|
|
1444
1403
|
gap: 24px;
|
|
1445
|
-
|
|
1404
|
+
`,c0=wd.default.div`
|
|
1446
1405
|
display: flex;
|
|
1447
1406
|
flex-direction: column;
|
|
1448
1407
|
align-items: center;
|
|
1449
1408
|
justify-content: center;
|
|
1450
1409
|
gap: 24px;
|
|
1451
1410
|
width: 100%;
|
|
1452
|
-
`;var
|
|
1411
|
+
`;var sn=require("react"),_a=require("react-device-detect"),bd=y(require("styled-components"));var Q=require("react/jsx-runtime"),ry="#8a63d2",ny=1e3,d0=ny*2,p0=ny*300,iy=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=_(),{requestFarcasterSignerStatus:n,closePrivyModal:a}=W(),[i,l]=(0,sn.useState)(void 0),[s,c]=(0,sn.useState)(!1),[u,g]=(0,sn.useState)(!1),f=(0,sn.useRef)([]),v=o?.render.inDialog?Ke:0,b=r?.farcasterSigner;(0,sn.useEffect)(()=>{let x=Date.now(),T=setInterval(async()=>{if(!b?.public_key){clearInterval(T),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}b.status==="approved"&&(clearInterval(T),c(!1),g(!0),f.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v)));let S=await n(b?.public_key),L=Date.now()-x;S.status==="approved"?(clearInterval(T),c(!1),g(!0),f.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v))):L>p0?(clearInterval(T),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):S.status==="revoked"&&(clearInterval(T),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},d0);return()=>{clearInterval(T),f.current.forEach(S=>clearTimeout(S))}},[]);let w=b?.status==="pending_approval"?b.signer_approval_url:void 0;return _a.isMobile||s?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(k,{backFn:e?t:void 0,onClose:a},"header"),(0,Q.jsx)(te,{}),_a.isIOS?(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(u0,{children:[(0,Q.jsx)($t,{children:(0,Q.jsxs)("div",{children:[(0,Q.jsx)(Rt,{success:u,fail:!!i}),(0,Q.jsx)(so,{style:{width:"38px",height:"38px"}})]})}),(0,Q.jsxs)(rt,{children:[(0,Q.jsx)(Le,{children:i?i.message:"Add a signer to Farcaster"}),(0,Q.jsx)(be,{children:i?i.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),w&&(0,Q.jsx)(D,{onClick:x=>{x.preventDefault(),window.location.href=w},children:"Open Warpcast app"})]})}):(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(oy,{children:[(0,Q.jsx)($t,{children:(0,Q.jsxs)("div",{children:[(0,Q.jsx)(Rt,{success:u,fail:!!i}),(0,Q.jsx)(so,{style:{width:"38px",height:"38px"}})]})}),(0,Q.jsxs)(rt,{children:[(0,Q.jsx)(Le,{children:i?i.message:"Requesting signer from Farcaster"}),(0,Q.jsx)(be,{children:i?i.detail:"This should only take a moment"}),(0,Q.jsx)(Ft,{children:w&&_a.isMobile&&(0,Q.jsx)(Rl,{text:"Take me to Warpcast",url:w,color:ry})})]})]})}),(0,Q.jsx)(ee,{})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(k,{backFn:e?t:void 0,onClose:a},"header"),(0,Q.jsx)(te,{}),(0,Q.jsx)(oy,{children:(0,Q.jsxs)("div",{children:[(0,Q.jsx)(Le,{children:"Add a signer to Farcaster"}),(0,Q.jsxs)(be,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),(0,Q.jsx)(yi,{children:b?.status==="pending_approval"?(0,Q.jsx)(Wi,{url:b.signer_approval_url,size:275,squareLogoElement:so}):(0,Q.jsx)(zt,{})}),(0,Q.jsxs)(Ft,{children:[(0,Q.jsx)(be,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),b?.status==="pending_approval"&&(0,Q.jsx)(an,{text:b.signer_approval_url,itemName:"link",color:ry})]})]})}),(0,Q.jsx)(ee,{})]})},oy=bd.default.div`
|
|
1453
1412
|
display: flex;
|
|
1454
1413
|
flex-direction: column;
|
|
1455
1414
|
align-items: center;
|
|
@@ -1457,14 +1416,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1457
1416
|
margin-left: 27px;
|
|
1458
1417
|
margin-right: 27px;
|
|
1459
1418
|
gap: 24px;
|
|
1460
|
-
`,
|
|
1419
|
+
`,u0=bd.default.div`
|
|
1461
1420
|
display: flex;
|
|
1462
1421
|
flex-direction: column;
|
|
1463
1422
|
align-items: center;
|
|
1464
1423
|
justify-content: center;
|
|
1465
1424
|
gap: 24px;
|
|
1466
1425
|
width: 100%;
|
|
1467
|
-
`;var
|
|
1426
|
+
`;var ay=y(require("@heroicons/react/24/outline/ClockIcon")),sy=y(require("@heroicons/react/24/outline/EyeSlashIcon")),ly=y(require("@heroicons/react/24/outline/LinkIcon")),Gr=y(require("styled-components"));var Li=require("react/jsx-runtime"),Il=({size:e=61,...t})=>(0,Li.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,Li.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,Li.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,Li.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var Ie=require("react/jsx-runtime"),Ed=({title:e,desc:t,icon:r})=>(0,Ie.jsxs)(v0,{children:[(0,Ie.jsx)(w0,{children:r}),(0,Ie.jsxs)(C0,{children:[(0,Ie.jsx)(y0,{children:e}),(0,Ie.jsx)(g0,{children:t})]})]}),cy=({app:e,signedUrl:t,onContinue:r})=>(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsxs)(f0,{children:[(0,Ie.jsx)(Il,{size:"3.75rem"}),(0,Ie.jsxs)(h0,{children:[e?.name," uses ",(0,Ie.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,Ie.jsxs)(b0,{children:[(0,Ie.jsx)(Ed,{icon:(0,Ie.jsx)(ly.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,Ie.jsxs)(Ie.Fragment,{children:["Connect a payment method (",(0,Ie.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,Ie.jsx)(Ed,{icon:(0,Ie.jsx)(ay.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,Ie.jsx)(Ed,{icon:(0,Ie.jsx)(sy.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,Ie.jsx)(E0,{className:"mobile-only"})]}),(0,Ie.jsx)(m0,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,Ie.jsx)(dl,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),m0=Gr.default.span`
|
|
1468
1427
|
display: inline-block;
|
|
1469
1428
|
color: var(--privy-color-foreground-3);
|
|
1470
1429
|
text-align: center;
|
|
@@ -1473,13 +1432,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1473
1432
|
font-weight: 400;
|
|
1474
1433
|
line-height: 140%; /* 0.875rem */
|
|
1475
1434
|
margin-bottom: 0.25rem;
|
|
1476
|
-
`,
|
|
1435
|
+
`,f0=Gr.default.div`
|
|
1477
1436
|
display: flex;
|
|
1478
1437
|
flex-direction: column;
|
|
1479
1438
|
align-items: center;
|
|
1480
1439
|
justify-content: center;
|
|
1481
1440
|
padding: 1.5rem 0;
|
|
1482
|
-
`,
|
|
1441
|
+
`,h0=Gr.default.span`
|
|
1483
1442
|
color: var(--privy-color-foreground);
|
|
1484
1443
|
text-align: center;
|
|
1485
1444
|
font-size: 1.125rem;
|
|
@@ -1488,46 +1447,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1488
1447
|
margin: 1.5rem 0;
|
|
1489
1448
|
text-align: center;
|
|
1490
1449
|
max-width: 19.5rem;
|
|
1491
|
-
`,
|
|
1450
|
+
`,y0=Gr.default.span`
|
|
1492
1451
|
color: var(--privy-color-foreground);
|
|
1493
1452
|
font-size: 0.875rem;
|
|
1494
1453
|
font-weight: 500;
|
|
1495
1454
|
line-height: 1.225rem;
|
|
1496
1455
|
width: 100%;
|
|
1497
|
-
`,
|
|
1456
|
+
`,g0=Gr.default.span`
|
|
1498
1457
|
color: var(--privy-color-foreground-2);
|
|
1499
1458
|
font-size: 0.875rem;
|
|
1500
1459
|
font-weight: 400;
|
|
1501
1460
|
line-height: 1.225rem;
|
|
1502
|
-
`,
|
|
1461
|
+
`,v0=Gr.default.div`
|
|
1503
1462
|
display: flex;
|
|
1504
1463
|
align-items: flex-start;
|
|
1505
1464
|
gap: 0.5rem;
|
|
1506
1465
|
align-self: stretch;
|
|
1507
|
-
`,
|
|
1466
|
+
`,C0=Gr.default.div`
|
|
1508
1467
|
display: flex;
|
|
1509
1468
|
flex-direction: column;
|
|
1510
1469
|
gap: 0.25rem;
|
|
1511
1470
|
align-items: flex-start;
|
|
1512
1471
|
text-align: left;
|
|
1513
1472
|
flex: 1 0 0;
|
|
1514
|
-
`,
|
|
1473
|
+
`,w0=Gr.default.div`
|
|
1515
1474
|
padding-top: 2px;
|
|
1516
|
-
`,
|
|
1475
|
+
`,b0=Gr.default.div`
|
|
1517
1476
|
display: flex;
|
|
1518
1477
|
flex-direction: column;
|
|
1519
1478
|
gap: 1.25rem;
|
|
1520
1479
|
margin: 0 0.5rem;
|
|
1521
|
-
`,
|
|
1480
|
+
`,E0=Gr.default.div`
|
|
1522
1481
|
margin: 30px 0;
|
|
1523
|
-
`;var
|
|
1482
|
+
`;var py=require("ofetch"),Oi=require("react");var Ml="moonpay",dy="sdk_fiat_on_ramp_completed_with_status";async function uy(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 T0(e,t){let r=t?lu:su,o=t?du:cu;return(0,py.ofetch)(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function my(e,t=!1){let[r,o]=(0,Oi.useState)(null),{createAnalyticsEvent:n}=W(),a=(0,Oi.useRef)(0);return(0,Oi.useEffect)(()=>{let i=setInterval(async()=>{if(e)try{let[l]=await T0(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;o(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n({eventName:dy,payload:{status:s,provider:Ml,paymentMethod:l.paymentMethod,cardPaymentType:l.cardPaymentType,currency:l.currency?.code,baseCurrencyAmount:l.baseCurrencyAmount,quoteCurrencyAmount:l.quoteCurrencyAmount,feeAmount:l.feeAmount,extraFeeAmount:l.extraFeeAmount,networkFeeAmount:l.networkFeeAmount}}),clearInterval(i))}catch(l){l.response?.status!==404&&(a.current+=1),a.current>=3&&(o("serviceFailure"),n({eventName:dy,payload:{status:"serviceFailure",provider:Ml}}),clearInterval(i))}},3e3);return()=>clearInterval(i)},[e,a]),r}var ln=require("react/jsx-runtime"),fy=()=>{let{app:e,data:t,navigate:r}=_(),{createAnalyticsEvent:o}=W(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,ln.jsxs)(ln.Fragment,{children:[(0,ln.jsx)(k,{title:"Fund account"},"header"),(0,ln.jsx)(cy,{app:e,signedUrl:n,onContinue:()=>{o({eventName:"sdk_fiat_on_ramp_started",payload:{provider:Ml}}),r("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,ln.jsx)(q,{protectedByPrivy:!0})]})};var hy=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),yy=y(require("@heroicons/react/24/solid/CheckCircleIcon")),gy=y(require("@heroicons/react/24/solid/XCircleIcon")),vy=require("react"),Td=y(require("styled-components"));var xe=require("react/jsx-runtime"),Cy=()=>{let{app:e,data:t}=_(),{closePrivyModal:r}=W(),{externalTransactionId:o}=t?.fiatOnRampStatus,n=my(o||null,e.fiatOnRamp.useSandbox);return(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(k,{title:"Fund account"},"header"),(0,xe.jsx)(S0,{status:n,onClickCta:r}),(0,xe.jsx)(q,{protectedByPrivy:!0})]})},P0=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"failed":return{title:"Something went wrong!",body:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,xe.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,xe.jsx)("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},S0=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,vy.useMemo)(()=>P0(e),[e]);return(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsxs)(R0,{children:[(0,xe.jsx)(k0,{status:e}),(0,xe.jsxs)(rt,{children:[(0,xe.jsx)("h3",{children:r}),(0,xe.jsx)(A0,{children:o})]})]}),n&&(0,xe.jsx)(D,{onClick:t,children:n})]})},x0=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)",_0=e=>{switch(e){case"serviceFailure":case"failed":return gy.default;case"completed":return yy.default;case"waitingAuthorization":return()=>(0,xe.jsx)(hy.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},k0=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return(0,xe.jsxs)("div",{style:{position:"relative"},children:[(0,xe.jsx)(zt,{color:o,style:{position:"absolute"}}),(0,xe.jsx)(Kc,{color:o}),(0,xe.jsx)(Il,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=_0(e),r=x0(e);return(0,xe.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,xe.jsx)(t,{width:"4rem",height:"4rem",color:r})})},A0=Td.default.p`
|
|
1524
1483
|
font-size: 1rem;
|
|
1525
1484
|
color: var(--privy-color-foreground-3);
|
|
1526
1485
|
margin-bottom: 1rem;
|
|
1527
1486
|
display: flex;
|
|
1528
1487
|
flex-direction: column;
|
|
1529
1488
|
gap: 1rem;
|
|
1530
|
-
`,
|
|
1489
|
+
`,R0=Td.default.div`
|
|
1531
1490
|
display: flex;
|
|
1532
1491
|
flex-direction: column;
|
|
1533
1492
|
align-items: center;
|
|
@@ -1535,7 +1494,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1535
1494
|
margin-left: 1.75rem;
|
|
1536
1495
|
margin-right: 1.75rem;
|
|
1537
1496
|
padding: 2rem 0;
|
|
1538
|
-
`;var
|
|
1497
|
+
`;var wy=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),by=y(require("styled-components"));var or=require("react/jsx-runtime"),Ey=()=>{let{closePrivyModal:e}=W();return(0,or.jsxs)(or.Fragment,{children:[(0,or.jsx)(k,{},"header"),(0,or.jsx)(I0,{children:(0,or.jsx)(wy.default,{style:{width:32,height:32}})}),(0,or.jsx)(no,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,or.jsx)(Pr,{children:(0,or.jsx)(D,{onClick:()=>e(),children:"Close"})}),(0,or.jsx)(ne,{}),(0,or.jsx)(q,{protectedByPrivy:!0})]})},I0=by.default.div`
|
|
1539
1498
|
border-radius: 50%;
|
|
1540
1499
|
height: 68px;
|
|
1541
1500
|
width: 68px;
|
|
@@ -1545,18 +1504,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1545
1504
|
background-color: var(--privy-color-accent);
|
|
1546
1505
|
color: white;
|
|
1547
1506
|
margin: 0 auto 24px auto;
|
|
1548
|
-
`;var
|
|
1507
|
+
`;var Sy=y(require("react-device-detect")),xy=y(require("styled-components"));var Wl=y(require("styled-components"));var Pd=require("react/jsx-runtime"),Ty=({style:e,...t})=>(0,Pd.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,Pd.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var Ol=require("react/jsx-runtime"),Py=Wl.default.div`
|
|
1549
1508
|
display: flex;
|
|
1550
1509
|
flex-direction: column;
|
|
1551
1510
|
justify-content: flex-start;
|
|
1552
1511
|
gap: 4px;
|
|
1553
|
-
`,
|
|
1512
|
+
`,Sd=Wl.default.div`
|
|
1554
1513
|
&&& {
|
|
1555
1514
|
margin-left: 7px; /* TODO: This is a total hack */
|
|
1556
1515
|
border-left: 2px solid var(--privy-color-foreground-4);
|
|
1557
1516
|
height: 12px;
|
|
1558
1517
|
}
|
|
1559
|
-
`,
|
|
1518
|
+
`,Ll=({children:e})=>(0,Ol.jsxs)(M0,{children:[(0,Ol.jsx)(Ty,{style:{width:"16px",height:"16px"}}),e]}),M0=Wl.default.div`
|
|
1560
1519
|
display: flex;
|
|
1561
1520
|
justify-content: flex-start;
|
|
1562
1521
|
justify-items: center;
|
|
@@ -1574,15 +1533,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1574
1533
|
margin-bottom: auto;
|
|
1575
1534
|
}
|
|
1576
1535
|
}
|
|
1577
|
-
`;var
|
|
1536
|
+
`;var De=require("react/jsx-runtime"),W0=()=>(0,De.jsxs)(L0,{children:[(0,De.jsx)(ya,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,De.jsx)(Ft,{children:(0,De.jsx)(eo,{style:{width:"152px",height:"152px"}})}),(0,De.jsxs)(Py,{children:[(0,De.jsx)(Ll,{children:(0,De.jsxs)("div",{children:[(0,De.jsx)("span",{children:"Install the "}),(0,De.jsx)("a",{href:Sy.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),(0,De.jsx)(Sd,{}),(0,De.jsx)(Ll,{children:"Set up your first wallet"}),(0,De.jsx)(Sd,{}),(0,De.jsx)(Ll,{children:"Store your recovery phrase in a safe place!"})]}),(0,De.jsx)(ui,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),_y=()=>{let{navigateBack:e}=_();return(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)(k,{backFn:e},"header"),(0,De.jsx)(te,{}),(0,De.jsx)(W0,{}),(0,De.jsx)(ne,{}),(0,De.jsxs)(ee,{children:[(0,De.jsx)("span",{children:"Still not sure? "}),(0,De.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},L0=(0,xy.default)(Ft)`
|
|
1578
1537
|
gap: 30px;
|
|
1579
1538
|
|
|
1580
1539
|
> :first-child > svg {
|
|
1581
1540
|
margin-top: 20px;
|
|
1582
1541
|
}
|
|
1583
|
-
`;var
|
|
1542
|
+
`;var Gy=y(require("@heroicons/react/24/outline/UserCircleIcon")),Ia=require("react"),Vy=require("react-device-detect"),zy=y(require("styled-components"));var Ay=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Ry=require("react");var ky=y(require("@heroicons/react/24/outline/EnvelopeIcon")),ka=require("react"),xd=y(require("styled-components"));var Vr=require("react/jsx-runtime"),Nl=(0,ka.forwardRef)((e,t)=>{let[r,o]=(0,ka.useState)(""),[n,a]=(0,ka.useState)(!1),{authenticated:i}=H(),{initLoginWithEmail:l}=W(),{navigate:s,setModalData:c,currentScreen:u}=_(),{enabled:g,token:f}=Se(),v=cs(r),b=n,w=n||!v,x=S=>{a(!0),l(r,S).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(L=>{c({errorModalData:{error:L,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{a(!1)})},T=()=>{g&&!f&&!i?(c({captchaModalData:{callback:S=>l(r,S),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):x(f)};return(0,Vr.jsxs)(Vr.Fragment,{children:[(0,Vr.jsx)(O0,{children:(0,Vr.jsxs)(N0,{stacked:e.stacked,children:[(0,Vr.jsx)(ky.default,{}),(0,Vr.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:S=>o(S.target.value),onKeyUp:S=>{S.key==="Enter"&&T()},value:r,autoComplete:"email"}),e.stacked?null:(0,Vr.jsx)(mi,{isSubmitting:b,onClick:T,disabled:w,children:"Submit"})]})}),e.stacked?(0,Vr.jsx)(D,{loadingText:null,loading:b,disabled:w,onClick:T,children:"Submit"}):null]})}),O0=xd.default.div`
|
|
1584
1543
|
width: 100%;
|
|
1585
|
-
`,
|
|
1544
|
+
`,N0=xd.default.label`
|
|
1586
1545
|
display: block;
|
|
1587
1546
|
position: relative;
|
|
1588
1547
|
width: 100%;
|
|
@@ -1643,7 +1602,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1643
1602
|
&& > input::placeholder {
|
|
1644
1603
|
color: var(--privy-color-foreground-3);
|
|
1645
1604
|
}
|
|
1646
|
-
`;var
|
|
1605
|
+
`;var lo=require("react/jsx-runtime"),Dl=({isEditable:e,setIsEditable:t})=>{let r=(0,Ry.useRef)(null);return(0,lo.jsxs)(lo.Fragment,{children:[(0,lo.jsx)(So,{if:!e,children:(0,lo.jsx)(Nl,{ref:r})}),(0,lo.jsx)(So,{if:e,children:(0,lo.jsxs)(ze,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,lo.jsx)(Ay.default,{})," Continue with Email"]})})]})};var Iy=require("react");var Ni=require("react/jsx-runtime"),Fl=()=>{let[e,t]=(0,Iy.useState)(!1),{currentScreen:r,navigate:o,setModalData:n}=_(),{enabled:a,token:i}=Se(),{initLoginWithFarcaster:l}=W();return(0,Ni.jsxs)(ze,{onClick:async()=>{t(!0);try{a&&!i?(n({captchaModalData:{callback:c=>l(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(i),o("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,Ni.jsx)(so,{})," Farcaster",e&&(0,Ni.jsx)("span",{children:(0,Ni.jsx)(To,{})})]})};var Ul=y(require("styled-components"));var My=require("react/jsx-runtime"),Bl=()=>{let{enabled:e,token:t}=Se(),{navigate:r,setModalData:o}=_(),{initLoginWithPasskey:n}=W();return(0,My.jsx)(F0,{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"})},D0=Ul.css`
|
|
1647
1606
|
&& {
|
|
1648
1607
|
width: 100%;
|
|
1649
1608
|
font-size: 0.875rem;
|
|
@@ -1668,11 +1627,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1668
1627
|
box-shadow: none;
|
|
1669
1628
|
}
|
|
1670
1629
|
}
|
|
1671
|
-
`,
|
|
1672
|
-
${
|
|
1673
|
-
`;var
|
|
1630
|
+
`,F0=Ul.default.button`
|
|
1631
|
+
${D0}
|
|
1632
|
+
`;var Fy=y(require("@heroicons/react/24/outline/PhoneIcon")),Uy=require("react");var Di=require("react"),_d=y(require("styled-components"));var Wy=y(require("libphonenumber-js/examples.mobile.json")),nr=require("libphonenumber-js/min"),Gl=require("react/jsx-runtime");var Aa=(e,t)=>(0,nr.isPossiblePhoneNumber)(String(e),t),Hl=(e,t)=>`+${(0,nr.getCountryCallingCode)(t)} ${e}`,Ly=e=>`*${e.replaceAll("-","").slice(-4)}`,Oy=e=>new nr.AsYouType(e),U0=(0,nr.getCountries)().map(e=>({code:e,callCode:(0,nr.getCountryCallingCode)(e)})),Ny=e=>{let t=(0,nr.getExampleNumber)(e,Wy.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},Dy=({value:e,onChange:t})=>(0,Gl.jsx)("select",{value:e,onChange:t,children:U0.map(r=>(0,Gl.jsxs)("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});var zr=require("react/jsx-runtime"),Fi=(0,Di.forwardRef)((e,t)=>{let{app:r}=_(),[o,n]=(0,Di.useState)(""),[a,i]=(0,Di.useState)(r?.intl.defaultCountry??"US"),l=Aa(o,a),s=Oy(a),c=Ny(a),u=(0,nr.getCountryCallingCode)(a),g=!l,[f,v]=(0,Di.useState)(!1),b=u.length,w=S=>{let L=S.target.value;i(L),n(""),e.onChange&&e.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:Hl(o,L),countryCode:L,isValid:Aa(o,a)})},x=S=>{try{let L=S.replace(/\D/g,""),I=o.replace(/\D/g,""),U=L===I?S:s.input(S);n(U),e.onChange&&e.onChange({rawPhoneNumber:U,qualifiedPhoneNumber:Hl(S,a),countryCode:a,isValid:Aa(S,a)})}catch(L){console.error("Error processing phone number:",L)}},T=()=>{v(!0);let S=Hl(o,a);e.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:S,countryCode:a,isValid:Aa(o,a)}).finally(()=>v(!1))};return(0,zr.jsxs)(zr.Fragment,{children:[(0,zr.jsx)(B0,{children:(0,zr.jsxs)(H0,{callingCodeLength:b,stacked:e.stacked,children:[(0,zr.jsx)(Dy,{value:a,onChange:w}),(0,zr.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:S=>{x(S.target.value)},onKeyUp:S=>{S.key==="Enter"&&T()},value:o,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,zr.jsx)(mi,{isSubmitting:f,onClick:T,disabled:g,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,zr.jsx)(D,{loading:f,loadingText:null,onClick:T,disabled:g,children:"Submit"}):null]})}),B0=_d.default.div`
|
|
1674
1633
|
width: 100%;
|
|
1675
|
-
`,
|
|
1634
|
+
`,H0=_d.default.label`
|
|
1676
1635
|
--country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
|
|
1677
1636
|
--phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
|
|
1678
1637
|
display: block;
|
|
@@ -1759,11 +1718,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1759
1718
|
&& > input::placeholder {
|
|
1760
1719
|
color: var(--privy-color-foreground-3);
|
|
1761
1720
|
}
|
|
1762
|
-
`;var
|
|
1721
|
+
`;var co=require("react/jsx-runtime"),Vl=({isEditable:e,setIsEditable:t})=>{let r=(0,Uy.useRef)(null),{authenticated:o}=H(),{navigate:n,setModalData:a,currentScreen:i}=_(),{initLoginWithSms:l}=W(),{enabled:s,token:c}=Se();async function u({qualifiedPhoneNumber:g}){if(s&&!c&&!o)a({captchaModalData:{callback:f=>l(g,f),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(g,c),n("AWAITING_PASSWORDLESS_CODE")}catch(f){a({errorModalData:{error:f,previousScreen:i||"LANDING"}}),n("ERROR_SCREEN")}}return(0,co.jsxs)(co.Fragment,{children:[(0,co.jsx)(So,{if:!e,children:(0,co.jsx)(Fi,{ref:r,onSubmit:u})}),(0,co.jsx)(So,{if:e,children:(0,co.jsxs)(ze,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,co.jsx)(Fy.default,{})," Continue with SMS"]})})]})};var By=require("react");var qr=require("react/jsx-runtime"),G0={apple:{logo:(0,qr.jsx)(ws,{}),displayName:"Apple"},discord:{logo:(0,qr.jsx)(bs,{}),displayName:"Discord"},github:{logo:(0,qr.jsx)(Es,{}),displayName:"GitHub"},google:{logo:(0,qr.jsx)(Ts,{}),displayName:"Google"},linkedin:{logo:(0,qr.jsx)(Ps,{}),displayName:"LinkedIn"},spotify:{logo:(0,qr.jsx)(Ss,{}),displayName:"Spotify"},twitter:{logo:(0,qr.jsx)(_s,{}),displayName:"Twitter"},tiktok:{logo:(0,qr.jsx)(xs,{}),displayName:"TikTok"}},bt=({provider:e})=>{let{enabled:t,token:r}=Se(),{navigate:o,setModalData:n}=_(),[a,i]=(0,By.useState)(!1),{initLoginWithOAuth:l}=W(),{displayName:s,logo:c}=G0[e];return(0,qr.jsxs)(ze,{onClick:()=>{i(!0),t&&!r?(n({captchaModalData:{callback:g=>l(e,g),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:a,children:[c," ",s]})};var Hy=y(require("@heroicons/react/24/outline/ChevronRightIcon"));var Ra=require("react/jsx-runtime"),zl=({onClick:e,text:t,icon:r})=>(0,Ra.jsxs)(ze,{onClick:e,children:[r,(0,Ra.jsx)(pl,{children:t}),(0,Ra.jsx)(Hy.default,{})]});var _e=require("react/jsx-runtime"),$l=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=_(),a=o.loginMethodsAndOrder?.primary??[],i=o.loginMethodsAndOrder?.overflow??[],l=[...a,...i],s=o.loginMethods.passkey,[c,u]=(0,Ia.useState)("default"),[g,f]=(0,Ia.useState)("email");(0,Ia.useEffect)(()=>{let M=l.indexOf("sms"),G=l.indexOf("email");M>-1&&M<G&&f("sms")},[a,i]);let v=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{u("default")},150)};n.current=v;let b=M=>M==="email"?(0,_e.jsx)(Dl,{isEditable:g==="email",setIsEditable:()=>{f("email")}},M):M==="sms"?(0,_e.jsx)(Vl,{isEditable:g==="sms",setIsEditable:()=>{f("sms")}},M):M==="apple"?(0,_e.jsx)(bt,{provider:"apple"},M):M==="discord"?(0,_e.jsx)(bt,{provider:"discord"},M):M==="farcaster"?(0,_e.jsx)(Fl,{},M):M==="github"?(0,_e.jsx)(bt,{provider:"github"},M):M==="google"?(0,_e.jsx)(bt,{provider:"google"},M):M==="linkedin"?(0,_e.jsx)(bt,{provider:"linkedin"},M):M==="tiktok"?(0,_e.jsx)(bt,{provider:"tiktok"},M):M==="twitter"&&(!Vy.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)?(0,_e.jsx)(bt,{provider:"twitter"},M):ga([M],r,e,l),w=a.map(b).flat(),x=i.map(b).flat(),T=[...w,...x],S=V0({primary:w.length,overflow:x.length}),[L,I]=mu(T,S);return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(k,{title:"Log in or sign up",onClose:v,backFn:c==="default"?void 0:()=>{u("default")}}),c==="default"&&(0,_e.jsx)(z0,{}),(0,_e.jsx)(ul,{style:{overflow:"hidden",padding:2},children:(0,_e.jsxs)(Tr,{children:[c==="default"&&(0,_e.jsxs)(_e.Fragment,{children:[...L,I.length>0&&(0,_e.jsx)(zl,{text:"More options",icon:(0,_e.jsx)(Gy.default,{}),onClick:()=>u("overflow")})]}),c==="overflow"&&(0,_e.jsxs)(_e.Fragment,{children:[...I]}),s&&c==="default"&&(0,_e.jsx)(Bl,{})]})}),o&&(0,_e.jsx)(fi,{app:o}),(0,_e.jsx)(q,{protectedByPrivy:!0})]})},ql=5,V0=({primary:e,overflow:t})=>e<ql?e:e===ql&&t===0?ql:ql-1,z0=(0,zy.default)(Ci)`
|
|
1763
1722
|
margin-bottom: 16px;
|
|
1764
|
-
`;var
|
|
1723
|
+
`;var Yy=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Zy=y(require("@heroicons/react/24/outline/PhoneIcon")),Jy=y(require("@heroicons/react/24/outline/UserCircleIcon")),Ma=require("react"),Qy=require("react-device-detect"),Xy=y(require("styled-components"));var Mo=require("react/jsx-runtime"),qy=({...e})=>(0,Mo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,Mo.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,Mo.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Mo.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,Mo.jsx)("defs",{children:(0,Mo.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,Mo.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var $y=y(require("@heroicons/react/24/outline/ChevronRightIcon")),jy=y(require("@heroicons/react/24/outline/WalletIcon"));var Ui=require("react/jsx-runtime"),Ky=({onClick:e,text:t})=>(0,Ui.jsxs)(ze,{onClick:e,children:[(0,Ui.jsx)(jy.default,{}),(0,Ui.jsx)(pl,{children:t}),(0,Ui.jsx)($y.default,{})]});var ie=require("react/jsx-runtime"),jl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=_(),{email:a,sms:i,google:l,twitter:s,discord:c,github:u,spotify:g,tiktok:f,linkedin:v,apple:b,wallet:w,farcaster:x,passkey:T}=o?.loginMethods??{},S=o?.appearance.loginGroupPriority||"web2-first",L=o?.appearance.hideDirectWeb2Inputs,[I,U]=(0,Ma.useState)("default"),[M,G]=(0,Ma.useState)(a?"email":"sms");(0,Ma.useEffect)(()=>{G(a?"email":"sms")},[a]);let Y=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{U("default")},150)};n.current=Y;let z=[a&&(0,ie.jsx)(Dl,{isEditable:M==="email",setIsEditable:()=>{G("email")}}),i&&(0,ie.jsx)(Vl,{isEditable:M==="sms",setIsEditable:()=>{G("sms")}})].filter(Boolean),j=[l&&(0,ie.jsx)(bt,{provider:"google"}),s&&(!Qy.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,ie.jsx)(bt,{provider:"twitter"}),c&&(0,ie.jsx)(bt,{provider:"discord"}),u&&(0,ie.jsx)(bt,{provider:"github"}),g&&(0,ie.jsx)(bt,{provider:"spotify"}),f&&(0,ie.jsx)(bt,{provider:"tiktok"}),v&&(0,ie.jsx)(bt,{provider:"linkedin"}),b&&(0,ie.jsx)(bt,{provider:"apple"}),x&&(0,ie.jsx)(Fl,{})].filter(Boolean),R=ga(o.appearance.walletList,r,e,o.appearance.walletList),fe=I==="default"?void 0:()=>{U("default")},B=$0({priority:S,email:a,sms:i,social:j}),he=j0({priority:S,email:a,sms:i,social:j}),ye=K0({priority:S,email:a,sms:i,social:j}),se=(0,ie.jsx)(Ky,{text:ye,onClick:()=>U("web3-overflow")}),Xe=(0,ie.jsx)(zl,{text:B,icon:he,onClick:()=>U("web2-overflow")}),le=L?0:1;return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(k,{title:"Log in or sign up",onClose:Y,backFn:fe}),I==="default"&&(0,ie.jsx)(q0,{}),(0,ie.jsx)(ul,{style:{overflow:"hidden",padding:2},children:(0,ie.jsxs)(Tr,{children:[I==="default"&&S==="web2-first"&&(0,ie.jsxs)(ie.Fragment,{children:[...z,...j.length+z.length>4?j.slice(0,3-z.length):j,z.length+j.length>4&&Xe,w&&se]}),I==="default"&&S==="web3-first"&&(0,ie.jsxs)(ie.Fragment,{children:[w&&(0,ie.jsxs)(ie.Fragment,{children:[...R.length>4?R.slice(0,3):R,R.length>4&&se]}),z.length+j.length>le&&Xe,z.length+j.length===le&&z.length?z[0]:null,z.length+j.length===le&&j.length?j[0]:null]}),I==="web2-overflow"&&(0,ie.jsxs)(ie.Fragment,{children:[...S==="web3-first"?z:[],...j]}),...I==="web3-overflow"?R:[],T&&I==="default"&&(0,ie.jsx)(Bl,{})]})}),o&&(0,ie.jsx)(fi,{app:o}),(0,ie.jsx)(q,{protectedByPrivy:!0})]})},q0=(0,Xy.default)(Ci)`
|
|
1765
1724
|
margin-bottom: 16px;
|
|
1766
|
-
`,Av=({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",Rv=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,ae.jsx)(Ny.default,{}):t&&r?(0,ae.jsx)(Ry,{}):t?(0,ae.jsx)(Ly.default,{}):r?(0,ae.jsx)(Oy.default,{}):null,Iv=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var vd=require("react/jsx-runtime"),Uy=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,vd.jsx)(Dl,{connectOnly:!0}):(0,vd.jsx)(Fl,{connectOnly:!0})};var Cd=require("react/jsx-runtime"),By=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Cd.jsx)(Dl,{connectOnly:!1}):(0,Cd.jsx)(Fl,{connectOnly:!1})};var Hy=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var ir=require("react/jsx-runtime"),Gy=()=>{let{app:e}=A();return(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)(x,{},"header"),(0,ir.jsx)(oe,{}),(0,ir.jsx)(He,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,ir.jsx)(Hy.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,ir.jsx)(br,{children:(0,ir.jsx)(kl,{stacked:!0})}),(0,ir.jsx)(le,{}),(0,ir.jsx)(j,{protectedByPrivy:!0})]})};var $y=y(require("@heroicons/react/24/outline/ClockIcon")),jy=y(require("@heroicons/react/24/outline/TrashIcon")),Ky=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),Yy=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Zy=y(require("@heroicons/react/24/solid/LockClosedIcon")),an=require("react"),At=y(require("styled-components"));var wd=require("react/jsx-runtime"),Vy=({style:e,...t})=>(0,wd.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,wd.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var Ee=require("react/jsx-runtime"),Ul=({style:e,...t})=>(0,Ee.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Ee.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,Ee.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,Ee.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,Ee.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,Ee.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,Ee.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,Ee.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,Ee.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,Ee.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,Ee.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,Ee.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,Ee.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,Ee.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,Ee.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,Ee.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,Ee.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,Ee.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,Ee.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,Ee.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,Ee.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,Ee.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,Ee.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,Ee.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,Ee.jsx)("defs",{children:(0,Ee.jsx)("clipPath",{id:"clip0_113_33841",children:(0,Ee.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var z=require("react/jsx-runtime"),zy=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,a]=(0,an.useState)([]),i=t?e.length:2,l=c=>c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device",s=c=>{a(u=>u.concat([c])),r(c)};return(0,z.jsxs)("div",{children:[(0,z.jsx)(Uv,{children:"Your passkeys"}),(0,z.jsxs)(Qy,{children:[e.slice(0,i).map(c=>(0,z.jsxs)(Gv,{children:[(0,z.jsxs)("div",{children:[(0,z.jsx)(Bv,{children:l(c)}),(0,z.jsxs)(Hv,{children:["Last used: ",c.verifiedAt.toLocaleString()]})]}),(0,z.jsx)(zv,{onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?(0,z.jsx)(To,{}):(0,z.jsx)(jy.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,z.jsx)(Nv,{onClick:o,children:"View all"})]})]})},Mv=()=>(0,z.jsxs)(Qy,{children:[(0,z.jsxs)(bn,{children:[(0,z.jsx)(wn,{children:(0,z.jsx)(Ky.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,z.jsxs)(bn,{children:[(0,z.jsx)(wn,{children:(0,z.jsx)(Zy.default,{})}),"More secure than a password."]}),(0,z.jsxs)(bn,{children:[(0,z.jsx)(wn,{children:(0,z.jsx)($y.default,{})}),"Takes seconds to set up and use."]})]}),Jy=()=>{let{user:e,unlinkPasskey:t}=V(),{linkWithPasskey:r,closePrivyModal:o}=W(),n=e?.linkedAccounts.filter(E=>E.type==="passkey"),[a,i]=(0,an.useState)(!1),[l,s]=(0,an.useState)(""),[c,u]=(0,an.useState)(!1),[g,f]=(0,an.useState)(!1);(0,an.useEffect)(()=>{n.length===0&&f(!1)},[n.length]);let C=()=>{i(!0),r().then(()=>u(!0)).catch(E=>{if(E instanceof Ze){if(E.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(E.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{i(!1)})};return c?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x,{onClose:()=>o()},"header"),(0,z.jsx)(Xe,{children:(0,z.jsx)(yt,{status:"success",children:(0,z.jsx)(Yy.default,{})})}),(0,z.jsx)(qy,{children:"Passkey added"}),(0,z.jsx)(Dv,{children:"From now on, you can use your passkey to log in."}),(0,z.jsx)(Lr,{children:(0,z.jsx)(D,{onClick:()=>o(),children:"Done"})}),(0,z.jsx)(ee,{})]}):g?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x,{backFn:()=>f(!1),onClose:()=>o()},"header"),(0,z.jsx)(zy,{passkeys:n,expanded:g,onUnlink:t,onExpand:()=>f(!0)}),(0,z.jsx)(ee,{})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x,{onClose:()=>o()},"header"),(0,z.jsx)(Xe,{children:(0,z.jsxs)(Wv,{children:[(0,z.jsx)(Vy,{}),(0,z.jsx)(Ul,{})]})}),(0,z.jsx)(qy,{children:"Secure your account with a passkey"}),(0,z.jsx)(Fv,{}),n.length===0?(0,z.jsx)(Mv,{}):(0,z.jsx)(zy,{passkeys:n,expanded:g,onUnlink:t,onExpand:()=>f(!0)}),(0,z.jsxs)(Lr,{style:{marginTop:"12px"},children:[l&&(0,z.jsx)(Lv,{fail:!0,children:l}),(0,z.jsx)(D,{onClick:C,loading:a,children:"Add new passkey"})]}),(0,z.jsx)(ee,{})]})},Wv=At.default.div`
|
|
1725
|
+
`,$0=({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",j0=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,ie.jsx)(Jy.default,{}):t&&r?(0,ie.jsx)(qy,{}):t?(0,ie.jsx)(Yy.default,{}):r?(0,ie.jsx)(Zy.default,{}):null,K0=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var kd=require("react/jsx-runtime"),e1=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,kd.jsx)($l,{connectOnly:!0}):(0,kd.jsx)(jl,{connectOnly:!0})};var Ad=require("react/jsx-runtime"),t1=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Ad.jsx)($l,{connectOnly:!1}):(0,Ad.jsx)(jl,{connectOnly:!1})};var r1=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var ir=require("react/jsx-runtime"),o1=()=>{let{app:e}=_();return(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)(k,{},"header"),(0,ir.jsx)(te,{}),(0,ir.jsx)(Oe,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,ir.jsx)(r1.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,ir.jsx)(Pr,{children:(0,ir.jsx)(Nl,{stacked:!0})}),(0,ir.jsx)(ne,{}),(0,ir.jsx)(q,{protectedByPrivy:!0})]})};var s1=y(require("@heroicons/react/24/outline/ClockIcon")),l1=y(require("@heroicons/react/24/outline/TrashIcon")),c1=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),d1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),p1=y(require("@heroicons/react/24/solid/LockClosedIcon")),cn=require("react"),Wt=y(require("styled-components"));var Rd=require("react/jsx-runtime"),n1=({style:e,...t})=>(0,Rd.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,Rd.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var Ee=require("react/jsx-runtime"),Kl=({style:e,...t})=>(0,Ee.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Ee.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,Ee.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,Ee.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,Ee.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,Ee.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,Ee.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,Ee.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,Ee.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,Ee.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,Ee.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,Ee.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,Ee.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,Ee.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,Ee.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,Ee.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,Ee.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,Ee.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,Ee.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,Ee.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,Ee.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,Ee.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,Ee.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,Ee.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,Ee.jsx)("defs",{children:(0,Ee.jsx)("clipPath",{id:"clip0_113_33841",children:(0,Ee.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var $=require("react/jsx-runtime"),i1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,a]=(0,cn.useState)([]),i=t?e.length:2,l=c=>c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device",s=c=>{a(u=>u.concat([c])),r(c)};return(0,$.jsxs)("div",{children:[(0,$.jsx)(rC,{children:"Your passkeys"}),(0,$.jsxs)(m1,{children:[e.slice(0,i).map(c=>(0,$.jsxs)(iC,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)(oC,{children:l(c)}),(0,$.jsxs)(nC,{children:["Last used: ",c.verifiedAt.toLocaleString()]})]}),(0,$.jsx)(sC,{onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?(0,$.jsx)(To,{}):(0,$.jsx)(l1.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,$.jsx)(X0,{onClick:o,children:"View all"})]})]})},Y0=()=>(0,$.jsxs)(m1,{children:[(0,$.jsxs)(_n,{children:[(0,$.jsx)(xn,{children:(0,$.jsx)(c1.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,$.jsxs)(_n,{children:[(0,$.jsx)(xn,{children:(0,$.jsx)(p1.default,{})}),"More secure than a password."]}),(0,$.jsxs)(_n,{children:[(0,$.jsx)(xn,{children:(0,$.jsx)(s1.default,{})}),"Takes seconds to set up and use."]})]}),u1=()=>{let{user:e,unlinkPasskey:t}=H(),{linkWithPasskey:r,closePrivyModal:o}=W(),n=e?.linkedAccounts.filter(b=>b.type==="passkey"),[a,i]=(0,cn.useState)(!1),[l,s]=(0,cn.useState)(""),[c,u]=(0,cn.useState)(!1),[g,f]=(0,cn.useState)(!1);(0,cn.useEffect)(()=>{n.length===0&&f(!1)},[n.length]);let v=()=>{i(!0),r().then(()=>u(!0)).catch(b=>{if(b instanceof et){if(b.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(b.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{i(!1)})};return c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(k,{onClose:()=>o()},"header"),(0,$.jsx)(ot,{children:(0,$.jsx)(Ct,{status:"success",children:(0,$.jsx)(d1.default,{})})}),(0,$.jsx)(a1,{children:"Passkey added"}),(0,$.jsx)(eC,{children:"From now on, you can use your passkey to log in."}),(0,$.jsx)(Nr,{children:(0,$.jsx)(D,{onClick:()=>o(),children:"Done"})}),(0,$.jsx)(ee,{})]}):g?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(k,{backFn:()=>f(!1),onClose:()=>o()},"header"),(0,$.jsx)(i1,{passkeys:n,expanded:g,onUnlink:t,onExpand:()=>f(!0)}),(0,$.jsx)(ee,{})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(k,{onClose:()=>o()},"header"),(0,$.jsx)(ot,{children:(0,$.jsxs)(Z0,{children:[(0,$.jsx)(n1,{}),(0,$.jsx)(Kl,{})]})}),(0,$.jsx)(a1,{children:"Secure your account with a passkey"}),(0,$.jsx)(tC,{}),n.length===0?(0,$.jsx)(Y0,{}):(0,$.jsx)(i1,{passkeys:n,expanded:g,onUnlink:t,onExpand:()=>f(!0)}),(0,$.jsxs)(Nr,{style:{marginTop:"12px"},children:[l&&(0,$.jsx)(J0,{fail:!0,children:l}),(0,$.jsx)(D,{onClick:v,loading:a,children:"Add new passkey"})]}),(0,$.jsx)(ee,{})]})},Z0=Wt.default.div`
|
|
1767
1726
|
display: flex;
|
|
1768
1727
|
align-items: center;
|
|
1769
1728
|
justify-content: center;
|
|
@@ -1779,7 +1738,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1779
1738
|
stroke: var(--privy-color-accent) !important;
|
|
1780
1739
|
fill: var(--privy-color-accent) !important;
|
|
1781
1740
|
}
|
|
1782
|
-
`,
|
|
1741
|
+
`,J0=Wt.default.div`
|
|
1783
1742
|
line-height: 20px;
|
|
1784
1743
|
height: 20px;
|
|
1785
1744
|
font-size: 13px;
|
|
@@ -1787,7 +1746,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1787
1746
|
display: flex;
|
|
1788
1747
|
justify-content: flex-beginngin;
|
|
1789
1748
|
width: 100%;
|
|
1790
|
-
`,
|
|
1749
|
+
`,Q0=Wt.css`
|
|
1791
1750
|
&& {
|
|
1792
1751
|
width: 100%;
|
|
1793
1752
|
font-size: 0.875rem;
|
|
@@ -1812,9 +1771,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1812
1771
|
box-shadow: none;
|
|
1813
1772
|
}
|
|
1814
1773
|
}
|
|
1815
|
-
`,
|
|
1816
|
-
${
|
|
1817
|
-
`,
|
|
1774
|
+
`,X0=Wt.default.button`
|
|
1775
|
+
${Q0}
|
|
1776
|
+
`,m1=Wt.default.div`
|
|
1818
1777
|
display: flex;
|
|
1819
1778
|
flex-direction: column;
|
|
1820
1779
|
align-items: stretch;
|
|
@@ -1822,18 +1781,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1822
1781
|
padding: 0.5rem 0rem 0rem;
|
|
1823
1782
|
flex-grow: 1;
|
|
1824
1783
|
width: 100%;
|
|
1825
|
-
`,
|
|
1784
|
+
`,a1=Wt.default.div`
|
|
1826
1785
|
font-size: 18px;
|
|
1827
1786
|
line-height: 18px;
|
|
1828
1787
|
text-align: center;
|
|
1829
1788
|
font-weight: 600;
|
|
1830
|
-
`,
|
|
1789
|
+
`,eC=Wt.default.div`
|
|
1831
1790
|
font-size: 0.875rem;
|
|
1832
1791
|
text-align: center;
|
|
1833
1792
|
margin-top: 10px;
|
|
1834
|
-
`,
|
|
1793
|
+
`,tC=Wt.default.div`
|
|
1835
1794
|
height: 32px;
|
|
1836
|
-
`,
|
|
1795
|
+
`,rC=Wt.default.div`
|
|
1837
1796
|
line-height: 20px;
|
|
1838
1797
|
height: 20px;
|
|
1839
1798
|
font-size: 1em;
|
|
@@ -1841,18 +1800,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1841
1800
|
display: flex;
|
|
1842
1801
|
justify-content: flex-beginning;
|
|
1843
1802
|
width: 100%;
|
|
1844
|
-
`,
|
|
1803
|
+
`,oC=Wt.default.div`
|
|
1845
1804
|
font-size: 1em;
|
|
1846
1805
|
line-height: 1.3em;
|
|
1847
1806
|
font-weight: 500;
|
|
1848
1807
|
color: var(--privy-color-foreground-2);
|
|
1849
1808
|
padding: 0.2em 0;
|
|
1850
|
-
`,
|
|
1809
|
+
`,nC=Wt.default.div`
|
|
1851
1810
|
font-size: 0.875rem;
|
|
1852
1811
|
line-height: 1rem;
|
|
1853
1812
|
color: #64668b;
|
|
1854
1813
|
padding: 0.2em 0;
|
|
1855
|
-
`,
|
|
1814
|
+
`,iC=Wt.default.div`
|
|
1856
1815
|
display: flex;
|
|
1857
1816
|
align-items: center;
|
|
1858
1817
|
justify-content: space-between;
|
|
@@ -1865,7 +1824,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1865
1824
|
border: 1px solid #e2e3f0 !important;
|
|
1866
1825
|
width: 100%;
|
|
1867
1826
|
height: 5em;
|
|
1868
|
-
`,
|
|
1827
|
+
`,aC=Wt.css`
|
|
1869
1828
|
:focus,
|
|
1870
1829
|
:hover,
|
|
1871
1830
|
:active {
|
|
@@ -1882,9 +1841,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1882
1841
|
svg:hover {
|
|
1883
1842
|
color: var(--privy-color-foreground-3);
|
|
1884
1843
|
}
|
|
1885
|
-
`,
|
|
1886
|
-
${
|
|
1887
|
-
`;var
|
|
1844
|
+
`,sC=Wt.default.button`
|
|
1845
|
+
${aC}
|
|
1846
|
+
`;var f1=y(require("@heroicons/react/24/outline/PhoneIcon"));var ar=require("react/jsx-runtime"),h1=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=_(),{initLoginWithSms:a}=W();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(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(k,{},"header"),(0,ar.jsx)(te,{}),(0,ar.jsx)(Oe,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,ar.jsx)(f1.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,ar.jsx)(Pr,{children:(0,ar.jsx)(Fi,{stacked:!0,onSubmit:i})}),(0,ar.jsx)(ne,{}),(0,ar.jsx)(q,{protectedByPrivy:!0})]})};var po=require("react/jsx-runtime"),y1=()=>{let{linkingHint:e}=W(),{app:t}=_(),r=e?`Select the wallet with ${zo(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,po.jsxs)(po.Fragment,{children:[(0,po.jsx)(k,{},"header"),(0,po.jsx)(no,{title:`${e?"Reconnect":"Connect"} your wallet`,description:r}),(0,po.jsx)(Tr,{children:(0,po.jsx)(vi,{connectOnly:!1})}),(0,po.jsx)(q,{protectedByPrivy:!0})]})};var Wa=require("react/jsx-runtime"),g1=({style:e,...t})=>(0,Wa.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,Wa.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,Wa.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var Zt=require("react/jsx-runtime"),v1=()=>{let{closePrivyModal:e}=W(),{navigate:t}=_();return(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)(k,{},"header"),(0,Zt.jsx)(te,{}),(0,Zt.jsx)(g1,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Zt.jsx)(no,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Zt.jsxs)(Pr,{children:[(0,Zt.jsx)(D,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Zt.jsx)(Or,{onClick:()=>e(),children:"Cancel"})]}),(0,Zt.jsx)(ne,{}),(0,Zt.jsx)(q,{protectedByPrivy:!0})]})};var Wd=y(require("@heroicons/react/20/solid/CheckIcon")),R1=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),I1=y(require("@heroicons/react/24/outline/FingerPrintIcon")),M1=y(require("@heroicons/react/24/outline/PhoneIcon")),Ld=y(require("@heroicons/react/24/outline/TrashIcon")),W1=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),Od=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Nd=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),L1=y(require("@heroicons/react/24/solid/IdentificationIcon")),Ql=y(require("@heroicons/react/24/solid/PhoneIcon")),Jl=y(require("@heroicons/react/24/solid/ShieldCheckIcon")),sr=require("react");var Zl=require("react"),E1=require("react-device-detect"),Md=y(require("styled-components"));var Ln=require("@headlessui/react"),Yl=y(require("react")),On=y(require("styled-components")),Wo=require("react/jsx-runtime"),C1=({children:e,open:t,onClick:r,...o})=>(0,Wo.jsx)(Ln.Transition,{show:t,as:Yl.default.Fragment,children:(0,Wo.jsxs)(Ln.Dialog,{onClose:r,...o,as:cC,children:[(0,Wo.jsx)(Ln.Transition.Child,{as:Yl.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,Wo.jsx)(lC,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,Wo.jsx)(dC,{children:(0,Wo.jsx)(Ln.Transition.Child,{as:Yl.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,Wo.jsx)(Ln.Dialog.Panel,{as:pC,children:e})})})]})}),Bi=On.default.div`
|
|
1888
1847
|
display: flex;
|
|
1889
1848
|
flex-direction: column;
|
|
1890
1849
|
text-align: center;
|
|
@@ -1907,7 +1866,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1907
1866
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
1908
1867
|
border-radius: var(--privy-border-radius-lg);
|
|
1909
1868
|
}
|
|
1910
|
-
`,
|
|
1869
|
+
`,lC=On.default.div`
|
|
1911
1870
|
position: fixed;
|
|
1912
1871
|
inset: 0;
|
|
1913
1872
|
|
|
@@ -1920,10 +1879,10 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1920
1879
|
backdrop-filter: unset;
|
|
1921
1880
|
-webkit-backdrop-filter: unset;
|
|
1922
1881
|
}
|
|
1923
|
-
|
|
1882
|
+
`,cC=On.default.div`
|
|
1924
1883
|
position: relative;
|
|
1925
1884
|
z-index: 999999;
|
|
1926
|
-
`,
|
|
1885
|
+
`,dC=On.default.div`
|
|
1927
1886
|
position: fixed;
|
|
1928
1887
|
inset: 0;
|
|
1929
1888
|
display: flex;
|
|
@@ -1931,7 +1890,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1931
1890
|
justify-content: center;
|
|
1932
1891
|
width: 100vw;
|
|
1933
1892
|
min-height: 100vh;
|
|
1934
|
-
`,
|
|
1893
|
+
`,pC=On.default.div`
|
|
1935
1894
|
// reset some default dialog styles
|
|
1936
1895
|
padding: 0;
|
|
1937
1896
|
background: transparent;
|
|
@@ -1978,19 +1937,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1978
1937
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
1979
1938
|
border-radius: var(--privy-border-radius-lg);
|
|
1980
1939
|
}
|
|
1981
|
-
`,
|
|
1940
|
+
`,w1=On.default.div`
|
|
1982
1941
|
display: flex;
|
|
1983
1942
|
flex-direction: column;
|
|
1984
1943
|
align-items: center;
|
|
1985
1944
|
justify-content: center;
|
|
1986
1945
|
height: 100%;
|
|
1987
|
-
`;var
|
|
1946
|
+
`;var uo=require("react/jsx-runtime"),La=6,uC=new Array(La).fill("");function mC(e){return e.replace(/\s+/g,"")}function Id(e){return/^[0-9]{1}$/.test(e)}function b1(e){return e.length===La&&e.every(Id)}function fC(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var Hi=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,a]=(0,Zl.useState)(uC),[i,l]=(0,Zl.useState)(null),[s,c]=(0,Zl.useState)(null),u=async b=>{b.preventDefault();let w=mC(b.currentTarget.value);if(w==="")return;let x=fC(n,Id),T=w.split(""),S=!T.every(Id),L=T.length+x>La;if(S){l("Passcode can only be numbers"),c(1);return}if(L){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let I=Number(b.currentTarget.name?.charAt(4)),U=[...w||[""]].slice(0,La-I),M=[...n.slice(0,I),...U,...n.slice(I+U.length)];a(M);let G=U.length,Y=Math.min(Math.max(I+G,0),La-1);if(document.querySelector(`input[name=pin-${Y}]`)?.focus(),b1(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${Y}]`)?.blur()}catch(j){c(1),l(j.message)}else try{await e(null)}catch(j){c(1),l(j.message)}},g=b=>{s===1&&(l(null),c(null));let w=[...n.slice(0,b),"",...n.slice(b+1)];a(w),b>0&&document.querySelector(`input[name=pin-${b-1}]`)?.focus(),b1(w)?e(w.join("")):e(null)},v=o?"success":!!(r||i)?"fail":"";return(0,uo.jsx)(uo.Fragment,{children:(0,uo.jsxs)(hC,{children:[(0,uo.jsx)("div",{children:n.map((b,w)=>(0,uo.jsx)("input",{name:`pin-${w}`,type:"text",value:n[w],onChange:u,onKeyUp:x=>{x.key==="Backspace"&&g(w)},inputMode:"numeric",autoFocus:w===0,pattern:"[0-9]",className:v,autoComplete:E1.isMobile?"one-time-code":"off",disabled:t},w))}),(0,uo.jsx)("div",{children:(0,uo.jsx)(yC,{fail:!!r||!!i,children:r||i})})]})})},hC=Md.default.div`
|
|
1988
1947
|
display: flex;
|
|
1989
1948
|
flex-direction: column;
|
|
1990
1949
|
width: 100%;
|
|
1991
1950
|
gap: 8px;
|
|
1992
1951
|
|
|
1993
|
-
${
|
|
1952
|
+
${Bi}[data-height='medium'] & {
|
|
1994
1953
|
margin-top: 22px;
|
|
1995
1954
|
}
|
|
1996
1955
|
|
|
@@ -2055,7 +2014,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2055
2014
|
transform: translate(1px, 0px);
|
|
2056
2015
|
}
|
|
2057
2016
|
}
|
|
2058
|
-
`,
|
|
2017
|
+
`,yC=Md.default.div`
|
|
2059
2018
|
line-height: 20px;
|
|
2060
2019
|
font-size: 13px;
|
|
2061
2020
|
display: flex;
|
|
@@ -2063,7 +2022,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2063
2022
|
width: 100%;
|
|
2064
2023
|
|
|
2065
2024
|
color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
2066
|
-
`;var
|
|
2025
|
+
`;var T1=require("react");function Nn(){let{promptMfa:e,init:t,submit:r,cancel:o}=(0,T1.useContext)(we);return{promptMfa:e,init:t,submit:r,cancel:o}}var P1=require("react");function Gi(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:o,unenroll:n,enrollInMfa:a}=(0,P1.useContext)(we);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:o,unenrollWithSms:()=>n("sms"),unenrollWithTotp:()=>n("totp"),showMfaEnrollmentModal:()=>a(!0),closeMfaEnrollmentModal:()=>a(!1)}}var S1=y(require("styled-components")),Oa=require("react/jsx-runtime"),x1=e=>(0,Oa.jsxs)(gC,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,Oa.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,Oa.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),gC=S1.default.svg`
|
|
2067
2026
|
height: 90px;
|
|
2068
2027
|
width: 90px;
|
|
2069
2028
|
|
|
@@ -2074,7 +2033,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2074
2033
|
> path {
|
|
2075
2034
|
fill: white;
|
|
2076
2035
|
}
|
|
2077
|
-
`;var u1=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var f1=require("react/jsx-runtime");var m1=({size:e,authUrl:t})=>(0,f1.jsx)(xi,{url:t,squareLogoElement:u1.default,size:e,fgColor:"#1F1F1F"});var h=require("react/jsx-runtime"),w1=()=>{let{user:e,enrollInMfa:t}=V(),[r,o]=(0,sr.useState)(null),{unenrollWithSms:n,unenrollWithTotp:a}=Oi(),{app:i,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),{closePrivyModal:u}=W(),{promptMfa:g}=Mn(),[f,C]=(0,sr.useState)(s?.mfaEnrollmentFlow?.seenIntro||!1),[E,w]=(0,sr.useState)(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),k=()=>{u({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),w(null)},500)};c.current=k;let T=e?.mfaMethods.includes("sms"),S=!!e?.phone,L=e?.mfaMethods.includes("totp"),M=T||L;(0,sr.useEffect)(()=>{M&&C(!0)},[M]);function F(){o(null),w(null)}function I(){C(!1)}async function H(R){await g(),w(R)}if(!l||!e||!i)return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{onClose:k},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(p1,{})}),(0,h.jsx)(Yo,{children:(0,h.jsx)(Vt,{})}),(0,h.jsx)(ee,{})]});async function Y(){o(null);try{await n()}catch{o(null)}}async function q(){o(null);try{await a()}catch{o(null)}}if(r==="sms")return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{backFn:F,onClose:k},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{children:(0,h.jsx)(Vl.default,{})})}),(0,h.jsx)(We,{children:"Remove SMS verification?"}),(0,h.jsxs)(be,{children:["MFA adds an extra layer of security to your ",i?.name," account. Make sure you have other methods to secure your account."]}),(0,h.jsx)(Lr,{children:(0,h.jsx)(D,{warn:!0,onClick:Y,children:"Remove SMS for MFA"})}),(0,h.jsx)(ee,{})]});if(r==="totp")return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{backFn:F,onClose:k},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{children:(0,h.jsx)(xd.default,{})})}),(0,h.jsx)(We,{children:"Remove Authenticator App verification?"}),(0,h.jsxs)(be,{children:["MFA adds an extra layer of security to your ",i?.name," account. Make sure you have other methods to secure your account."]}),(0,h.jsx)(Lr,{children:(0,h.jsx)(D,{warn:!0,onClick:q,children:"Remove Authenticator App for MFA"})}),(0,h.jsx)(ee,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!M)return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{onClose:k},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{children:(0,h.jsx)(Gl.default,{})})}),(0,h.jsx)(We,{children:"Add more security"}),(0,h.jsxs)(be,{children:[i?.name," does not have any verification methods enabled."]}),(0,h.jsx)(Lr,{children:(0,h.jsx)(D,{onClick:k,children:"Close"})}),(0,h.jsx)(ee,{})]});let $=!M&&!f;if($)return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{onClose:k},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{children:(0,h.jsx)(Gl.default,{})})}),(0,h.jsx)(We,{children:"Transaction Protection"}),(0,h.jsx)(be,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,h.jsxs)(Em,{children:[(0,h.jsxs)(bn,{children:[(0,h.jsx)(wn,{children:(0,h.jsx)(v1.default,{})}),"Enable 2-Step verification for your ",i?.name," wallet."]}),(0,h.jsxs)(bn,{children:[(0,h.jsx)(wn,{children:(0,h.jsx)(C1.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,h.jsxs)(Lr,{children:[(0,h.jsx)(D,{onClick:()=>C(!0),children:"Continue"}),(0,h.jsx)(Wr,{onClick:k,children:"Not now"})]}),(0,h.jsx)(ee,{})]});switch(E){case"sms":return(0,h.jsx)(tC,{onComplete:k,onReset:F,onClose:k});case"totp":return(0,h.jsx)(rC,{onComplete:k,onClose:k,onReset:F});default:return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{backFn:$?I:void 0,onClose:k},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{children:(0,h.jsx)(Gl.default,{})})}),(0,h.jsx)(We,{children:"Choose a verification method"}),M?(0,h.jsx)(be,{children:"To add or delete verification methods, verification is required."}):(0,h.jsx)(be,{children:"How would you like to verify your identity? You can change this later."}),(0,h.jsxs)(sl,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||L)&&(0,h.jsxs)(ll,{children:[(0,h.jsx)(Be,{disabled:L,onClick:()=>H("totp"),children:(0,h.jsxs)(dl,{children:[(0,h.jsxs)(cl,{children:[(0,h.jsx)(h1.default,{}),"Authenticator App"]}),L?(0,h.jsxs)(ci,{children:[(0,h.jsx)(Td.default,{}),"Added"]}):(0,h.jsx)(ci,{children:"Recommended"})]})}),L&&(0,h.jsx)(Vc,{id:"remove",onClick:()=>o("totp"),children:(0,h.jsx)(Pd.default,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||T)&&(0,h.jsxs)(ll,{children:[(0,h.jsx)(Be,{disabled:T||S,onClick:()=>H("sms"),children:(0,h.jsxs)(dl,{children:[(0,h.jsxs)(cl,{children:[(0,h.jsx)(g1.default,{}),"SMS"]}),T&&(0,h.jsxs)(ci,{children:[(0,h.jsx)(Td.default,{}),"Added"]}),S&&(0,h.jsx)(ci,{children:"Disabled"})]})}),T&&(0,h.jsx)(Vc,{id:"remove",onClick:()=>o("sms"),children:(0,h.jsx)(Pd.default,{})})]},"sms"),(0,h.jsx)(ll,{children:(0,h.jsx)(Be,{disabled:!0,children:(0,h.jsxs)(dl,{children:[(0,h.jsxs)(cl,{children:[(0,h.jsx)(y1.default,{}),"Passkey"]}),(0,h.jsx)(ci,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),(0,h.jsx)(ee,{})]})}},tC=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,sr.useState)(""),[a,i]=(0,sr.useState)(!1),[l,s]=(0,sr.useState)("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:u}=Oi(),{app:g,data:f,currentScreen:C,navigate:E,setModalData:w}=A();function k(){f?.mfaEnrollmentFlow?.onSuccess(),e()}async function T({qualifiedPhoneNumber:M}){try{await c({phoneNumber:M}),n(M),s("verify")}catch(F){w({mfaEnrollmentFlow:f?.mfaEnrollmentFlow?{...f?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:F,previousScreen:C||"MFA_ENROLLMENT_FLOW_SCREEN"}}),E("ERROR_SCREEN")}}async function S(M){try{if(!M)return;await u({phoneNumber:o,mfaCode:M}),i(!0)}catch(F){throw td(F)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Sn(F)?new Error("The code you entered is not valid"):Pn(F)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):rd(F)?new Error("Verification canceled"):new Error("Unknown error")}}function L(){l==="verify"?s("enroll"):t()}return l==="enroll"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{backFn:t,onClose:r},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{children:(0,h.jsx)(Vl.default,{})})}),(0,h.jsx)(We,{children:"Set up SMS verification"}),(0,h.jsx)(be,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,h.jsxs)(Yo,{children:[(0,h.jsx)(Ii,{onSubmit:T}),(0,h.jsxs)(Tm,{children:["By providing your mobile number, you agree to receive text messages from ",g?.name,". Some carrier charges may apply"]})]}),(0,h.jsx)(ee,{})]}):a?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{onClose:k},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{status:"success",children:(0,h.jsx)(Sd.default,{})})}),(0,h.jsx)(We,{children:"SMS verification added"}),(0,h.jsx)(be,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,h.jsx)(Lr,{children:(0,h.jsx)(D,{onClick:k,children:"Done"})}),(0,h.jsx)(ee,{})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{backFn:L,onClose:r},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{children:(0,h.jsx)(Vl.default,{})})}),(0,h.jsx)(We,{children:"Enter enrollment code"}),(0,h.jsxs)(Yo,{children:[(0,h.jsx)(Li,{onChange:S}),(0,h.jsxs)(be,{children:["To continue, enter the 6-digit code sent to ",(0,h.jsx)("strong",{children:Cy(o)})]})]}),(0,h.jsx)(ee,{})]})},rC=({onComplete:e,onClose:t,onReset:r})=>{let[o,n]=(0,sr.useState)("enroll"),[a,i]=(0,sr.useState)(null),[l,s]=(0,sr.useState)(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:u}=Oi(),{data:g}=A();(0,sr.useEffect)(()=>{i(null),c().then(k=>{i(k)}).catch(()=>{i(null),r()})},[]);function f(){g?.mfaEnrollmentFlow?.onSuccess(),e()}function C(){n("verify")}async function E(k){try{if(!k)return;await u({mfaCode:k}),s(!0)}catch(T){throw td(T)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Sn(T)?new Error("The code you entered is not valid"):Pn(T)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):rd(T)?new Error("Verification canceled"):new Error("Unknown error")}}function w(){o==="verify"?n("enroll"):r()}return o==="enroll"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{backFn:r,onClose:t},"header"),(0,h.jsx)(We,{children:"Scan QR code"}),(0,h.jsx)(be,{children:"Open your authenticator app and scan the QR code to continue."}),(0,h.jsx)(di,{children:a?.authUrl?(0,h.jsx)(m1,{authUrl:a.authUrl,size:200}):(0,h.jsx)(Vt,{})}),(0,h.jsxs)(Lr,{children:[(0,h.jsx)(Ot,{children:a?.secret&&(0,h.jsx)(rn,{itemName:"secret",text:a.secret})}),(0,h.jsx)(D,{onClick:C,children:"Continue"})]}),(0,h.jsx)(ee,{})]}):l?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{onClose:f},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{status:"success",children:(0,h.jsx)(Sd.default,{})})}),(0,h.jsx)(We,{children:"Authenticator app verification added"}),(0,h.jsx)(be,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,h.jsx)(Lr,{children:(0,h.jsx)(D,{onClick:f,children:"Done"})}),(0,h.jsx)(ee,{})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{backFn:w,onClose:t},"header"),(0,h.jsx)(Xe,{children:(0,h.jsx)(yt,{children:(0,h.jsx)(xd.default,{})})}),(0,h.jsx)(We,{children:"Enter enrollment code"}),(0,h.jsx)(Yo,{children:(0,h.jsx)(Li,{onChange:E})}),(0,h.jsxs)(be,{children:["To continue, enter the 6-digit code generated from your ",(0,h.jsx)("strong",{children:"authenticator app"})]}),(0,h.jsx)(ee,{})]})};var og=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),ng=y(require("@heroicons/react/24/outline/PhoneIcon")),ig=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),ag=y(require("@heroicons/react/24/solid/PhoneIcon")),sg=y(require("@heroicons/react/24/solid/ShieldCheckIcon")),zi=require("react");var On=require("react"),rg=y(require("styled-components"));var Wd=y(require("styled-components"));var kd=y(require("styled-components")),Ra=require("react/jsx-runtime"),zl=({label:e,children:t,valueStyles:r})=>(0,Ra.jsxs)(oC,{children:[(0,Ra.jsx)("div",{children:e}),(0,Ra.jsx)(nC,{style:{...r},children:t})]}),oC=kd.default.div`
|
|
2036
|
+
`;var _1=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var A1=require("react/jsx-runtime");var k1=({size:e,authUrl:t})=>(0,A1.jsx)(Wi,{url:t,squareLogoElement:_1.default,size:e,fgColor:"#1F1F1F"});var h=require("react/jsx-runtime"),O1=()=>{let{user:e,enrollInMfa:t}=H(),[r,o]=(0,sr.useState)(null),{unenrollWithSms:n,unenrollWithTotp:a}=Gi(),{app:i,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),{closePrivyModal:u}=W(),{promptMfa:g}=Nn(),[f,v]=(0,sr.useState)(s?.mfaEnrollmentFlow?.seenIntro||!1),[b,w]=(0,sr.useState)(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),x=()=>{u({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),w(null)},500)};c.current=x;let T=e?.mfaMethods.includes("sms"),S=!!e?.phone,L=e?.mfaMethods.includes("totp"),I=T||L;(0,sr.useEffect)(()=>{I&&v(!0)},[I]);function U(){o(null),w(null)}function M(){v(!1)}async function G(R){await g(),w(R)}if(!l||!e||!i)return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{onClose:x},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(x1,{})}),(0,h.jsx)(Qo,{children:(0,h.jsx)(zt,{})}),(0,h.jsx)(ee,{})]});async function Y(){o(null);try{await n()}catch{o(null)}}async function z(){o(null);try{await a()}catch{o(null)}}if(r==="sms")return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{backFn:U,onClose:x},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{children:(0,h.jsx)(Ql.default,{})})}),(0,h.jsx)(Le,{children:"Remove SMS verification?"}),(0,h.jsxs)(be,{children:["MFA adds an extra layer of security to your ",i?.name," account. Make sure you have other methods to secure your account."]}),(0,h.jsx)(Nr,{children:(0,h.jsx)(D,{warn:!0,onClick:Y,children:"Remove SMS for MFA"})}),(0,h.jsx)(ee,{})]});if(r==="totp")return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{backFn:U,onClose:x},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{children:(0,h.jsx)(Nd.default,{})})}),(0,h.jsx)(Le,{children:"Remove Authenticator App verification?"}),(0,h.jsxs)(be,{children:["MFA adds an extra layer of security to your ",i?.name," account. Make sure you have other methods to secure your account."]}),(0,h.jsx)(Nr,{children:(0,h.jsx)(D,{warn:!0,onClick:z,children:"Remove Authenticator App for MFA"})}),(0,h.jsx)(ee,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!I)return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{onClose:x},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{children:(0,h.jsx)(Jl.default,{})})}),(0,h.jsx)(Le,{children:"Add more security"}),(0,h.jsxs)(be,{children:[i?.name," does not have any verification methods enabled."]}),(0,h.jsx)(Nr,{children:(0,h.jsx)(D,{onClick:x,children:"Close"})}),(0,h.jsx)(ee,{})]});let j=!I&&!f;if(j)return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{onClose:x},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{children:(0,h.jsx)(Jl.default,{})})}),(0,h.jsx)(Le,{children:"Transaction Protection"}),(0,h.jsx)(be,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,h.jsxs)(Nm,{children:[(0,h.jsxs)(_n,{children:[(0,h.jsx)(xn,{children:(0,h.jsx)(W1.default,{})}),"Enable 2-Step verification for your ",i?.name," wallet."]}),(0,h.jsxs)(_n,{children:[(0,h.jsx)(xn,{children:(0,h.jsx)(L1.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,h.jsxs)(Nr,{children:[(0,h.jsx)(D,{onClick:()=>v(!0),children:"Continue"}),(0,h.jsx)(Or,{onClick:x,children:"Not now"})]}),(0,h.jsx)(ee,{})]});switch(b){case"sms":return(0,h.jsx)(vC,{onComplete:x,onReset:U,onClose:x});case"totp":return(0,h.jsx)(CC,{onComplete:x,onClose:x,onReset:U});default:return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{backFn:j?M:void 0,onClose:x},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{children:(0,h.jsx)(Jl.default,{})})}),(0,h.jsx)(Le,{children:"Choose a verification method"}),I?(0,h.jsx)(be,{children:"To add or delete verification methods, verification is required."}):(0,h.jsx)(be,{children:"How would you like to verify your identity? You can change this later."}),(0,h.jsxs)(ml,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||L)&&(0,h.jsxs)(fl,{children:[(0,h.jsx)(ze,{disabled:L,onClick:()=>G("totp"),children:(0,h.jsxs)(yl,{children:[(0,h.jsxs)(hl,{children:[(0,h.jsx)(R1.default,{}),"Authenticator App"]}),L?(0,h.jsxs)(hi,{children:[(0,h.jsx)(Wd.default,{}),"Added"]}):(0,h.jsx)(hi,{children:"Recommended"})]})}),L&&(0,h.jsx)(Xc,{id:"remove",onClick:()=>o("totp"),children:(0,h.jsx)(Ld.default,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||T)&&(0,h.jsxs)(fl,{children:[(0,h.jsx)(ze,{disabled:T||S,onClick:()=>G("sms"),children:(0,h.jsxs)(yl,{children:[(0,h.jsxs)(hl,{children:[(0,h.jsx)(M1.default,{}),"SMS"]}),T&&(0,h.jsxs)(hi,{children:[(0,h.jsx)(Wd.default,{}),"Added"]}),S&&(0,h.jsx)(hi,{children:"Disabled"})]})}),T&&(0,h.jsx)(Xc,{id:"remove",onClick:()=>o("sms"),children:(0,h.jsx)(Ld.default,{})})]},"sms"),(0,h.jsx)(fl,{children:(0,h.jsx)(ze,{disabled:!0,children:(0,h.jsxs)(yl,{children:[(0,h.jsxs)(hl,{children:[(0,h.jsx)(I1.default,{}),"Passkey"]}),(0,h.jsx)(hi,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),(0,h.jsx)(ee,{})]})}},vC=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,sr.useState)(""),[a,i]=(0,sr.useState)(!1),[l,s]=(0,sr.useState)("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:u}=Gi(),{app:g,data:f,currentScreen:v,navigate:b,setModalData:w}=_();function x(){f?.mfaEnrollmentFlow?.onSuccess(),e()}async function T({qualifiedPhoneNumber:I}){try{await c({phoneNumber:I}),n(I),s("verify")}catch(U){w({mfaEnrollmentFlow:f?.mfaEnrollmentFlow?{...f?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:U,previousScreen:v||"MFA_ENROLLMENT_FLOW_SCREEN"}}),b("ERROR_SCREEN")}}async function S(I){try{if(!I)return;await u({phoneNumber:o,mfaCode:I}),i(!0)}catch(U){throw pd(U)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):In(U)?new Error("The code you entered is not valid"):Rn(U)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):ud(U)?new Error("Verification canceled"):new Error("Unknown error")}}function L(){l==="verify"?s("enroll"):t()}return l==="enroll"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{backFn:t,onClose:r},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{children:(0,h.jsx)(Ql.default,{})})}),(0,h.jsx)(Le,{children:"Set up SMS verification"}),(0,h.jsx)(be,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,h.jsxs)(Qo,{children:[(0,h.jsx)(Fi,{onSubmit:T}),(0,h.jsxs)(Dm,{children:["By providing your mobile number, you agree to receive text messages from ",g?.name,". Some carrier charges may apply"]})]}),(0,h.jsx)(ee,{})]}):a?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{onClose:x},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{status:"success",children:(0,h.jsx)(Od.default,{})})}),(0,h.jsx)(Le,{children:"SMS verification added"}),(0,h.jsx)(be,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,h.jsx)(Nr,{children:(0,h.jsx)(D,{onClick:x,children:"Done"})}),(0,h.jsx)(ee,{})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{backFn:L,onClose:r},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{children:(0,h.jsx)(Ql.default,{})})}),(0,h.jsx)(Le,{children:"Enter enrollment code"}),(0,h.jsxs)(Qo,{children:[(0,h.jsx)(Hi,{onChange:S}),(0,h.jsxs)(be,{children:["To continue, enter the 6-digit code sent to ",(0,h.jsx)("strong",{children:Ly(o)})]})]}),(0,h.jsx)(ee,{})]})},CC=({onComplete:e,onClose:t,onReset:r})=>{let[o,n]=(0,sr.useState)("enroll"),[a,i]=(0,sr.useState)(null),[l,s]=(0,sr.useState)(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:u}=Gi(),{data:g}=_();(0,sr.useEffect)(()=>{i(null),c().then(x=>{i(x)}).catch(()=>{i(null),r()})},[]);function f(){g?.mfaEnrollmentFlow?.onSuccess(),e()}function v(){n("verify")}async function b(x){try{if(!x)return;await u({mfaCode:x}),s(!0)}catch(T){throw pd(T)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):In(T)?new Error("The code you entered is not valid"):Rn(T)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):ud(T)?new Error("Verification canceled"):new Error("Unknown error")}}function w(){o==="verify"?n("enroll"):r()}return o==="enroll"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{backFn:r,onClose:t},"header"),(0,h.jsx)(Le,{children:"Scan QR code"}),(0,h.jsx)(be,{children:"Open your authenticator app and scan the QR code to continue."}),(0,h.jsx)(yi,{children:a?.authUrl?(0,h.jsx)(k1,{authUrl:a.authUrl,size:200}):(0,h.jsx)(zt,{})}),(0,h.jsxs)(Nr,{children:[(0,h.jsx)(Ft,{children:a?.secret&&(0,h.jsx)(an,{itemName:"secret",text:a.secret})}),(0,h.jsx)(D,{onClick:v,children:"Continue"})]}),(0,h.jsx)(ee,{})]}):l?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{onClose:f},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{status:"success",children:(0,h.jsx)(Od.default,{})})}),(0,h.jsx)(Le,{children:"Authenticator app verification added"}),(0,h.jsx)(be,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,h.jsx)(Nr,{children:(0,h.jsx)(D,{onClick:f,children:"Done"})}),(0,h.jsx)(ee,{})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{backFn:w,onClose:t},"header"),(0,h.jsx)(ot,{children:(0,h.jsx)(Ct,{children:(0,h.jsx)(Nd.default,{})})}),(0,h.jsx)(Le,{children:"Enter enrollment code"}),(0,h.jsx)(Qo,{children:(0,h.jsx)(Hi,{onChange:b})}),(0,h.jsxs)(be,{children:["To continue, enter the 6-digit code generated from your ",(0,h.jsx)("strong",{children:"authenticator app"})]}),(0,h.jsx)(ee,{})]})};var vg=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),Cg=y(require("@heroicons/react/24/outline/PhoneIcon")),wg=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),bg=y(require("@heroicons/react/24/solid/PhoneIcon")),Eg=y(require("@heroicons/react/24/solid/ShieldCheckIcon")),Ji=require("react");var Un=require("react"),gg=y(require("styled-components"));var Vd=y(require("styled-components"));var Dd=y(require("styled-components")),Na=require("react/jsx-runtime"),Xl=({label:e,children:t,valueStyles:r})=>(0,Na.jsxs)(wC,{children:[(0,Na.jsx)("div",{children:e}),(0,Na.jsx)(bC,{style:{...r},children:t})]}),wC=Dd.default.div`
|
|
2078
2037
|
display: flex;
|
|
2079
2038
|
align-items: center;
|
|
2080
2039
|
justify-content: space-between;
|
|
@@ -2089,7 +2048,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2089
2048
|
color: var(--privy-color-foreground-2);
|
|
2090
2049
|
text-align: right;
|
|
2091
2050
|
}
|
|
2092
|
-
`,
|
|
2051
|
+
`,bC=Dd.default.div`
|
|
2093
2052
|
font-size: 14px;
|
|
2094
2053
|
line-height: 100%;
|
|
2095
2054
|
display: flex;
|
|
@@ -2098,28 +2057,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2098
2057
|
border-radius: var(--privy-border-radius-full);
|
|
2099
2058
|
background-color: var(--privy-color-background-2);
|
|
2100
2059
|
padding: 4px 8px;
|
|
2101
|
-
`;var
|
|
2060
|
+
`;var Fa=y(require("styled-components"));var Fd=require("@ethersproject/bignumber"),Ud=require("@ethersproject/units");var Da=(e,t)=>{let r=(t*parseFloat((0,Ud.formatEther)(e))).toFixed(2);return r!=="0.00"?`$${r}`:"<$0.01"},mo=(e,t,r=6,o=!1)=>{let a=parseFloat((0,Ud.formatEther)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${a} ${t}`:`${a==="0"?"<0.001":a} ${t}`},Bd=e=>e.map(Lt).reduce((t,r)=>t.add(r),Fd.BigNumber.from(0)).toHexString(),N1=(e,t)=>{let{chains:r}=W(),o=`https://etherscan.io/address/${t}`,n=`${Cu(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n},Lt=e=>Fd.BigNumber.from(e);var fo=require("react/jsx-runtime"),D1=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Bd(e),n=t?Da(o,t):void 0,a=mo(o,r);return(0,fo.jsx)(F1,{children:n||a})},Hd=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Bd(e),n=t?Da(o,t):void 0,a=mo(o,r);return(0,fo.jsx)(F1,{children:n?(0,fo.jsxs)(fo.Fragment,{children:[(0,fo.jsx)(EC,{children:"USD"}),n==="<$0.01"?(0,fo.jsxs)(PC,{children:[(0,fo.jsx)(TC,{children:"<"}),"$0.01"]}):n]}):a})},F1=Fa.default.span`
|
|
2102
2061
|
font-size: 14px;
|
|
2103
2062
|
line-height: 140%;
|
|
2104
2063
|
display: flex;
|
|
2105
2064
|
gap: 4px;
|
|
2106
2065
|
align-items: center;
|
|
2107
|
-
`,
|
|
2066
|
+
`,EC=Fa.default.span`
|
|
2108
2067
|
font-size: 12px;
|
|
2109
2068
|
line-height: 12px;
|
|
2110
2069
|
color: var(--privy-color-foreground-3);
|
|
2111
|
-
`,
|
|
2070
|
+
`,TC=Fa.default.span`
|
|
2112
2071
|
font-size: 10px;
|
|
2113
|
-
`,
|
|
2072
|
+
`,PC=Fa.default.span`
|
|
2114
2073
|
display: flex;
|
|
2115
2074
|
align-items: center;
|
|
2116
|
-
`;var
|
|
2075
|
+
`;var ec=y(require("styled-components"));var Jt=require("react/jsx-runtime"),U1=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,Jt.jsxs)(nd,{style:{paddingBottom:"12px"},children:[(0,Jt.jsxs)(H1,{children:[(0,Jt.jsx)(V1,{children:"Est. Fees"}),(0,Jt.jsx)("div",{children:(0,Jt.jsx)(Hd,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,Jt.jsx)(G1,{children:`${mo(e,r)}`})]}),B1=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=Lt(e.value||0).add(Lt(t)).toHexString();return(0,Jt.jsxs)(nd,{children:[(0,Jt.jsxs)(H1,{children:[(0,Jt.jsx)(V1,{children:"Total (including fees)"}),(0,Jt.jsx)("div",{children:(0,Jt.jsx)(Hd,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&(0,Jt.jsx)(G1,{children:mo(n,o)})]})},H1=ec.default.div`
|
|
2117
2076
|
display: flex;
|
|
2118
2077
|
flex-direction: row;
|
|
2119
2078
|
justify-content: space-between;
|
|
2120
2079
|
align-items: center;
|
|
2121
2080
|
padding-top: 4px;
|
|
2122
|
-
`,
|
|
2081
|
+
`,G1=ec.default.div`
|
|
2123
2082
|
display: flex;
|
|
2124
2083
|
flex-direction: row;
|
|
2125
2084
|
height: 12px;
|
|
@@ -2128,23 +2087,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2128
2087
|
line-height: 12px;
|
|
2129
2088
|
color: var(--privy-color-foreground-3);
|
|
2130
2089
|
font-weight: 400;
|
|
2131
|
-
`,
|
|
2090
|
+
`,V1=ec.default.div`
|
|
2132
2091
|
font-size: 14px;
|
|
2133
2092
|
line-height: 22.4px;
|
|
2134
2093
|
font-weight: 400;
|
|
2135
|
-
`;var
|
|
2094
|
+
`;var z1=y(require("@heroicons/react/24/outline/ChevronDownIcon")),ho=require("react"),Lo=y(require("styled-components"));var tc=require("react"),Vi=(0,tc.createContext)(void 0);var Ua=(0,tc.createContext)(void 0);var Et=require("react/jsx-runtime"),q1=({defaultValue:e,children:t})=>{let[r,o]=(0,ho.useState)(e||null),n=a=>{o(r===a?null:a)};return(0,Et.jsx)(Vi.Provider,{value:{activePanel:r,togglePanel:n},children:(0,Et.jsx)(SC,{children:t})})},$1=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=(0,ho.useContext)(Vi),n=r===e;return(0,Et.jsx)(Ua.Provider,{value:{onToggle:()=>o(e),value:e},children:(0,Et.jsx)(AC,{isActive:n,"data-open":n,children:t})})},j1=({children:e})=>{let{activePanel:t}=(0,ho.useContext)(Vi),{onToggle:r,value:o}=(0,ho.useContext)(Ua),n=t===o;return(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsxs)(xC,{onClick:r,"data-open":n,children:[(0,Et.jsx)(kC,{children:e}),(0,Et.jsx)(IC,{isactive:n,children:(0,Et.jsx)(z1.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,Et.jsx)(_C,{})]})},K1=({children:e})=>{let{activePanel:t}=(0,ho.useContext)(Vi),{value:r}=(0,ho.useContext)(Ua);return(0,Et.jsx)(RC,{"data-open":t===r,children:(0,Et.jsx)(Z1,{children:e})})},Y1=({children:e})=>{let{activePanel:t}=(0,ho.useContext)(Vi),{value:r}=(0,ho.useContext)(Ua);return(0,Et.jsx)(Z1,{children:typeof e=="function"?e({isActive:t===r}):e})},SC=Lo.default.div`
|
|
2136
2095
|
display: flex;
|
|
2137
2096
|
flex-direction: column;
|
|
2138
2097
|
width: 100%;
|
|
2139
2098
|
gap: 8px;
|
|
2140
|
-
`,
|
|
2099
|
+
`,xC=Lo.default.div`
|
|
2141
2100
|
display: flex;
|
|
2142
2101
|
justify-content: space-between;
|
|
2143
2102
|
align-items: center;
|
|
2144
2103
|
width: 100%;
|
|
2145
2104
|
cursor: pointer;
|
|
2146
2105
|
padding-bottom: 8px;
|
|
2147
|
-
`,
|
|
2106
|
+
`,_C=Lo.default.div`
|
|
2148
2107
|
width: 100%;
|
|
2149
2108
|
|
|
2150
2109
|
&& {
|
|
@@ -2152,13 +2111,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2152
2111
|
border-color: var(--privy-color-foreground-4);
|
|
2153
2112
|
}
|
|
2154
2113
|
padding-bottom: 12px;
|
|
2155
|
-
`,
|
|
2114
|
+
`,kC=Lo.default.div`
|
|
2156
2115
|
font-size: 14px;
|
|
2157
2116
|
font-weight: 500;
|
|
2158
2117
|
line-height: 19.6px;
|
|
2159
2118
|
width: 100%;
|
|
2160
2119
|
padding-right: 8px;
|
|
2161
|
-
`,
|
|
2120
|
+
`,AC=Lo.default.div`
|
|
2162
2121
|
display: flex;
|
|
2163
2122
|
flex-direction: column;
|
|
2164
2123
|
width: 100%;
|
|
@@ -2170,7 +2129,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2170
2129
|
border-color: var(--privy-color-foreground-4);
|
|
2171
2130
|
border-radius: var(--privy-border-radius-md);
|
|
2172
2131
|
}
|
|
2173
|
-
`,
|
|
2132
|
+
`,RC=Lo.default.div`
|
|
2174
2133
|
position: relative;
|
|
2175
2134
|
overflow: hidden;
|
|
2176
2135
|
transition: max-height 25ms ease-out;
|
|
@@ -2182,38 +2141,38 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2182
2141
|
&[data-open='false'] {
|
|
2183
2142
|
max-height: 0;
|
|
2184
2143
|
}
|
|
2185
|
-
`,
|
|
2144
|
+
`,Z1=Lo.default.div`
|
|
2186
2145
|
display: flex;
|
|
2187
2146
|
flex-direction: column;
|
|
2188
2147
|
gap: 12px;
|
|
2189
2148
|
flex: 1 1 auto;
|
|
2190
2149
|
min-height: 1px;
|
|
2191
|
-
`,
|
|
2150
|
+
`,IC=Lo.default.div`
|
|
2192
2151
|
transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
|
|
2193
|
-
`;var
|
|
2152
|
+
`;var J1=y(require("styled-components"));var Q1=require("react/jsx-runtime"),Gd=({walletAddress:e,chainId:t=vo})=>(0,Q1.jsx)(MC,{href:N1(t,e),target:"_blank",children:zo(e)}),MC=J1.default.a`
|
|
2194
2153
|
&:hover {
|
|
2195
2154
|
text-decoration: underline;
|
|
2196
2155
|
}
|
|
2197
|
-
`;var
|
|
2156
|
+
`;var ft=require("react/jsx-runtime"),zi=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:a,tokenSymbol:i})=>{let l=r?.value||0;return(0,ft.jsx)(q1,{children:(0,ft.jsxs)($1,{value:"details",children:[(0,ft.jsx)(j1,{children:(0,ft.jsxs)(WC,{children:[(0,ft.jsx)("div",{children:o?.title||o?.actionDescription||"Details"}),(0,ft.jsx)(LC,{children:(0,ft.jsx)(D1,{weiQuantities:[l],tokenPrice:n,tokenSymbol:i})})]})}),(0,ft.jsxs)(K1,{children:[(0,ft.jsx)(Xl,{label:"From",children:(0,ft.jsx)(Gd,{walletAddress:e,chainId:r.chainId||vo})}),(0,ft.jsx)(Xl,{label:"To",children:(0,ft.jsx)(Gd,{walletAddress:t,chainId:r.chainId||vo})}),o&&o.action&&(0,ft.jsx)(Xl,{label:"Action",children:o.action}),a&&(0,ft.jsx)(U1,{transactionData:r,gas:a,tokenPrice:n,tokenSymbol:i})]}),(0,ft.jsx)(Y1,{children:({isActive:s})=>(0,ft.jsx)(B1,{transactionData:r,displayFee:s,gas:a||"0x0",tokenPrice:n,tokenSymbol:i})})]})})},WC=Vd.default.div`
|
|
2198
2157
|
display: flex;
|
|
2199
2158
|
flex-direction: row;
|
|
2200
2159
|
justify-content: space-between;
|
|
2201
|
-
`,
|
|
2160
|
+
`,LC=Vd.default.div`
|
|
2202
2161
|
flex-shrink: 0;
|
|
2203
2162
|
padding-left: 8px;
|
|
2204
|
-
`;var
|
|
2163
|
+
`;var qi=y(require("styled-components")),dn=require("react/jsx-runtime"),zd=({description:e,contractInfo:t})=>(0,dn.jsxs)(OC,{children:[t.imgUrl&&(0,dn.jsx)(NC,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&(0,dn.jsx)(DC,{children:(0,dn.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&(0,dn.jsx)(FC,{children:t.name}),(0,dn.jsx)(UC,{children:e||t.actionText})]}),OC=qi.default.div`
|
|
2205
2164
|
display: flex;
|
|
2206
2165
|
flex-direction: column;
|
|
2207
2166
|
align-items: center;
|
|
2208
2167
|
margin-bottom: 8px;
|
|
2209
|
-
`,
|
|
2168
|
+
`,NC=qi.default.img`
|
|
2210
2169
|
&& {
|
|
2211
2170
|
height: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2212
2171
|
width: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2213
2172
|
border-radius: 16px;
|
|
2214
2173
|
margin-bottom: 12px;
|
|
2215
2174
|
}
|
|
2216
|
-
`,
|
|
2175
|
+
`,DC=qi.default.div`
|
|
2217
2176
|
font-size: 12px;
|
|
2218
2177
|
line-height: 12px;
|
|
2219
2178
|
padding: 7px;
|
|
@@ -2226,7 +2185,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2226
2185
|
text-decoration: underline;
|
|
2227
2186
|
}
|
|
2228
2187
|
}
|
|
2229
|
-
`,
|
|
2188
|
+
`,FC=qi.default.div`
|
|
2230
2189
|
font-size: 18px;
|
|
2231
2190
|
line-height: 18px;
|
|
2232
2191
|
font-weight: 500;
|
|
@@ -2234,7 +2193,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2234
2193
|
white-space: nowrap;
|
|
2235
2194
|
max-width: 275px;
|
|
2236
2195
|
text-overflow: ellipsis;
|
|
2237
|
-
`,
|
|
2196
|
+
`,UC=qi.default.div`
|
|
2238
2197
|
font-size: 16px;
|
|
2239
2198
|
line-height: 140%;
|
|
2240
2199
|
font-weight: 400;
|
|
@@ -2242,7 +2201,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2242
2201
|
overflow: hidden;
|
|
2243
2202
|
max-width: 275px;
|
|
2244
2203
|
text-overflow: ellipsis;
|
|
2245
|
-
`;var
|
|
2204
|
+
`;var X1=y(require("@heroicons/react/24/outline/WalletIcon")),rc=y(require("styled-components"));var Dn=require("react/jsx-runtime"),eg=({address:e,txn:t,balance:r,hasFunds:o})=>{let n=!!r,{nativeTokenSymbolForChainId:a}=W(),i=a(t.chainId)||"ETH";return(0,Dn.jsxs)(BC,{children:[(0,Dn.jsxs)(HC,{children:[(0,Dn.jsx)(X1.default,{strokeWidth:"2",width:"16px",height:"16px"}),(0,Dn.jsx)("div",{children:zo(e)})]}),(0,Dn.jsxs)(GC,{displayBalanceColor:n,hasFunds:o,children:[r?mo(r,i,6,!0):0," available"]})]})},BC=rc.default.div`
|
|
2246
2205
|
display: flex;
|
|
2247
2206
|
flex-direction: row;
|
|
2248
2207
|
justify-content: space-between;
|
|
@@ -2255,12 +2214,12 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2255
2214
|
border: 1px solid var(--privy-color-foreground-4);
|
|
2256
2215
|
border-radius: var(--privy-border-radius-md);
|
|
2257
2216
|
}
|
|
2258
|
-
`,
|
|
2217
|
+
`,HC=rc.default.div`
|
|
2259
2218
|
display: flex;
|
|
2260
2219
|
flex-direction: row;
|
|
2261
2220
|
align-items: center;
|
|
2262
2221
|
gap: 8px;
|
|
2263
|
-
`,
|
|
2222
|
+
`,GC=rc.default.div`
|
|
2264
2223
|
display: flex;
|
|
2265
2224
|
align-items: center;
|
|
2266
2225
|
justify-content: center;
|
|
@@ -2270,35 +2229,35 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2270
2229
|
background-color: var(--privy-color-background-2);
|
|
2271
2230
|
padding: 5px 8px;
|
|
2272
2231
|
color: ${e=>e.displayBalanceColor?e.hasFunds?"var(--privy-color-success-dark)":"var(--privy-color-error)":"inherit"};
|
|
2273
|
-
`;var
|
|
2232
|
+
`;var Ba=y(require("styled-components"));var kr=require("react/jsx-runtime"),rg=({description:e,txn:t,tokenSymbol:r,tokenPrice:o})=>{let n=t.value||0,a=o?Da(n,o):void 0,i=mo(n,r);return(0,kr.jsxs)(VC,{children:[a?(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(tg,{children:a}),(0,kr.jsx)(zC,{children:i})]}):(0,kr.jsx)(kr.Fragment,{children:(0,kr.jsx)(tg,{children:i})}),(0,kr.jsx)(qC,{children:e})]})},VC=Ba.default.div`
|
|
2274
2233
|
display: flex;
|
|
2275
2234
|
flex-direction: column;
|
|
2276
2235
|
align-items: center;
|
|
2277
2236
|
margin-bottom: 20px;
|
|
2278
|
-
`,
|
|
2237
|
+
`,tg=Ba.default.h2`
|
|
2279
2238
|
&& {
|
|
2280
2239
|
font-size: 48px;
|
|
2281
2240
|
line-height: 48px;
|
|
2282
2241
|
margin: 8px auto;
|
|
2283
2242
|
}
|
|
2284
|
-
`,
|
|
2243
|
+
`,zC=Ba.default.p`
|
|
2285
2244
|
margin-bottom: 12px;
|
|
2286
2245
|
&& {
|
|
2287
2246
|
font-size: 17px;
|
|
2288
2247
|
line-height: 17px;
|
|
2289
2248
|
color: var(--privy-color-foreground-3);
|
|
2290
2249
|
}
|
|
2291
|
-
`,
|
|
2250
|
+
`,qC=Ba.default.div`
|
|
2292
2251
|
font-size: 16px;
|
|
2293
2252
|
line-height: 22.4px;
|
|
2294
2253
|
font-weight: 400;
|
|
2295
2254
|
overflow: hidden;
|
|
2296
2255
|
max-width: 275px;
|
|
2297
2256
|
text-overflow: ellipsis;
|
|
2298
|
-
`;var
|
|
2257
|
+
`;var fg=require("@ethersproject/abstract-signer"),KC=require("@ethersproject/providers");var qd=require("@ethersproject/bignumber");var Fn=require("@ethersproject/bignumber"),og=require("@ethersproject/contracts"),ng=require("@ethersproject/transactions");var $i=e=>[Gs.id,Vs.id,zs.id,qs.id,$s.id,js.id,Ks.id,Zs.id,Ys.id].includes(e),ig=async(e,t)=>{if(!$i(e.chainId))throw new Error("Invalid chain ID for OP Stack gas estimation.");if(e.type===void 0&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas||e.gasPrice)return e;try{if(!e.maxPriorityFeePerGas){let r=await t.send("eth_maxPriorityFeePerGas",[]);e.maxPriorityFeePerGas=r}if(e.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),e.maxPriorityFeePerGas>=e.maxFeePerGas))throw new Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!e.maxFeePerGas){let{lastBaseFeePerGas:r}=await t.getFeeData();if(!r)throw new Error("Unable to fetch baseFee for last block.");let a=Fn.BigNumber.from(r).mul(Fn.BigNumber.from(126)).div(Fn.BigNumber.from(100)).add(Fn.BigNumber.from(e.maxPriorityFeePerGas));e.maxFeePerGas=Ha(a)}}catch(r){throw new Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return e};async function ag(e,t){if(!e.chainId||e.chainId&&!$i(e.chainId))return Fn.BigNumber.from(0);let r=Fn.BigNumber.from(0);try{let o=new og.Contract(pu,uu,t),n=sg(e),a=(0,ng.serialize)(n);r=await o.getL1Fee(a)}catch{}return r}async function lg(e,t){try{return(await t.estimateGas(e)).toHexString()}catch{}let r={...e,from:void 0};return(await t.estimateGas(r)).toHexString()}var cg=async(e,t)=>{if(e.type===void 0&&(e.type=2),e.type===2){if(!e.maxFeePerGas||!e.maxPriorityFeePerGas){let r=await t.getFeeData();e.maxFeePerGas||(e.maxFeePerGas=r.maxFeePerGas?.toHexString()),e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=r.maxPriorityFeePerGas?.toHexString())}}else if(!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e};async function ji(e,t){if(!e.gasLimit)throw new Ye("gasLimit was not successfully set for transaction.");let r=Lt(e.gasLimit),o=qd.BigNumber.from(0);if(e.type==2)if(e.maxFeePerGas)o=Lt(e.maxFeePerGas);else throw new Ye("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)o=Lt(e.gasPrice);else throw new Ye("gasPrice was not successfully set for transaction of type 0 or 1.");let n=r.mul(o),a=qd.BigNumber.from(0);if(e.chainId&&$i(e.chainId))try{a=await ag(e,t),n=n.add(a)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:a}}var oc=require("@ethersproject/bignumber");var $d=e=>[Us.id,Bs.id,Hs.id].includes(e),dg=async(e,t)=>{if(!$d(e.chainId))throw new Error("Invalid chain ID for Arbitrum gas estimation.");if(e.type===void 0&&(e.type=2),e.maxFeePerGas)return e;try{let{lastBaseFeePerGas:r}=await t.getFeeData();if(r){let o=r.mul(oc.BigNumber.from(120)).div(oc.BigNumber.from(100));e.maxFeePerGas=Ha(o),e.maxPriorityFeePerGas=Ha(oc.BigNumber.from(0))}}catch(r){throw new Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return e};var jd=e=>[56,97].includes(e),pg=async(e,t)=>{if(!jd(e.chainId))throw new Error("Invalid chain ID for BSC gas estimation.");if(e.type===void 0?e.type=0:(e.type==1||e.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e};var Zd=require("@ethersproject/units"),ug=require("ofetch");var Kd={id:80002,name:"Polygon Amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};var Jd=e=>[ma.id,fa.id,Kd.id].includes(e),Yd=e=>({maxPriorityFee:(0,Zd.parseUnits)(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:(0,Zd.parseUnits)(e.maxFee.toFixed(9),"gwei").toHexString()}),$C=e=>({safeLow:Yd(e.safeLow),standard:Yd(e.standard),fast:Yd(e.fast)}),jC=async e=>{let t="";switch(e){case ma.id:t="https://gasstation.polygon.technology/v2";break;case fa.id:t="https://gasstation-testnet.polygon.technology/v2";break;case Kd.id:t="https://gasstation-testnet.polygon.technology/amoy";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return $C(await(0,ug.ofetch)(t))};async function mg(e){if(!Jd(e.chainId))throw new Error("Invalid chain ID for Polygon gas estimation.");if(e.type===void 0&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{let{standard:t}=await jC(e.chainId);e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=t.maxPriorityFee),e.maxFeePerGas||(e.maxFeePerGas=t.maxFee)}catch(t){throw new Error(`Failed to set gas prices from Polygon gas station with error: ${t}.`)}return e}function Ha(e){if(typeof e=="number"||typeof e=="bigint"||typeof e=="string")return e;if(typeof e.toHexString=="function")return e.toHexString();throw new Error(`Expected numeric value but received ${e}`)}function sg(e){let t={};return e.to!==void 0&&(t.to=e.to),e.data!==void 0&&(t.data=e.data),e.chainId!==void 0&&(t.chainId=e.chainId),e.type!==void 0&&(t.type=e.type),e.accessList!==void 0&&(t.accessList=e.accessList),e.nonce!==void 0&&(t.nonce=Lt(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=Lt(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=Lt(e.gasPrice)),e.value!==void 0&&(t.value=Lt(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=Lt(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=Lt(e.maxPriorityFeePerGas)),t}async function Ki(e,t,r){if(t.chainId=Number(t.chainId),hg(t),t.from||(t.from=e),!t.nonce){let o=new fg.VoidSigner(e,r);t.nonce=await o.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await lg(t,r)),typeof t.type=="string"&&yg(t.type)&&(t.type=Number(t.type)),[23294,23295].includes(t.chainId)&&(t.type=0),Jd(t.chainId)?t=await mg(t):$d(t.chainId)?t=await dg(t,r):$i(t.chainId)?t=await ig(t,r):jd(t.chainId)?t=await pg(t,r):t=await cg(t,r),t.type===0&&delete t.accessList,t.type!==2&&(delete t.maxPriorityFeePerGas,delete t.maxFeePerGas),t}async function nc(e,t,r,o,n){o=Object.assign({chainId:vo},o),hg(o);let i=(await r.rpc({address:t,accessToken:e,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(i)}async function ic(e,t,r,o){let n=await o.getBalance(e),a=t.value||0,l=!n.sub(Lt(a)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function hg(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!YC(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 YC(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&yg(e);return t||r||o}function yg(e){return/^-?0x[a-f0-9]+$/i.test(e)}function ac(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 Yi=require("react");var sc=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=W(),[n,a]=(0,Yi.useState)(!0),[i,l]=(0,Yi.useState)(void 0),[s,c]=(0,Yi.useState)(void 0);return(0,Yi.useEffect)(()=>{let u=e.chainId||vo,g=o.find(v=>v.id===Number(u));if(!g)throw new oe(`Unsupported chain: ${u}`);(async()=>{if(!t){a(!1);return}try{a(!0);let v=await r(g);v?c(v):l(new Error(`Unable to fetch token price on chain id ${g.id}`))}catch(v){l(v)}finally{a(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:i}};var lc=require("react"),Qd=(0,lc.createContext)(null);function Zi(){let e=(0,lc.useContext)(Qd);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var Xd=require("react/jsx-runtime"),ep=({pendingTransaction:e})=>{let{getAccessToken:t}=H(),{wallets:r}=Zi(),{walletProxy:o,rpcConfig:n,chains:a,appId:i,nativeTokenSymbolForChainId:l}=W(),[s,c]=(0,Un.useState)(null),[u,g]=(0,Un.useState)(e),{tokenPrice:f}=sc(u),v=l(e.chainId)||"ETH",b=(0,Un.useMemo)(()=>r.find(w=>w.walletClientType==="privy"),[r]);return(0,Un.useEffect)(()=>{async function w(){if(!await t()||!o||!b)return u;let T=Co(u.chainId,a,n,{appId:i}),S=await Ki(b.address,u,T),{totalGasEstimate:L}=await ji(S,T);return c(L.toHexString()),S}w().then(g).catch(console.error)},[o]),b?(0,Xd.jsx)(ZC,{children:(0,Xd.jsx)(zi,{from:b.address,to:u.to,txn:u,gas:s??void 0,tokenPrice:f,tokenSymbol:v})}):null},ZC=gg.default.div`
|
|
2299
2258
|
width: 100%;
|
|
2300
2259
|
padding: 1rem 0;
|
|
2301
|
-
`;var Z=require("react/jsx-runtime"),
|
|
2260
|
+
`;var Z=require("react/jsx-runtime"),tp=({open:e,onClose:t})=>{let{user:r}=H(),[o,n]=(0,Ji.useState)(null),{init:a,cancel:i}=Nn();(0,Ji.useEffect)(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?l(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);async function l(c){try{n(c),await a(c)}catch(u){console.error(u)}}let s=()=>{n(null),i(),t()};return!e||!r?null:o?(0,Z.jsx)(JC,{selectedMethod:o,onClose:s,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(k,{onClose:s},"header"),(0,Z.jsx)(ot,{children:(0,Z.jsx)(Ct,{children:(0,Z.jsx)(Eg.default,{})})}),(0,Z.jsx)(Le,{children:"Verify your identity"}),(0,Z.jsx)(be,{children:"Choose a verification method"}),(0,Z.jsxs)(ml,{children:[r.mfaMethods.includes("totp")&&(0,Z.jsxs)(ze,{onClick:()=>l("totp"),children:[(0,Z.jsx)(vg.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,Z.jsxs)(ze,{onClick:()=>l("sms"),children:[(0,Z.jsx)(Cg.default,{}),"SMS"]},"sms")]}),(0,Z.jsx)(ee,{})]})},JC=({selectedMethod:e,onClose:t,onBack:r})=>{let{app:o}=_(),{pendingTransaction:n}=W(),[a,i]=(0,Ji.useState)(!1),[l,s]=(0,Ji.useState)(!1),{submit:c}=Nn();async function u(g){try{if(!g)return;await c(e,g),s(!0),i(!1),t()}catch(f){throw bl(f)?(i(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):In(f)?(i(!1),new Error("The code you entered is not valid")):Rn(f)?(i(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(i(!1),new Error("Unknown error"))}}switch(e){case"sms":return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(k,{onClose:t},"header"),(0,Z.jsx)(ot,{children:(0,Z.jsx)(Ct,{children:(0,Z.jsx)(bg.default,{})})}),(0,Z.jsx)(Le,{children:"Enter verification code"}),(0,Z.jsxs)(Qo,{children:[(0,Z.jsx)(Hi,{success:l,disabled:a,onChange:u}),(0,Z.jsxs)(be,{children:["To continue, please enter the 6-digit code sent to your ",(0,Z.jsx)("strong",{children:"mobile device"})]}),n&&(0,Z.jsx)(ep,{pendingTransaction:n})]}),r&&(0,Z.jsx)(ed,{theme:o?.appearance.palette.colorScheme,onClick:r,children:"Choose another method"}),(0,Z.jsx)(Or,{onClick:t,children:"Not now"}),(0,Z.jsx)(ee,{})]});case"totp":return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(k,{onClose:t},"header"),(0,Z.jsx)(ot,{children:(0,Z.jsx)(Ct,{children:(0,Z.jsx)(wg.default,{})})}),(0,Z.jsx)(Le,{children:"Enter verification code"}),(0,Z.jsxs)(Qo,{children:[(0,Z.jsx)(Hi,{success:l,disabled:a,onChange:u}),(0,Z.jsxs)(be,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,Z.jsx)("strong",{children:"authenticator app"})]}),n&&(0,Z.jsx)(ep,{pendingTransaction:n})]}),r&&(0,Z.jsx)(ed,{theme:o?.appearance.palette.colorScheme,onClick:r,children:"Choose another method"}),(0,Z.jsx)(Or,{onClick:t,children:"Not now"}),(0,Z.jsx)(ee,{})]});default:return null}};var Qi=require("react"),Tg=y(require("styled-components"));var ht=require("react/jsx-runtime"),Pg=()=>{let{authenticated:e,logout:t,ready:r,user:o}=H(),{app:n,setModalData:a,navigate:i,resetNavigation:l}=_(),{getAuthMeta:s,initLoginWithOAuth:c,loginWithOAuth:u,updateWallets:g,setReadyToTrue:f,closePrivyModal:v,createAnalyticsEvent:b}=W(),[w,x]=(0,Qi.useState)(!1),[T,S]=(0,Qi.useState)(void 0),L=s()?.provider||"google",{name:I,component:U}=ca(L),M=n?.render.inDialog?Ke:0;(0,Qi.useEffect)(()=>{u(L).then(()=>{x(!0),f(!0)}).catch(z=>{if(z?.privyErrorCode==="allowlist_rejected"){S(void 0),l(),i("ALLOWLIST_REJECTION_SCREEN");return}if(z?.privyErrorCode==="max_accounts_reached"){console.error(new Qr(z).toString()),S(void 0),l(),i("USER_LIMIT_REACHED_SCREEN");return}let{retryable:j,detail:R}=Ru(z,L);S({retryable:j,detail:R,message:"Authentication failed"}),f(!1)}).finally(()=>{bn()})},[I,L]),(0,Qi.useEffect)(()=>{if(r&&e&&w&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let j=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},M);return()=>clearTimeout(j)}if(gr(o,n?.embeddedWallets?.createOnLogin)){let j=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:R=>{console.error(R),b({eventName:"embedded_wallet_creation_failure_logout",payload:{error:R,provider:L,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},M);return()=>clearTimeout(j)}else{let j=setTimeout(()=>v({shouldCallAuthOnSuccess:!0,isSuccess:!0}),M);return g(),()=>clearTimeout(j)}}},[r,e,w,o]);let G=w?`Successfully connected with ${I}`:T?T.message:`Verifying connection to ${I}`,Y="";return w?Y="You\u2019re good to go!":T?Y=T.detail:Y="Just a few moments more",(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsx)(k,{}),(0,ht.jsx)(te,{}),(0,ht.jsxs)(QC,{children:[(0,ht.jsx)($t,{children:(0,ht.jsxs)("div",{children:[(0,ht.jsx)(Rt,{success:w,fail:!!T}),(0,ht.jsx)(U,{style:{width:"38px",height:"38px"}})]})}),(0,ht.jsxs)(rt,{children:[(0,ht.jsx)("h3",{children:G}),(0,ht.jsx)("p",{children:Y})]}),T&&T?.retryable?(0,ht.jsx)(ui,{onClick:()=>{bn(),c(L),S(void 0)},disabled:!w&&!T?.retryable,children:"Retry"}):null]}),(0,ht.jsx)(ne,{}),(0,ht.jsx)(ee,{})]})},QC=Tg.default.div`
|
|
2302
2261
|
display: flex;
|
|
2303
2262
|
flex-direction: column;
|
|
2304
2263
|
align-items: center;
|
|
@@ -2306,17 +2265,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2306
2265
|
margin-left: 27px;
|
|
2307
2266
|
margin-right: 27px;
|
|
2308
2267
|
gap: 24px;
|
|
2309
|
-
`;var Oo=require("react")
|
|
2310
|
-
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(c instanceof
|
|
2268
|
+
`;var Oo=require("react"),rp=y(require("styled-components"));var Tt=require("react/jsx-runtime"),Sg=()=>{let{app:e,lastScreen:t,currentScreen:r,navigateBack:o}=_(),{loginWithPasskey:n,closePrivyModal:a}=W(),i=e?.render.inDialog?Ke:0,[l,s]=(0,Oo.useState)("loading"),[c,u]=(0,Oo.useState)(null),g=(0,Oo.useRef)([]),f=T=>{g.current=[T,...g.current]};(0,Oo.useEffect)(()=>()=>{g.current.forEach(T=>clearTimeout(T)),g.current=[]},[]);let v=()=>{switch(l){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},b=()=>{switch(l){case"loading":return`Please follow prompts to verify your passkey.
|
|
2269
|
+
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(c instanceof et){if(c.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(c.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
|
|
2311
2270
|
You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
|
|
2312
|
-
You will have to sign up with another method first to register a passkey for your account.`}},w=()=>{switch(l){case"loading":case"success":return(0,
|
|
2271
|
+
You will have to sign up with another method first to register a passkey for your account.`}},w=()=>{switch(l){case"loading":case"success":return(0,Tt.jsx)(D,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return(0,Tt.jsx)(D,{onClick:x,disabled:!1,children:"Retry"})}},x=async()=>{s("loading");try{await n(),s("success")}catch(T){u(T),s("error")}};return(0,Oo.useEffect)(()=>{l==="success"&&f(setTimeout(()=>{a({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[l]),(0,Oo.useEffect)(()=>{x()},[]),(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)(k,{backFn:!t||r===t?void 0:o}),(0,Tt.jsxs)(XC,{children:[(0,Tt.jsx)($t,{children:(0,Tt.jsxs)("div",{children:[(0,Tt.jsx)(Rt,{success:l==="success",fail:l==="error"}),(0,Tt.jsx)(Kl,{style:{width:"38px",height:"38px"}})]})}),(0,Tt.jsxs)(rt,{children:[(0,Tt.jsx)("h3",{children:v()}),(0,Tt.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:b()})]}),w()]}),(0,Tt.jsx)(ee,{})]})},XC=rp.default.div`
|
|
2313
2272
|
display: flex;
|
|
2314
2273
|
flex-direction: column;
|
|
2315
2274
|
align-items: center;
|
|
2316
2275
|
justify-content: center;
|
|
2317
2276
|
gap: 24px;
|
|
2318
2277
|
width: 100%;
|
|
2319
|
-
`,
|
|
2278
|
+
`,aM=rp.default.div`
|
|
2320
2279
|
display: flex;
|
|
2321
2280
|
align-items: center;
|
|
2322
2281
|
justify-content: center;
|
|
@@ -2332,63 +2291,136 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2332
2291
|
stroke: var(--privy-color-accent) !important;
|
|
2333
2292
|
fill: var(--privy-color-accent) !important;
|
|
2334
2293
|
}
|
|
2335
|
-
`;var
|
|
2294
|
+
`;var Ga=require("react"),kg=y(require("styled-components"));var xg=require("react-device-detect");var _g=(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(!Vo()&&xg.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};var Bt=require("react/jsx-runtime"),Ag=()=>{let{forkSession:e,ready:t,authenticated:r}=H(),[o,n]=(0,Ga.useState)(""),[a,i]=(0,Ga.useState)(!1);(0,Ga.useEffect)(()=>{t&&r&&e().then(n)},[t,r]);let l=_g(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."),(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(k,{},"header"),(0,Bt.jsx)(te,{}),(0,Bt.jsx)(no,{title:s.title,description:s.description}),(0,Bt.jsxs)(Pr,{children:[(0,Bt.jsx)(ew,{children:(0,Bt.jsx)(eo,{style:{width:"72px",height:"72px"}})}),(0,Bt.jsx)(dl,{href:l,onClick:()=>{setTimeout(()=>i(!0),1e3)},loading:t&&!l,children:a?"Go to App Store":"Continue"}),s.footnote?(0,Bt.jsx)("p",{children:s.footnote}):null]}),(0,Bt.jsx)(ne,{}),(0,Bt.jsx)(q,{protectedByPrivy:!0})]})},ew=(0,kg.default)(Ft)`
|
|
2336
2295
|
margin: 16px auto;
|
|
2337
|
-
`;var
|
|
2296
|
+
`;var Rg=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),Bn=require("react"),Hn=y(require("styled-components"));var Fe=require("react/jsx-runtime"),Ig=()=>{let[e,t]=(0,Bn.useState)(!0),{authenticated:r,getAccessToken:o}=H(),{walletProxy:n,closePrivyModal:a,createAnalyticsEvent:i}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),[u,g]=(0,Bn.useState)(void 0),[f,v]=(0,Bn.useState)(""),[b,w]=(0,Bn.useState)(!1),{privyWallet:x,onCompleteNavigateTo:T,onSuccess:S,onFailure:L}=s.recoverWallet,I=(G="User exited before their wallet could be recovered")=>{a({shouldCallAuthOnSuccess:!1}),L(typeof G=="string"?new Nt(G):G)};c.current=I,(0,Bn.useEffect)(()=>{if(!r||!x)return I("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let U=G=>{G&&g(G)};return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(k,{onClose:I}),(0,Fe.jsx)(te,{}),(0,Fe.jsxs)(rw,{children:[(0,Fe.jsxs)(tw,{children:[(0,Fe.jsx)(Rg.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Fe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),(0,Fe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,Fe.jsxs)("div",{children:[(0,Fe.jsxs)(rn,{children:[(0,Fe.jsx)(xi,{type:e?"password":"text",onChange:G=>U(G.target.value),disabled:b,style:{paddingRight:"2.3rem"}}),(0,Fe.jsx)(_i,{style:{right:"0.75rem"},children:e?(0,Fe.jsx)(ki,{onClick:()=>t(!1)}):(0,Fe.jsx)(Ai,{onClick:()=>t(!0)})})]}),!!f&&(0,Fe.jsx)(ow,{children:f})]}),(0,Fe.jsxs)("div",{children:[(0,Fe.jsxs)(qm,{children:[(0,Fe.jsx)("h4",{children:"Why is this necessary?"}),(0,Fe.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Fe.jsx)(nw,{loading:b||!n,disabled:!u,onClick:async()=>{w(!0);let G=await o();if(G&&x&&u!==null)try{i({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:x.address}}),await n?.recover({address:x.address,accessToken:G,recoveryPin:u}),v(""),T?l(T):a({shouldCallAuthOnSuccess:!1}),S?.(x),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:x.address}})}catch(Y){Mf(Y)?v("Invalid recovery password, please try again."):v("An error has occurred, please try again.")}finally{w(!1)}else return I("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!x&&b,children:"Recover your account"})]})]}),(0,Fe.jsx)(ne,{}),(0,Fe.jsx)(q,{protectedByPrivy:!0})]})},tw=Hn.default.div`
|
|
2297
|
+
display: flex;
|
|
2298
|
+
flex-direction: column;
|
|
2299
|
+
align-items: center;
|
|
2300
|
+
justify-content: center;
|
|
2301
|
+
margin: 20px 0;
|
|
2302
|
+
gap: 4px;
|
|
2303
|
+
|
|
2304
|
+
& h3 {
|
|
2305
|
+
font-size: 18px;
|
|
2306
|
+
font-style: normal;
|
|
2307
|
+
font-weight: 600;
|
|
2308
|
+
line-height: 24px;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
& p {
|
|
2312
|
+
max-width: 300px;
|
|
2313
|
+
font-size: 14px;
|
|
2314
|
+
font-style: normal;
|
|
2315
|
+
font-weight: 400;
|
|
2316
|
+
line-height: 20px;
|
|
2317
|
+
}
|
|
2318
|
+
`,rw=Hn.default.div`
|
|
2319
|
+
display: flex;
|
|
2320
|
+
flex-direction: column;
|
|
2321
|
+
justify-content: space-between;
|
|
2322
|
+
`,ow=Hn.default.div`
|
|
2323
|
+
line-height: 20px;
|
|
2324
|
+
height: 20px;
|
|
2325
|
+
font-size: 13px;
|
|
2326
|
+
color: var(--privy-color-error);
|
|
2327
|
+
text-align: left;
|
|
2328
|
+
margin-top: 0.5rem;
|
|
2329
|
+
`,nw=(0,Hn.default)(D)`
|
|
2330
|
+
${e=>e.hideAnimations&&Hn.css`
|
|
2331
|
+
&& {
|
|
2332
|
+
// Remove animations because the recoverWallet task on the iframe partially
|
|
2333
|
+
// blocks the renderer, so the animation stutters and doesn't look good
|
|
2334
|
+
transition: none;
|
|
2335
|
+
}
|
|
2336
|
+
`}
|
|
2337
|
+
`;var No=require("react"),op=y(require("styled-components"));var lr=require("react/jsx-runtime"),cc=({style:e,...t})=>(0,lr.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,lr.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,lr.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,lr.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,lr.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,lr.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,lr.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,lr.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,lr.jsx)("defs",{children:(0,lr.jsx)("clipPath",{id:"clip0_2115_829",children:(0,lr.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]});var He=require("react/jsx-runtime"),Mg={"google-drive":{name:"Google Drive",component:cc}},Wg=()=>{let{navigate:e,data:t}=_(),{recoveryOAuthFlow:r,closePrivyModal:o}=W(),[n,a]=(0,No.useState)(!1),{provider:i,action:l}=t?.recoveryOAuthStatus,[s,c]=(0,No.useState)(void 0),[u,g]=(0,No.useState)(l==="create-wallet"),f=Mg[i].name,v=Mg[i].component,b=t?.recoverWallet?.onCompleteNavigateTo,w=new qe(async()=>{try{let L=window.open();await r(i,"create-wallet",L),a(!0)}catch(L){c(L.message)}});(0,No.useEffect)(()=>{l==="create-wallet"&&w.execute()},[]),(0,No.useEffect)(()=>{if(!n)return;let L=setTimeout(()=>o({shouldCallAuthOnSuccess:!1}),Ke);return()=>clearTimeout(L)},[n]);let x=(0,No.useCallback)(async()=>{g(!0);try{let L=window.open();await r(i,"recover",L)}catch(L){c(L.message),g(!1);return}b?e(b):a(!0)},[]),T=n?"Success!":s?s.message:`Verifying connection to ${f}`,S="";return s?S=s.detail:n?S="":S="Just a few moments more",(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(k,{}),u?(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(te,{}),(0,He.jsxs)(iw,{children:[(0,He.jsx)(aw,{children:(0,He.jsxs)("div",{children:[(0,He.jsx)(Rt,{success:n,fail:!!s}),(0,He.jsx)(v,{style:{width:"38px",height:"38px"}})]})}),(0,He.jsxs)(rt,{children:[(0,He.jsx)("h3",{children:T}),(0,He.jsx)("p",{children:S})]}),s&&s?.retryable?(0,He.jsx)(ui,{onClick:()=>{bn(),c(void 0),l==="create-wallet"?w.execute():x()},disabled:!n&&!s?.retryable,children:"Retry"}):null]}),(0,He.jsx)(ne,{})]}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Oe,{title:"Confirm it's really you",icon:(0,He.jsx)(v,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to Google Drive where your account is
|
|
2338
|
+
backed up.`}),(0,He.jsx)(D,{onClick:x,children:"Confirm with Google"})]}),(0,He.jsx)(q,{protectedByPrivy:!0})]})},iw=op.default.div`
|
|
2339
|
+
display: flex;
|
|
2340
|
+
flex-direction: column;
|
|
2341
|
+
align-items: center;
|
|
2342
|
+
justify-content: center;
|
|
2343
|
+
margin-left: 27px;
|
|
2344
|
+
margin-right: 27px;
|
|
2345
|
+
gap: 24px;
|
|
2346
|
+
`,aw=op.default.div`
|
|
2347
|
+
display: flex;
|
|
2348
|
+
flex-direction: column;
|
|
2349
|
+
justify-content: center;
|
|
2350
|
+
align-items: center;
|
|
2351
|
+
width: 100%;
|
|
2352
|
+
height: 82px;
|
|
2353
|
+
|
|
2354
|
+
> div {
|
|
2355
|
+
position: relative;
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
> div > span {
|
|
2359
|
+
position: absolute;
|
|
2360
|
+
left: -41px;
|
|
2361
|
+
top: -41px;
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
> div > svg {
|
|
2365
|
+
position: absolute;
|
|
2366
|
+
left: -19px;
|
|
2367
|
+
top: -19px;
|
|
2368
|
+
}
|
|
2369
|
+
`;var Do=require("react");var Og=require("react/jsx-runtime"),Lg=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=_(),[n,a]=(0,Do.useState)(""),[i,l]=(0,Do.useState)(!1),[s,c]=(0,Do.useState)(),[u,g]=(0,Do.useState)(null),{authenticated:f}=H(),{closePrivyModal:v,isNewUserThisSession:b,initializeWalletProxy:w}=W(),{onSuccess:x,onFailure:T,callAuthOnSuccessOnClose:S}=r.createWallet,{createWallet:L}=Pl(),[I,U]=(0,Do.useState)(null),M=new qe(async()=>{try{let z=await L(s);if(!z)return;U(z),b?t("EMBEDDED_WALLET_CREATED_SCREEN"):(x(z),v({shouldCallAuthOnSuccess:S}))}catch(z){a(z.message)}});(0,Do.useEffect)(()=>{u||w(3e4).then(z=>g(z))},[u]),(0,Do.useEffect)(()=>{if(!f){t("LANDING"),T(new Error("User must be authenticated before creating a Privy wallet"));return}},[f]);let G=()=>{I&&I?.recoveryMethod!=="user-passcode"?(T(new Nt("User created a wallet but failed to set a password for it")),v({shouldCallAuthOnSuccess:!1})):I?(x(I),v({shouldCallAuthOnSuccess:S})):(T(new Nt("User wallet creation failed")),v({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let Y=async()=>{l(!0);let z=250;return M.execute().then(()=>new Promise(j=>setTimeout(j,z))).finally(()=>l(!1))};return(0,Og.jsx)(_l,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:i,buttonHideAnimations:!I&&i,error:n,password:s||"",onClose:G,onPasswordChange:c,onPasswordGenerate:()=>c(xl()),onSubmit:Y})};var Fg=y(require("@heroicons/react/24/outline/LockClosedIcon")),Ug=y(require("@heroicons/react/24/outline/PencilSquareIcon")),Bg=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),Hg=require("react");var np=y(require("styled-components")),Ng=np.default.div`
|
|
2338
2370
|
display: flex;
|
|
2339
2371
|
flex-direction: column;
|
|
2340
2372
|
gap: 12px;
|
|
2341
2373
|
padding-top: 24px;
|
|
2342
2374
|
padding-bottom: 24px;
|
|
2343
|
-
`,
|
|
2375
|
+
`,Dg=np.default.div`
|
|
2344
2376
|
padding-bottom: 24px;
|
|
2345
|
-
`;var
|
|
2377
|
+
`;var Ge=require("react/jsx-runtime"),sw=({onClose:e})=>(0,Ge.jsxs)(Dg,{children:[(0,Ge.jsx)(Oe,{title:"Why do I need to secure my account?",icon:(0,Ge.jsx)(Bg.default,{width:48}),description:(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),(0,Ge.jsx)("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),(0,Ge.jsx)(D,{onClick:e,children:"Select backup method"})]}),Gg=()=>{let{navigate:e,setModalData:t}=_(),{user:r}=H(),{embeddedWallets:o}=Yo(),a=We(r)===null,[i,l]=(0,Hg.useState)(!1);return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(k,{backFn:i?()=>l(!1):void 0,infoFn:i?void 0:()=>l(!0)},"header"),i?(0,Ge.jsx)(sw,{onClose:()=>l(!1)}):(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(Oe,{title:"Secure your account",icon:(0,Ge.jsx)(Fg.default,{width:48}),description:"Select a method for logging in on new devices and recovering your account."}),(0,Ge.jsx)(Ng,{children:o.userOwnedRecoveryOptions.map(s=>{switch(s){case"google-drive":return(0,Ge.jsxs)(ze,{onClick:async()=>{t({recoveryOAuthStatus:{provider:"google-drive",action:a?"create-wallet":"set-recovery"}}),e("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")},children:[(0,Ge.jsx)(cc,{})," Back up to Google Drive"]},s);case"user-passcode":return(0,Ge.jsxs)(ze,{onClick:()=>{e(a?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:[(0,Ge.jsx)(Ug.default,{})," Set a password"]},s);default:return null}})})]}),(0,Ge.jsx)(q,{protectedByPrivy:!0})]})};var ip=require("@ethersproject/bignumber"),at=require("react"),Gn=y(require("styled-components"));function Vg(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var dc=require("@ethersproject/bignumber"),zg=y(require("styled-components"));var yo=require("react/jsx-runtime"),lw=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=dc.BigNumber.from(e.gasUsed),o=dc.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let a=dc.BigNumber.from(t);n=n.add(a)}return n.toString()}catch{return}else return},qg=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:a,l1GasEstimate:i})=>(0,yo.jsxs)(yo.Fragment,{children:[(0,yo.jsx)(k,{onClose:o}),(0,yo.jsx)(ya,{title:"Transaction complete!",description:"You're all set."}),(0,yo.jsx)(zi,{tokenPrice:n,from:t.from,to:t.to,gas:lw(t,i),txn:e,transactionInfo:r,tokenSymbol:a}),(0,yo.jsx)(cw,{loading:!1,onClick:o,children:"All Done"}),(0,yo.jsx)(ee,{})]}),cw=(0,zg.default)(D)`
|
|
2346
2378
|
&& {
|
|
2347
2379
|
margin-top: 24px;
|
|
2348
2380
|
}
|
|
2349
2381
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2350
|
-
`;var ke=require("react/jsx-runtime");var
|
|
2382
|
+
`;var ke=require("react/jsx-runtime");var dw=({txn:e,txnFamily:t,uiOptions:r,tokenSymbol:o,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(r.transactionInfo?.contractInfo)return(0,ke.jsx)(zd,{contractInfo:r.transactionInfo.contractInfo,description:r.description});if(r.senderInfo)return(0,ke.jsx)(zd,{contractInfo:r.senderInfo,description:r.description||r.senderInfo.actionText})}return(0,ke.jsx)(ke.Fragment,{children:(0,ke.jsx)(rg,{description:r.description||r.transactionInfo?.description||"",txn:e,tokenSymbol:o,tokenPrice:n})})},jg=()=>{let{authenticated:e,getAccessToken:t}=H(),{wallets:r}=Zi(),{walletProxy:o,closePrivyModal:n,getFiatOnRampConfig:a,rpcConfig:i,chains:l,nativeTokenSymbolForChainId:s,appId:c}=W(),{app:u,navigate:g,data:f,onUserCloseViaDialogOrKeybindRef:v,setModalData:b}=_(),{transactionRequest:w,onSuccess:x,onFailure:T,uiOptions:S,fundWalletConfig:L}=f.sendTransaction,[I,U]=(0,at.useState)(null),[M,G]=(0,at.useState)(null),[Y,z]=(0,at.useState)(""),[j,R]=(0,at.useState)(),[fe,B]=(0,at.useState)(!1),he=()=>{z(""),R(void 0)},ye=(Me,gt,Bo)=>{z(Me),R(new Ye(new vr(gt??Me,Bo??kt.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[se,Xe]=(0,at.useState)(!1),[le,Ar]=(0,at.useState)(!0),[dr,pr]=(0,at.useState)(null),[Pe,Kr]=(0,at.useState)(w),{tokenPrice:Yr,isTokenPriceLoading:zn}=sc(Pe),Zr=s(w.chainId)||"ETH",[Ht,st]=(0,at.useState)(null),[O,me]=(0,at.useState)(null),[V,Jr]=(0,at.useState)(!0);(0,at.useEffect)(()=>{e||(g("LANDING"),T(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let ce=(0,at.useMemo)(()=>r.find(Me=>Me.walletClientType==="privy"),[r]),Gt=async()=>{if(!ce)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:Me,externalTransactionId:gt}=await a(ce.address,{config:L?.config||{}});b({fiatOnRampPrompt:{signedUrl:Me},fiatOnRampStatus:{externalTransactionId:gt}}),g("FIAT_ON_RAMP_PROMPT_SCREEN")},go=(0,at.useMemo)(()=>Co(Pe.chainId,l,i,{appId:c}),[Pe.chainId,i]);(0,at.useEffect)(()=>{async function Me(){let gt=Pe;if(!await t()||!o||!ce)return;try{gt=await Ki(ce.address,Pe,go),Kr(gt)}catch(ur){console.error(ur),ye("There was an error preparing your transaction. Please try again.",ur.reason)}let ta=ip.BigNumber.from(0),$n=ip.BigNumber.from(0);try{({totalGasEstimate:ta,l1ExecutionFeeEstimate:$n}=await ji(gt,go)),st(ta.toHexString()),me($n.toHexString())}catch{st(null)}try{let{balance:ur,hasSufficientFunds:gc}=await ic(ce.address,gt,ta,go);pr(ur.toHexString()),gc||(Ar(!1),ye("Wallet has insufficient funds for this transaction."),u?.fiatOnRamp.enabled&&B(!0))}catch(ur){console.warn(`Failed to fetch wallet balance with error: ${ur}`)}Jr(!1)}Me()},[o]);let $a=Vg(Pe),ea=$a==="SEND"?`Send ${Zr}`:"Review transaction",Uo={modalTitle:S.header||S.modalTitle||ea,buttonText:S.buttonText||"Submit"},qn=()=>{se||(M?x(M):T(j||new Ye(new vr("The user rejected the request",kt.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return v.current=qn,Yr===void 0&&zn||V?(0,ke.jsxs)(ke.Fragment,{children:[S.transactionInfo?.contractInfo?.imgUrl&&(0,ke.jsx)(Fs,{src:S.transactionInfo?.contractInfo?.imgUrl}),(0,ke.jsx)(k,{title:Uo.modalTitle,onClose:qn}),(0,ke.jsx)($g,{children:(0,ke.jsx)(Ti,{})})]}):I!==null?(0,ke.jsx)(qg,{txn:Pe,onClose:qn,receipt:I,transactionInfo:S.transactionInfo,tokenPrice:Yr,tokenSymbol:Zr,l1GasEstimate:O}):(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)(k,{title:Uo.modalTitle,onClose:qn}),(0,ke.jsxs)($g,{children:[(0,ke.jsxs)(fw,{children:[(0,ke.jsx)(dw,{txn:Pe,txnFamily:$a,uiOptions:S,tokenSymbol:Zr,tokenPrice:Yr}),ce?(0,ke.jsx)(zi,{from:ce.address,to:Pe.to,txn:Pe,transactionInfo:S.transactionInfo,gas:Ht||void 0,tokenPrice:Yr,tokenSymbol:Zr}):null]}),(0,ke.jsxs)(hw,{children:[(0,ke.jsx)(pw,{children:Y}),(0,ke.jsx)(eg,{txn:Pe,address:ce?.address??"",hasFunds:le,balance:dr}),(0,ke.jsxs)(uw,{children:[fe&&(0,ke.jsx)(D,{onClick:Gt,children:"Add Funds"}),(0,ke.jsx)(mw,{disabled:se||!le,loading:!o||se,loadingText:se?"Submitting (may take a few moments)...":"Loading...",onClick:async()=>{Xe(!0);let Me=await t();if(Me&&!se&&ce)try{let gt=await nc(Me,ce.address,o,Pe,go);G(gt);let Bo=await gt.wait();U(ac(Bo)),he()}catch(gt){let Bo="There was an error processing your transaction. Please contact support.";console.warn({transaction:Pe,error:gt}),ye(Bo,gt.reason)}finally{Xe(!1)}},children:Uo.buttonText})]})]})]})]})},$g=Gn.default.div`
|
|
2351
2383
|
display: flex;
|
|
2352
2384
|
flex-direction: column;
|
|
2353
2385
|
justify-content: space-between;
|
|
2354
2386
|
flex-grow: 1;
|
|
2355
2387
|
padding-bottom: 16px;
|
|
2356
|
-
`,
|
|
2388
|
+
`,pw=Gn.default.div`
|
|
2357
2389
|
font-size: 13px;
|
|
2358
2390
|
color: var(--privy-color-error);
|
|
2359
2391
|
width: 100%;
|
|
2360
2392
|
margin-top: 16px;
|
|
2361
|
-
`,
|
|
2393
|
+
`,uw=Gn.default.div`
|
|
2362
2394
|
display: flex;
|
|
2363
2395
|
direction: row;
|
|
2364
2396
|
justify-content: space-between;
|
|
2365
2397
|
align-items: center;
|
|
2366
2398
|
gap: 8px;
|
|
2367
|
-
`,
|
|
2399
|
+
`,mw=(0,Gn.default)(D)`
|
|
2368
2400
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2369
|
-
`,
|
|
2401
|
+
`,fw=Gn.default.div`
|
|
2370
2402
|
height: 100%;
|
|
2371
2403
|
display: flex;
|
|
2372
2404
|
flex-direction: column;
|
|
2373
2405
|
justify-content: space-evenly;
|
|
2374
2406
|
flex-grow: 1;
|
|
2375
|
-
|
|
2407
|
+
`,hw=Gn.default.div`
|
|
2376
2408
|
display: flex;
|
|
2377
2409
|
flex-direction: column;
|
|
2378
2410
|
gap: 8px;
|
|
2379
|
-
`;var
|
|
2411
|
+
`;var Kg=require("@ethersproject/bytes"),Yg=require("@ethersproject/strings"),pn=require("react"),$r=y(require("styled-components"));var Te=require("react/jsx-runtime"),yw=e=>{if(!(0,Kg.isHexString)(e))return e;try{return(0,Yg.toUtf8String)(e)}catch{return e}},gw=e=>JSON.stringify(e,null,2),vw=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?(0,Te.jsx)(Tw,{children:Object.entries(r).map(([o,n])=>(0,Te.jsxs)("li",{children:[(0,Te.jsxs)("strong",{children:[o,":"]})," ",t(n)]},o))}):(0,Te.jsx)("span",{children:String(r)});return(0,Te.jsx)("div",{children:t(e)})},Cw=e=>{let{types:t,primaryType:r,...o}=e.typedData;return(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(Jg,{children:(0,Te.jsx)(vw,{data:o})}),(0,Te.jsx)(an,{text:gw(e.typedData),itemName:"full payload to clipboard"})," "]})},Zg=()=>{let{authenticated:e}=H(),{initializeWalletProxy:t,closePrivyModal:r}=W(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:a}=_(),[i,l]=(0,pn.useState)(!0),[s,c]=(0,pn.useState)(""),[u,g]=(0,pn.useState)(),[f,v]=(0,pn.useState)(null),b=f!==null;(0,pn.useEffect)(()=>{e||o("LANDING")},[e]),(0,pn.useEffect)(()=>{t(Yn).then(G=>{l(!1),G||(c("An error has occurred, please try again."),g(new Ye(new vr(s,kt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:w,data:x,confirmAndSign:T,onSuccess:S,onFailure:L,uiOptions:I}=n.signMessage,U={title:I.title||"Sign message",description:I.description||"Signing this message will not cost you any fees.",buttonText:I.buttonText||"Sign and continue"},M=G=>{G?S(G):L(u||new Ye(new vr("The user rejected the request.",kt.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),v(null),c(""),g(void 0)};return a.current=()=>{M(f)},(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(k,{onClose:()=>M(f)}),(0,Te.jsx)(te,{}),(0,Te.jsxs)(ww,{children:[(0,Te.jsx)(bw,{children:U.title}),(0,Te.jsx)(Ew,{children:U.description}),w==="personal_sign"&&(0,Te.jsx)(Jg,{children:yw(x)}),w==="eth_signTypedData_v4"&&(0,Te.jsx)(Cw,{typedData:x}),(0,Te.jsx)(Pw,{fail:!0,children:s}),(0,Te.jsx)(xw,{success:b,loading:i,disabled:b,onClick:async()=>{try{let G=await T();v(G),c(""),setTimeout(()=>{M(G)},Ke)}catch{c("An error has occurred, please try again."),g(new Ye(new vr(s,kt.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:b?(0,Te.jsxs)(Sw,{children:[(0,Te.jsx)(kl,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,Te.jsx)("span",{children:"Success"})]}):U.buttonText})]}),(0,Te.jsx)(ne,{}),(0,Te.jsx)(q,{protectedByPrivy:!0})]})},ww=$r.default.div`
|
|
2380
2412
|
display: flex;
|
|
2381
2413
|
flex-direction: column;
|
|
2382
2414
|
align-items: center;
|
|
2383
2415
|
justify-content: center;
|
|
2384
|
-
`,
|
|
2416
|
+
`,bw=$r.default.span`
|
|
2385
2417
|
color: var(--privy-color-foreground);
|
|
2386
2418
|
text-align: center;
|
|
2387
2419
|
font-size: 1.125rem;
|
|
2388
2420
|
font-weight: 500;
|
|
2389
2421
|
line-height: 1.25rem; /* 111.111% */
|
|
2390
2422
|
text-align: center;
|
|
2391
|
-
`,
|
|
2423
|
+
`,Ew=$r.default.span`
|
|
2392
2424
|
margin-top: 4px;
|
|
2393
2425
|
color: var(--privy-color-foreground);
|
|
2394
2426
|
text-align: center;
|
|
@@ -2398,7 +2430,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2398
2430
|
font-weight: 400;
|
|
2399
2431
|
line-height: 20px; /* 142.857% */
|
|
2400
2432
|
letter-spacing: -0.008px;
|
|
2401
|
-
`,
|
|
2433
|
+
`,Jg=$r.default.div`
|
|
2402
2434
|
margin-top: 1.5rem;
|
|
2403
2435
|
background-color: var(--privy-color-background-2);
|
|
2404
2436
|
border-radius: var(--privy-border-radius-md);
|
|
@@ -2417,7 +2449,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2417
2449
|
display: none; /* Safari and Chrome */
|
|
2418
2450
|
}
|
|
2419
2451
|
}
|
|
2420
|
-
`,
|
|
2452
|
+
`,Tw=$r.default.ul`
|
|
2421
2453
|
margin-left: 12px !important;
|
|
2422
2454
|
white-space: nowrap;
|
|
2423
2455
|
|
|
@@ -2429,7 +2461,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2429
2461
|
font-weight: 500 !important;
|
|
2430
2462
|
}
|
|
2431
2463
|
}
|
|
2432
|
-
`,
|
|
2464
|
+
`,Pw=$r.default.div`
|
|
2433
2465
|
line-height: 20px;
|
|
2434
2466
|
height: 20px;
|
|
2435
2467
|
font-size: 13px;
|
|
@@ -2439,22 +2471,22 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2439
2471
|
width: 100%;
|
|
2440
2472
|
margin-top: 16px;
|
|
2441
2473
|
margin-bottom: 4px;
|
|
2442
|
-
`,
|
|
2474
|
+
`,Sw=$r.default.span`
|
|
2443
2475
|
display: flex;
|
|
2444
2476
|
align-items: center;
|
|
2445
2477
|
gap: 8px;
|
|
2446
|
-
`,
|
|
2478
|
+
`,xw=(0,$r.default)(D)`
|
|
2447
2479
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2448
2480
|
|
|
2449
|
-
${e=>e.success
|
|
2481
|
+
${e=>e.success&&$r.css`
|
|
2450
2482
|
&&&& {
|
|
2451
2483
|
background-color: var(--privy-color-success);
|
|
2452
2484
|
color: #ffffff;
|
|
2453
2485
|
}
|
|
2454
2486
|
`}
|
|
2455
|
-
`;var
|
|
2487
|
+
`;var e2=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Qg=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Va=require("react"),ap=y(require("styled-components"));var jr=require("react/jsx-runtime"),Xg=(0,Va.forwardRef)((e,t)=>{let[r,o]=(0,Va.useState)(""),[n,a]=(0,Va.useState)(!1),{authenticated:i,user:l}=H(),{initUpdateEmail:s}=W(),{navigate:c,setModalData:u,currentScreen:g}=_(),{enabled:f,token:v}=Se(),b=cs(r),w=n,x=n||!b,T=async L=>{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,L),c("AWAITING_PASSWORDLESS_CODE")}catch(I){u({errorModalData:{error:I,previousScreen:g||"LANDING"}})}a(!1)},S=()=>{f&&!v&&!i?(u({captchaModalData:{callback:L=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,L)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):T(v)};return(0,jr.jsxs)(jr.Fragment,{children:[(0,jr.jsx)(_w,{children:(0,jr.jsxs)(kw,{children:[(0,jr.jsx)(Qg.default,{}),(0,jr.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:L=>o(L.target.value),onKeyUp:L=>{L.key==="Enter"&&S()},value:r,autoComplete:"email"}),e.stacked?null:(0,jr.jsx)(mi,{isSubmitting:w,onClick:S,disabled:x,children:"Submit"})]})}),e.stacked?(0,jr.jsx)(D,{loadingText:null,loading:w,disabled:x,onClick:S,children:"Submit"}):null]})}),_w=ap.default.div`
|
|
2456
2488
|
width: 100%;
|
|
2457
|
-
`,
|
|
2489
|
+
`,kw=ap.default.label`
|
|
2458
2490
|
display: block;
|
|
2459
2491
|
position: relative;
|
|
2460
2492
|
width: 100%;
|
|
@@ -2512,7 +2544,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2512
2544
|
&& > input::placeholder {
|
|
2513
2545
|
color: var(--privy-color-foreground-3);
|
|
2514
2546
|
}
|
|
2515
|
-
`;var cr=require("react/jsx-runtime"),
|
|
2547
|
+
`;var cr=require("react/jsx-runtime"),t2=()=>(0,cr.jsxs)(cr.Fragment,{children:[(0,cr.jsx)(k,{},"header"),(0,cr.jsx)(te,{}),(0,cr.jsx)(Oe,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,cr.jsx)(e2.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,cr.jsx)(Pr,{children:(0,cr.jsx)(Xg,{stacked:!0})}),(0,cr.jsx)(ne,{}),(0,cr.jsx)(q,{protectedByPrivy:!0})]});var pc=y(require("styled-components"));var sp=require("react/jsx-runtime"),r2=({style:e,...t})=>(0,sp.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:(0,sp.jsx)("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});var Qt=require("react/jsx-runtime"),o2=()=>{let{navigate:e}=_();return(0,Qt.jsxs)(Qt.Fragment,{children:[(0,Qt.jsx)(k,{}),(0,Qt.jsxs)(Aw,{children:[(0,Qt.jsx)(Rw,{children:(0,Qt.jsx)(r2,{})}),(0,Qt.jsxs)(Iw,{children:[(0,Qt.jsx)("h3",{children:"Unable to sign in"}),(0,Qt.jsx)("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),(0,Qt.jsx)(D,{onClick:()=>{e("LANDING")},children:"Go back"})]}),(0,Qt.jsx)(q,{protectedByPrivy:!0})]})},Aw=pc.default.div`
|
|
2516
2548
|
display: flex;
|
|
2517
2549
|
flex-direction: column;
|
|
2518
2550
|
align-items: center;
|
|
@@ -2521,7 +2553,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2521
2553
|
width: 100%;
|
|
2522
2554
|
padding-top: 8px;
|
|
2523
2555
|
padding-bottom: 32px;
|
|
2524
|
-
`,
|
|
2556
|
+
`,Rw=pc.default.div`
|
|
2525
2557
|
display: flex;
|
|
2526
2558
|
align-items: center;
|
|
2527
2559
|
justify-content: center;
|
|
@@ -2530,11 +2562,11 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2530
2562
|
color: var(--privy-color-error);
|
|
2531
2563
|
background-color: var(--privy-color-error-light);
|
|
2532
2564
|
border-radius: 50%;
|
|
2533
|
-
`,
|
|
2565
|
+
`,Iw=pc.default.div`
|
|
2534
2566
|
display: flex;
|
|
2535
2567
|
flex-direction: column;
|
|
2536
2568
|
gap: 8px;
|
|
2537
|
-
`;var
|
|
2569
|
+
`;var uc=y(require("styled-components"));var Mw=`
|
|
2538
2570
|
*,
|
|
2539
2571
|
::before,
|
|
2540
2572
|
::after {
|
|
@@ -2764,7 +2796,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2764
2796
|
[hidden] {
|
|
2765
2797
|
display: none;
|
|
2766
2798
|
}
|
|
2767
|
-
`,
|
|
2799
|
+
`,n2=Mw;var i2=uc.createGlobalStyle`
|
|
2768
2800
|
:root {
|
|
2769
2801
|
// Borders
|
|
2770
2802
|
--privy-border-radius-sm: 6px;
|
|
@@ -2797,10 +2829,10 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2797
2829
|
--privy-height-modal-full: 620px;
|
|
2798
2830
|
--privy-height-modal-compact: 480px;
|
|
2799
2831
|
};
|
|
2800
|
-
`,
|
|
2832
|
+
`,a2=uc.default.div`
|
|
2801
2833
|
// css normalize only the privy application to avoid conflicts
|
|
2802
2834
|
// with consuming application
|
|
2803
|
-
${
|
|
2835
|
+
${n2}
|
|
2804
2836
|
|
|
2805
2837
|
// Privy styles
|
|
2806
2838
|
color: var(--privy-color-foreground-2);
|
|
@@ -2859,4 +2891,4 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2859
2891
|
opacity: 1;
|
|
2860
2892
|
}
|
|
2861
2893
|
}
|
|
2862
|
-
`;var Ye=require("react/jsx-runtime"),d4={["LANDING"]:By,["CONNECT_OR_CREATE"]:Uy,["AWAITING_PASSWORDLESS_CODE"]:Bm,["AWAITING_CONNECTION"]:mf,["AWAITING_CONNECT_ONLY_CONNECTION"]:yf,["AWAITING_FARCASTER_CONNECTION"]:Bh,["AWAITING_FARCASTER_SIGNER"]:zh,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:dg,["PHANTOM_INTERSTITIAL_SCREEN"]:fg,["LOGIN_FAILED_SCREEN"]:o1,["AWAITING_OAUTH_SCREEN"]:cg,["ALLOWLIST_REJECTION_SCREEN"]:Am,["USER_LIMIT_REACHED_SCREEN"]:Dg,["INSTALL_PHANTOM_SCREEN"]:uy,["LINK_EMAIL_SCREEN"]:Gy,["LINK_PHONE_SCREEN"]:e1,["LINK_WALLET_SCREEN"]:t1,["LINK_PASSKEY_SCREEN"]:Jy,["UPDATE_EMAIL_SCREEN"]:Og,["CONNECT_ONLY_LANDING_SCREEN"]:df,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:of,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:hh,["EMBEDDED_WALLET_CREATED_SCREEN"]:Sf,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Ef,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:Eh,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:Eg,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Rf,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:Rg,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:kg,["FIAT_ON_RAMP_PROMPT_SCREEN"]:Xh,["FIAT_ON_RAMP_STATUS_SCREEN"]:ny,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:wh,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:yh,["MFA_ENROLLMENT_FLOW_SCREEN"]:w1,["CAPTCHA_SCREEN"]:Km,["ERROR_SCREEN"]:Sh,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:sy,["AFFIRMATIVE_CONSENT_SCREEN"]:xm},p4=["LANDING","AWAITING_CONNECTION"],u4=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=V(),{headless:n}=W(),{ready:a,currentScreen:i}=A(),{status:l,execute:s,reset:c,enabled:u}=Pe(),g=(0,No.useRef)(null),f=mm(g),C=o&&i&&p4.includes(i)&&!n&&l==="ready";if((0,No.useEffect)(()=>{C&&s()},[C]),(0,No.useEffect)(()=>{!o&&u&&c()},[o,u]),(!r||!a)&&i!=="AWAITING_OAUTH_SCREEN")return(0,Ye.jsxs)(Wi,{id:"privy-modal-content",children:[(0,Ye.jsx)(x,{}),(0,Ye.jsx)(oe,{}),(0,Ye.jsx)(i1,{children:(0,Ye.jsx)(Vt,{})}),(0,Ye.jsx)(le,{}),(0,Ye.jsx)(ee,{})]});if(!i&&e)return(0,Ye.jsx)(Wi,{style:{height:f},id:"privy-modal-conent",children:(0,Ye.jsx)("div",{ref:g,children:(0,Ye.jsx)(qd,{open:e,onClose:t})})});if(!i)return null;let E=d4[i];return(0,Ye.jsx)(Wi,{style:{height:f},id:"privy-modal-content",children:(0,Ye.jsxs)("div",{ref:g,children:[(0,Ye.jsx)(So,{if:!!e,children:(0,Ye.jsx)(E,{})}),(0,Ye.jsx)(So,{if:!e,children:(0,Ye.jsx)(qd,{open:e,onClose:t})})]})})},m4=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=A();return{gracefulClosePrivyModal:(0,No.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Gg=({open:e})=>{let{app:t}=A(),{gracefulClosePrivyModal:r}=m4(),[o,n]=(0,No.useState)(!1);el({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let a=(0,Ye.jsx)(Bg,{children:(0,Ye.jsx)(u4,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})}),i=e||o,l=t?.render.inDialog?(0,Ye.jsx)(n1,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:a}):a;if(typeof window<"u"&&t?.render.inParentNodeId){let s=document.getElementById(t.render.inParentNodeId);if(s)return Hg.default.createPortal(l,s)}return l};var Vg=require("react"),$i=require("react");var oc=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:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery-password":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:submit-cast":return o;case"privy:farcaster:remove-cast":return o;case"privy:farcaster:react-to-cast":return o;case"privy:farcaster:submit-link":return o;case"privy:farcaster:remove-link":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function Dn(e,t,r,o,n,a=!1){let i=a,l=async u=>{if(i&&t&&t.length>0){u===(a?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Le("missing_or_invalid_mfa","MFA verification failed, retry."));let g=await new Promise((f,C)=>{r.current={resolve:f,reject:C};let E=1e3*60*5;setTimeout(()=>{let w=new Le("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(w),C(w)},E)});return await e(g)}return await e()},s=4,c=null;for(let u=0;u<s;u++)try{c=await l(u),o.current?.resolve(void 0);break}catch(g){if(g.type==="missing_or_invalid_mfa")i=!0;else throw o.current?.resolve(void 0),g}if(c===null){let u=new Le("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}var qg=require("react/jsx-runtime"),f4=function(e){return()=>`id-${e++}`}(0);function h4(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function bt(e){return e.error!==void 0}var ft=new oc,Jd=new Map,y4=(e,t)=>typeof t=="bigint"?t.toString():t,g4=(e,t)=>`${e}${JSON.stringify(t,y4)}`;function Et(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let a=g4(e,t);if(e==="privy:wallet:create"){let l=Jd.get(a);if(l)return l}let i=new Promise((l,s)=>{let c=f4();ft.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{Jd.delete(a)});return Jd.set(a,i),i}function v4(e){switch(e.event){case"privy:iframe:ready":let t=ft.dequeue(e.event,e.id);return bt(e)?t.reject(new Le(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=ft.dequeue(e.event,e.id);return bt(e)?r.reject(new Le(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:connect":let o=ft.dequeue(e.event,e.id);return bt(e)?o.reject(new Le(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:recover":let n=ft.dequeue(e.event,e.id);return bt(e)?n.reject(new Le(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let a=ft.dequeue(e.event,e.id);return bt(e)?a.reject(new Le(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery-password":let i=ft.dequeue(e.event,e.id);return bt(e)?i.reject(new Le(e.error.type,e.error.message)):i.resolve(e.data);case"privy:mfa:verify":let l=ft.dequeue(e.event,e.id);return bt(e)?l.reject(new Le(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:clear":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:init-signer":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:submit-cast":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:remove-cast":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:react-to-cast":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:submit-link":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:remove-link":{let s=ft.dequeue(e.event,e.id);return bt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function zg(e){let t=(0,$i.useRef)(null),r=(0,$i.useRef)(e.mfaMethods),o=ym(),[n,a]=(0,Vg.useState)(!1);return(0,$i.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,$i.useEffect)(()=>{if(!n)return;let i=t.current;if(!i)return;function l(f){f&&f.origin===e.origin&&h4(f.data)&&v4(f.data)}let s={create(f){return Et("privy:wallet:create",f,i,e.origin)},connect(f){return Et("privy:wallet:connect",f,i,e.origin)},recover(f){return Dn(C=>Et("privy:wallet:recover",{...f,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(f){return Dn(C=>Et("privy:wallet:rpc",{...f,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(f){return Dn(C=>Et("privy:wallet:set-recovery-password",{...f,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return Dn(C=>Et("privy:mfa:verify",{...f,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return Dn(C=>Et("privy:mfa:init-enrollment",{...f,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return Et("privy:mfa:submit-enrollment",f,i,e.origin)},unenrollMfa(f){return Dn(C=>Et("privy:mfa:unenroll",{...f,...C},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(f){return Et("privy:mfa:clear",f,i,e.origin)},initFarcasterSigner(f){return Et("privy:farcaster:init-signer",f,i,e.origin)},submitCast(f){return Et("privy:farcaster:submit-cast",f,i,e.origin)},removeCast(f){return Et("privy:farcaster:remove-cast",f,i,e.origin)},reactToCast(f){return Et("privy:farcaster:react-to-cast",f,i,e.origin)},submitLink(f){return Et("privy:farcaster:submit-link",f,i,e.origin)},removeLink(f){return Et("privy:farcaster:remove-link",f,i,e.origin)}};window.addEventListener("message",l);let c=()=>e.onLoad(s),u=(...f)=>{console.warn("Privy iframe failed to load: ",...f),e.onLoadFailed()},g=new AbortController;return ou(()=>Et("privy:iframe:ready",{},i,e.origin),{abortSignal:g.signal}).then(c,u),()=>{window.removeEventListener("message",l),g.abort()}},[n]),(0,qg.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>a(!0),src:ns(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function nc(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(o=>t.includes(o))}var ic=class{constructor(t,r){this.meta={action:t,phoneNumber:r}}async init(){if(!this.meta.action)throw new P("action required");if(!this.api)throw new P("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new P("phone number must be set when initialzing authentication.");try{await this.api.post(Dp,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw ye(t)}}async authenticate(){if(!this.meta.action)throw new P("action required");if(!this.api)throw new P("Mfa flow has no API instance");if(!this.meta.smsCode)throw new P("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new P("phone number must be set prior to calling authenticate.");try{let t=await this.api.post(Fp,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return Ht(t)}catch(t){throw ye(t)}}};var Qt=require("react/jsx-runtime"),ji;function C4(e){return typeof e=="string"&&e.length===25}function _e(){if(!ji){let e=X.get(cn);return Promise.resolve(e||null)}return ji.getAccessToken()}var jg,wu=(e,t)=>jg(e,t),Kg,bu=(e,t)=>Kg(e,t),Yg,Eu=(e,t)=>Yg(e,t),Zg,Tu=()=>Zg(),w4=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(Zi,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},Jg=({config:e,...t})=>{if(!C4(t.appId))throw new P("Cannot initialize the Privy provider with an invalid Privy app ID");ji||(ji=new ii({appId:t.appId,apiUrl:t.apiUrl||Qa}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,Qt.jsx)(Ju,{client:ji,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,Qt.jsx)(b4,{...t,config:r,client:ji})})},b4=e=>{let t=e.client,[r,o]=(0,te.useState)(!1),[n,a]=(0,te.useState)(!1),[i,l]=(0,te.useState)(!1),[s,c]=(0,te.useState)(null),[u,g]=(0,te.useState)([]),f=(0,te.useRef)(u),[C,E]=(0,te.useState)(!1),[w,k]=(0,te.useState)(null),[T,S]=(0,te.useState)(!1),[L,M]=(0,te.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:b}),[F,I]=(0,te.useState)({status:"initial"}),[H,Y]=(0,te.useState)(null),[q,$]=(0,te.useState)(null),[R,ce]=(0,te.useState)(null),U=Vs(),ue=zs(),[ie,re]=(0,te.useState)(!0),[qe,se]=(0,te.useState)({}),[jr,It]=(0,te.useState)(null),[ot,Ce]=(0,te.useState)(null),[dr,Kr]=(0,te.useState)(!1),[Fn,Yr]=(0,te.useState)(!1),Ft=(0,te.useRef)(null),nt=(0,te.useRef)(null),O=(0,te.useRef)(fm);t.onStoreToken=d=>{d&&N(O,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),N(O,"accessToken","onAccessTokenRemoved")};let me=(0,te.useRef)(null),G=(0,te.useRef)(null),Zr=(0,te.useCallback)(d=>{let p=t.connectors?.walletsReady||!1;return i&&s?.linkedAccounts?.some(v=>v.type==="wallet"&&v.walletClientType==="privy")?p&&d?.some(v=>v?.walletClientType==="privy"):p},[i,s?.linkedAccounts,t?.connectors?.walletsReady]),de=d=>{k(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},Ut=d=>{U.embeddedWallets.createOnLogin!=="off"&&re(!0),de(d)};(0,te.useEffect)(()=>{let d=()=>{document.visibilityState==="hidden"&&t.createAnalyticsEvent({eventName:"page_hidden",options:{keepAlive:!0}})};return document.addEventListener("visibilitychange",d),()=>{document.removeEventListener("visibilitychange",d)}},[]),(0,te.useEffect)(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=s.linkedAccounts.find(p=>p.type==="wallet"&&p.walletClientType==="privy");if(!d){t.connectors?.removeEmbeddedWalletConnector();return}if(!t.connectors){console.warn("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!R){console.warn("Failed to add embedded wallet connector: Wallet proxy not initialized");return}t.connectors.addEmbeddedWalletConnector(R,d.address,U.defaultChain,e.appId)},[R,s]),(0,te.useEffect)(()=>{R&&ot?.(R)},[R]),(0,te.useEffect)(()=>{(async()=>{if(!U.customAuth?.enabled)return;re(!0);let{getCustomAccessToken:p,isLoading:m}=U.customAuth;if(!(!n||m))try{let v=await p();if(!v&&i){await Hn.logout();return}if(!v||i)return;t.startAuthFlow(new Gn(v));let{user:_,isNewUser:B}=await t.authenticate();if(!_){await Hn.logout();return}c(_||null),E(B||!1),l(!0),Yr(!0)}catch(v){console.warn(v),i&&await Hn.logout()}})()},[U.customAuth?.enabled,U.customAuth?.getCustomAccessToken,U.customAuth?.isLoading,n,i]),(0,te.useEffect)(()=>{Fn&&R&&s&&fr(s,e.config?.embeddedWallets?.createOnLogin)&&(Yr(!1),ep(s,zn).catch(console.error))},[Fn&&R&&s]),(0,te.useEffect)(()=>{async function d(){let p=yo();w4();let m=(0,$g.createStore)();Y(m),t.initializeConnectorManager({walletConnectCloudProjectId:U.walletConnectCloudProjectId,rpcConfig:U.rpcConfig,chains:U.chains,defaultChain:U.defaultChain,store:m,walletList:U.appearance.walletList,shouldEnforceDefaultChainOnConnect:U.shouldEnforceDefaultChainOnConnect,appName:U.name??"Privy"}),t.connectors?.initialize().then(()=>{Un()});let v=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!v),v&&N(O,"login","onComplete",v,!1,!0,null),c(v)),p||fe.setReadyToTrue(!!v),p&&(v?G.current="link":G.current="login")}!n&&ue&&d()},[t,jr,n,ue]);let yo=()=>{let d=oa();return!d.inProgress||d.headless?!1:(t.startAuthFlow(new Qr(d)),Ut("AWAITING_OAUTH_SCREEN"),!0)},Ba=async(d,p,m,v)=>{let _=await t.connectors?.createWalletConnector(d,p)||null;Ki(_,p,m,v)};async function Ki(d,p,m,v){if(d)M({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:b});else return M({status:"disconnected",connectedWallet:null,connectError:new ne("Unable to connect to wallet."),connector:null,connectRetry:b}),v?.(null,m);d instanceof to&&p&&await d.resetConnection(p),M({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Ki(d,p,m,v)});try{let _=await d.connect({showPrompt:!0});if(U.shouldEnforceDefaultChainOnConnect&&!U.chains.find(B=>B.id===Number(_?.chainId))&&!(_?.connectorType==="wallet_connect_v2"&&_?.walletClientType==="metamask")){M(B=>({...B,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:b}));try{await _?.switchChain(U.defaultChain.id),_&&(_.chainId=qn(fn(U.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${U.defaultChain.id}`)}}return M(B=>({...B,status:"connected",connectedWallet:_,connectError:null,connectRetry:b})),_&&!G.current&&N(O,"connectWallet","onSuccess",_),v?.(_,m)}catch(_){return _ instanceof Ze?(console.warn(_.cause?_.cause:_.message),G.current||N(O,"connectWallet","onError",_.privyErrorCode||"generic_connect_wallet_error")):(console.warn(_),G.current||N(O,"connectWallet","onError","unknown_connect_wallet_error")),M(B=>({...B,status:"disconnected",connectedWallet:null,connectError:_})),v?.(null,m)}}let Do=async(d,p)=>{if(d===null)return;let m=new gn(d,p);t.startAuthFlow(m)},Un=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),m=d.get("privy_wallet_client");if(!p||!m)return;if(m==="phantom"&&!Ho()&&Ut("LOGIN_FAILED_SCREEN"),!t.connectors)throw new P("Connector not initialized");de("AWAITING_CONNECTION");let v=new URL(window.location.href);v.searchParams.delete("privy_connector"),v.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",v),Ba(p,m,void 0,Do)};(0,te.useEffect)(()=>{n&&i&&s===null&&t.getAuthenticatedUser().then(c)},[n,i,s,t]);let Me=()=>{if(!i)throw N(O,"linkAccount","onError","must_be_authenticated"),new P("User must be authenticated before linking an account.")},ht=()=>{Me(),me.current="siwe",G.current="link",de("LINK_WALLET_SCREEN")},Fo=d=>{if(!i||!s)return!1;if(d.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},Yi=async d=>{if(!t.connectors)throw new P("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(M(m=>({...m,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:b})),U.captchaEnabled&&!i){let m={callback:v=>Do(d,v),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};se({captchaModalData:m}),Ut("CAPTCHA_SCREEN")}else await Do(d),Ut("AWAITING_CONNECTION")},Bn=async(d,p)=>{if(!U.fiatOnRamp.enabled)throw new P("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:m,externalTransactionId:v}=await Jh(t,d,p?.config??{},U.appearance.palette,U.fiatOnRamp.useSandbox);return{signedUrl:m,externalTransactionId:v}}else throw new P("Unsupported fund provider. Currently supported option is `moonpay`.")},pr=()=>{g(d=>{let p=t.connectors?.wallets.map(m=>({...m,linked:Fo(m),loginOrLink:async()=>{if(!await m.isConnected())throw new P("Wallet is not connected");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new P("Cannot link or login with embedded wallet");Yi(m)},fund:async v=>{let{signedUrl:_,externalTransactionId:B}=await Bn(m.address,v);se({fiatOnRampPrompt:{signedUrl:_},fiatOnRampStatus:{externalTransactionId:B}}),de("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!i)throw new P("User is not authenticated.");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new P("Cannot unlink an embedded wallet");let v=await t.unlinkWallet(m.address);c(v)}}))||[];return Kr(Zr(p)),Es(d,p)?d:p})};(0,te.useEffect)(()=>{pr()},[s?.linkedAccounts,i,n]),(0,te.useEffect)(()=>{if(n){if(!t.connectors)throw new P("Connector not initialized");pr(),t.connectors.on("walletsUpdated",pr)}},[n]);let sc=()=>{de(i?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,te.useEffect)(()=>{if(!u[0])return;let d=u[0],p=f.current.find(v=>v.address===d.address),m;if(d.walletClientType==="privy"?m=s?.linkedAccounts.find(v=>v.type==="wallet"&&v.address===d.address&&v.walletClientType==="privy"):m=s?.linkedAccounts.find(v=>v.type==="wallet"&&v.address===d.address&&v.walletClientType!=="privy"),!p&&m){let v=Object.assign({},s);v.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType},c(v)}f.current=u},[u]);let ep=async(d,p)=>{if(Ge(d))throw N(O,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[v,_]=await Promise.all([fe.initializeWalletProxy(p),_e()]);if(!v&&e.config?.customAuth?.enabled)throw N(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!v||!_||U.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((B,he)=>{re(!0),se({createWallet:{onSuccess:Bt=>{N(O,"createWallet","onSuccess",Bt),B(Bt)},onFailure:Bt=>{N(O,"createWallet","onError","unknown_embedded_wallet_error"),he(Bt)},callAuthOnSuccessOnClose:!1}}),de("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await v.create({accessToken:_});let B=await fe.refreshUser(),he=Ge(B);if(!he)throw N(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return N(O,"createWallet","onSuccess",he),he}},x2=d=>{if(!U.chains.map(p=>p.id).includes(d))throw new ne(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},tp=(d,p,m)=>new Promise(async(v,_)=>{if(!i||!s){N(O,"sendTransaction","onError","must_be_authenticated"),_(new Error("User must be authenticated before signing with a Privy wallet"));return}let B=Ge(s);if(!B){N(O,"sendTransaction","onError","embedded_wallet_not_found"),_(new Error("Must have a Privy wallet before signing"));return}re(!0);let he=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,Mt=d.chainId?Number(d.chainId):he.chainId;x2(Mt);let Bt=Object.assign({},d,{chainId:Mt}),go=async()=>{let Wt=await _e();if(!Wt||!R){N(O,"sendTransaction","onError","embedded_wallet_not_found"),_(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await fe.recoverEmbeddedWallet()){N(O,"sendTransaction","onError","unknown_connect_wallet_error"),_(new Error("Unable to connect to wallet"));return}let xr=Co(Bt.chainId,U.chains,U.rpcConfig,{appId:e.appId}),lc=await Hi(B.address,Bt,xr);if(U.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:_2}=await Bi(lc,xr),{hasSufficientFunds:A2}=await Zl(B.address,lc,_2,xr);if(!A2)throw new $e(new hr("Wallet has insufficient funds for this transaction.",St.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let np=await Yl(Wt,B.address,R,lc,xr);N(O,"sendTransaction","onSuccess",np),v(np)}catch(Sr){N(O,"sendTransaction","onError","transaction_failure"),_(Sr)}};if(U.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),go();else{let Wt={transactionRequest:Bt,onSuccess:xr=>{N(O,"sendTransaction","onSuccess",xr),v(xr)},onFailure:xr=>{N(O,"sendTransaction","onError","transaction_failure"),_(xr)},uiOptions:p||{},fundWalletConfig:m},Sr={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:xr=>{N(O,"sendTransaction","onError","unknown_connect_wallet_error"),_(xr)}};se({connectWallet:Sr,sendTransaction:Wt}),de("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function rp(){return new Promise(async(d,p)=>{let m=await _e();if(!m||!R)throw new Error("Must have valid access token to enroll in MFA");try{await R.verifyMfa({accessToken:m}),d()}catch(v){p(v)}})}let ur=d=>{if(d==="passkey"){if(s&&s.linkedAccounts.filter(p=>p.type==="passkey").length>=5)throw N(O,"linkAccount","onError","cannot_link_more_of_type"),new P(`User already has an account of type ${d} linked.`)}else if(s?.[d])throw N(O,"linkAccount","onError","cannot_link_more_of_type"),new P(`User already has an account of type ${d} linked.`)},Hn={ready:n,authenticated:i,user:s,walletConnectors:t.connectors||null,connectWallet:sc,linkWallet:ht,linkEmail:()=>{Me(),ur("email"),me.current="email",G.current="link",de("LINK_EMAIL_SCREEN")},linkPhone:()=>{Me(),ur("phone"),me.current="sms",G.current="link",de("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Me(),ur("google"),G.current="link",await fe.initLoginWithOAuth("google")},linkTwitter:async()=>{Me(),ur("twitter"),G.current="link",await fe.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Me(),ur("discord"),G.current="link",await fe.initLoginWithOAuth("discord")},linkGithub:async()=>{Me(),ur("github"),G.current="link",await fe.initLoginWithOAuth("github")},linkSpotify:async()=>{Me(),ur("spotify"),G.current="link",await fe.initLoginWithOAuth("spotify")},linkTiktok:async()=>{Me(),ur("tiktok"),G.current="link",await fe.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Me(),ur("linkedin"),G.current="link",await fe.initLoginWithOAuth("linkedin")},linkApple:async()=>{Me(),ur("apple"),G.current="link",await fe.initLoginWithOAuth("apple")},linkPasskey:async()=>{Me(),ur("passkey"),await fe.initLinkWithPasskey(),de("LINK_PASSKEY_SCREEN")},linkFarcaster:async()=>{Me(),ur("farcaster"),await fe.initLoginWithFarcaster(),G.current="link",me.current="farcaster",de("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Me(),!s?.email)throw new P("User does not have an email linked to their account.");G.current="link",me.current="email",de("UPDATE_EMAIL_SCREEN")},login:async()=>{let d="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let p=await new Promise(m=>{It(v=>m.bind(v))});if(It(null),p){console.warn(d);return}}if(i){console.warn(d);return}G.current="login",Ut("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{It(()=>d)}),It(null)),i){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(u[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}Ut("CONNECT_OR_CREATE")},logout:async()=>{if(await t.logout(),s&&R)try{await R.clearMfa({userId:s.id})}catch{}c(null),l(!1),k(null),N(O,"logout","onSuccess"),G.current=null,me.current=null,o(!1),X.del(Ji)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Ue;let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(v=>v.address===d?.address));return!d||!p?new Ue:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new ac.Web3Provider(new Rr(new Ue));let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(v=>v.address===d?.address));return!d||!p?new ac.Web3Provider(new Rr(new Ue)):new ac.Web3Provider(new Rr(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new qo(new Ue);let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(v=>v.address===d?.address));return!d||!p?new qo(new Ue):new qo(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},setActiveWallet:async d=>{let p=u.find(v=>(0,Fa.getAddress)(v.address)===(0,Fa.getAddress)(d)),m=s?.linkedAccounts.find(v=>v.type==="wallet"&&(0,Fa.getAddress)(v.address)===(0,Fa.getAddress)(d));if(!p||!await p.isConnected())$(d),ht();else if(!p.linked)p.loginOrLink();else{let v=Object.assign({},s);v.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType},c(v)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!i||!s)throw N(O,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return ep(s,15e3)},setWalletPassword:async()=>{if(!i||!s)throw N(O,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=Ge(s);if(!d||!R)throw N(O,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw N(O,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await rp()}catch(p){throw N(O,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,m)=>{re(!0);let v={onSuccess:B=>{N(O,"setWalletPassword","onSuccess",B),p(B)},onFailure:B=>{N(O,"setWalletPassword","onError","user_exited_set_password_flow"),m(B)},callAuthOnSuccessOnClose:!1},_={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:B=>{N(O,"setWalletPassword","onError","unknown_connect_wallet_error"),m(B)}};se({setWalletPassword:v,connectWallet:_}),de("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(m,v)=>{if(!i||!s){N(O,"signMessage","onError","must_be_authenticated"),v(new Error("User must be authenticated before signing with a Privy wallet"));return}let _=Ge(s);if(!_){N(O,"signMessage","onError","embedded_wallet_not_found"),v(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){N(O,"signMessage","onError","invalid_message"),v(new Error("Message must be a non-empty string"));return}re(!0);let B=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let he=await _e();if(!R||!he)throw new Error("Unable to connect to wallet");if(!await fe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:_.address}});let{response:Bt}=await R.rpc({accessToken:he,address:_.address,request:{method:"personal_sign",params:[d,_.address]}}),go=Bt.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:_.address}}),go};if(U.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let he=await B();N(O,"signMessage","onSuccess",he),m(he)}catch(he){N(O,"signMessage","onError","unable_to_sign"),v(he??new $e("Unable to sign message"))}}else{let Bt={method:"personal_sign",data:d,confirmAndSign:B,onSuccess:Wt=>{N(O,"signMessage","onSuccess",Wt),m(Wt)},onFailure:Wt=>{N(O,"signMessage","onError","unable_to_sign"),v(Wt)},uiOptions:p||{}},go={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Wt=>{N(O,"signMessage","onError","unknown_connect_wallet_error"),v(Wt)}};se({signMessage:Bt,connectWallet:go}),de("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(m,v)=>{if(!i||!s){N(O,"signTypedData","onError","must_be_authenticated"),v(new Error("User must be authenticated before signing with a Privy wallet"));return}let _=Ge(s);if(!_){N(O,"signTypedData","onError","embedded_wallet_not_found"),v(new Error("Must have a Privy wallet before signing"));return}re(!0);let B=as(d),he=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let Mt=await _e();if(!R||!Mt)throw new Error("Unable to connect to wallet");if(!await fe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:_.address}});let{response:go}=await R.rpc({accessToken:Mt,address:_.address,request:{method:"eth_signTypedData_v4",params:[_.address,B]}}),Wt=go.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:_.address}}),Wt};if(U.embeddedWallets.noPromptOnSignature||(U.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Mt=await he();N(O,"signTypedData","onSuccess",Mt),m(Mt)}catch(Mt){N(O,"signTypedData","onError","unable_to_sign"),v(Mt??new $e("Unable to sign message"))}}else{let go={method:"eth_signTypedData_v4",data:B,confirmAndSign:he,onSuccess:Sr=>{N(O,"signTypedData","onSuccess",Sr),m(Sr)},onFailure:Sr=>{N(O,"signTypedData","onError","unable_to_sign"),v(Sr)},uiOptions:p||{}},Wt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Sr=>{N(O,"signMessage","onError","unknown_connect_wallet_error"),v(Sr)}};se({signMessage:go,connectWallet:Wt}),de("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,m)=>{let _=await(await tp(d,p,m)).wait();return Jl(_)},exportWallet:()=>new Promise(async(d,p)=>{if(!i||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let m=Ge(s);if(!m){p(new Error("Must have a Privy wallet before exporting"));return}re(!0);let v={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},_=await _e();if(!_||!R){p(new Error("Must have valid access token to enroll in MFA"));return}if(!R){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await R.connect({accessToken:_,address:m.address}),await R.verifyMfa({accessToken:_})}catch(he){if(Tn(he))await fe.recoverEmbeddedWallet();else throw he}}catch(he){p(he);return}let B={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};se({keyExport:B,connectWallet:v}),de("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:rp,async init(d){let p;switch(d){case"sms":p=new ic("verify");break;case"totp":return;default:throw new Error(`Unsupported MFA method: ${d}`)}t.startMfaFlow(p),await p.init()},async submit(d,p){switch(d){case"totp":case"sms":Ft.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((m,v)=>{nt.current={resolve:m,reject:v}});break;default:throw Ft.current?.reject(new P("Unsupported MFA method")),new P(`Unsupported MFA method: ${d}`)}},cancel(){Ft.current?.reject(new P("MFA canceled"))},async initEnrollmentWithSms(d){let p=await _e();if(!p||!R)throw new Error("Must have valid access token to enroll in MFA");await R.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,m)=>{if(!d){fe.closePrivyModal(),p();return}U.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."),se({mfaEnrollmentFlow:{mfaMethods:U.mfa.methods,onSuccess:p,onFailure:m}}),de("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await _e();if(!d||!R)throw new Error("Must have valid access token to enroll in MFA");let p=await R.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await _e();if(!p||!R)throw new Error("Must have valid access token to enroll in MFA");await R.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async submitEnrollmentWithTotp(d){let p=await _e();if(!p||!R)throw new Error("Must have valid access token to enroll in MFA");await R.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async unenroll(d){let p=await _e();if(!p||!R)throw new Error("Must have valid access token to remove MFA");await R.unenrollMfa({method:d,accessToken:p});let m=await t.getAuthenticatedUser();c(m)},requestFarcasterSigner:async()=>{let d=await _e(),p=s?.linkedAccounts.find(_=>_.type==="wallet"&&_.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!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 fe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");let v=await R.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null});if(v.status==="approved"){let _=await t.getAuthenticatedUser();c(_||s||null)}se({farcasterSigner:v}),de("AWAITING_FARCASTER_SIGNER")},submitCast:async d=>{let p=await _e(),m=s?.linkedAccounts.find(B=>B.type==="wallet"&&B.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await fe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.submitCast({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:d,fid:BigInt(s.farcaster.fid)})).response.hash}},removeCast:async({castHash:d})=>{let p=await _e(),m=s?.linkedAccounts.find(B=>B.type==="wallet"&&B.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await fe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.removeCast({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:d,fid:BigInt(s.farcaster.fid)})).response.hash}},likeCast:async({castHash:d,castAuthorFid:p})=>{let m=await _e(),v=s?.linkedAccounts.find(he=>he.type==="wallet"&&he.walletClientType==="privy");if(!m)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!v)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await fe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.reactToCast({address:v.address,hdWalletIndex:null,accessToken:m,mfaCode:null,mfaMethod:null,payload:{type:1,castId:{hash:d,fid:p}},fid:BigInt(s.farcaster.fid)})).response.hash}},recastCast:async({castHash:d,castAuthorFid:p})=>{let m=await _e(),v=s?.linkedAccounts.find(he=>he.type==="wallet"&&he.walletClientType==="privy");if(!m)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!v)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await fe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.reactToCast({address:v.address,hdWalletIndex:null,accessToken:m,mfaCode:null,mfaMethod:null,payload:{type:2,castId:{hash:d,fid:p}},fid:BigInt(s.farcaster.fid)})).response.hash}},followUser:async({fid:d})=>{let p=await _e(),m=s?.linkedAccounts.find(B=>B.type==="wallet"&&B.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await fe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.submitLink({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{type:"follow",targetFid:d},fid:BigInt(s.farcaster.fid)})).response.hash}},unfollowUser:async({fid:d})=>{let p=await _e(),m=s?.linkedAccounts.find(B=>B.type==="wallet"&&B.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await fe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.removeLink({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{type:"follow",targetFid:d},fid:BigInt(s.farcaster.fid)})).response.hash}},isHeadlessOAuthLoading:T,loginWithCode(d){return fe.loginWithCode(d)},initLoginWithEmail(d){return fe.initLoginWithEmail(d)},initLoginWithSms(d){return fe.initLoginWithSms(d)},otpState:F,fundWallet(d,p){return fe.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return fe.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return fe.loginWithHeadlessOAuth(d)},isModalOpen:r};jg=Hn.signMessage,Kg=Hn.signTypedData,Yg=async(...d)=>{let p=await tp(...d);return U.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let op=!!e.config?.headless,fe=(()=>({headless:op,isNewUserThisSession:C,linkingHint:q,pendingTransaction:null,walletConnectionStatus:L,mipdStore:H,connectors:t.connectors?.walletConnectors??[],rpcConfig:U.rpcConfig,chains:U.chains,appId:e.appId,showFiatPrices:U.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>U.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(R)return R;let p=new Promise(_=>{Ce(()=>B=>_(B))}),m=new Promise(_=>setTimeout(()=>_(null),d)),v=await Promise.race([p,m]);return Ce(null),v},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&i&&s;G.current==="login"?d.shouldCallAuthOnSuccess&&p?(N(O,"login","onComplete",s,C,!1,me.current??null),e.onSuccess?.(s,C)):N(O,"login","onError","exited_auth_flow"):G.current==="link"&&me.current&&(d.isSuccess&&p?N(O,"linkAccount","onSuccess",s,me.current):N(O,"linkAccount","onError","exited_link_flow")),$(null),G.current=null,me.current=null,E(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:de,connectWallet:Ki,initLoginWithWallet:async(d,p)=>{me.current="siwe",Do(d,p)},loginWithWallet:async()=>{if(!n)throw new Uo;if(!(t.authFlow instanceof gn))throw new P("Must initialize SIWE flow first.");let d,p;if(i)try{d=await t.link(),me.current="siwe"}catch(m){throw N(O,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),me.current="siwe"}catch(m){throw N(O,"login","onError",m.privyErrorCode||"generic_connect_wallet_error"),m}c(d||s||null),E(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new Qi(d);t.startAuthFlow(p);try{me.current="farcaster",await p.initializeFarcasterConnect()}catch(m){throw G.current==="login"?N(O,"login","onError",m.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(O,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},loginWithFarcaster:async()=>{if(!n)throw new Uo;if(!(t.authFlow instanceof Qi))throw new P("Must initialize Farcaster flow first.");let d,p;if(i)try{d=await t.link(),me.current="farcaster"}catch(m){throw N(O,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),me.current="farcaster"}catch(m){throw N(O,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d||null),E(p||!1),l(!0)},async initLoginWithOAuth(d,p){if(me.current=d,uc()){if(d==="google"&&nc(window.navigator.userAgent)){Ut("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Ut("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}X.del(pn);let m=new Qr({provider:d});p&&m.addCaptchaToken(p),t.startAuthFlow(m);let v=await t.authFlow.getAuthorizationUrl();v&&v.url&&window.location.assign(v.url)},async loginWithOAuth(d){if(!(t.authFlow instanceof Qr))throw new P("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(dn),m=t.authFlow.meta.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:m??""}}),new P("Unexpected auth flow. This may be a phishing attempt.");let v,_;if(i)try{v=await t.link(),me.current=d}catch(B){throw N(O,"linkAccount","onError",B.privyErrorCode||"failed_to_link_account"),B}else try{({user:v,isNewUser:_}=await t.authenticate()),me.current=d}catch(B){throw G.current==="login"?N(O,"login","onError",B.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(O,"linkAccount","onError",B.privyErrorCode||"failed_to_link_account"),B}c(v),E(_||!1),l(!0)},async initLoginWithPasskey(d){let p=new yn(d);t.startAuthFlow(p),G.current="login";try{me.current="passkey",await p.initAuthenticationFlow()}catch(m){throw N(O,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}},async loginWithPasskey(){if(!n)throw new Uo;if(!(t.authFlow instanceof yn))throw new P("Must initialize Passkey flow first.");if(me.current!=="passkey")throw new P("Must init login with Passkey flow first.");let d,p;try{me.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(m){throw N(O,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d),E(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new yn(d);t.startAuthFlow(p),G.current="link",me.current="passkey";try{await p.initLinkFlow()}catch(m){throw N(O,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},async linkWithPasskey(){if(!n)throw new Uo;if(!(t.authFlow instanceof yn))throw new P("Must initialize Passkey flow first.");if(me.current!=="passkey")throw new P("Must init login with Passkey flow first.");let d;try{me.current="passkey",d=await t.link()}catch(p){throw N(O,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account"),p}c(d||s||null)},async initLoginWithHeadlessOAuth(d,p){if(uc()){if(d==="google"&&nc(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 m=new Qr({provider:d,headless:!0});p&&m.addCaptchaToken(p);let v=await t.startAuthFlow(m).getAuthorizationUrl();v?.url&&window.location.assign(v.url)},async loginWithHeadlessOAuth(d){S(!0),t.startAuthFlow(new Qr(d));let p=X.get(dn),m=d.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:m??""}}),S(!1),new P("Unexpected auth flow. This may be a phishing attempt.");let v,_;if(i)try{v=await t.link(),me.current=d.provider}catch(B){throw N(O,"linkAccount","onError",B.privyErrorCode||"failed_to_link_account"),B}else try{({user:v,isNewUser:_}=await t.authenticate()),me.current=d.provider}catch(B){throw G.current==="login"?N(O,"login","onError",B.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(O,"linkAccount","onError",B.privyErrorCode||"failed_to_link_account"),B}return c(v),E(_||!1),l(!0),S(!1),v??void 0},initLoginWithEmail:async(d,p)=>{let m=new Bo(d,p);t.startAuthFlow(m);try{me.current="email",await m.sendCodeEmail()}catch(v){throw G.current==="login"?N(O,"login","onError",v.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(O,"linkAccount","onError",v.privyErrorCode||"failed_to_link_account"),v}},initUpdateEmail:async(d,p,m)=>{let v=new Ya(d,p,m);t.startAuthFlow(v),await v.sendCodeEmail()},initLoginWithSms:async(d,p)=>{I({status:"sending-code"});let m=new vn(d,p);t.startAuthFlow(m);try{me.current="sms",await m.sendSmsCode(),I({status:"awaiting-code-input"})}catch(v){throw I({status:"error",error:v}),G.current==="login"?N(O,"login","onError",v.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(O,"linkAccount","onError",v.privyErrorCode||"failed_to_link_account"),v}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(I({status:"submitting-code"}),!n){let _=new Uo;throw I({status:"error",error:_}),_}if(t.authFlow instanceof Bo)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof vn)t.authFlow.meta.smsCode=d.trim();else{let _=new P("Must initialize a passwordless code flow first");throw I({status:"error",error:_}),_}let p=await _e(),m,v;if(p&&t.sessionHasActiveToken())try{m=await t.link()}catch(_){throw I({status:"error",error:_}),N(O,"linkAccount","onError",_.privyErrorCode||"failed_to_link_account"),_}else try{({user:m,isNewUser:v}=await t.authenticate())}catch(_){throw I({status:"error",error:_}),N(O,"login","onError",_.privyErrorCode||"unknown_auth_error"),_}c(m||s||null),E(v||!1),l(!0),I({status:"done"})},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:R,createAnalyticsEvent:({eventName:d,payload:p,timestamp:m})=>t.createAnalyticsEvent({eventName:d,payload:p,timestamp:m}),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let m=s?.linkedAccounts.find(_=>_.type==="wallet"&&_.walletClientType==="privy"),v=await _e();if(!v||!R||!m){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await R.connect({accessToken:v,address:m.address}),d(!0)}catch(_){Tn(_)&&m.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:m.address}}),(await R.recover({address:m.address,accessToken:v})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:m.address}}),d(!0)):Tn(_)?(se({recoverWallet:{privyWallet:m,onFailure:p,onSuccess:()=>d(!0)}}),de("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(_)}}),getFiatOnRampConfig:Bn,setReadyToTrue:d=>{a(!0),jr?.(d)},updateWallets:()=>pr(),fundWallet:async(d,p)=>{let{signedUrl:m,externalTransactionId:v}=await Bn(d,p);se({fiatOnRampPrompt:{signedUrl:m},fiatOnRampStatus:{externalTransactionId:v}}),de("FIAT_ON_RAMP_PROMPT_SCREEN")},requestFarcasterSignerStatus:async d=>{let p=await _e(),m=s?.linkedAccounts.find(_=>_.type==="wallet"&&_.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)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 v=await t.requestFarcasterSignerStatus(d);if(v.status==="approved"){let _=await t.getAuthenticatedUser();c(_||s||null)}return v}}))();Zg=fe.recoverEmbeddedWallet;let k2=(0,te.useMemo)(()=>({wallets:u,ready:dr}),[u,dr]);return(0,Qt.jsx)(we.Provider,{value:Hn,children:(0,Qt.jsx)(Dc.Provider,{value:O,children:(0,Qt.jsx)(Gd.Provider,{value:k2,children:(0,Qt.jsxs)(dm,{...U,children:[e.children,(0,Qt.jsxs)(Nc.Provider,{value:fe,children:[!op&&U.captchaEnabled&&n&&!i&&(0,Qt.jsx)(Zs,{delayedExecution:!1}),(0,Qt.jsx)(Ug,{theme:{...U.appearance.palette||{}}}),(0,Qt.jsx)(em,{data:qe,setModalData:se,setInitialScreen:k,initialScreen:w,authenticated:i,open:r,children:(0,Qt.jsx)(Gg,{open:r})}),ie&&ue?(0,Qt.jsx)(zg,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Ft,mfaSubmitPromise:nt,onLoad:ce,onLoadFailed:()=>null}):null]})]})})})})};var Qg=require("react");function Xg(e){let{login:t}=(0,Qg.useContext)(we);return Ve("login",e),{login:t}}var e2=require("react");function t2(e){let{logout:t}=(0,e2.useContext)(we);return Ve("logout",e),{logout:t}}var Ua=require("react");function r2(){let e=Pe(),t=zs(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:a,user:i}=V(),l=(0,Ua.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new Mr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=(0,Ua.useCallback)(async()=>{let c=oa();if(i)return console.warn("Cannot login with OAuth when already logged in"),i;if(!c.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");try{return await o(c)}catch(u){throw u}finally{na()}},[o]);return(0,Ua.useEffect)(()=>{let c=oa();a&&t&&c.inProgress&&c.headless&&s()},[a,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}var Qd=require("react");var o2=()=>{let e=Pe(),{initLoginWithEmail:t,loginWithCode:r}=V(),o=(0,Qd.useCallback)(async({email:a})=>{if(!a)throw new Error("Email required to send OTP code");return t(a)},[t]),n=(0,Qd.useCallback)(async({code:a})=>{if(e.enabled&&e.status==="error")throw new Mr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var Xd=require("react");var n2=()=>{let e=Pe(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=V(),n=(0,Xd.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return t(i)},[t]),a=(0,Xd.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new Mr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:n,loginWithCode:a,state:o}};var i2=require("react");function a2(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:g,linkFarcaster:f}=(0,i2.useContext)(we);return Ve("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:g,linkFarcaster:f}}var s2=require("react");function l2(e){let{connectWallet:t}=(0,s2.useContext)(we);return Ve("connectWallet",e),{connectWallet:t}}var c2=require("react");function d2(e){let{createWallet:t}=(0,c2.useContext)(we);return Ve("createWallet",e),{createWallet:t}}var p2=()=>{let{fundWallet:e}=V();return{fundWallet:e}};var u2=require("react");function m2(e){let{sendTransaction:t}=(0,u2.useContext)(we);return Ve("sendTransaction",e),{sendTransaction:t}}var f2=require("react");function h2(e){let{setWalletPassword:t}=(0,f2.useContext)(we);return Ve("setWalletPassword",e),{setWalletPassword:t}}var y2=require("react");function g2(e){let{signMessage:t}=(0,y2.useContext)(we);return Ve("signMessage",e),{signMessage:t}}var v2=require("react");function C2(e){let{signTypedData:t}=(0,v2.useContext)(we);return Ve("signTypedData",e),{signTypedData:t}}var w2=require("react");var b2=()=>{let{isModalOpen:e}=(0,w2.useContext)(we);return{isOpen:e}};var E2=require("react");function T2(e){let{getAccessToken:t}=(0,E2.useContext)(we);return Ve("accessToken",e),{getAccessToken:t}}function P2(){let{submitCast:e,removeCast:t,likeCast:r,recastCast:o,followUser:n,unfollowUser:a,requestFarcasterSigner:i}=V();return{followUser:n,unfollowUser:a,submitCast:e,removeCast:t,likeCast:r,recastCast:o,requestFarcasterSigner:i}}function S2(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,useConnectWallet,useCreateWallet,useExperimentalFarcasterSigner,useFundWallet,useLinkAccount,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSignMessage,useSignTypedData,useToken,useWallets});
|
|
2894
|
+
`;var Qe=require("react/jsx-runtime"),Ww={["LANDING"]:t1,["CONNECT_OR_CREATE"]:e1,["AWAITING_PASSWORDLESS_CODE"]:ef,["AWAITING_CONNECTION"]:_f,["AWAITING_CONNECT_ONLY_CONNECTION"]:Rf,["AWAITING_FARCASTER_CONNECTION"]:ty,["AWAITING_FARCASTER_SIGNER"]:iy,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:Sg,["PHANTOM_INTERSTITIAL_SCREEN"]:Ag,["LOGIN_FAILED_SCREEN"]:v1,["AWAITING_OAUTH_SCREEN"]:Pg,["ALLOWLIST_REJECTION_SCREEN"]:Vm,["USER_LIMIT_REACHED_SCREEN"]:o2,["INSTALL_PHANTOM_SCREEN"]:_y,["LINK_EMAIL_SCREEN"]:o1,["LINK_PHONE_SCREEN"]:h1,["LINK_WALLET_SCREEN"]:y1,["LINK_PASSKEY_SCREEN"]:u1,["UPDATE_EMAIL_SCREEN"]:t2,["CONNECT_ONLY_LANDING_SCREEN"]:Pf,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:vf,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Zf,["EMBEDDED_WALLET_CREATED_SCREEN"]:Gf,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Uf,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:Ig,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:Gg,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:Wg,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:jf,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:Zg,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:jg,["FIAT_ON_RAMP_PROMPT_SCREEN"]:fy,["FIAT_ON_RAMP_STATUS_SCREEN"]:Cy,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Dh,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Wh,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:Lg,["MFA_ENROLLMENT_FLOW_SCREEN"]:O1,["CAPTCHA_SCREEN"]:cf,["ERROR_SCREEN"]:Bh,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Ey,["AFFIRMATIVE_CONSENT_SCREEN"]:Bm},Lw=["LANDING","AWAITING_CONNECTION"],Ow=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=H(),{headless:n}=W(),{ready:a,currentScreen:i}=_(),{status:l,execute:s,reset:c,enabled:u}=Se(),g=(0,Fo.useRef)(null),f=_m(g),v=o&&i&&Lw.includes(i)&&!n&&l==="ready";if((0,Fo.useEffect)(()=>{v&&s()},[v]),(0,Fo.useEffect)(()=>{!o&&u&&c()},[o,u]),(!r||!a)&&i!=="AWAITING_OAUTH_SCREEN")return(0,Qe.jsxs)(Bi,{id:"privy-modal-content",children:[(0,Qe.jsx)(k,{}),(0,Qe.jsx)(te,{}),(0,Qe.jsx)(w1,{children:(0,Qe.jsx)(zt,{})}),(0,Qe.jsx)(ne,{}),(0,Qe.jsx)(ee,{})]});if(!i&&e)return(0,Qe.jsx)(Bi,{style:{height:f},id:"privy-modal-conent",children:(0,Qe.jsx)("div",{ref:g,children:(0,Qe.jsx)(tp,{open:e,onClose:t})})});if(!i)return null;let b=Ww[i];return(0,Qe.jsx)(Bi,{style:{height:f},id:"privy-modal-content",children:(0,Qe.jsxs)("div",{ref:g,children:[(0,Qe.jsx)(So,{if:!!e,children:(0,Qe.jsx)(b,{})}),(0,Qe.jsx)(So,{if:!e,children:(0,Qe.jsx)(tp,{open:e,onClose:t})})]})})},Nw=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=_();return{gracefulClosePrivyModal:(0,Fo.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},l2=({open:e})=>{let{app:t}=_(),{gracefulClosePrivyModal:r}=Nw(),[o,n]=(0,Fo.useState)(!1);sl({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let a=(0,Qe.jsx)(a2,{children:(0,Qe.jsx)(Ow,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})}),i=e||o,l=t?.render.inDialog?(0,Qe.jsx)(C1,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:a}):a;if(typeof window<"u"&&t?.render.inParentNodeId){let s=document.getElementById(t.render.inParentNodeId);if(s)return s2.default.createPortal(l,s)}return l};var c2=require("react"),Xi=require("react");var mc=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:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery-password":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:submit-cast":return o;case"privy:farcaster:remove-cast":return o;case"privy:farcaster:react-to-cast":return o;case"privy:farcaster:submit-link":return o;case"privy:farcaster:remove-link":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function Vn(e,t,r,o,n,a=!1){let i=a,l=async u=>{if(i&&t&&t.length>0){u===(a?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Ne("missing_or_invalid_mfa","MFA verification failed, retry."));let g=await new Promise((f,v)=>{r.current={resolve:f,reject:v};let b=1e3*60*5;setTimeout(()=>{let w=new Ne("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(w),v(w)},b)});return await e(g)}return await e()},s=4,c=null;for(let u=0;u<s;u++)try{c=await l(u),o.current?.resolve(void 0);break}catch(g){if(g.type==="missing_or_invalid_mfa")i=!0;else throw o.current?.resolve(void 0),g}if(c===null){let u=new Ne("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}var p2=require("react/jsx-runtime"),Dw=function(e){return()=>`id-${e++}`}(0);function Fw(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Pt(e){return e.error!==void 0}var yt=new mc,lp=new Map,Uw=(e,t)=>typeof t=="bigint"?t.toString():t,Bw=(e,t)=>`${e}${JSON.stringify(t,Uw)}`;function St(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let a=Bw(e,t);if(e==="privy:wallet:create"){let l=lp.get(a);if(l)return l}let i=new Promise((l,s)=>{let c=Dw();yt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{lp.delete(a)});return lp.set(a,i),i}function Hw(e){switch(e.event){case"privy:iframe:ready":let t=yt.dequeue(e.event,e.id);return Pt(e)?t.reject(new Ne(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=yt.dequeue(e.event,e.id);return Pt(e)?r.reject(new Ne(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:connect":let o=yt.dequeue(e.event,e.id);return Pt(e)?o.reject(new Ne(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:recover":let n=yt.dequeue(e.event,e.id);return Pt(e)?n.reject(new Ne(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let a=yt.dequeue(e.event,e.id);return Pt(e)?a.reject(new Ne(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery-password":let i=yt.dequeue(e.event,e.id);return Pt(e)?i.reject(new Ne(e.error.type,e.error.message)):i.resolve(e.data);case"privy:mfa:verify":let l=yt.dequeue(e.event,e.id);return Pt(e)?l.reject(new Ne(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:clear":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:init-signer":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:submit-cast":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:remove-cast":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:react-to-cast":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:submit-link":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:remove-link":{let s=yt.dequeue(e.event,e.id);return Pt(e)?s.reject(new Ne(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function d2(e){let t=(0,Xi.useRef)(null),r=(0,Xi.useRef)(e.mfaMethods),o=Rm(),[n,a]=(0,c2.useState)(!1);return(0,Xi.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,Xi.useEffect)(()=>{if(!n)return;let i=t.current;if(!i)return;function l(f){f&&f.origin===e.origin&&Fw(f.data)&&Hw(f.data)}let s={create(f){return St("privy:wallet:create",f,i,e.origin)},connect(f){return St("privy:wallet:connect",f,i,e.origin)},recover(f){return Vn(v=>St("privy:wallet:recover",{...f,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(f){return Vn(v=>St("privy:wallet:rpc",{...f,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(f){return Vn(v=>St("privy:wallet:set-recovery-password",{...f,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return Vn(v=>St("privy:mfa:verify",{...f,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return Vn(v=>St("privy:mfa:init-enrollment",{...f,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return St("privy:mfa:submit-enrollment",f,i,e.origin)},unenrollMfa(f){return Vn(v=>St("privy:mfa:unenroll",{...f,...v},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(f){return St("privy:mfa:clear",f,i,e.origin)},initFarcasterSigner(f){return St("privy:farcaster:init-signer",f,i,e.origin)},submitCast(f){return St("privy:farcaster:submit-cast",f,i,e.origin)},removeCast(f){return St("privy:farcaster:remove-cast",f,i,e.origin)},reactToCast(f){return St("privy:farcaster:react-to-cast",f,i,e.origin)},submitLink(f){return St("privy:farcaster:submit-link",f,i,e.origin)},removeLink(f){return St("privy:farcaster:remove-link",f,i,e.origin)}};window.addEventListener("message",l);let c=()=>e.onLoad(s),u=(...f)=>{console.warn("Privy iframe failed to load: ",...f),e.onLoadFailed()},g=new AbortController;return yu(()=>St("privy:iframe:ready",{},i,e.origin),{abortSignal:g.signal}).then(c,u),()=>{window.removeEventListener("message",l),g.abort()}},[n]),(0,p2.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>a(!0),src:ds(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function fc(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(o=>t.includes(o))}async function u2({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{function a(){t?.close(),window.removeEventListener("message",i)}function i(l){l.data&&(l.data.type==="PRIVY_OAUTH_RESPONSE"?(o(l.data),a()):l.data.type==="PRIVY_OAUTH_ERROR"&&(n(l.data.error),a()))}window.addEventListener("message",i)})}var hc=class{constructor(t,r){this.meta={action:t,phoneNumber:r}}async init(){if(!this.meta.action)throw new E("action required");if(!this.api)throw new E("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new E("phone number must be set when initialzing authentication.");try{await this.api.post(Zp,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw pe(t)}}async authenticate(){if(!this.meta.action)throw new E("action required");if(!this.api)throw new E("Mfa flow has no API instance");if(!this.meta.smsCode)throw new E("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new E("phone number must be set prior to calling authenticate.");try{let t=await this.api.post(Jp,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return Vt(t)}catch(t){throw pe(t)}}};var Xt=require("react/jsx-runtime"),un;function Gw(e){return typeof e=="string"&&e.length===25}function ge(){if(!un){let e=X.get(mn);return Promise.resolve(e||null)}return un.getAccessToken()}var f2,Lu=(e,t)=>f2(e,t),h2,Ou=(e,t)=>h2(e,t),y2,Nu=(e,t)=>y2(e,t),g2,Du=()=>g2(),Vw=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(ra,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},v2=({config:e,...t})=>{if(!Gw(t.appId))throw new E("Cannot initialize the Privy provider with an invalid Privy app ID");un||(un=new di({appId:t.appId,apiUrl:t.apiUrl||ns}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,Xt.jsx)(pm,{client:un,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,Xt.jsx)(zw,{...t,config:r,client:un})})},zw=e=>{let t=e.client,[r,o]=(0,re.useState)(!1),[n,a]=(0,re.useState)(!1),[i,l]=(0,re.useState)(!1),[s,c]=(0,re.useState)(null),[u,g]=(0,re.useState)([]),f=(0,re.useRef)(u),[v,b]=(0,re.useState)(!1),[w,x]=(0,re.useState)(null),[T,S]=(0,re.useState)(!1),[L,I]=(0,re.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:P}),[U,M]=(0,re.useState)({status:"initial"}),[G,Y]=(0,re.useState)(null),[z,j]=(0,re.useState)(null),[R,fe]=(0,re.useState)(null),B=Yo(),he=Js(),[ye,se]=(0,re.useState)(!0),[Xe,le]=(0,re.useState)({}),[Ar,dr]=(0,re.useState)(null),[pr,Pe]=(0,re.useState)(null),[Kr,Yr]=(0,re.useState)(!1),[zn,Zr]=(0,re.useState)(!1),Ht=(0,re.useRef)(null),st=(0,re.useRef)(null),O=(0,re.useRef)(km);t.onStoreToken=d=>{d&&N(O,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),N(O,"accessToken","onAccessTokenRemoved")};let me=(0,re.useRef)(null),V=(0,re.useRef)(null),Jr=(0,re.useCallback)(d=>{let p=t.connectors?.walletsReady||!1;return i&&s?.linkedAccounts?.some(C=>C.type==="wallet"&&C.walletClientType==="privy")?p&&d?.some(C=>C?.walletClientType==="privy"):p},[i,s?.linkedAccounts,t?.connectors?.walletsReady]),ce=d=>{x(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},Gt=d=>{B.embeddedWallets.createOnLogin!=="off"&&se(!0),ce(d)};(0,re.useEffect)(()=>{let d=()=>{document.visibilityState==="hidden"&&t.createAnalyticsEvent({eventName:"page_hidden",options:{keepAlive:!0}})};return document.addEventListener("visibilitychange",d),()=>{document.removeEventListener("visibilitychange",d)}},[]),(0,re.useEffect)(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=s.linkedAccounts.find(p=>p.type==="wallet"&&p.walletClientType==="privy");if(!d){t.connectors?.removeEmbeddedWalletConnector();return}if(!t.connectors){console.warn("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!R){console.warn("Failed to add embedded wallet connector: Wallet proxy not initialized");return}t.connectors.addEmbeddedWalletConnector(R,d.address,B.defaultChain,e.appId)},[R,s]),(0,re.useEffect)(()=>{R&&pr?.(R)},[R]),(0,re.useEffect)(()=>{(async()=>{if(!B.customAuth?.enabled)return;se(!0);let{getCustomAccessToken:p,isLoading:m}=B.customAuth;if(!(!n||m))try{let C=await p();if(!C&&i){await jn.logout();return}if(!C||i)return;t.startAuthFlow(new Kn(C));let{user:A,isNewUser:F}=await t.authenticate();if(!A){await jn.logout();return}c(A||null),b(F||!1),l(!0),Zr(!0)}catch(C){console.warn(C),i&&await jn.logout()}})()},[B.customAuth?.enabled,B.customAuth?.getCustomAccessToken,B.customAuth?.isLoading,n,i]),(0,re.useEffect)(()=>{zn&&R&&s&&gr(s,e.config?.embeddedWallets?.createOnLogin)&&(Zr(!1),pp(s,Yn).catch(console.error))},[zn&&R&&s]),(0,re.useEffect)(()=>{async function d(){let p=go();Vw();let m=(0,m2.createStore)();Y(m),t.initializeConnectorManager({walletConnectCloudProjectId:B.walletConnectCloudProjectId,rpcConfig:B.rpcConfig,chains:B.chains,defaultChain:B.defaultChain,store:m,walletList:B.appearance.walletList,shouldEnforceDefaultChainOnConnect:B.shouldEnforceDefaultChainOnConnect,appName:B.name??"Privy"}),t.connectors?.initialize().then(()=>{qn()});let C=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!C),C&&N(O,"login","onComplete",C,!1,!0,null),c(C)),p||de.setReadyToTrue(!!C),p&&(C?V.current="link":V.current="login")}!n&&he&&d()},[t,Ar,n,he]);let go=()=>{let d=da();if(d.inProgress&&d.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode});return}return!d.inProgress||d.headless?!1:(t.startAuthFlow(new Xr(d)),Gt("AWAITING_OAUTH_SCREEN"),!0)},$a=async(d,p,m,C)=>{let A=await t.connectors?.createWalletConnector(d,p)||null;ea(A,p,m,C)};async function ea(d,p,m,C){if(d)I({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:P});else return I({status:"disconnected",connectedWallet:null,connectError:new oe("Unable to connect to wallet."),connector:null,connectRetry:P}),C?.(null,m);d instanceof ro&&p&&await d.resetConnection(p),I({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>ea(d,p,m,C)});try{let A=await d.connect({showPrompt:!0});if(B.shouldEnforceDefaultChainOnConnect&&!B.chains.find(F=>F.id===Number(A?.chainId))&&!(A?.connectorType==="wallet_connect_v2"&&A?.walletClientType==="metamask")){I(F=>({...F,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:P}));try{await A?.switchChain(B.defaultChain.id),A&&(A.chainId=Zn(Cn(B.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${B.defaultChain.id}`)}}return I(F=>({...F,status:"connected",connectedWallet:A,connectError:null,connectRetry:P})),A&&!V.current&&N(O,"connectWallet","onSuccess",A),C?.(A,m)}catch(A){return A instanceof et?(console.warn(A.cause?A.cause:A.message),V.current||N(O,"connectWallet","onError",A.privyErrorCode||"generic_connect_wallet_error")):(console.warn(A),V.current||N(O,"connectWallet","onError","unknown_connect_wallet_error")),I(F=>({...F,status:"disconnected",connectedWallet:null,connectError:A})),C?.(null,m)}}let Uo=async(d,p)=>{if(d===null)return;let m=new Tn(d,p);t.startAuthFlow(m)},qn=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),m=d.get("privy_wallet_client");if(!p||!m)return;if(m==="phantom"&&!Vo()&&Gt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new E("Connector not initialized");ce("AWAITING_CONNECTION");let C=new URL(window.location.href);C.searchParams.delete("privy_connector"),C.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",C),$a(p,m,void 0,Uo)};(0,re.useEffect)(()=>{n&&i&&s===null&&t.getAuthenticatedUser().then(c)},[n,i,s,t]);let Me=()=>{if(!i)throw N(O,"linkAccount","onError","must_be_authenticated"),new E("User must be authenticated before linking an account.")},gt=()=>{Me(),me.current="siwe",V.current="link",ce("LINK_WALLET_SCREEN")},Bo=d=>{if(!i||!s)return!1;if(d.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},ta=async d=>{if(!t.connectors)throw new E("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(I(m=>({...m,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:P})),B.captchaEnabled&&!i){let m={callback:C=>Uo(d,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};le({captchaModalData:m}),Gt("CAPTCHA_SCREEN")}else await Uo(d),Gt("AWAITING_CONNECTION")},$n=async(d,p)=>{if(!B.fiatOnRamp.enabled)throw new E("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:m,externalTransactionId:C}=await uy(t,d,p?.config??{},B.appearance.palette,B.fiatOnRamp.useSandbox);return{signedUrl:m,externalTransactionId:C}}else throw new E("Unsupported fund provider. Currently supported option is `moonpay`.")},ur=()=>{g(d=>{let p=t.connectors?.wallets.map(m=>({...m,linked:Bo(m),loginOrLink:async()=>{if(!await m.isConnected())throw new E("Wallet is not connected");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new E("Cannot link or login with embedded wallet");ta(m)},fund:async C=>{let{signedUrl:A,externalTransactionId:F}=await $n(m.address,C);le({fiatOnRampPrompt:{signedUrl:A},fiatOnRampStatus:{externalTransactionId:F}}),ce("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!i)throw new E("User is not authenticated.");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new E("Cannot unlink an embedded wallet");let C=await t.unlinkWallet(m.address);c(C)}}))||[];return Yr(Jr(p)),Rs(d,p)?d:p})};(0,re.useEffect)(()=>{ur()},[s?.linkedAccounts,i,n]),(0,re.useEffect)(()=>{if(n){if(!t.connectors)throw new E("Connector not initialized");ur(),t.connectors.on("walletsUpdated",ur)}},[n]);let gc=()=>{ce(i?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,re.useEffect)(()=>{if(!u[0])return;let d=u[0],p=f.current.find(C=>C.address===d.address),m;if(d.walletClientType==="privy"?m=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType==="privy"):m=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType!=="privy"),!p&&m){let C=Object.assign({},s);C.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType},c(C)}f.current=u},[u]);let pp=async(d,p)=>{if(We(d))throw N(O,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[C,A]=await Promise.all([de.initializeWalletProxy(p),ge()]);if(!C&&e.config?.customAuth?.enabled)throw N(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!C||!A||B.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((F,ae)=>{se(!0),le({createWallet:{onSuccess:vt=>{N(O,"createWallet","onSuccess",vt),F(vt)},onFailure:vt=>{N(O,"createWallet","onError","unknown_embedded_wallet_error"),ae(vt)},callAuthOnSuccessOnClose:!1}}),ce("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await C.create({accessToken:A});let F=await de.refreshUser(),ae=We(F);if(!ae)throw N(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return N(O,"createWallet","onSuccess",ae),ae}},j2=d=>{if(!B.chains.map(p=>p.id).includes(d))throw new oe(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},up=(d,p,m)=>new Promise(async(C,A)=>{if(!i||!s){N(O,"sendTransaction","onError","must_be_authenticated"),A(new Error("User must be authenticated before signing with a Privy wallet"));return}let F=We(s);if(!F){N(O,"sendTransaction","onError","embedded_wallet_not_found"),A(new Error("Must have a Privy wallet before signing"));return}se(!0);let ae=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,lt=d.chainId?Number(d.chainId):ae.chainId;j2(lt);let vt=Object.assign({},d,{chainId:lt}),fr=async()=>{let Ue=await ge();if(!Ue||!R){N(O,"sendTransaction","onError","embedded_wallet_not_found"),A(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await de.recoverEmbeddedWallet()){N(O,"sendTransaction","onError","unknown_connect_wallet_error"),A(new Error("Unable to connect to wallet"));return}let Ot=Co(vt.chainId,B.chains,B.rpcConfig,{appId:e.appId}),vc=await Ki(F.address,vt,Ot);if(B.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:Y2}=await ji(vc,Ot),{hasSufficientFunds:Z2}=await ic(F.address,vc,Y2,Ot);if(!Z2)throw new Ye(new vr("Wallet has insufficient funds for this transaction.",kt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let hp=await nc(Ue,F.address,R,vc,Ot);N(O,"sendTransaction","onSuccess",hp),C(hp)}catch(er){N(O,"sendTransaction","onError","transaction_failure"),A(er)}};if(B.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),fr();else{let Ue={transactionRequest:vt,onSuccess:Ot=>{N(O,"sendTransaction","onSuccess",Ot),C(Ot)},onFailure:Ot=>{N(O,"sendTransaction","onError","transaction_failure"),A(Ot)},uiOptions:p||{},fundWalletConfig:m},er={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:Ot=>{N(O,"sendTransaction","onError","unknown_connect_wallet_error"),A(Ot)}};le({connectWallet:er,sendTransaction:Ue}),ce("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function mp(){return new Promise(async(d,p)=>{let m=await ge();if(!m||!R)throw new Error("Must have valid access token to enroll in MFA");try{await R.verifyMfa({accessToken:m}),d()}catch(C){p(C)}})}let mr=d=>{if(d==="passkey"){if(s&&s.linkedAccounts.filter(p=>p.type==="passkey").length>=5)throw N(O,"linkAccount","onError","cannot_link_more_of_type"),new E(`User already has an account of type ${d} linked.`)}else if(s?.[d])throw N(O,"linkAccount","onError","cannot_link_more_of_type"),new E(`User already has an account of type ${d} linked.`)},jn={ready:n,authenticated:i,user:s,walletConnectors:t.connectors||null,connectWallet:gc,linkWallet:gt,linkEmail:()=>{Me(),mr("email"),me.current="email",V.current="link",ce("LINK_EMAIL_SCREEN")},linkPhone:()=>{Me(),mr("phone"),me.current="sms",V.current="link",ce("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Me(),mr("google"),V.current="link",await de.initLoginWithOAuth("google")},linkTwitter:async()=>{Me(),mr("twitter"),V.current="link",await de.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Me(),mr("discord"),V.current="link",await de.initLoginWithOAuth("discord")},linkGithub:async()=>{Me(),mr("github"),V.current="link",await de.initLoginWithOAuth("github")},linkSpotify:async()=>{Me(),mr("spotify"),V.current="link",await de.initLoginWithOAuth("spotify")},linkTiktok:async()=>{Me(),mr("tiktok"),V.current="link",await de.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Me(),mr("linkedin"),V.current="link",await de.initLoginWithOAuth("linkedin")},linkApple:async()=>{Me(),mr("apple"),V.current="link",await de.initLoginWithOAuth("apple")},linkPasskey:async()=>{Me(),mr("passkey"),await de.initLinkWithPasskey(),ce("LINK_PASSKEY_SCREEN")},linkFarcaster:async()=>{Me(),mr("farcaster"),await de.initLoginWithFarcaster(),V.current="link",me.current="farcaster",ce("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Me(),!s?.email)throw new E("User does not have an email linked to their account.");V.current="link",me.current="email",ce("UPDATE_EMAIL_SCREEN")},login:async()=>{let d="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let p=await new Promise(m=>{dr(C=>m.bind(C))});if(dr(null),p){console.warn(d);return}}if(i){console.warn(d);return}V.current="login",Gt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{dr(()=>d)}),dr(null)),i){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(u[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}Gt("CONNECT_OR_CREATE")},logout:async()=>{if(await t.logout(),s&&R)try{await R.clearMfa({userId:s.id})}catch{}c(null),l(!1),x(null),N(O,"logout","onSuccess"),V.current=null,me.current=null,o(!1),X.del(oa)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Ve;let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(C=>C.address===d?.address));return!d||!p?new Ve:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new yc.Web3Provider(new Mr(new Ve));let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(C=>C.address===d?.address));return!d||!p?new yc.Web3Provider(new Mr(new Ve)):new yc.Web3Provider(new Mr(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new jo(new Ve);let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(C=>C.address===d?.address));return!d||!p?new jo(new Ve):new jo(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},setActiveWallet:async d=>{let p=u.find(C=>(0,za.getAddress)(C.address)===(0,za.getAddress)(d)),m=s?.linkedAccounts.find(C=>C.type==="wallet"&&(0,za.getAddress)(C.address)===(0,za.getAddress)(d));if(!p||!await p.isConnected())j(d),gt();else if(!p.linked)p.loginOrLink();else{let C=Object.assign({},s);C.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType},c(C)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!i||!s)throw N(O,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return pp(s,15e3)},setWalletPassword:async()=>{if(!i||!s)throw N(O,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=We(s);if(!d||!R)throw N(O,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw N(O,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await mp()}catch(p){throw N(O,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,m)=>{se(!0);let C={onSuccess:F=>{N(O,"setWalletPassword","onSuccess",F),p(F)},onFailure:F=>{N(O,"setWalletPassword","onError","user_exited_set_password_flow"),m(F)},callAuthOnSuccessOnClose:!1},A={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:F=>{N(O,"setWalletPassword","onError","unknown_connect_wallet_error"),m(F)}};le({setWalletPassword:C,connectWallet:A}),ce("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(m,C)=>{if(!i||!s){N(O,"signMessage","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let A=We(s);if(!A){N(O,"signMessage","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){N(O,"signMessage","onError","invalid_message"),C(new Error("Message must be a non-empty string"));return}se(!0);let F=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let ae=await ge();if(!R||!ae)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:A.address}});let{response:vt}=await R.rpc({accessToken:ae,address:A.address,request:{method:"personal_sign",params:[d,A.address]}}),fr=vt.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:A.address}}),fr};if(B.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ae=await F();N(O,"signMessage","onSuccess",ae),m(ae)}catch(ae){N(O,"signMessage","onError","unable_to_sign"),C(ae??new Ye("Unable to sign message"))}}else{let vt={method:"personal_sign",data:d,confirmAndSign:F,onSuccess:Ue=>{N(O,"signMessage","onSuccess",Ue),m(Ue)},onFailure:Ue=>{N(O,"signMessage","onError","unable_to_sign"),C(Ue)},uiOptions:p||{}},fr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Ue=>{N(O,"signMessage","onError","unknown_connect_wallet_error"),C(Ue)}};le({signMessage:vt,connectWallet:fr}),ce("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(m,C)=>{if(!i||!s){N(O,"signTypedData","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let A=We(s);if(!A){N(O,"signTypedData","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}se(!0);let F=us(d),ae=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let lt=await ge();if(!R||!lt)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:A.address}});let{response:fr}=await R.rpc({accessToken:lt,address:A.address,request:{method:"eth_signTypedData_v4",params:[A.address,F]}}),Ue=fr.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:A.address}}),Ue};if(B.embeddedWallets.noPromptOnSignature||(B.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let lt=await ae();N(O,"signTypedData","onSuccess",lt),m(lt)}catch(lt){N(O,"signTypedData","onError","unable_to_sign"),C(lt??new Ye("Unable to sign message"))}}else{let fr={method:"eth_signTypedData_v4",data:F,confirmAndSign:ae,onSuccess:er=>{N(O,"signTypedData","onSuccess",er),m(er)},onFailure:er=>{N(O,"signTypedData","onError","unable_to_sign"),C(er)},uiOptions:p||{}},Ue={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:er=>{N(O,"signMessage","onError","unknown_connect_wallet_error"),C(er)}};le({signMessage:fr,connectWallet:Ue}),ce("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,m)=>{let A=await(await up(d,p,m)).wait();return ac(A)},exportWallet:()=>new Promise(async(d,p)=>{if(!i||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let m=We(s);if(!m){p(new Error("Must have a Privy wallet before exporting"));return}se(!0);let C={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},A=await ge();if(!A||!R){p(new Error("Must have valid access token to enroll in MFA"));return}if(!R){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await R.connect({accessToken:A,address:m.address}),await R.verifyMfa({accessToken:A})}catch(ae){if(An(ae))await de.recoverEmbeddedWallet();else throw ae}}catch(ae){p(ae);return}let F={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};le({keyExport:F,connectWallet:C}),ce("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:mp,async init(d){let p;switch(d){case"sms":p=new hc("verify");break;case"totp":return;default:throw new Error(`Unsupported MFA method: ${d}`)}t.startMfaFlow(p),await p.init()},async submit(d,p){switch(d){case"totp":case"sms":Ht.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((m,C)=>{st.current={resolve:m,reject:C}});break;default:throw Ht.current?.reject(new E("Unsupported MFA method")),new E(`Unsupported MFA method: ${d}`)}},cancel(){Ht.current?.reject(new E("MFA canceled"))},async initEnrollmentWithSms(d){let p=await ge();if(!p||!R)throw new Error("Must have valid access token to enroll in MFA");await R.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,m)=>{if(!d){de.closePrivyModal(),p();return}B.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."),le({mfaEnrollmentFlow:{mfaMethods:B.mfa.methods,onSuccess:p,onFailure:m}}),ce("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await ge();if(!d||!R)throw new Error("Must have valid access token to enroll in MFA");let p=await R.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await ge();if(!p||!R)throw new Error("Must have valid access token to enroll in MFA");await R.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async submitEnrollmentWithTotp(d){let p=await ge();if(!p||!R)throw new Error("Must have valid access token to enroll in MFA");await R.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async unenroll(d){let p=await ge();if(!p||!R)throw new Error("Must have valid access token to remove MFA");await R.unenrollMfa({method:d,accessToken:p});let m=await t.getAuthenticatedUser();c(m)},requestFarcasterSigner:async()=>{let d=await ge(),p=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");let C=await R.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null});if(C.status==="approved"){let A=await t.getAuthenticatedUser();c(A||s||null)}le({farcasterSigner:C}),ce("AWAITING_FARCASTER_SIGNER")},submitCast:async d=>{let p=await ge(),m=s?.linkedAccounts.find(F=>F.type==="wallet"&&F.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.submitCast({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:d,fid:BigInt(s.farcaster.fid)})).response.hash}},removeCast:async({castHash:d})=>{let p=await ge(),m=s?.linkedAccounts.find(F=>F.type==="wallet"&&F.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.removeCast({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:d,fid:BigInt(s.farcaster.fid)})).response.hash}},likeCast:async({castHash:d,castAuthorFid:p})=>{let m=await ge(),C=s?.linkedAccounts.find(ae=>ae.type==="wallet"&&ae.walletClientType==="privy");if(!m)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!C)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.reactToCast({address:C.address,hdWalletIndex:null,accessToken:m,mfaCode:null,mfaMethod:null,payload:{type:1,castId:{hash:d,fid:p}},fid:BigInt(s.farcaster.fid)})).response.hash}},recastCast:async({castHash:d,castAuthorFid:p})=>{let m=await ge(),C=s?.linkedAccounts.find(ae=>ae.type==="wallet"&&ae.walletClientType==="privy");if(!m)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!C)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.reactToCast({address:C.address,hdWalletIndex:null,accessToken:m,mfaCode:null,mfaMethod:null,payload:{type:2,castId:{hash:d,fid:p}},fid:BigInt(s.farcaster.fid)})).response.hash}},followUser:async({fid:d})=>{let p=await ge(),m=s?.linkedAccounts.find(F=>F.type==="wallet"&&F.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.submitLink({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{type:"follow",targetFid:d},fid:BigInt(s.farcaster.fid)})).response.hash}},unfollowUser:async({fid:d})=>{let p=await ge(),m=s?.linkedAccounts.find(F=>F.type==="wallet"&&F.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await R.removeLink({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{type:"follow",targetFid:d},fid:BigInt(s.farcaster.fid)})).response.hash}},isHeadlessOAuthLoading:T,loginWithCode(d){return de.loginWithCode(d)},initLoginWithEmail(d){return de.initLoginWithEmail(d)},initLoginWithSms(d){return de.initLoginWithSms(d)},otpState:U,fundWallet(d,p){return de.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return de.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return de.loginWithHeadlessOAuth(d)},isModalOpen:r};f2=jn.signMessage,h2=jn.signTypedData,y2=async(...d)=>{let p=await up(...d);return B.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let fp=!!e.config?.headless,de=(()=>({headless:fp,isNewUserThisSession:v,linkingHint:z,pendingTransaction:null,walletConnectionStatus:L,mipdStore:G,connectors:t.connectors?.walletConnectors??[],rpcConfig:B.rpcConfig,chains:B.chains,appId:e.appId,showFiatPrices:B.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>B.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(R)return R;let p=new Promise(A=>{Pe(()=>F=>A(F))}),m=new Promise(A=>setTimeout(()=>A(null),d)),C=await Promise.race([p,m]);return Pe(null),C},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&i&&s;V.current==="login"?d.shouldCallAuthOnSuccess&&p?(N(O,"login","onComplete",s,v,!1,me.current??null),e.onSuccess?.(s,v)):N(O,"login","onError","exited_auth_flow"):V.current==="link"&&me.current&&(d.isSuccess&&p?N(O,"linkAccount","onSuccess",s,me.current):N(O,"linkAccount","onError","exited_link_flow")),j(null),V.current=null,me.current=null,b(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:ce,connectWallet:ea,initLoginWithWallet:async(d,p)=>{me.current="siwe",Uo(d,p)},loginWithWallet:async()=>{if(!n)throw new Ho;if(!(t.authFlow instanceof Tn))throw new E("Must initialize SIWE flow first.");let d,p;if(i)try{d=await t.link(),me.current="siwe"}catch(m){throw N(O,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),me.current="siwe"}catch(m){throw N(O,"login","onError",m.privyErrorCode||"generic_connect_wallet_error"),m}c(d||s||null),b(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new na(d);t.startAuthFlow(p);try{me.current="farcaster",await p.initializeFarcasterConnect()}catch(m){throw V.current==="login"?N(O,"login","onError",m.privyErrorCode||"unknown_auth_error"):V.current==="link"&&N(O,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},loginWithFarcaster:async()=>{if(!n)throw new Ho;if(!(t.authFlow instanceof na))throw new E("Must initialize Farcaster flow first.");let d,p;if(i)try{d=await t.link(),me.current="farcaster"}catch(m){throw N(O,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),me.current="farcaster"}catch(m){throw N(O,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d||null),b(p||!1),l(!0)},async initLoginWithOAuth(d,p){if(me.current=d,Ec()){if(d==="google"&&fc(window.navigator.userAgent)){Gt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Gt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}X.del(yn);let m=new Xr({provider:d});p&&m.addCaptchaToken(p),t.startAuthFlow(m);let C=await t.authFlow.getAuthorizationUrl();C&&C.url&&window.location.assign(C.url)},async recoveryOAuthFlow(d,p,m){let{url:C,codeVerifier:A,stateCode:F}=await Lf({api:un.api,provider:d});if(!C)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new E("Recovery OAuth failed");let ae,lt;try{let Ue=await u2({url:C,popup:m});if(ae=Ue.stateCode,lt=Ue.authorizationCode,ae!==F)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:F??"",returnedStateCode:ae??""}}),new E("Unexpected auth flow. This may be a phishing attempt.")}catch(Ue){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:Ue.toString(),provider:d}}),new E("Recovery OAuth failed")}let[vt,fr]=await Promise.all([ge(),Of({api:un.api,provider:d,codeVerifier:A,stateCode:ae,authorizationCode:lt})]);if(!R)throw new E("Cannot connect to wallet proxy");switch(p){case"recover":let Ue=Xe.recoverWallet?.privyWallet?.address;if(!Ue)throw new E("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:Ue,recoveryMethod:d}}),await R.recover({address:Ue,accessToken:vt,recoveryAccessToken:fr,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:Ue,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await R.create({accessToken:vt,recoveryAccessToken:fr,recoveryMethod:d});let er=await de.refreshUser(),Ot=We(er);if(!Ot)throw N(O,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:Ot.address}}),N(O,"createWallet","onSuccess",Ot);break;default:throw new E("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof Xr))throw new E("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(fn),m=t.authFlow.meta.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:m??""}}),new E("Unexpected auth flow. This may be a phishing attempt.");let C,A;if(i)try{C=await t.link(),me.current=d}catch(F){throw N(O,"linkAccount","onError",F.privyErrorCode||"failed_to_link_account"),F}else try{({user:C,isNewUser:A}=await t.authenticate()),me.current=d}catch(F){throw V.current==="login"?N(O,"login","onError",F.privyErrorCode||"unknown_auth_error"):V.current==="link"&&N(O,"linkAccount","onError",F.privyErrorCode||"failed_to_link_account"),F}c(C),b(A||!1),l(!0)},async initLoginWithPasskey(d){let p=new En(d);t.startAuthFlow(p),V.current="login";try{me.current="passkey",await p.initAuthenticationFlow()}catch(m){throw N(O,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}},async loginWithPasskey(){if(!n)throw new Ho;if(!(t.authFlow instanceof En))throw new E("Must initialize Passkey flow first.");if(me.current!=="passkey")throw new E("Must init login with Passkey flow first.");let d,p;try{me.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(m){throw N(O,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d),b(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new En(d);t.startAuthFlow(p),V.current="link",me.current="passkey";try{await p.initLinkFlow()}catch(m){throw N(O,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},async linkWithPasskey(){if(!n)throw new Ho;if(!(t.authFlow instanceof En))throw new E("Must initialize Passkey flow first.");if(me.current!=="passkey")throw new E("Must init login with Passkey flow first.");let d;try{me.current="passkey",d=await t.link()}catch(p){throw N(O,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account"),p}c(d||s||null)},async initLoginWithHeadlessOAuth(d,p){if(Ec()){if(d==="google"&&fc(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 m=new Xr({provider:d,headless:!0});p&&m.addCaptchaToken(p);let C=await t.startAuthFlow(m).getAuthorizationUrl();C?.url&&window.location.assign(C.url)},async loginWithHeadlessOAuth(d){S(!0),t.startAuthFlow(new Xr(d));let p=X.get(fn),m=d.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:m??""}}),S(!1),new E("Unexpected auth flow. This may be a phishing attempt.");let C,A;if(i)try{C=await t.link(),me.current=d.provider}catch(F){throw N(O,"linkAccount","onError",F.privyErrorCode||"failed_to_link_account"),F}else try{({user:C,isNewUser:A}=await t.authenticate()),me.current=d.provider}catch(F){throw V.current==="login"?N(O,"login","onError",F.privyErrorCode||"unknown_auth_error"):V.current==="link"&&N(O,"linkAccount","onError",F.privyErrorCode||"failed_to_link_account"),F}return c(C),b(A||!1),l(!0),S(!1),C??void 0},initLoginWithEmail:async(d,p)=>{let m=new Go(d,p);t.startAuthFlow(m);try{me.current="email",await m.sendCodeEmail()}catch(C){throw V.current==="login"?N(O,"login","onError",C.privyErrorCode||"unknown_auth_error"):V.current==="link"&&N(O,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account"),C}},initUpdateEmail:async(d,p,m)=>{let C=new ts(d,p,m);t.startAuthFlow(C),await C.sendCodeEmail()},initLoginWithSms:async(d,p)=>{M({status:"sending-code"});let m=new Pn(d,p);t.startAuthFlow(m);try{me.current="sms",await m.sendSmsCode(),M({status:"awaiting-code-input"})}catch(C){throw M({status:"error",error:C}),V.current==="login"?N(O,"login","onError",C.privyErrorCode||"unknown_auth_error"):V.current==="link"&&N(O,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account"),C}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(M({status:"submitting-code"}),!n){let A=new Ho;throw M({status:"error",error:A}),A}if(t.authFlow instanceof Go)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof Pn)t.authFlow.meta.smsCode=d.trim();else{let A=new E("Must initialize a passwordless code flow first");throw M({status:"error",error:A}),A}let p=await ge(),m,C;if(p&&t.sessionHasActiveToken())try{m=await t.link()}catch(A){throw M({status:"error",error:A}),N(O,"linkAccount","onError",A.privyErrorCode||"failed_to_link_account"),A}else try{({user:m,isNewUser:C}=await t.authenticate())}catch(A){throw M({status:"error",error:A}),N(O,"login","onError",A.privyErrorCode||"unknown_auth_error"),A}c(m||s||null),b(C||!1),l(!0),M({status:"done"})},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:R,createAnalyticsEvent:({eventName:d,payload:p,timestamp:m})=>t.createAnalyticsEvent({eventName:d,payload:p,timestamp:m}),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let m=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy"),C=await ge();if(!C||!R||!m){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}se(!0);try{await R.connect({accessToken:C,address:m.address}),d(!0)}catch(A){if(An(A)&&m.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:m.address}}),(await R.recover({address:m.address,accessToken:C})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:m.address}}),d(!0);else if(An(A)){le({recoverWallet:{privyWallet:m,onFailure:p,onSuccess:()=>d(!0)}});let F=El(m.recoveryMethod);ce(F)}else p(A)}}),getFiatOnRampConfig:$n,setReadyToTrue:d=>{a(!0),Ar?.(d)},updateWallets:()=>ur(),fundWallet:async(d,p)=>{let{signedUrl:m,externalTransactionId:C}=await $n(d,p);le({fiatOnRampPrompt:{signedUrl:m},fiatOnRampStatus:{externalTransactionId:C}}),ce("FIAT_ON_RAMP_PROMPT_SCREEN")},requestFarcasterSignerStatus:async d=>{let p=await ge(),m=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!R||!m)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let C=await t.requestFarcasterSignerStatus(d);if(C.status==="approved"){let A=await t.getAuthenticatedUser();c(A||s||null)}return C}}))();g2=de.recoverEmbeddedWallet;let K2=(0,re.useMemo)(()=>({wallets:u,ready:Kr}),[u,Kr]);return(0,Xt.jsx)(we.Provider,{value:jn,children:(0,Xt.jsx)(jc.Provider,{value:O,children:(0,Xt.jsx)(Qd.Provider,{value:K2,children:(0,Xt.jsxs)(Pm,{...B,children:[e.children,(0,Xt.jsxs)($c.Provider,{value:de,children:[!fp&&B.captchaEnabled&&n&&!i&&(0,Xt.jsx)(ol,{delayedExecution:!1}),(0,Xt.jsx)(i2,{theme:{...B.appearance.palette||{}}}),(0,Xt.jsx)(fm,{data:Xe,setModalData:le,setInitialScreen:x,initialScreen:w,authenticated:i,open:r,children:(0,Xt.jsx)(l2,{open:r})}),ye&&he?(0,Xt.jsx)(d2,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Ht,mfaSubmitPromise:st,onLoad:fe,onLoadFailed:()=>null}):null]})]})})})})};var C2=require("react");function w2(e){let{login:t}=(0,C2.useContext)(we);return $e("login",e),{login:t}}var b2=require("react");function E2(e){let{logout:t}=(0,b2.useContext)(we);return $e("logout",e),{logout:t}}var qa=require("react");function T2(){let e=Se(),t=Js(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:a,user:i}=H(),l=(0,qa.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new Lr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=(0,qa.useCallback)(async()=>{let c=da();if(i)return console.warn("Cannot login with OAuth when already logged in"),i;if(!c.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!c.popupFlow)try{return await o(c)}catch(u){throw u}finally{bn()}},[o]);return(0,qa.useEffect)(()=>{let c=da();a&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[a,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}var cp=require("react");var P2=()=>{let e=Se(),{initLoginWithEmail:t,loginWithCode:r}=H(),o=(0,cp.useCallback)(async({email:a})=>{if(!a)throw new Error("Email required to send OTP code");return t(a)},[t]),n=(0,cp.useCallback)(async({code:a})=>{if(e.enabled&&e.status==="error")throw new Lr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var dp=require("react");var S2=()=>{let e=Se(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=H(),n=(0,dp.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return t(i)},[t]),a=(0,dp.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new Lr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:n,loginWithCode:a,state:o}};var x2=require("react");function _2(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:g,linkFarcaster:f}=(0,x2.useContext)(we);return $e("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:g,linkFarcaster:f}}var k2=require("react");function A2(e){let{connectWallet:t}=(0,k2.useContext)(we);return $e("connectWallet",e),{connectWallet:t}}var R2=require("react");function I2(e){let{createWallet:t}=(0,R2.useContext)(we);return $e("createWallet",e),{createWallet:t}}var M2=()=>{let{fundWallet:e}=H();return{fundWallet:e}};var W2=require("react");function L2(e){let{sendTransaction:t}=(0,W2.useContext)(we);return $e("sendTransaction",e),{sendTransaction:t}}var O2=require("react");function N2(e){let{setWalletPassword:t}=(0,O2.useContext)(we);return $e("setWalletPassword",e),{setWalletPassword:t}}var D2=require("react");function F2(e){let{signMessage:t}=(0,D2.useContext)(we);return $e("signMessage",e),{signMessage:t}}var U2=require("react");function B2(e){let{signTypedData:t}=(0,U2.useContext)(we);return $e("signTypedData",e),{signTypedData:t}}var H2=require("react");var G2=()=>{let{isModalOpen:e}=(0,H2.useContext)(we);return{isOpen:e}};var V2=require("react");function z2(e){let{getAccessToken:t}=(0,V2.useContext)(we);return $e("accessToken",e),{getAccessToken:t}}function q2(){let{submitCast:e,removeCast:t,likeCast:r,recastCast:o,followUser:n,unfollowUser:a,requestFarcasterSigner:i}=H();return{followUser:n,unfollowUser:a,submitCast:e,removeCast:t,likeCast:r,recastCast:o,requestFarcasterSigner:i}}function $2(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,useConnectWallet,useCreateWallet,useExperimentalFarcasterSigner,useFundWallet,useLinkAccount,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSignMessage,useSignTypedData,useToken,useWallets});
|