@privy-io/react-auth 1.59.2 → 1.59.3-beta-20240307234516

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var P1=Object.create;var Ca=Object.defineProperty;var T1=Object.getOwnPropertyDescriptor;var x1=Object.getOwnPropertyNames;var S1=Object.getPrototypeOf,_1=Object.prototype.hasOwnProperty;var A1=(e,t)=>{for(var o in t)Ca(e,o,{get:t[o],enumerable:!0})},_d=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of x1(t))!_1.call(e,n)&&n!==o&&Ca(e,n,{get:()=>t[n],enumerable:!(r=T1(t,n))||r.enumerable});return e};var h=(e,t,o)=>(o=e!=null?P1(S1(e)):{},_d(t||!e||!e.__esModule?Ca(o,"default",{value:e,enumerable:!0}):o,e)),k1=e=>_d(Ca({},"__esModule",{value:!0}),e);var Dl=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)};var Ad=(e,t,o)=>(Dl(e,t,"read from private field"),o?o.call(e):t.get(e)),ba=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},Ul=(e,t,o,r)=>(Dl(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o);var kd=(e,t,o)=>(Dl(e,t,"access private method"),o);var q0={};A1(q0,{AsExternalProvider:()=>vo,Captcha:()=>vs,ConnectorManager:()=>Nn,PrivyClient:()=>Dn,PrivyProvider:()=>$g,PrivyProxyProvider:()=>ke,SUPPORTED_CHAINS:()=>Wn,VERSION:()=>Ra,WalletConnector:()=>Pt,addRpcUrlOverrideToChain:()=>v1,errorIndicatesMaxMfaRetries:()=>Bs,errorIndicatesMfaTimeout:()=>en,errorIndicatesMfaVerificationFailed:()=>tn,getAccessToken:()=>Ye,useConnectWallet:()=>o1,useCreateWallet:()=>n1,useFundWallet:()=>i1,useLinkAccount:()=>e1,useLogin:()=>jg,useLoginWithEmail:()=>Zg,useLoginWithOAuth:()=>Jg,useLoginWithSms:()=>Qg,useLogout:()=>Yg,useMfa:()=>dn,useMfaEnrollment:()=>fi,useModalStatus:()=>h1,usePrivy:()=>G,useRegisterMfaListener:()=>Es,useSendTransaction:()=>s1,useSetWalletPassword:()=>c1,useSignMessage:()=>p1,useSignTypedData:()=>m1,useToken:()=>g1,useWallets:()=>Ei});module.exports=k1(q0);var ga=require("@ethersproject/address"),Si=require("@ethersproject/providers"),Bg=require("mipd"),Q=require("react");var Rd=require("ofetch"),ct=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},No=class extends ct{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},T=class extends ct{constructor(o,r,n){super(o,r,n);this.type="client_error"}},Ea=class extends T{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var X=class extends ct{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},me=e=>{if(e instanceof ct)return e;if(!(e instanceof Rd.FetchError))return wt(e);if(!e.response)return new No("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new No(t||"ApiError",e.response.status,o||r,e,n)},wt=e=>e instanceof ct?e:e instanceof Error?new T(e.message,e):new T(`Internal error: ${e}`);var Cn=class extends T{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Ft=class extends T{constructor(t="Embedded wallet error",o){super(t,o,"unknown_embedded_wallet_error")}},Pa=class extends T{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Ta="/api/v1/sessions",xa="/api/v1/sessions/logout",Id="/api/v1/sessions/fork",Sa="/api/v1/sessions/fork/recover",Md="/api/v1/siwe/init",Wd="/api/v1/siwe/authenticate",Ld="/api/v1/siwe/link",Od="/api/v1/siwe/unlink",Nd="/api/v1/farcaster/init",Dd="/api/v1/farcaster/authenticate",Ud="/api/v1/farcaster/link",Fd="/api/v1/farcaster/status",Bd="/api/v1/farcaster/unlink",Hd="/api/v1/passwordless/init",Gd="/api/v1/passwordless/authenticate",Vd="/api/v1/passwordless/link",zd="/api/v1/passwordless/unlink",$d="/api/v1/passwordless/update",qd="/api/v1/passwordless_sms/init",jd="/api/v1/passwordless_sms/link",Kd="/api/v1/passwordless_sms/unlink",Yd="/api/v1/passwordless_sms/authenticate",Jd="/api/v1/oauth/init",Zd="/api/v1/oauth/authenticate",Qd="/api/v1/oauth/link",Xd="/api/v1/oauth/unlink";var ep="/api/v1/mfa/passwordless_sms/init",tp="/api/v1/mfa/passwordless_sms/enroll";var op="/api/v1/users/me/accept_terms",rp="/api/v1/analytics_events",np="/api/v1/plugins/moonpay_on_ramp/sign",ip="/api/v1/custom_jwt_account/authenticate";var bn=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new T("Auth flow has no API instance");try{let t=await this.api.post(ip,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){throw new Error("Unimplemented")}};var Cr=class{constructor(t,o){this.meta={email:t,captchaToken:o}}async authenticate(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new T("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Gd,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new T("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Vd,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw me(t)}}async sendCodeEmail(t,o){if(!this.api)throw new T("Auth flow has no API instance");if(t&&(this.meta.email=t),o&&(this.meta.captchaToken=o),!this.meta.email)throw new T("Email must be set when initialzing authentication.");try{return await this.api.post(Hd,{email:this.meta.email,token:this.meta.captchaToken})}catch(r){throw me(r)}}},_a=class extends Cr{constructor(o,r,n){super(r,n);this.meta={email:r,captchaToken:n,oldAddress:o}}async link(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new T("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post($d,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(o){throw me(o)}}};var ap=require("react-device-detect");var Ct=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 ki=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Ct(this._startChannelOnce.bind(this)),this.pollForReady=new Ct(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.channelToken)throw new T("Auth flow must be initialized first");try{let t=await this.api.post(Dd,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new T("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new T("Auth flow has no API instance");try{return await this.api.post(Ud,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw me(t)}}async _startChannelOnce(){if(!this.api)throw new T("Auth flow has no API instance");let t=await this.api.post(Nd,{token:this.captchaToken});ap.isMobile&&t.connect_uri&&window.open(t.connect_uri,"_blank","noopener noreferrer"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new T("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.channelToken)throw new T("Auth flow must be initialized first");let t=await this.api.get(Fd,{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 jl=require("jose");var sp="1.59.2";var Aa="4df5e2316331463a9130964bd6078dfa",lp="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",cp="34357d3c125c2bcf2ce2bc3309d98715",ka="https://auth.privy.io",dp=2e4,bt=1400,pp=2500,Ra=sp;var $r="privy:token",Fl="privy-token",Ia="privy:refresh_token",Bl="privy-refresh-token",Ma="privy-session",Ri="privy:session_transfer_token",I1="privy:wallet",Ii="privy:caid",qr="privy:state_code",En="privy:code_verifier",Mi="privy:headless_oauth",Wa=e=>`${I1}:${e}`,Hl="privy:connectors",Gl="privy:connections";var jr=12e4,or=1,Vl="0x1",Pn=3e4,up="https://api.moonpay.com/v1",mp="https://api.moonpay.com/v1",fp="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",hp="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",yp="0x420000000000000000000000000000000000000F",gp=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function vp(e){let t=new TextEncoder().encode(e),o=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(o)}function wp(e){return crypto.getRandomValues(new Uint8Array(e))}var La=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},zl=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}},$l=class{get(t){let o=sessionStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?sessionStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){sessionStorage.removeItem(t)}getKeys(){return Object.entries(sessionStorage).map(([t])=>t)}};function ql(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function M1(){return typeof window<"u"&&window.localStorage?new zl:new La}function W1(){return typeof window<"u"&&window.sessionStorage?new $l:new La}var dt=W1(),fe=M1();function Oa(){return!!dt.get(Mi)}var L1="S256",O1="S256",Do=class{constructor(t){let o=typeof t.headless=="boolean"?t.headless:Oa();this.meta={...t,headless:o}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new T("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new T("User denied confirmation during OAuth flow");let t=dt.get(En);if(!t)throw new T("Authentication error.");try{let o=await this.api.post(Zd,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return dt.del(En),this.meta.headless&&dt.del(Mi),{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(o){let r=me(o);throw r.privyErrorCode?new T(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.message==="User denied confirmation during OAuth flow"?new T("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new T("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new T("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new T("User denied confirmation during OAuth flow");let t=dt.get(En);if(!t)throw new T("Authentication error.");try{let o=await this.api.post(Qd,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return dt.del(En),o}catch(o){throw me(o)}}createCodeVerifier(){return jl.base64url.encode(wp(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,o=L1){if(o==O1){let r=await vp(t);return jl.base64url.encode(r)}else return t}async getAuthorizationUrl(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.provider)throw new T("Provider must be set when initializing OAuth authentication.");let t=this.createCodeVerifier();dt.put(En,t);let o=this.createStateCode();dt.put(qr,o);let r=await this.deriveCodeChallengeFromCodeVerifier(t);this.meta.headless&&dt.put(Mi,!0);try{return await this.api.post(Jd,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:o})}catch(n){throw me(n)}}};function Kl(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Cp(e,t){let o={detail:"",retryable:!1},r=Kl(t);return e?.privyErrorCode==="linked_to_another_user"&&(o.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(o.retryable=!0,o.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(o.detail=`Retry and check ${r} to finish connecting your account.`,o.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(o.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="oauth_account_suspended"&&(o.detail=`Your ${r} account is suspended. Please try another login method.`),o}function Li(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),o=e.get("privy_oauth_state"),r=e.get("privy_oauth_provider");return!t||!o||!r?{inProgress:!1}:{inProgress:!0,authorizationCode:t,stateCode:o,provider:r,headless:Oa()}}function Oi(){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"),dt.del(qr),window.history.pushState({},"",e)}var Kr=class{constructor(t,o){this.createSiweMessage=(t,o,r,n,i,a,l)=>`${r} wants you to sign in with your Ethereum account:
2
- ${o}
1
+ "use strict";var E1=Object.create;var wa=Object.defineProperty;var P1=Object.getOwnPropertyDescriptor;var T1=Object.getOwnPropertyNames;var x1=Object.getPrototypeOf,S1=Object.prototype.hasOwnProperty;var _1=(e,t)=>{for(var r in t)wa(e,r,{get:t[r],enumerable:!0})},Rd=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T1(t))!S1.call(e,n)&&n!==r&&wa(e,n,{get:()=>t[n],enumerable:!(o=P1(t,n))||o.enumerable});return e};var h=(e,t,r)=>(r=e!=null?E1(x1(e)):{},Rd(t||!e||!e.__esModule?wa(r,"default",{value:e,enumerable:!0}):r,e)),A1=e=>Rd(wa({},"__esModule",{value:!0}),e);var Fl=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var Id=(e,t,r)=>(Fl(e,t,"read from private field"),r?r.call(e):t.get(e)),Ca=(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)},Bl=(e,t,r,o)=>(Fl(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var Md=(e,t,r)=>(Fl(e,t,"access private method"),r);var $2={};_1($2,{AsExternalProvider:()=>gr,Captcha:()=>ys,ConnectorManager:()=>Un,PrivyClient:()=>Fn,PrivyProvider:()=>$g,PrivyProxyProvider:()=>Ae,SUPPORTED_CHAINS:()=>On,VERSION:()=>Aa,WalletConnector:()=>Pt,addRpcUrlOverrideToChain:()=>v1,errorIndicatesMaxMfaRetries:()=>Us,errorIndicatesMfaTimeout:()=>nn,errorIndicatesMfaVerificationFailed:()=>an,getAccessToken:()=>je,useConnectWallet:()=>r1,useCreateWallet:()=>n1,useFundWallet:()=>i1,useLinkAccount:()=>e1,useLogin:()=>jg,useLoginWithEmail:()=>Zg,useLoginWithOAuth:()=>Jg,useLoginWithSms:()=>Qg,useLogout:()=>Yg,useMfa:()=>fn,useMfaEnrollment:()=>yi,useModalStatus:()=>h1,usePrivy:()=>G,useRegisterMfaListener:()=>Cs,useSendTransaction:()=>s1,useSetWalletPassword:()=>c1,useSignMessage:()=>p1,useSignTypedData:()=>m1,useToken:()=>g1,useWallets:()=>Ti});module.exports=A1($2);var ya=require("@ethersproject/address"),Ll=require("@ethersproject/providers"),Bg=require("mipd"),Z=require("react");var Wd=require("ofetch"),lt=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}]`:""}`}},Dr=class extends lt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},x=class extends lt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},ba=class extends x{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var X=class extends lt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},ue=e=>{if(e instanceof lt)return e;if(!(e instanceof Wd.FetchError))return wt(e);if(!e.response)return new Dr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new Dr(t||"ApiError",e.response.status,r||o,e,n)},wt=e=>e instanceof lt?e:e instanceof Error?new x(e.message,e):new x(`Internal error: ${e}`);var bn=class extends x{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Ht=class extends x{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},Ea=class extends x{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Pa="/api/v1/sessions",Ta="/api/v1/sessions/logout",Ld="/api/v1/sessions/fork",xa="/api/v1/sessions/fork/recover",Od="/api/v1/siwe/init",Nd="/api/v1/siwe/authenticate",Dd="/api/v1/siwe/link",Ud="/api/v1/siwe/unlink",Fd="/api/v1/farcaster/init",Bd="/api/v1/farcaster/authenticate",Hd="/api/v1/farcaster/link",Gd="/api/v1/farcaster/status",Vd="/api/v1/farcaster/unlink",zd="/api/v1/passwordless/init",$d="/api/v1/passwordless/authenticate",qd="/api/v1/passwordless/link",jd="/api/v1/passwordless/unlink",Kd="/api/v1/passwordless/update",Yd="/api/v1/passwordless_sms/init",Jd="/api/v1/passwordless_sms/link",Zd="/api/v1/passwordless_sms/unlink",Qd="/api/v1/passwordless_sms/authenticate",Xd="/api/v1/oauth/init",ep="/api/v1/oauth/authenticate",tp="/api/v1/oauth/link",rp="/api/v1/oauth/unlink";var op="/api/v1/mfa/passwordless_sms/init",np="/api/v1/mfa/passwordless_sms/enroll";var ip="/api/v1/users/me/accept_terms",ap="/api/v1/analytics_events",sp="/api/v1/plugins/moonpay_on_ramp/sign",lp="/api/v1/custom_jwt_account/authenticate";var En=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let t=await this.api.post(lp,{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 ue(t)}}async link(){throw new Error("Unimplemented")}};var To=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post($d,{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 ue(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(qd,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ue(t)}}async sendCodeEmail(t,r){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new x("Email must be set when initialzing authentication.");try{return await this.api.post(zd,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ue(o)}}},Sa=class extends To{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new x("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Kd,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ue(r)}}};var cp=require("react-device-detect");var Ct=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 Ai=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Ct(this._startChannelOnce.bind(this)),this.pollForReady=new Ct(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.channelToken)throw new x("Auth flow must be initialized first");try{let t=await this.api.post(Bd,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new x("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 ue(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{return await this.api.post(Hd,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ue(t)}}async _startChannelOnce(){if(!this.api)throw new x("Auth flow has no API instance");let t=await this.api.post(Fd,{token:this.captchaToken});cp.isMobile&&t.connect_uri&&window.open(t.connect_uri,"_blank","noopener noreferrer"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new x("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.channelToken)throw new x("Auth flow must be initialized first");let t=await this.api.get(Gd,{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 Zl=require("jose");var dp="1.59.3-beta-20240307234516";var Hl="4df5e2316331463a9130964bd6078dfa",Gl="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",pp="34357d3c125c2bcf2ce2bc3309d98715",_a="https://auth.privy.io",up=2e4,bt=1400,mp=2500,Aa=dp;var Ko="privy:token",Vl="privy-token",ka="privy:refresh_token",zl="privy-refresh-token",Ra="privy-session",ki="privy:session_transfer_token",R1="privy:wallet",Ri="privy:caid",Yo="privy:state_code",Pn="privy:code_verifier",Ii="privy:headless_oauth",Ia=e=>`${R1}:${e}`,$l="privy:connectors",ql="privy:connections";var Jo=12e4,no=1,jl="0x1",Tn=3e4,fp="https://api.moonpay.com/v1",hp="https://api.moonpay.com/v1",yp="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",gp="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",vp="0x420000000000000000000000000000000000000F",wp=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function Cp(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function bp(e){return crypto.getRandomValues(new Uint8Array(e))}var Ma=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)}},Kl=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)}},Yl=class{get(t){let r=sessionStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?sessionStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){sessionStorage.removeItem(t)}getKeys(){return Object.entries(sessionStorage).map(([t])=>t)}};function Jl(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function I1(){return typeof window<"u"&&window.localStorage?new Kl:new Ma}function M1(){return typeof window<"u"&&window.sessionStorage?new Yl:new Ma}var ct=M1(),me=I1();function Wa(){return!!ct.get(Ii)}var W1="S256",L1="S256",Ur=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Wa();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 x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");let t=ct.get(Pn);if(!t)throw new x("Authentication error.");try{let r=await this.api.post(ep,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return ct.del(Pn),this.meta.headless&&ct.del(Ii),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(r){let o=ue(r);throw o.privyErrorCode?new x(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new x("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new x("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");let t=ct.get(Pn);if(!t)throw new x("Authentication error.");try{let r=await this.api.post(tp,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return ct.del(Pn),r}catch(r){throw ue(r)}}createCodeVerifier(){return Zl.base64url.encode(bp(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,r=W1){if(r==L1){let o=await Cp(t);return Zl.base64url.encode(o)}else return t}async getAuthorizationUrl(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.provider)throw new x("Provider must be set when initializing OAuth authentication.");let t=this.createCodeVerifier();ct.put(Pn,t);let r=this.createStateCode();ct.put(Yo,r);let o=await this.deriveCodeChallengeFromCodeVerifier(t);this.meta.headless&&ct.put(Ii,!0);try{return await this.api.post(Xd,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw ue(n)}}};function Ql(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ep(e,t){let r={detail:"",retryable:!1},o=Ql(t);return 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==="oauth_account_suspended"&&(r.detail=`Your ${o} account is suspended. Please try another login method.`),r}function Wi(){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:Wa()}}function Li(){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"),ct.del(Yo),window.history.pushState({},"",e)}var Zo=class{constructor(t,r){this.createSiweMessage=(t,r,o,n,i,a,l)=>`${o} wants you to sign in with your Ethereum account:
2
+ ${r}
3
3
 
4
4
  ${l}
5
5
 
@@ -9,7 +9,7 @@ Chain ID: ${t}
9
9
  Nonce: ${a}
10
10
  Issued At: ${i}
11
11
  Resources:
12
- - https://privy.io`;this.getNonceOnce=new Ct(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.api)throw new T("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Wd,{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new T("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign();return await this.api.post(Ld,{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw me(t)}}async sign(){if(!this.api)throw new T("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new T("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 T("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(Md,{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new T("Auth flow has no API instance");let t=this.wallet.address,o=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=this.prepareMessage(o,t,this.nonce),this.preparedMessage}prepareMessage(t,o,r){let n=window.location.host,i=window.location.origin,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",l=new Date().toISOString();return this.createSiweMessage(t,o,n,i,l,r,a)}};var Yr=class{constructor(t,o){this.meta={phoneNumber:t,captchaToken:o}}async authenticate(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new T("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Yd,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new T("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new T("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(jd,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw me(t)}}async sendSmsCode(t,o){if(!this.api)throw new T("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),o&&(this.meta.captchaToken=o),!this.meta.phoneNumber)throw new T("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(qd,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(r){throw me(r)}}};var _u=require("uuid");function Et(e){return new Date(e*1e3)}function N1(e){let t=[];for(let o of e){let r=o.type;switch(o.type){case"wallet":let n={address:o.address,type:o.type,verifiedAt:Et(o.verified_at),chainType:"ethereum",chainId:o.chain_id,walletClient:o.wallet_client_type==="privy"?"privy":"unknown",walletClientType:o.wallet_client_type,connectorType:o.connector_type,recoveryMethod:o.recovery_method};t.push(n);break;case"email":let i={address:o.address,type:o.type,verifiedAt:Et(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:Et(o.verified_at)};t.push(a);break;case"google_oauth":let l={subject:o.subject,email:o.email,name:o.name,type:o.type,verifiedAt:Et(o.verified_at)};t.push(l);break;case"spotify_oauth":let s={subject:o.subject,email:o.email,name:o.name,type:o.type,verifiedAt:Et(o.verified_at)};t.push(s);break;case"twitter_oauth":let c={subject:o.subject,username:o.username,name:o.name,type:o.type,profilePictureUrl:o.profile_picture_url,verifiedAt:Et(o.verified_at)};t.push(c);break;case"discord_oauth":let u={subject:o.subject,username:o.username,email:o.email,type:o.type,verifiedAt:Et(o.verified_at)};t.push(u);break;case"github_oauth":let f={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:Et(o.verified_at)};t.push(f);break;case"tiktok_oauth":let g={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:Et(o.verified_at)};t.push(g);break;case"linkedin_oauth":let w={subject:o.subject,name:o.name,email:o.email,type:o.type,verifiedAt:Et(o.verified_at)};t.push(w);break;case"apple_oauth":let C={subject:o.subject,email:o.email,type:o.type,verifiedAt:Et(o.verified_at)};t.push(C);break;case"custom_auth":t.push({type:o.type,customUserId:o.custom_user_id,verifiedAt:Et(o.verified_at)});break;case"farcaster":let E={type:o.type,fid:o.fid,ownerAddress:o.owner_address,displayName:o.display_name,username:o.username,bio:o.bio,pfp:o.profile_picture_url,url:o.homepage_url,verifiedAt:Et(o.verified_at)};t.push(E);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function Jt(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var Ie=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,D1=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Zt=(e,t)=>t==="all-users"&&!Ie(e)||t==="users-without-wallets"&&!D1(e)?.length;function Bt(e){if(!e)return null;let t=N1(e.linked_accounts),o=Jt(t,"wallet"),r=Jt(t,"email"),n=Jt(t,"phone"),i=Jt(t,"google_oauth"),a=Jt(t,"twitter_oauth"),l=Jt(t,"discord_oauth"),s=Jt(t,"github_oauth"),c=Jt(t,"spotify_oauth"),u=Jt(t,"tiktok_oauth"),f=Jt(t,"linkedin_oauth"),g=Jt(t,"apple_oauth"),w=Jt(t,"farcaster"),C=e.mfa_methods.map(({type:x,verified_at:b})=>({type:x,verifiedAt:Et(b)}));return{id:e.id,createdAt:Et(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:n&&{number:n?.number},wallet:o&&{address:o.address,chainType:o.chainType,chainId:o.chainId,walletClient:o.walletClient,walletClientType:o.walletClientType,connectorType:o.connectorType,recoveryMethod:o.recoveryMethod},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:f&&{subject:f.subject,name:f.name,email:f.email},apple:g&&{subject:g.subject,email:g.email},farcaster:w&&{fid:w.fid,ownerAddress:w.ownerAddress,displayName:w.displayName,username:w.username,bio:w.bio,pfp:w.pfp,url:w.url},mfaMethods:C.map(x=>x.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var nc=require("@ethersproject/address"),Pu=h(require("eventemitter3"));function bp(){let e=window,t=e.ethereum;if(!t)return[];let o=[];if(t.providers?.length)for(let r of t.providers)r&&o.push(r);return o.push(e.ethereum),o}var Na=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 Yl=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Na(e)!=="MetaMask")return!1;if(e.providers){for(let o of e.providers)if(!Yl(o))return!1}return!0},br=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Ep=()=>{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 Pp=(e,t)=>{let o=[],r=[];for(let[n,i]of e.entries())n<t?o.push(i):r.push(i);return[o,r]},Da=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,}))$/),Tp=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Er=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},Jl=e=>new Promise(t=>setTimeout(t,e));function xp(e,{interval:t=100,timeout:o=5e3}={}){return new Promise((r,n)=>{let i=0,a,l=()=>{if(i>=o){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){r(a);return}setTimeout(l,t)};l()})}var Sp=(e,t={})=>{let o=t.delayMs||150,r=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<r;){if(t.abortSignal?.aborted)return;e().then(()=>{a=!0,n()},(...s)=>{a=!0,i(...s)}),l+=1,await Jl(o)}a||i(new Error("Exceeded max attempts before resolving function"))})},Ua=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href};var _p=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Jr=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Ap(e,t,o=3e3){let r=!1,n=window;return new Promise(i=>{n.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout(()=>{a()},o));function a(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",a);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 bp()){let u=Na(c);if(!l.some(f=>f.info.name===u)){if(Yl(c,!0)&&!s.find(f=>f.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(f=>f.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(f=>f.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function Tn(e){return`eip155:${String(Number(e))}`}var yo=(e,t,o)=>{let r=Number(e),n=t.find(a=>a.id===r);if(!n)throw new X(`Unsupported chainId ${e}`,4901);let i;if(n.rpcUrls.privyWalletOverride&&n.rpcUrls.privyWalletOverride.http[0]?i=n.rpcUrls.privyWalletOverride.http[0]:o.rpcUrls&&o.rpcUrls[r]?i=o.rpcUrls[r]:n.rpcUrls.infura?.http[0]?i=n.rpcUrls.infura.http[0]+"/"+Aa:n.rpcUrls.blast?.http[0]?i=n.rpcUrls.blast.http[0]+"/"+lp:i=n.rpcUrls.default?.http[0],!i)throw new X(`No RPC url found for ${e}`);return i},kp=(e,t)=>{let o=Number(e),r=t.find(n=>n.id===o);if(!r)throw new X(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url},Fa=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},o=Object.entries(e.domain).map(([r,n])=>{if(n!=null&&typeof r=="string"&&r in t)return{name:r,type:t[r]}}).filter(r=>r!==void 0);return{...e,types:{...e.types,EIP712Domain:o}}};var Up=h(require("@coinbase/wallet-sdk"));var Ni=require("react/jsx-runtime"),Ba=({style:e,...t})=>(0,Ni.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,Ni.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Ni.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 wo=require("@ethersproject/address"),Ql=require("@ethersproject/providers"),Dp=h(require("eventemitter3"));var Zl=require("@ethersproject/providers"),Mp=h(require("eventemitter3"));var U1=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Rp=e=>U1.includes(e);var Ip=require("@ethersproject/logger");var xn=class extends X{constructor(){super("Wallet timeout");this.type="wallet_error"}},Sn=class extends X{constructor(){super("User rejected connection");this.type="wallet_error"}},go=e=>{if(e instanceof X)return e;if(e?.code&&e?.reason){let t=new Oe(e);return e.code===Ip.ErrorCode.ACTION_REJECTED&&(t.details=pt.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Oe(e):new X("Unknown connector error",e)},Qt=class extends ct{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Oe=class extends Qt{constructor(o){let r=o;super(r.message,r.code,r.data);let n=Object.values(pt).find(i=>i.eipCode===r.code);this.details=n||pt.UNKNOWN_ERROR,r.code===-32002&&(r.message?.includes("already pending for origin")?r.message?.includes("wallet_requestPermissions")?this.details=pt.E32002_CONNECTION_ALREADY_PENDING:this.details=pt.E32002_REQUEST_ALREADY_PENDING:r.message?.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=pt.E32002_WALLET_LOCKED))}},F1={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}},B1={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}},H1={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}},pt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...H1,...B1},rr={...F1,...pt};var ke=class{constructor(t,o){this.removeListener=(t,o)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,o)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new xn,o=this.rpcTimeoutDuration)=>new Promise((r,n)=>setTimeout(()=>{n(t)},o));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(o=>{this.removeListener(o.eventName,o.listener)}),this.walletProvider=t,this._subscriptions.forEach(o=>{this.walletProvider?.on(o.eventName,o.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=o||jr,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new X(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(o=>{throw go(o)})}},Pr=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Ha=class extends Mp.default{constructor(o,r,n,i,a=1){super();this.walletProxy=o,this.address=r,this.chainId=a,this.rpcConfig=n,this.chains=i,this.provider=new Zl.StaticJsonRpcProvider(yo(a,this.chains,n)),this.rpcTimeoutDuration=_n(n,"privy")}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Pr(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Ye()||!this.address)throw new Pr("Disconnected",4900);return(await Op(r)).hash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Pr(`Invalid params for ${o.method}`,4200);let r;if(typeof o.params[0]=="string")r=o.params[0];else if("chainId"in o.params[0]&&typeof o.params[0].chainId=="string")r=o.params[0].chainId;else throw new Pr(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new Zl.StaticJsonRpcProvider(yo(this.chainId,this.chains,this.rpcConfig)),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for personal_sign");let r=o.params[0];return await Wp(r)}async handleSignedTypedData(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_signTypedData_v4");let r=typeof o.params[1]=="string"?JSON.parse(o.params[1]):o.params[1];return await Lp(Fa(r))}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");delete o.params[0].gasPrice,delete o.params[0].maxFeePerGas,delete o.params[0].maxPriorityFeePerGas;let r={...o.params[0],chainId:Jr(this.chainId)};try{return await this.provider.send("eth_estimateGas",[r])}catch{return delete r.from,await this.provider.send("eth_estimateGas",[r])}}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return Jr(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);case"eth_signTypedData_v4":return this.handleSignedTypedData(o);default:break}if(Rp(o.method)){let r=await Ye();if(await Np(),!r||!this.address)throw new Pr("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new Pr("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await Ye();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},vo=class extends ke{constructor(o){super(o,o.rpcTimeoutDuration)}},Tr=class extends ke{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var G1=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},Pt=class extends Dp.default{constructor(o,r,n,i){super();this.onAccountsChanged=o=>{o.length===0?this.onDisconnect():this.syncAccounts(o)};this.onChainChanged=o=>{this.wallets.forEach(r=>{r.chainId=Tn(o),this.walletClientType==="privy"&&fe.put(Wa(r.address),o)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=o,this.chains=r,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=_n(i,o),this.connected=!1,this.initialized=!1}buildConnectedWallet(o,r,n){let i=async()=>!!this.wallets.find(a=>(0,wo.getAddress)(a.address)===(0,wo.getAddress)(o));return{address:(0,wo.getAddress)(o),chainId:r,meta:n,switchChain:async a=>{if(!i)throw new X("Wallet is not currently connected.");let l=this.wallets.find(g=>(0,wo.getAddress)(g.address)===(0,wo.getAddress)(o))?.chainId;if(!l)throw new X("Unable to determine current chainId.");let s,c;if(typeof a=="number"?(s=`0x${a.toString(16)}`,c=a):(s=a,c=Number(a)),l===Tn(s))return;let u=this.chains.find(g=>g.id===c);if(!u)throw new X(`Unsupported chainId: ${a}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await f()}catch(g){if(G1(g,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??""]}]}),f();throw this.walletClientType==="rainbow"&&g.message?.includes("wallet_switchEthereumChain")?new X(`Rainbow does not support the chainId ${r}`):g}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new X("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new X("Wallet is not currently connected.");return new Ql.Web3Provider(new vo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new X("Wallet is not currently connected.");return new Tr(this.proxyProvider)},sign:async a=>{if(!await i())throw new X("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(o){let r=o;try{if(r===void 0){let c=await this.proxyProvider.request({method:"eth_accounts"});Array.isArray(c)&&(r=c)}}catch{console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.")}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return;let n=r[0],i=(0,wo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=fe.get(Wa(i));this.chains.find(u=>u.id===Number(c))||(fe.del(Wa(i)),c=null),l=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let c=await 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 ${Vl}`,c),l=Vl}let s=Tn(l);if(!a.find(c=>(0,wo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,wo.getAddress)(n),s,c))}Ga(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let o=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((r,n)=>n.connectedAt-r.connectedAt).find(r=>o.find(n=>(0,wo.getAddress)(n)===(0,wo.getAddress)(r.address)))||null}async isConnected(){let o=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(o)&&o.length>0}async sign(o){return await this.connect({showPrompt:!1}),new Ql.Web3Provider(new vo(this.proxyProvider)).getSigner().signMessage(o)}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 V1=e=>{let t=`https://mainnet.infura.io/v3/${Aa}`,o=1;return e.makeWeb3Provider(t,o)},Va,za=class extends Pt{constructor(o,r,n){super("coinbase_wallet",o,r,n);this.connectorType="coinbase_wallet";this.proxyProvider=new ke(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),Va||(Va=new Up.default({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(V1(Va))}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){Va.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:Ba,id:"com.coinbase.wallet"}}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0||!o[0])throw new X("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([o[0]])}catch(o){throw go(o)}}};var Xl=require("react/jsx-runtime"),$a=({...e})=>(0,Xl.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Xl.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 qa=class extends Pt{constructor(o,r,n,i){super("privy",r,n,i);this.connectorType="embedded";this.proxyProvider=o,this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(o){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Jr(o?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:$a,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var ec=require("react/jsx-runtime"),An=({style:e,...t})=>(0,ec.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,ec.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 ut=require("react/jsx-runtime"),kn=({style:e,...t})=>(0,ut.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,ut.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,ut.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,ut.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,ut.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,ut.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,ut.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,ut.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,ut.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,ut.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,ut.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,ut.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,ut.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,ut.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 Di=require("react/jsx-runtime"),Uo=({style:e,...t})=>(0,Di.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,Di.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,Di.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 In=class extends Pt{constructor(o,r,n,i,a){super(a||"unknown",o,r,n);this.connectorType="injected";this.proxyProvider=new ke(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(o){return o.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 o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0||!o[0])throw new X("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw go(o)}}},Rn,Mn=class extends Pt{constructor(o,r,n,i,a){super(a??"unknown",o,r,n);this.connectorType="injected";ba(this,Rn,void 0);this.proxyProvider=new ke(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Ul(this,Rn,{name:"MetaMask",icon:kn,id:"io.metamask"}):a==="phantom"&&Ul(this,Rn,{name:"Phantom",icon:Uo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return Ad(this,Rn)??{name:"Browser Extension",icon:An,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0||!o[0])throw new X("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw go(o)}}};Rn=new WeakMap;var z1=require("@ethersproject/address"),$1=require("@ethersproject/providers"),Fp=require("react-device-detect");var ja=class extends In{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Fp.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 X("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw go(t)}}};var Ka=class extends Pt{constructor(o,r){super(o,[],r,{});this.connectorType="null";this.proxyProvider=new ke(void 0,jr);this.connectorType=o}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(o){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${o}`)}};var Ya=class extends Ka{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Uo,id:"phantom"}}};var On=require("@walletconnect/ethereum-provider"),Eu=require("react-device-detect");var eo=require("react");var Bp=require("react/jsx-runtime");function Ja({src:e,...t}){return(0,Bp.jsx)("img",{src:e,...t,style:{display:"none"}})}var Fo=require("react"),au=require("react");var Xt={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:cp,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Hp=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],o=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let r of e.primary.slice(1))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let r of e.overflow??[])!t.includes(r)&&!o.includes(r)?o.push(r):console.warn(`Duplicated login method: ${r}`);return{primary:t,overflow:o}};var q1=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),Gp=e=>q1.has(e),Vp=(e,t,o)=>o.indexOf(e)===t,zp=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Gp).filter(Vp):e?e.filter(Gp).filter(Vp):Xt.appearance.walletList;var Za={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 Qa={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 Xa={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{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 $p={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 qp={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 es={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 ts={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 os={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{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 jp={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 Kp={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 Yp={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 Jp={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 Zp={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{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 Qp={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 Xp={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 eu={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 rs={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 ns={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 is={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 as={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{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 Ui={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 Fi={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{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 tu={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 ou={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{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 ss={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 ls={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 cs={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 Wn=[Za,Qa,Xa,Zp,ou,rs,ns,is,as,Ui,Fi,jp,Kp,Yp,Jp,es,ts,os,Xp,eu,$p,qp,ss,cs,ls,Qp,tu],e4=new Set(Wn.map(e=>e.id));var Sr=h(require("tinycolor2")),ru="#FFFFFF",j1="#000000",K1=ru,Y1="#1E1E1D";function J1(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 xr(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Sr.default)({...e.toHsl(),l:o})}function nu({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",warnHex:r="#FFB74D",errorHex:n="#EC6351",whiteHex:i=ru,blackHex:a=j1}){let l;switch(e){case"light":l=K1;break;case"dark":l=Y1;break;default:l=e;break}let s=(0,Sr.default)(l),c=(0,Sr.default)(t),u=(0,Sr.default)(o),f=(0,Sr.default)(r),g=(0,Sr.default)(n),w=J1(s.getLuminance()),C=xr(s,w==="light"?-.04:.11),E=xr(s,w==="light"?-.88:.87),x=xr(s,w==="light"?-.77:.75),b=xr(s,w==="light"?-.43:.45).desaturate(w==="light"?60:20),A=xr(s,w==="light"?-.08:.25).desaturate(w==="light"?60:20),W=xr(c,.15),I=xr(c,-.06),S=(0,Sr.default)(c.getLuminance()>.5?a:i),B=xr(u,-.16);return{colorScheme:w,background:s.toHslString(),background2:C.toHslString(),foreground:E.toHslString(),foreground2:x.toHslString(),foreground3:b.toHslString(),foreground4:A.toHslString(),accent:c.toHslString(),accentLight:W.toHslString(),accentDark:I.toHslString(),foregroundAccent:S.toHslString(),success:u.toHslString(),successDark:B.toHslString(),error:g.toHslString(),warn:f.toHslString()}}function tc(e,t,o){let r=o?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],i=t?.loginMethods?.filter(J=>n.includes(J)),a,l,s,c,u,f,g,w,C,E,x,b;t?.loginMethods?(a=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),c=i?.includes("google"),u=i?.includes("twitter"),f=i?.includes("discord"),w=i?.includes("spotify"),g=i?.includes("tiktok"),E=i?.includes("github"),C=i?.includes("linkedin"),x=i?.includes("apple"),b=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,s=e.walletAuth,c=e.googleOAuth,u=e.twitterOAuth,f=e.discordOAuth,E=e.githubOAuth,w=e.spotifyOAuth,g=e.tiktokOAuth,C=e.linkedinOAuth,x=e.appleOAuth,b=e.farcasterAuth);let A=[a,l].filter(Boolean),W=[c,u,f,E,w,g,C,x,b].filter(Boolean),I=[s].filter(Boolean);if(A.length+W.length+I.length===0)throw new Error("You must enable at least one login method");let S=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;S&&I.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):!S&&W.length+A.length===0&&(r("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0),t?.loginMethods&&t.loginMethodsAndOrder&&r("You should only configure one of `loginMethods` or `loginMethodsAndOrder`"),t?.appearance?.walletList&&t.loginMethodsAndOrder&&r("You should only configure one of `appearance.walletList` or `loginMethodsAndOrder`");let B=zp({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),F=Hp({input:t?.loginMethodsAndOrder}),q=t?.intl?.defaultCountry??"US",{chains:R,defaultChain:Z}=Z1({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),D=!!t?.defaultChain||!!t?.supportedChains,Y=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,K,re=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?Y?K=t?.embeddedWallets?.noPromptOnSignature??!0:K=t?.embeddedWallets?.noPromptOnSignature??re:K=re,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&K!==!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:nu({backgroundTheme:t?.appearance?.theme??Xt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Xt.appearance.accentColor}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:B},loginMethods:{wallet:s,email:a,sms:l,google:c,twitter:u,discord:f,github:E,spotify:w,tiktok:g,linkedin:C,apple:x,farcaster:b},loginMethodsAndOrder:F,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Xt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Xt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Xt.rpcConfig.rpcTimeouts},chains:R,defaultChain:Z,intl:{defaultCountry:q},shouldEnforceDefaultChainOnConnect:D,captchaEnabled:e.captchaEnabled??Xt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...Y?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:K},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:Y?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Xt.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??Xt._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Xt._render.inParentNodeId}}}function iu(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:o,additionalChains:r,supportedChains:n,defaultChain:i,...a}=e;return{...a,...r?{additionalChains:r.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,...o?{...o,...o.logo&&typeof o.logo?{logo:"component"}:void 0}:void 0,legacyCreateEmbeddedWalletFlag:t}}function Z1({additionalChains:e,supportedChains:t,defaultChainFromConfig:o,hasRpcConfigDefined:r}){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&&r&&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:Wn.find(u=>u.id===s.id)??s)}else n=Wn.concat(e??[]);let i=t?n[0]:rs,a=o??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var cu=require("react/jsx-runtime"),su={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:""},oc=tc(su,void 0,!1),rc=(0,au.createContext)({appConfig:oc,isServerConfigLoaded:!1}),lu=({children:e,legacyCreateEmbeddedWalletFlag:t,client:o,clientConfig:r})=>{let[n,i]=(0,Fo.useState)(null),a=(0,Fo.useMemo)(()=>tc(n??su,r,!!n),[n,r]);return(0,Fo.useEffect)(()=>{let l=iu(r,t);o.createAnalyticsEvent("sdk_initialize",l)},[r,t]),(0,Fo.useEffect)(()=>{n||(async()=>{try{let s=await o.getServerConfig();s.customApiUrl&&o.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,cu.jsx)(rc.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},ds=()=>{let{appConfig:e}=(0,Fo.useContext)(rc);return e},ps=()=>{let{isServerConfigLoaded:e}=(0,Fo.useContext)(rc);return e};var P=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var us=require("react/jsx-runtime"),du=(0,eo.createContext)({ready:!1,app:oc,currentScreen:null,lastScreen:null,navigate:P,navigateBack:P,resetNavigation:P,setModalData:P,onUserCloseViaDialogOrKeybindRef:void 0}),Q1=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],pu=e=>{let t=ds(),o=e.authenticated,[r,n]=(0,eo.useState)(e.initialScreen);(0,eo.useEffect)(()=>{!o&&!Q1.includes(e.initialScreen)&&e.setInitialScreen(null)},[o]);let i=(0,eo.useRef)(null);(0,eo.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,eo.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,us.jsxs)(du.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,us.jsx)(Ja,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},_=()=>(0,eo.useContext)(du);var nr=require("react/jsx-runtime"),Bi=({style:e,...t})=>{let{app:o}=_();return(0,nr.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,nr.jsx)("rect",{width:"28",height:"28",rx:"3",fill:o?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,nr.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,nr.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,nr.jsx)("defs",{children:(0,nr.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,nr.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var ms=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries(Ln))if(t.includes(r.hostname))return{walletClientType:o,entry:r}};var Ln={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 X1(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var uu=e=>e in Ln,mu=e=>{let t=Ln[e].mobile;if("native"in t)return t.native};function fu(e,t){let o=X1(t);if(o.deepLink)return wu(o.deepLink,e);if(o.universalLink)return Cu(o.universalLink,e);throw new T(`Unsupported wallet ${t.id}`)}var hu="WALLETCONNECT_DEEPLINK_CHOICE";function yu(){try{localStorage.removeItem(hu)}catch{}}function gu({href:e,name:t}){try{localStorage.setItem(hu,JSON.stringify({href:e,name:t}))}catch{}}function vu(e){return e.startsWith("http://")||e.startsWith("https://")}function wu(e,t){if(vu(e))return Cu(e,t);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function Cu(e,t){if(!vu(e))return wu(e,t);let o=e;o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function bu(e,t){window.open(e,t,"noreferrer noopener")}var Bo=class extends Pt{constructor(o,r,n,i,a,l){super(l||"unknown",n,i,r);this.connectorType="wallet_connect_v2";this.walletConnectCloudProjectId=o,this.rpcConfig=r,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new ke(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=Ln[l],this.walletClientType=l)}async initialize(){let o=await this.createProvider();if(this.provider=o,this.proxyProvider.setWalletProvider(o),this.subscribeListeners(),o.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:r}=await import("@walletconnect/modal");this.modal=new r({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(o){return o.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:kn,id:"io.metamask"}:{name:_p(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Bi,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(o){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=Ln[o],this.walletClientType=o,this.redirectUri=void 0,yu(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((o,r)=>{let n=()=>{r(new Sn)};this.onQrModalClosed=n,(async()=>{let a="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(a=l[0]),!a||a==="")throw new X("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=_n(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(go(a));return}r(new X("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(o){this.proxyProvider.setWalletProvider(o)}async createProvider(){let o={};for(let a of this.chains){let l=yo(a.id,this.chains,this.rpcConfig);l&&(o[a.id]=l)}let r=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await On.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:On.OPTIONAL_EVENTS,optionalMethods:On.OPTIONAL_METHODS,rpcMap:o,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),Eu.isMobile&&this.walletEntry){let{redirect:l,href:s}=fu(a,this.walletEntry);gu({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,bu(l,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=ms(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var ic=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===(0,nc.getAddress)(t)).length:!1},_n=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||jr:jr,Nn=class extends Pu.default{constructor(o,r,n,i,a,l,s){super();this.getEthereumProvider=()=>{let o=this.wallets[0],r=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===o?.address));return!o||!r?new ke:r.proxyProvider};this.walletConnectCloudProjectId=o,this.rpcConfig=r,this.chains=n,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=a,this.walletList=l,this.shouldEnforceDefaultChainOnConnect=s,this.initializedWalletConnectors=0,this.walletsReady=!1,this.storedConnections=this.loadConnectionHistory()}get wallets(){let o=new Set,r=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return o.has(a)?!1:(o.add(a),!0)}),n=r.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&r.unshift(r.splice(n,1)[0]),r}async initialize(){if(this.initialized)return;fe.get(Hl)&&(fe.getKeys().forEach(r=>{r.startsWith("walletconnect")&&fe.del(r)}),fe.del(Hl));let o=Ap(this.store,this.walletList).then(r=>{r.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!br()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.createWalletConnector("wallet_connect_v2","unknown"),await o,this.initialized=!0}findWalletConnector(o,r){return o==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===o)||null:this.walletConnectors.find(n=>n.connectorType===o&&n.walletClientType===r)||null}onInitialized(o){o.wallets.forEach(r=>{let n=this.storedConnections.find(i=>i.address===r.address&&i.connectorType===r.connectorType&&i.walletClientType===r.walletClientType);n&&(r.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.initializedWalletConnectors++,this.walletsReady=this.initializedWalletConnectors===this.walletConnectors.length,this.emit("walletsUpdated")}onWalletsUpdated(o){o.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(o,r,n){let i=this.findWalletConnector("embedded","privy");if(i)i.proxyProvider.walletProxy=o;else{let a=new Ha(o,r,this.rpcConfig,this.chains,n.id),l=new qa(a,this.chains,n,this.rpcConfig);this.addWalletConnector(l)}}removeEmbeddedWalletConnector(){let o=this.findWalletConnector("embedded","privy");if(o){let r=this.walletConnectors.indexOf(o);this.walletConnectors.splice(r,1),this.saveConnectionHistory(),this.storedConnections=this.loadConnectionHistory(),this.emit("walletsUpdated")}}async createWalletConnector(o,r,n){let i=this.findWalletConnector(o,r);if(i)return i instanceof Bo&&i.resetConnection(r),i;let l=(()=>{if(o==="injected"){if(r==="metamask"&&n?.eip6963InjectedProvider)return new ja(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(r==="metamask"&&n?.legacyInjectedProvider)return new Mn(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(r==="phantom"&&n?.legacyInjectedProvider)return new Mn(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&r==="unknown_browser_extension")return new Mn(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new In(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,r)}else return o==="coinbase_wallet"?new za(this.chains,this.defaultChain,this.rpcConfig):o==="phantom"?new Ya(this.defaultChain):new Bo(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,r)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(o){this.walletConnectors.push(o),o.on("initialized",()=>this.onInitialized(o)),o.on("walletsUpdated",()=>this.onWalletsUpdated(o)),o.initialize()}loadConnectionHistory(){let o=a=>a&&typeof a.address=="string"&&typeof a.connectorType=="string"&&typeof a.walletClientType=="string"&&typeof a.connectedAt=="number",r=fe.get(Gl);return r&&Array.isArray(r)&&r.map(a=>o(a)).every(Boolean)?r:[]}saveConnectionHistory(){let o=this.wallets.map(r=>({address:r.address,connectorType:r.connectorType,walletClientType:r.walletClientType,connectedAt:r.connectedAt}));fe.put(Gl,o)}async activeWalletSign(o){let r=this.wallets,n=r.length>0?r[0]:null;return n?n.sign(o):null}setActiveWallet(o){this.activeWallet=(0,nc.getAddress)(o),this.emit("walletsUpdated")}};function Ga(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++){let r=e[o],n=t[o];if(r?.address!==n?.address||r?.chainId!==n?.chainId||r?.connectorType!==n?.connectorType||r?.connectedAt!==n?.connectedAt||r?.walletClientType!==n?.walletClientType||r?.isConnected!==n?.isConnected||r?.linked!==n?.linked)return!1}return!0}var Tu=require("ofetch");var ev=[Ta,Sa,xa],fs=class{constructor(t,o,r){this.appId=t,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Ra,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=Tu.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:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-ca-id",this.clientAnalyticsId||""),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=!ev.includes(n.toString());if(!a.has("authorization")&&l){let s=await this.client.getAccessToken();s!==null&&a.set("authorization",`Bearer ${s}`)}i.headers=a},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new Ea}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw me(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw me(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw me(r)}}};var _r=h(require("js-cookie"));function xu(e){return e instanceof Cr?"email":e instanceof Yr?"sms":e instanceof Kr?"siwe":e instanceof bn?"custom_auth":e instanceof Do?e.meta.provider:null}var Su=h(require("jose")),Ho=class{static parse(t){try{return new Ho(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Su.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 o=Date.now(),r=(this.expiration-t)*1e3;return o>=r}};var tv=30,hs=class{constructor(){this.authenticateOnce=new Ct(async t=>this._authenticate(t)),this.linkOnce=new Ct(async t=>this._link(t)),this.refreshOnce=new Ct(this._refresh.bind(this)),this.destroyOnce=new Ct(this._destroy.bind(this)),this.forkSessionOnce=new Ct(this._forkSession.bind(this))}get token(){try{let t=fe.get($r);return typeof t=="string"?new Ho(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=fe.get(Ia);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=fe.get(Ri);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=_r.default.get(Ma);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=Ho.parse(this.token);return t!==null&&!t.isExpired(tv)}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:o,refresh_token:r,user:n,is_new_user:i}=await t.authenticate();this.storeToken(o),this.storeRefreshToken(r);let a=xu(t);return a&&this.client&&this.client.createAnalyticsEvent("sdk_authenticate",{method:a,isNewUser:i}),a==="siwe"&&this.client&&this.client.createAnalyticsEvent("sdk_authenticate_siwe",{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}),{user:Bt(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),wt(o)}}async _link(t){try{let o=await t.link();return Bt(o)}catch(o){throw console.warn("Error linking account"),wt(o)}}async _refresh(){if(!this.api)throw new T("Session has no API instance");if(!this.client)throw new T("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,o=this.refreshToken,r=this.forkedToken;try{let n;if(t&&o||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=o?{refresh_token:o}:{};n=await this.api.post(Ta,a,{headers:i}),r&&this.clearForkedToken()}else if(r)n=await this.api.post(Sa,{refresh_token:r}),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(),Bt(n.user)}catch(n){if(n instanceof No&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw wt(n)}}async _destroy(){try{await this.api?.post(xa,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new T("Session has no API instance");let t=this.refreshToken;try{let o=await this.api.post(Id,{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw wt(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let o=fe.get($r);if(fe.put($r,t),o!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let r=Ho.parse(t)?.expiration;_r.default.set(Fl,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}}else fe.del($r),_r.default.remove(Fl)}storeRefreshToken(t){typeof t=="string"?(fe.put(Ia,t),this.client?.useServerCookies||(_r.default.set(Ma,"t",{sameSite:"Strict",secure:!0,expires:30}),_r.default.set(Bl,t,{sameSite:"Strict",secure:!0,expires:30}))):(fe.del(Ia),_r.default.remove(Bl),_r.default.remove(Ma))}clearForkedToken(){fe.del(Ri)}};var ac,ys,Au,Dn=class{constructor(t){ba(this,ys);this.apiUrl=t.apiUrl||ka,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||dp,this.appId=t.appId,this.clientAnalyticsId=kd(this,ys,Au).call(this),ac||(ac=new hs),this.session=ac,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,o,r,n,i,a,l){this.connectors||(this.connectors=new Nn(t,o,r,n,i,a,l))}generateApi(){let t=new fs(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 T("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new T("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 o=await this.api.post(zd,{address:t});return Bt(o)}catch(o){throw wt(o)}}async acceptTerms(){try{let t=await this.api.post(op,{});return Bt(t)}catch(t){throw wt(t)}}async unlinkPhone(t){try{let o=await this.api.post(Kd,{phoneNumber:t});return Bt(o)}catch(o){throw wt(o)}}async unlinkWallet(t){try{let o=await this.api.post(Od,{address:t});return Bt(o)}catch(o){throw wt(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post(Xd,{provider:t,subject:o});return Bt(r)}catch(r){throw wt(r)}}async unlinkFarcaster(t){try{let o=await this.api.post(Bd,{fid:t});return Bt(o)}catch(o){throw wt(o)}}async createAnalyticsEvent(t,o,r){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(rp,{event_name:t,client_id:this.clientAnalyticsId,payload:{...o||{},clientTimestamp:r?r.toISOString():new Date().toISOString()}})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(np,t)}catch(o){throw wt(o)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Ho.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=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl});return{id:t.id,name:t.name,verificationKey:t.verification_key,logoUrl:t.logo_url||void 0,accentColor:t.accent_color||void 0,showWalletLoginFirst:t.show_wallet_login_first,allowlistConfig:{errorTitle:t.allowlist_config.error_title,errorDetail:t.allowlist_config.error_detail,errorCtaText:t.allowlist_config.cta_text,errorCtaLink:t.allowlist_config.cta_link},walletAuth:t.wallet_auth,emailAuth:t.email_auth,smsAuth:t.sms_auth,googleOAuth:t.google_oauth,twitterOAuth:t.twitter_oauth,discordOAuth:t.discord_oauth,githubOAuth:t.github_oauth,spotifyOAuth:t.spotify_oauth,tiktokOAuth:t.tiktok_oauth,linkedinOAuth:t.linkedin_oauth,appleOAuth:t.apple_oauth,farcasterAuth:t.farcaster_auth,termsAndConditionsUrl:t.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:t.embedded_wallet_config?.create_on_login,requireUserPasswordOnCreate:t.embedded_wallet_config?.require_user_password_on_create},privacyPolicyUrl:t.privacy_policy_url,requireUsersAcceptTerms:t.require_users_accept_terms,customApiUrl:t.custom_api_url,walletConnectCloudProjectId:t.wallet_connect_cloud_project_id,fiatOnRampEnabled:t.fiat_on_ramp_enabled,captchaEnabled:t.captcha_enabled,captchaSiteKey:t.captcha_site_key,twitterOAuthOnMobileEnabled:t.twitter_oauth_on_mobile_enabled,createdAt:new Date(t.created_at*1e3),updatedAt:new Date(t.updated_at*1e3),mfaMethods:t.mfa_methods,enforceWalletUis:t.enforce_wallet_uis,legacyWalletUiConfig:t.legacy_wallet_ui_config}}catch(t){throw wt(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 forkSession(){return await this.session.forkSession()}};ys=new WeakSet,Au=function(){if(typeof window>"u")return null;try{let o=fe.get(Ii);if(typeof o=="string"&&o.length>0)return o}catch{}let t=(0,_u.v4)();try{return fe.put(Ii,t),t}catch{return t}};var Mu=require("@marsidev/react-turnstile"),gs=require("react");var to=require("react");var Iu=require("react/jsx-runtime"),ku=(0,to.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}),Co=class extends ct{constructor(o,r,n){super(o||"Captcha failed");this.type="Captcha";r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},Ru=({children:e,id:t,captchaSiteKey:o,captchaEnabled:r})=>{let n=(0,to.useRef)(null),[i,a]=(0,to.useState)(),[l,s]=(0,to.useState)(),[c,u]=(0,to.useState)(!1),f=(0,to.useMemo)(()=>r?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[r,i,l,c]);return(0,Iu.jsx)(ku.Provider,{value:{...f,ref:n,enabled:r,siteKey:o,appId:t,setToken:a,setError:s,setExecuting:u,remove(){r&&(n.current?.remove(),u(!1),s(void 0),a(void 0))},reset(){r&&(n.current?.reset(),u(!1),s(void 0),a(void 0))},execute(){r&&(u(!0),n.current?.execute())},async waitForResult(){if(!r)return"";try{return await xp(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Co("Captcha failed",null,"captcha_timeout")}}},children:e})},Ee=()=>(0,to.useContext)(ku);var sc=require("react/jsx-runtime"),vs=e=>{let{enabled:t,siteKey:o,appId:r,setError:n,setToken:i,setExecuting:a,ref:l}=Ee(),[,s]=(0,gs.useMemo)(()=>o?.split("t:")||[],[o]);if((0,gs.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,sc.jsx)("div",{className:"hidden h-0 w-0",children:(0,sc.jsx)(Mu.Turnstile,{...e,ref:l,siteKey:s,options:{action:r,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var yr=require("react"),Ng=h(require("react-dom"));var ws=require("react");var lc=(0,ws.createContext)({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,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,loginWithOAuth:P,refreshUser:P,walletProxy:null,createAnalyticsEvent:P,acceptTerms:P,getUsdTokenPrice:P,recoverEmbeddedWallet:P,getFiatOnRampConfig:P,updateWallets:P,fundWallet:P,setReadyToTrue:P}),M=()=>(0,ws.useContext)(lc);var Cs=require("react");var de=(0,Cs.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,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,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,initLoginWithEmail:P,initLoginWithSms:P,loginWithCode:P,fundWallet:P,initLoginWithHeadlessOAuth:P,loginWithHeadlessOAuth:P,isHeadlessOAuthLoading:!1,isModalOpen:!1}),G=()=>(0,Cs.useContext)(de);var bs=require("react"),Wu=e=>{let[t,o]=(0,bs.useState)("auto");return(0,bs.useEffect)(()=>{let r=new ResizeObserver(n=>{o(n[0]?.contentRect.height??"auto")});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},[e.current]),t};var Un=require("react"),Lu={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:[]}},cc=(0,Un.createContext)(void 0),Ou=()=>(0,Un.useContext)(cc);function We(e,t){if(!t)return;let r=Ou().current[e];return(0,Un.useEffect)(()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]=r[n]?.filter(a=>a!==i)}},[t])}function N(e,t,o,...r){for(let n of e.current[t][o])n(...r)}function Nu(){let e=Ou();return(t,o,...r)=>N(e,t,o,...r)}function Es(e){We("configureMfa",e)}var vc=h(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),$u=h(require("@heroicons/react/24/solid/DocumentCheckIcon")),qu=h(require("styled-components"));var ro=h(require("styled-components"));var Ps=h(require("styled-components")),Ar=require("react/jsx-runtime"),kr=({success:e,fail:t})=>(0,Ar.jsxs)(Ar.Fragment,{children:[(0,Ar.jsx)(oo,{className:e?"success":t?"fail":""}),(0,Ar.jsx)(dc,{className:e?"success":t?"fail":""})]}),oo=Ps.default.span`
12
+ - https://privy.io`;this.getNonceOnce=new Ct(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 x("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign(),o=await this.api.post(Nd,{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 ue(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign();return await this.api.post(Dd,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ue(t)}}async sign(){if(!this.api)throw new x("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new x("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 x("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(Od,{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new x("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,i=window.location.origin,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",l=new Date().toISOString();return this.createSiweMessage(t,r,n,i,l,o,a)}};var Qo=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Qd,{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 ue(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Jd,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ue(t)}}async sendSmsCode(t,r){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new x("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Yd,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ue(o)}}};var ku=require("uuid");function Et(e){return new Date(e*1e3)}function O1(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:Et(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 i={address:r.address,type:r.type,verifiedAt:Et(r.verified_at)};t.push(i);break;case"phone":let a={number:r.phoneNumber,type:r.type,verifiedAt:Et(r.verified_at)};t.push(a);break;case"google_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:Et(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:Et(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:Et(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:Et(r.verified_at)};t.push(u);break;case"github_oauth":let f={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:Et(r.verified_at)};t.push(f);break;case"tiktok_oauth":let g={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:Et(r.verified_at)};t.push(g);break;case"linkedin_oauth":let w={subject:r.subject,name:r.name,email:r.email,type:r.type,verifiedAt:Et(r.verified_at)};t.push(w);break;case"apple_oauth":let C={subject:r.subject,email:r.email,type:r.type,verifiedAt:Et(r.verified_at)};t.push(C);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:Et(r.verified_at)});break;case"farcaster":let b={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:Et(r.verified_at)};t.push(b);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function Qt(e,t){return e.sort((r,o)=>o.verifiedAt.getTime()-r.verifiedAt.getTime()),e.find(r=>r.type===t)}var ke=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,N1=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Xt=(e,t)=>t==="all-users"&&!ke(e)||t==="users-without-wallets"&&!N1(e)?.length;function Gt(e){if(!e)return null;let t=O1(e.linked_accounts),r=Qt(t,"wallet"),o=Qt(t,"email"),n=Qt(t,"phone"),i=Qt(t,"google_oauth"),a=Qt(t,"twitter_oauth"),l=Qt(t,"discord_oauth"),s=Qt(t,"github_oauth"),c=Qt(t,"spotify_oauth"),u=Qt(t,"tiktok_oauth"),f=Qt(t,"linkedin_oauth"),g=Qt(t,"apple_oauth"),w=Qt(t,"farcaster"),C=e.mfa_methods.map(({type:S,verified_at:P})=>({type:S,verifiedAt:Et(P)}));return{id:e.id,createdAt:Et(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:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:f&&{subject:f.subject,name:f.name,email:f.email},apple:g&&{subject:g.subject,email:g.email},farcaster:w&&{fid:w.fid,ownerAddress:w.ownerAddress,displayName:w.displayName,username:w.username,bio:w.bio,pfp:w.pfp,url:w.url},mfaMethods:C.map(S=>S.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var sc=require("@ethersproject/address"),xu=h(require("eventemitter3"));var Xo=require("@ethersproject/providers");function Pp(){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 La=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 Xl=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||La(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!Xl(r))return!1}return!0},xo=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Tp=()=>{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 xp=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},Oa=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,}))$/),Sp=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},So=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},ec=e=>new Promise(t=>setTimeout(t,e));function _p(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var Ap=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(()=>{a=!0,n()},(...s)=>{a=!0,i(...s)}),l+=1,await ec(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},Na=(e,t,r={})=>{let o=new URL(t,e);for(let[n,i]of Object.entries(r))o.searchParams.set(n,i);return o.href};var kp=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),en=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Rp(e,t,r=3e3){let o=!1,n=window;return new Promise(i=>{n.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout(()=>{a()},r));function a(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",a);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 Pp()){let u=La(c);if(!l.some(f=>f.info.name===u)){if(Xl(c,!0)&&!s.find(f=>f.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(f=>f.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(f=>f.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function xn(e){return`eip155:${String(Number(e))}`}var Da=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new X(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0])a=i.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[n])a=r.rpcUrls[n];else if(i.rpcUrls.privy?.http[0]){let l=new URL(i.rpcUrls.privy.http[0]);l.searchParams.append("privyAppId",o),a=l.toString()}else i.rpcUrls.infura?.http[0]?a=i.rpcUrls.infura.http[0]+"/"+Hl:i.rpcUrls.blast?.http[0]?a=i.rpcUrls.blast.http[0]+"/"+Gl:a=i.rpcUrls.default?.http[0];if(!a)throw new X(`No RPC url found for ${e}`);return a},Ip=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new X(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},io=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new X(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new Xo.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new Xo.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new Xo.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.infura?.http[0]?a=new Xo.StaticJsonRpcProvider(i.rpcUrls.infura.http[0]+"/"+Hl):i.rpcUrls.blast?.http[0]?a=new Xo.StaticJsonRpcProvider(i.rpcUrls.blast.http[0]+"/"+Gl):a=new Xo.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new X(`No RPC url found for ${e}`);return a},Ua=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=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 Bp=h(require("@coinbase/wallet-sdk"));var Oi=require("react/jsx-runtime"),Fa=({style:e,...t})=>(0,Oi.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,Oi.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Oi.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 vr=require("@ethersproject/address"),tc=require("@ethersproject/providers"),Fp=h(require("eventemitter3"));var Lp=h(require("eventemitter3"));var D1=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Mp=e=>D1.includes(e);var Wp=require("@ethersproject/logger");var Sn=class extends X{constructor(){super("Wallet timeout");this.type="wallet_error"}},_n=class extends X{constructor(){super("User rejected connection");this.type="wallet_error"}},yr=e=>{if(e instanceof X)return e;if(e?.code&&e?.reason){let t=new We(e);return e.code===Wp.ErrorCode.ACTION_REJECTED&&(t.details=dt.E4001_USER_REJECTED_REQUEST),t}return e?.code?new We(e):new X("Unknown connector error",e)},er=class extends lt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},We=class extends er{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(dt).find(i=>i.eipCode===o.code);this.details=n||dt.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=dt.E32002_CONNECTION_ALREADY_PENDING:this.details=dt.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=dt.E32002_WALLET_LOCKED))}},U1={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}},F1={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}},B1={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}},dt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...B1,...F1},ao={...U1,...dt};var Ae=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 Sn,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||Jo,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 X(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(r=>{throw yr(r)})}},_o=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Ba=class extends Lp.default{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=io(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=An(n,"privy"),this.appId=a}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 je()||!this.address)throw new _o("Disconnected",4900);return(await Dp(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=io(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 Op(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 Np(Ua(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:en(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 en(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(Mp(r.method)){let o=await je();if(await Up(),!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 je();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}}},gr=class extends Ae{constructor(r){super(r,r.rpcTimeoutDuration)}},Ao=class extends Ae{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 H1=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},Pt=class extends Fp.default{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=xn(r),this.walletClientType==="privy"&&me.put(Ia(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=An(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n){let i=async()=>!!this.wallets.find(a=>(0,vr.getAddress)(a.address)===(0,vr.getAddress)(r));return{address:(0,vr.getAddress)(r),chainId:o,meta:n,switchChain:async a=>{if(!i)throw new X("Wallet is not currently connected.");let l=this.wallets.find(g=>(0,vr.getAddress)(g.address)===(0,vr.getAddress)(r))?.chainId;if(!l)throw new X("Unable to determine current chainId.");let s,c;if(typeof a=="number"?(s=`0x${a.toString(16)}`,c=a):(s=a,c=Number(a)),l===xn(s))return;let u=this.chains.find(g=>g.id===c);if(!u)throw new X(`Unsupported chainId: ${a}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await f()}catch(g){if(H1(g,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??""]}]}),f();throw this.walletClientType==="rainbow"&&g.message?.includes("wallet_switchEthereumChain")?new X(`Rainbow does not support the chainId ${o}`):g}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new X("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new X("Wallet is not currently connected.");return new tc.Web3Provider(new gr(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new X("Wallet is not currently connected.");return new Ao(this.proxyProvider)},sign:async a=>{if(!await i())throw new X("Wallet is not currently connected.");return await this.sign(a)},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],i=(0,vr.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=me.get(Ia(i));this.chains.find(u=>u.id===Number(c))||(me.del(Ia(i)),c=null),l=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let c=await 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 ${jl}`,c),l=jl}let s=xn(l);if(!a.find(c=>(0,vr.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,vr.getAddress)(n),s,c))}Ha(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,vr.getAddress)(n)===(0,vr.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 tc.Web3Provider(new gr(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 kn={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 G1=(e,t)=>{let o=Da(1,[kn],{},t);return e.makeWeb3Provider(o,1)},Ga,Va=class extends Pt{constructor(r,o,n,i){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.proxyProvider=new Ae(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),Ga||(Ga=new Bp.default({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(G1(Ga,i))}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(){Ga.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:Fa,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 X("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw yr(r)}}};var rc=require("react/jsx-runtime"),za=({...e})=>(0,rc.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,rc.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 $a=class extends Pt{constructor(r,o,n,i){super("privy",o,n,i);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:[en(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:za,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var oc=require("react/jsx-runtime"),Rn=({style:e,...t})=>(0,oc.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,oc.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 pt=require("react/jsx-runtime"),In=({style:e,...t})=>(0,pt.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,pt.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,pt.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,pt.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,pt.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,pt.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,pt.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,pt.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,pt.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,pt.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,pt.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,pt.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,pt.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,pt.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 Ni=require("react/jsx-runtime"),Fr=({style:e,...t})=>(0,Ni.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,Ni.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,Ni.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 Wn=class extends Pt{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Ae(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.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 X("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw yr(r)}}},Mn,Ln=class extends Pt{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Ca(this,Mn,void 0);this.proxyProvider=new Ae(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Bl(this,Mn,{name:"MetaMask",icon:In,id:"io.metamask"}):a==="phantom"&&Bl(this,Mn,{name:"Phantom",icon:Fr,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 Id(this,Mn)??{name:"Browser Extension",icon:Rn,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 X("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw yr(r)}}};Mn=new WeakMap;var V1=require("@ethersproject/address"),z1=require("@ethersproject/providers"),Hp=require("react-device-detect");var qa=class extends Wn{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Hp.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 X("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw yr(t)}}};var ja=class extends Pt{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Ae(void 0,Jo);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 Ka=class extends ja{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Fr,id:"phantom"}}};var Dn=require("@walletconnect/ethereum-provider"),Tu=require("react-device-detect");var rr=require("react");var Gp=require("react/jsx-runtime");function Ya({src:e,...t}){return(0,Gp.jsx)("img",{src:e,...t,style:{display:"none"}})}var Br=require("react"),lu=require("react");var tr={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:pp,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Vp=({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 $1=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),zp=e=>$1.has(e),$p=(e,t,r)=>r.indexOf(e)===t,qp=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(zp).filter($p):e?e.filter(zp).filter($p):tr.appearance.walletList;var Ja={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 Za={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 Qa={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 jp={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 Kp={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 Xa={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 es={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 ts={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 Yp={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 Jp={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 Zp={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 Qp={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 Xp={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 eu={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 tu={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 ru={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 rs={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 os={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 ns={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 Di={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 Ui={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 ou={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 nu={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 is={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 as={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 ss={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 On=[Ja,Za,Qa,Xp,nu,kn,rs,os,ns,Di,Ui,Yp,Jp,Zp,Qp,Xa,es,ts,tu,ru,jp,Kp,is,ss,as,eu,ou],e4=new Set(On.map(e=>e.id));var Ro=h(require("tinycolor2")),iu="#FFFFFF",q1="#000000",j1=iu,K1="#1E1E1D";function Y1(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 ko(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Ro.default)({...e.toHsl(),l:r})}function au({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:i=iu,blackHex:a=q1}){let l;switch(e){case"light":l=j1;break;case"dark":l=K1;break;default:l=e;break}let s=(0,Ro.default)(l),c=(0,Ro.default)(t),u=(0,Ro.default)(r),f=(0,Ro.default)(o),g=(0,Ro.default)(n),w=Y1(s.getLuminance()),C=ko(s,w==="light"?-.04:.11),b=ko(s,w==="light"?-.88:.87),S=ko(s,w==="light"?-.77:.75),P=ko(s,w==="light"?-.43:.45).desaturate(w==="light"?60:20),T=ko(s,w==="light"?-.08:.25).desaturate(w==="light"?60:20),M=ko(c,.15),I=ko(c,-.06),_=(0,Ro.default)(c.getLuminance()>.5?a:i),F=ko(u,-.16);return{colorScheme:w,background:s.toHslString(),background2:C.toHslString(),foreground:b.toHslString(),foreground2:S.toHslString(),foreground3:P.toHslString(),foreground4:T.toHslString(),accent:c.toHslString(),accentLight:M.toHslString(),accentDark:I.toHslString(),foregroundAccent:_.toHslString(),success:u.toHslString(),successDark:F.toHslString(),error:g.toHslString(),warn:f.toHslString()}}function nc(e,t,r){let o=r?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],i=t?.loginMethods?.filter(J=>n.includes(J)),a,l,s,c,u,f,g,w,C,b,S,P;t?.loginMethods?(a=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),c=i?.includes("google"),u=i?.includes("twitter"),f=i?.includes("discord"),w=i?.includes("spotify"),g=i?.includes("tiktok"),b=i?.includes("github"),C=i?.includes("linkedin"),S=i?.includes("apple"),P=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,s=e.walletAuth,c=e.googleOAuth,u=e.twitterOAuth,f=e.discordOAuth,b=e.githubOAuth,w=e.spotifyOAuth,g=e.tiktokOAuth,C=e.linkedinOAuth,S=e.appleOAuth,P=e.farcasterAuth);let T=[a,l].filter(Boolean),M=[c,u,f,b,w,g,C,S,P].filter(Boolean),I=[s].filter(Boolean);if(T.length+M.length+I.length===0)throw new Error("You must enable at least one login method");let _=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;_&&I.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),_=!1):!_&&M.length+T.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),_=!0),t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`"),t?.appearance?.walletList&&t.loginMethodsAndOrder&&o("You should only configure one of `appearance.walletList` or `loginMethodsAndOrder`");let F=qp({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),B=Vp({input:t?.loginMethodsAndOrder}),q=t?.intl?.defaultCountry??"US",{chains:R,defaultChain:Q}=J1({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),D=!!t?.defaultChain||!!t?.supportedChains,Y=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,K,ie=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?Y?K=t?.embeddedWallets?.noPromptOnSignature??!0:K=t?.embeddedWallets?.noPromptOnSignature??ie:K=ie,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&K!==!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:au({backgroundTheme:t?.appearance?.theme??tr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??tr.appearance.accentColor}),loginGroupPriority:_?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:F},loginMethods:{wallet:s,email:a,sms:l,google:c,twitter:u,discord:f,github:b,spotify:w,tiktok:g,linkedin:C,apple:S,farcaster:P},loginMethodsAndOrder:B,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??tr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??tr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??tr.rpcConfig.rpcTimeouts},chains:R,defaultChain:Q,intl:{defaultCountry:q},shouldEnforceDefaultChainOnConnect:D,captchaEnabled:e.captchaEnabled??tr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...Y?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:K},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:Y?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??tr.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??tr._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??tr._render.inParentNodeId}}}function su(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:i,...a}=e;return{...a,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,...r?{...r,...r.logo&&typeof r.logo?{logo:"component"}:void 0}:void 0,legacyCreateEmbeddedWalletFlag:t}}function J1({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:On.find(u=>u.id===s.id)??s)}else n=On.concat(e??[]);let i=t?n[0]:kn,a=r??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var pu=require("react/jsx-runtime"),cu={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:""},ic=nc(cu,void 0,!1),ac=(0,lu.createContext)({appConfig:ic,isServerConfigLoaded:!1}),du=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=(0,Br.useState)(null),a=(0,Br.useMemo)(()=>nc(n??cu,o,!!n),[n,o]);return(0,Br.useEffect)(()=>{let l=su(o,t);r.createAnalyticsEvent("sdk_initialize",l)},[o,t]),(0,Br.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,pu.jsx)(ac.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},ls=()=>{let{appConfig:e}=(0,Br.useContext)(ac);return e},cs=()=>{let{isServerConfigLoaded:e}=(0,Br.useContext)(ac);return e};var E=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var ds=require("react/jsx-runtime"),uu=(0,rr.createContext)({ready:!1,app:ic,currentScreen:null,lastScreen:null,navigate:E,navigateBack:E,resetNavigation:E,setModalData:E,onUserCloseViaDialogOrKeybindRef:void 0}),Z1=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],mu=e=>{let t=ls(),r=e.authenticated,[o,n]=(0,rr.useState)(e.initialScreen);(0,rr.useEffect)(()=>{!r&&!Z1.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=(0,rr.useRef)(null);(0,rr.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,rr.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,ds.jsxs)(uu.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,ds.jsx)(Ya,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},A=()=>(0,rr.useContext)(uu);var so=require("react/jsx-runtime"),Fi=({style:e,...t})=>{let{app:r}=A();return(0,so.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,so.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,so.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,so.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,so.jsx)("defs",{children:(0,so.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,so.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var ps=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Nn))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Nn={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 Q1(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var fu=e=>e in Nn,hu=e=>{let t=Nn[e].mobile;if("native"in t)return t.native};function yu(e,t){let r=Q1(t);if(r.deepLink)return bu(r.deepLink,e);if(r.universalLink)return Eu(r.universalLink,e);throw new x(`Unsupported wallet ${t.id}`)}var gu="WALLETCONNECT_DEEPLINK_CHOICE";function vu(){try{localStorage.removeItem(gu)}catch{}}function wu({href:e,name:t}){try{localStorage.setItem(gu,JSON.stringify({href:e,name:t}))}catch{}}function Cu(e){return e.startsWith("http://")||e.startsWith("https://")}function bu(e,t){if(Cu(e))return Eu(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 Eu(e,t){if(!Cu(e))return bu(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Pu(e,t){window.open(e,t,"noreferrer noopener")}var Hr=class extends Pt{constructor(r,o,n,i,a,l,s){super(s||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new Ae(void 0,this.rpcTimeoutDuration),s&&(this.walletEntry=Nn[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=ps(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:In,id:"io.metamask"}:{name:kp(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Fi,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=Nn[r],this.walletClientType=r,this.redirectUri=void 0,vu(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new _n)};this.onQrModalClosed=n,(async()=>{let a="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(a=l[0]),!a||a==="")throw new X("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=ps(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=An(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(yr(a));return}o(new X("Unknown error during connection"))}).finally(()=>this.modal?.closeModal())})}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let a of this.chains){let l=Da(a.id,this.chains,this.rpcConfig,this.privyAppId);l&&(r[a.id]=l)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await Dn.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:Dn.OPTIONAL_EVENTS,optionalMethods:Dn.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),Tu.isMobile&&this.walletEntry){let{redirect:l,href:s}=yu(a,this.walletEntry);wu({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,Pu(l,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=ps(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var lc=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&o.address===(0,sc.getAddress)(t)).length:!1},An=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Jo:Jo,Un=class extends xu.default{constructor(r,o,n,i,a,l,s,c){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new Ae:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=c,this.initializedWalletConnectors=0,this.walletsReady=!1,this.storedConnections=this.loadConnectionHistory()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return r.has(a)?!1:(r.add(a),!0)}),n=o.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;me.get($l)&&(me.getKeys().forEach(o=>{o.startsWith("walletconnect")&&me.del(o)}),me.del($l));let r=Rp(this.store,this.walletList).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!xo()&&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(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.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,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new Ba(r,o,this.rpcConfig,this.chains,i,n.id),s=new $a(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 i=this.findWalletConnector(r,o);if(i)return i instanceof Hr&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new qa(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Ln(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Ln(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Ln(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Wn(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Va(this.chains,this.defaultChain,this.rpcConfig,this.privyAppId):r==="phantom"?new Ka(this.defaultChain):new Hr(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=a=>a&&typeof a.address=="string"&&typeof a.connectorType=="string"&&typeof a.walletClientType=="string"&&typeof a.connectedAt=="number",o=me.get(ql);return o&&Array.isArray(o)&&o.map(a=>r(a)).every(Boolean)?o:[]}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));me.put(ql,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,sc.getAddress)(r),this.emit("walletsUpdated")}};function Ha(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 Su=require("ofetch");var X1=[Pa,xa,Ta],us=class{constructor(t,r,o){this.appId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=Aa,this.client=r,this.defaults=o,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=Su.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:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-ca-id",this.clientAnalyticsId||""),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=!X1.includes(n.toString());if(!a.has("authorization")&&l){let s=await this.client.getAccessToken();s!==null&&a.set("authorization",`Bearer ${s}`)}i.headers=a},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new ba}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw ue(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw ue(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw ue(o)}}};var Io=h(require("js-cookie"));function _u(e){return e instanceof To?"email":e instanceof Qo?"sms":e instanceof Zo?"siwe":e instanceof En?"custom_auth":e instanceof Ur?e.meta.provider:null}var Au=h(require("jose")),Gr=class{static parse(t){try{return new Gr(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Au.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 ev=30,ms=class{constructor(){this.authenticateOnce=new Ct(async t=>this._authenticate(t)),this.linkOnce=new Ct(async t=>this._link(t)),this.refreshOnce=new Ct(this._refresh.bind(this)),this.destroyOnce=new Ct(this._destroy.bind(this)),this.forkSessionOnce=new Ct(this._forkSession.bind(this))}get token(){try{let t=me.get(Ko);return typeof t=="string"?new Gr(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=me.get(ka);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=me.get(ki);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=Io.default.get(Ra);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=Gr.parse(this.token);return t!==null&&!t.isExpired(ev)}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:i}=await t.authenticate();this.storeToken(r),this.storeRefreshToken(o);let a=_u(t);return a&&this.client&&this.client.createAnalyticsEvent("sdk_authenticate",{method:a,isNewUser:i}),a==="siwe"&&this.client&&this.client.createAnalyticsEvent("sdk_authenticate_siwe",{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}),{user:Gt(n),isNewUser:i}}catch(r){throw console.warn("Error authenticating session"),wt(r)}}async _link(t){try{let r=await t.link();return Gt(r)}catch(r){throw console.warn("Error linking account"),wt(r)}}async _refresh(){if(!this.api)throw new x("Session has no API instance");if(!this.client)throw new x("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 i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(Pa,a,{headers:i}),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(),Gt(n.user)}catch(n){if(n instanceof Dr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw wt(n)}}async _destroy(){try{await this.api?.post(Ta,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new x("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(Ld,{refresh_token:t});return this.storeToken(r.token),this.storeRefreshToken(r.refresh_token),r.new_session_refresh_token}catch(r){throw wt(r)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let r=me.get(Ko);if(me.put(Ko,t),r!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let o=Gr.parse(t)?.expiration;Io.default.set(Vl,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}}else me.del(Ko),Io.default.remove(Vl)}storeRefreshToken(t){typeof t=="string"?(me.put(ka,t),this.client?.useServerCookies||(Io.default.set(Ra,"t",{sameSite:"Strict",secure:!0,expires:30}),Io.default.set(zl,t,{sameSite:"Strict",secure:!0,expires:30}))):(me.del(ka),Io.default.remove(zl),Io.default.remove(Ra))}clearForkedToken(){me.del(ki)}};var cc,fs,Ru,Fn=class{constructor(t){Ca(this,fs);this.apiUrl=t.apiUrl||_a,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||up,this.appId=t.appId,this.clientAnalyticsId=Md(this,fs,Ru).call(this),cc||(cc=new ms),this.session=cc,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,r,o,n,i,a,l){this.connectors||(this.connectors=new Un(this.appId,t,r,o,n,i,a,l))}generateApi(){let t=new us(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 x("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new x("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(jd,{address:t});return Gt(r)}catch(r){throw wt(r)}}async acceptTerms(){try{let t=await this.api.post(ip,{});return Gt(t)}catch(t){throw wt(t)}}async unlinkPhone(t){try{let r=await this.api.post(Zd,{phoneNumber:t});return Gt(r)}catch(r){throw wt(r)}}async unlinkWallet(t){try{let r=await this.api.post(Ud,{address:t});return Gt(r)}catch(r){throw wt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(rp,{provider:t,subject:r});return Gt(o)}catch(o){throw wt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Vd,{fid:t});return Gt(r)}catch(r){throw wt(r)}}async createAnalyticsEvent(t,r,o){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(ap,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(sp,t)}catch(r){throw wt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Gr.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=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl});return{id:t.id,name:t.name,verificationKey:t.verification_key,logoUrl:t.logo_url||void 0,accentColor:t.accent_color||void 0,showWalletLoginFirst:t.show_wallet_login_first,allowlistConfig:{errorTitle:t.allowlist_config.error_title,errorDetail:t.allowlist_config.error_detail,errorCtaText:t.allowlist_config.cta_text,errorCtaLink:t.allowlist_config.cta_link},walletAuth:t.wallet_auth,emailAuth:t.email_auth,smsAuth:t.sms_auth,googleOAuth:t.google_oauth,twitterOAuth:t.twitter_oauth,discordOAuth:t.discord_oauth,githubOAuth:t.github_oauth,spotifyOAuth:t.spotify_oauth,tiktokOAuth:t.tiktok_oauth,linkedinOAuth:t.linkedin_oauth,appleOAuth:t.apple_oauth,farcasterAuth:t.farcaster_auth,termsAndConditionsUrl:t.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:t.embedded_wallet_config?.create_on_login,requireUserPasswordOnCreate:t.embedded_wallet_config?.require_user_password_on_create},privacyPolicyUrl:t.privacy_policy_url,requireUsersAcceptTerms:t.require_users_accept_terms,customApiUrl:t.custom_api_url,walletConnectCloudProjectId:t.wallet_connect_cloud_project_id,fiatOnRampEnabled:t.fiat_on_ramp_enabled,captchaEnabled:t.captcha_enabled,captchaSiteKey:t.captcha_site_key,twitterOAuthOnMobileEnabled:t.twitter_oauth_on_mobile_enabled,createdAt:new Date(t.created_at*1e3),updatedAt:new Date(t.updated_at*1e3),mfaMethods:t.mfa_methods,enforceWalletUis:t.enforce_wallet_uis,legacyWalletUiConfig:t.legacy_wallet_ui_config}}catch(t){throw wt(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 forkSession(){return await this.session.forkSession()}};fs=new WeakSet,Ru=function(){if(typeof window>"u")return null;try{let r=me.get(Ri);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,ku.v4)();try{return me.put(Ri,t),t}catch{return t}};var Lu=require("@marsidev/react-turnstile"),hs=require("react");var or=require("react");var Wu=require("react/jsx-runtime"),Iu=(0,or.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:E,setError:E,setExecuting:E,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:E,reset:E,execute:E}),wr=class extends lt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Mu=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,or.useRef)(null),[i,a]=(0,or.useState)(),[l,s]=(0,or.useState)(),[c,u]=(0,or.useState)(!1),f=(0,or.useMemo)(()=>o?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,c]);return(0,Wu.jsx)(Iu.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),u(!1),s(void 0),a(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await _p(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new wr("Captcha failed",null,"captcha_timeout")}}},children:e})},be=()=>(0,or.useContext)(Iu);var dc=require("react/jsx-runtime"),ys=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=be(),[,s]=(0,hs.useMemo)(()=>r?.split("t:")||[],[r]);if((0,hs.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,dc.jsx)("div",{className:"hidden h-0 w-0",children:(0,dc.jsx)(Lu.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var Co=require("react"),Ng=h(require("react-dom"));var gs=require("react");var pc=(0,gs.createContext)({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:E,initializeWalletProxy:E,getAuthMeta:E,getAuthFlow:E,closePrivyModal:E,openPrivyModal:E,connectWallet:E,initLoginWithWallet:E,loginWithWallet:E,initLoginWithFarcaster:E,loginWithFarcaster:E,loginWithCode:E,initLoginWithEmail:E,initLoginWithSms:E,initUpdateEmail:E,resendEmailCode:E,resendSmsCode:E,initLoginWithHeadlessOAuth:E,loginWithHeadlessOAuth:E,initLoginWithOAuth:E,loginWithOAuth:E,refreshUser:E,walletProxy:null,createAnalyticsEvent:E,acceptTerms:E,getUsdTokenPrice:E,recoverEmbeddedWallet:E,getFiatOnRampConfig:E,updateWallets:E,fundWallet:E,setReadyToTrue:E}),W=()=>(0,gs.useContext)(pc);var vs=require("react");var ce=(0,vs.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:E,login:E,connectOrCreateWallet:E,linkEmail:E,linkPhone:E,linkFarcaster:E,linkWallet:E,linkGoogle:E,linkTwitter:E,linkDiscord:E,linkGithub:E,linkSpotify:E,linkTiktok:E,linkLinkedIn:E,linkApple:E,updateEmail:E,logout:E,getAccessToken:E,getEthereumProvider:E,getEthersProvider:E,getWeb3jsProvider:E,unlinkEmail:E,unlinkPhone:E,unlinkWallet:E,unlinkGoogle:E,unlinkTwitter:E,unlinkDiscord:E,unlinkGithub:E,unlinkSpotify:E,unlinkTiktok:E,unlinkLinkedIn:E,unlinkApple:E,unlinkFarcaster:E,setActiveWallet:E,forkSession:E,createWallet:E,signMessage:E,signTypedData:E,enrollInMfa:E,initEnrollmentWithSms:E,initEnrollmentWithTotp:E,promptMfa:E,init:E,submitEnrollmentWithSms:E,submitEnrollmentWithTotp:E,unenroll:E,submit:E,cancel:E,sendTransaction:E,exportWallet:E,setWalletPassword:E,initLoginWithEmail:E,initLoginWithSms:E,loginWithCode:E,fundWallet:E,initLoginWithHeadlessOAuth:E,loginWithHeadlessOAuth:E,isHeadlessOAuthLoading:!1,isModalOpen:!1}),G=()=>(0,vs.useContext)(ce);var ws=require("react"),Ou=e=>{let[t,r]=(0,ws.useState)("auto");return(0,ws.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 Bn=require("react"),Nu={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:[]}},uc=(0,Bn.createContext)(void 0),Du=()=>(0,Bn.useContext)(uc);function Ie(e,t){if(!t)return;let o=Du().current[e];return(0,Bn.useEffect)(()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(a=>a!==i)}},[t])}function N(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function Uu(){let e=Du();return(t,r,...o)=>N(e,t,r,...o)}function Cs(e){Ie("configureMfa",e)}var bc=h(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),ju=h(require("@heroicons/react/24/solid/DocumentCheckIcon")),Ku=h(require("styled-components"));var ir=h(require("styled-components"));var bs=h(require("styled-components")),Mo=require("react/jsx-runtime"),Wo=({success:e,fail:t})=>(0,Mo.jsxs)(Mo.Fragment,{children:[(0,Mo.jsx)(nr,{className:e?"success":t?"fail":""}),(0,Mo.jsx)(mc,{className:e?"success":t?"fail":""})]}),nr=bs.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
- `,dc=(0,Ps.default)(oo)`
45
+ `,mc=(0,bs.default)(nr)`
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
- `,Zr=e=>(0,Ar.jsx)(ov,{color:e.color||"var(--privy-color-foreground-3)"}),ov=(0,Ps.default)(oo)`
51
+ `,tn=e=>(0,Mo.jsx)(tv,{color:e.color||"var(--privy-color-foreground-3)"}),tv=(0,bs.default)(nr)`
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 Je=require("react/jsx-runtime"),Ts=ro.default.button`
60
+ `;var Ke=require("react/jsx-runtime"),Es=ir.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
- `,U=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>(0,Je.jsx)(Du,{disabled:t||o,...n,children:t?(0,Je.jsxs)("span",{children:[(0,Je.jsx)(Zr,{}),r?(0,Je.jsx)("span",{children:r}):null]}):e}),FE=(0,ro.default)(U)`
89
- ${e=>e.hideAnimations&&ro.css`
88
+ `,U=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,Ke.jsx)(Fu,{disabled:t||r,...n,children:t?(0,Ke.jsxs)("span",{children:[(0,Ke.jsx)(tn,{}),o?(0,Ke.jsx)("span",{children:o}):null]}):e}),FE=(0,ir.default)(U)`
89
+ ${e=>e.hideAnimations&&ir.css`
90
90
  && {
91
91
  transition: none;
92
92
  }
93
93
  `}
94
- `,xs=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>(0,Je.jsx)(Du,{as:"a",disabled:t||o,...n,children:t?(0,Je.jsxs)("span",{children:[(0,Je.jsx)(Zr,{}),r?(0,Je.jsx)("span",{children:r}):null]}):e}),Du=(0,ro.default)(Ts)`
94
+ `,Ps=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,Ke.jsx)(Fu,{as:"a",disabled:t||r,...n,children:t?(0,Ke.jsxs)("span",{children:[(0,Ke.jsx)(tn,{}),o?(0,Ke.jsx)("span",{children:o}):null]}):e}),Fu=(0,ir.default)(Es)`
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?ro.css`
120
+ ${e=>e.disabled?ir.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
- `,bo=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>(0,Je.jsx)(rv,{disabled:t||o,...n,children:t?(0,Je.jsxs)("span",{children:[(0,Je.jsx)(Zr,{}),r?(0,Je.jsx)("span",{children:r}):null]}):e}),rv=(0,ro.default)(Ts)`
139
+ `,Cr=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,Ke.jsx)(rv,{disabled:t||r,...n,children:t?(0,Ke.jsxs)("span",{children:[(0,Ke.jsx)(tn,{}),o?(0,Ke.jsx)("span",{children:o}):null]}):e}),rv=(0,ir.default)(Es)`
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
- `,Ss=ro.default.button`
168
+ `,Ts=ir.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&&ro.css`
181
+ ${e=>e.invisible&&ir.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
- `,BE=ro.default.div`
199
+ `,BE=ir.default.div`
200
200
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
201
201
  height: 44px;
202
- `,Fn=({children:e,onClick:t,disabled:o,isSubmitting:r,...n})=>(0,Je.jsxs)(nv,{isSubmitting:r,onClick:t,disabled:o,...n,children:[(0,Je.jsx)("span",{children:e}),(0,Je.jsx)("span",{children:(0,Je.jsx)(Zr,{})})]}),nv=ro.default.button`
202
+ `,Hn=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>(0,Ke.jsxs)(ov,{isSubmitting:o,onClick:t,disabled:r,...n,children:[(0,Ke.jsx)("span",{children:e}),(0,Ke.jsx)("span",{children:(0,Ke.jsx)(tn,{})})]}),ov=ir.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 uc=h(require("styled-components"));var It=require("react/jsx-runtime"),pc=uc.default.div`
244
+ `;var hc=h(require("styled-components"));var It=require("react/jsx-runtime"),fc=hc.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 Bn(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:o,requireUsersAcceptTerms:r}}=e.app;if(r&&!e.alwaysShowImplicitConsent)return(0,It.jsx)(pc,{});if(!o&&!t)return(0,It.jsx)(pc,{});let n=!!(t&&o);return(0,It.jsxs)(pc,{children:["By logging in I agree to the"," ",o&&(0,It.jsx)("a",{href:o,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,It.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var $=({protectedByPrivy:e})=>(0,It.jsx)(ne,{children:e?(0,It.jsxs)(It.Fragment,{children:[(0,It.jsx)($a,{className:"hide-on-mobile"}),(0,It.jsx)("span",{className:"hide-on-mobile",children:(0,It.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),ne=uc.default.div`
253
+ `;function Gn(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return(0,It.jsx)(fc,{});if(!r&&!t)return(0,It.jsx)(fc,{});let n=!!(t&&r);return(0,It.jsxs)(fc,{children:["By logging in I agree to the"," ",r&&(0,It.jsx)("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,It.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var $=({protectedByPrivy:e})=>(0,It.jsx)(oe,{children:e?(0,It.jsxs)(It.Fragment,{children:[(0,It.jsx)(za,{className:"hide-on-mobile"}),(0,It.jsx)("span",{className:"hide-on-mobile",children:(0,It.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),oe=hc.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 Fu=h(require("@heroicons/react/24/outline/ArrowLeftIcon")),Bu=h(require("@heroicons/react/24/outline/XMarkIcon")),_s=h(require("styled-components"));var Tt=require("react/jsx-runtime"),Uu=()=>(0,Tt.jsx)("div",{}),iv=({backFn:e})=>(0,Tt.jsx)("div",{children:(0,Tt.jsx)(Hu,{onClick:e,children:(0,Tt.jsx)(Fu.default,{height:"16px",width:"16px",strokeWidth:2})})}),av=e=>(0,Tt.jsx)("div",{children:(0,Tt.jsx)(Hu,{"aria-label":"close modal",onClick:e.onClose,children:(0,Tt.jsx)(Bu.default,{height:"16px",width:"16px",strokeWidth:2})})});var k=({backFn:e,onClose:t,title:o,closeable:r=!0})=>{let{closePrivyModal:n}=M(),{app:i}=_();return(0,Tt.jsxs)(sv,{children:[e?(0,Tt.jsx)(iv,{backFn:e}):(0,Tt.jsx)(Uu,{}),o&&(0,Tt.jsx)(lv,{id:"privy-dialog-title",children:o}),i?.render.inDialog&&r?(0,Tt.jsx)(av,{onClose:t||(()=>n())}):(0,Tt.jsx)(Uu,{})]})},Hu=_s.default.button`
280
+ `;var Hu=h(require("@heroicons/react/24/outline/ArrowLeftIcon")),Gu=h(require("@heroicons/react/24/outline/XMarkIcon")),xs=h(require("styled-components"));var Tt=require("react/jsx-runtime"),Bu=()=>(0,Tt.jsx)("div",{}),nv=({backFn:e})=>(0,Tt.jsx)("div",{children:(0,Tt.jsx)(Vu,{onClick:e,children:(0,Tt.jsx)(Hu.default,{height:"16px",width:"16px",strokeWidth:2})})}),iv=e=>(0,Tt.jsx)("div",{children:(0,Tt.jsx)(Vu,{"aria-label":"close modal",onClick:e.onClose,children:(0,Tt.jsx)(Gu.default,{height:"16px",width:"16px",strokeWidth:2})})});var k=({backFn:e,onClose:t,title:r,closeable:o=!0})=>{let{closePrivyModal:n}=W(),{app:i}=A();return(0,Tt.jsxs)(av,{children:[e?(0,Tt.jsx)(nv,{backFn:e}):(0,Tt.jsx)(Bu,{}),r&&(0,Tt.jsx)(sv,{id:"privy-dialog-title",children:r}),i?.render.inDialog&&o?(0,Tt.jsx)(iv,{onClose:t||(()=>n())}):(0,Tt.jsx)(Bu,{})]})},Vu=xs.default.button`
281
281
  && {
282
282
  cursor: pointer;
283
283
  display: flex;
@@ -296,7 +296,7 @@ Resources:
296
296
  opacity: 1;
297
297
  }
298
298
  }
299
- `,sv=_s.default.div`
299
+ `,av=xs.default.div`
300
300
  padding: 16px 0;
301
301
  display: flex;
302
302
  align-items: center;
@@ -318,22 +318,22 @@ Resources:
318
318
  display: flex;
319
319
  justify-content: flex-end;
320
320
  }
321
- `,lv=_s.default.div`
321
+ `,sv=xs.default.div`
322
322
  overflow: hidden;
323
323
  white-space: nowrap;
324
324
  max-width: 100%;
325
325
  text-overflow: ellipsis;
326
326
  text-align: center;
327
327
  color: var(--privy-color-foreground-2);
328
- `;var ir=h(require("styled-components")),As=ir.default.div`
328
+ `;var lo=h(require("styled-components")),Ss=lo.default.div`
329
329
  text-align: left;
330
330
  flex-grow: 1;
331
- `,ks=ir.default.div`
331
+ `,_s=lo.default.div`
332
332
  display: flex;
333
333
  flex-direction: column;
334
334
  justify-content: flex-end;
335
335
  flex-grow: 1;
336
- `,no=ir.default.div`
336
+ `,ar=lo.default.div`
337
337
  display: flex;
338
338
  flex-direction: column;
339
339
  gap: 12px;
@@ -348,7 +348,7 @@ Resources:
348
348
  &::-webkit-scrollbar {
349
349
  display: none;
350
350
  }
351
- `,Gu=ir.css`
351
+ `,zu=lo.css`
352
352
  && {
353
353
  width: 100%;
354
354
  font-size: 16px;
@@ -386,14 +386,14 @@ Resources:
386
386
  max-width: 24px;
387
387
  }
388
388
  }
389
- `,Ne=ir.default.button`
390
- ${Gu}
391
- `,mc=ir.default.a`
392
- ${Gu}
393
- `,ar=ir.default.div`
389
+ `,Le=lo.default.button`
390
+ ${zu}
391
+ `,yc=lo.default.a`
392
+ ${zu}
393
+ `,co=lo.default.div`
394
394
  width: 100%;
395
395
  ${e=>e.if?"display: none;":""}
396
- `;var Ze=h(require("styled-components")),mt=Ze.default.div`
396
+ `;var Ye=h(require("styled-components")),ut=Ye.default.div`
397
397
  display: flex;
398
398
  flex-direction: column;
399
399
  align-items: center;
@@ -401,17 +401,17 @@ Resources:
401
401
  @media (max-width: 440px) {
402
402
  padding: 10px 10px 20px;
403
403
  }
404
- `,De=Ze.default.div`
404
+ `,Oe=Ye.default.div`
405
405
  font-size: 18px;
406
406
  line-height: 18px;
407
407
  text-align: center;
408
408
  font-weight: 600;
409
409
  margin-bottom: 10px;
410
- `,Me=Ze.default.div`
410
+ `,Re=Ye.default.div`
411
411
  font-size: 0.875rem;
412
412
 
413
413
  text-align: center;
414
- `,Rr=Ze.default.div`
414
+ `,Lo=Ye.default.div`
415
415
  display: flex;
416
416
  flex-direction: column;
417
417
  align-items: center;
@@ -421,7 +421,7 @@ Resources:
421
421
  @media (max-width: 440px) {
422
422
  padding: 10px 10px 20px;
423
423
  }
424
- `,Vu=Ze.default.div`
424
+ `,$u=Ye.default.div`
425
425
  display: flex;
426
426
  flex-direction: column;
427
427
  align-items: stretch;
@@ -429,7 +429,7 @@ Resources:
429
429
  padding: 1rem 0rem 0rem;
430
430
  flex-grow: 1;
431
431
  width: 100%;
432
- `,fc=Ze.default.div`
432
+ `,gc=Ye.default.div`
433
433
  width: 25px;
434
434
  display: flex;
435
435
  align-items: center;
@@ -441,19 +441,19 @@ Resources:
441
441
  width: 25px !important;
442
442
  color: var(--privy-color-accent);
443
443
  }
444
- `,hc=Ze.default.div`
444
+ `,vc=Ye.default.div`
445
445
  display: flex;
446
446
  align-items: center;
447
447
  gap: 10px;
448
448
  font-size: 0.875rem;
449
449
  line-height: 1rem;
450
450
  text-align: left;
451
- `,Ir=Ze.default.div`
451
+ `,Oo=Ye.default.div`
452
452
  display: flex;
453
453
  flex-direction: column;
454
454
  gap: 10px;
455
455
  padding-top: 20px;
456
- `,Rs=Ze.default.div`
456
+ `,As=Ye.default.div`
457
457
  display: flex;
458
458
  flex-direction: column;
459
459
  align-items: stretch;
@@ -461,7 +461,7 @@ Resources:
461
461
  padding: 1rem 0rem 0rem;
462
462
  flex-grow: 1;
463
463
  width: 100%;
464
- `,Is=Ze.default.div`
464
+ `,ks=Ye.default.div`
465
465
  display: flex;
466
466
  gap: 5px;
467
467
  width: 100%;
@@ -469,7 +469,7 @@ Resources:
469
469
  & > button:not(#remove) {
470
470
  width: 100%;
471
471
  }
472
- `,yc=Ze.default.button`
472
+ `,wc=Ye.default.button`
473
473
  && {
474
474
  background-color: transparent;
475
475
  color: var(--privy-color-foreground-3);
@@ -488,7 +488,7 @@ Resources:
488
488
  &&:hover {
489
489
  color: var(--privy-color-error);
490
490
  }
491
- `,Ms=Ze.default.div`
491
+ `,Rs=Ye.default.div`
492
492
  display: flex;
493
493
  align-items: center;
494
494
  gap: 0.5rem;
@@ -498,7 +498,7 @@ Resources:
498
498
  height: 20px !important;
499
499
  width: 20px !important;
500
500
  }
501
- `,Hn=Ze.default.div`
501
+ `,Vn=Ye.default.div`
502
502
  display: flex;
503
503
  align-items: center;
504
504
  gap: 6px;
@@ -512,15 +512,15 @@ Resources:
512
512
  display: flex !important;
513
513
  align-items: flex-end;
514
514
  }
515
- `,Ws=Ze.default.div`
515
+ `,Is=Ye.default.div`
516
516
  width: 100%;
517
517
  display: flex;
518
518
  justify-content: space-between;
519
- `,zu=Ze.default.p`
519
+ `,qu=Ye.default.p`
520
520
  text-align: left;
521
521
  width: 100%;
522
522
  color: var(--privy-color-foreground-3) !important;
523
- `,gc=Ze.default.button`
523
+ `,Cc=Ye.default.button`
524
524
  display: flex;
525
525
  flex-direction: row;
526
526
  align-items: center;
@@ -550,7 +550,7 @@ Resources:
550
550
  &:hover {
551
551
  text-decoration: underline;
552
552
  }
553
- `,xt=Ze.default.div`
553
+ `,xt=Ye.default.div`
554
554
  display: flex;
555
555
  align-items: center;
556
556
  justify-content: center;
@@ -565,10 +565,10 @@ Resources:
565
565
  width: auto !important;
566
566
  color: white;
567
567
  }
568
- `;var Ve=require("react/jsx-runtime"),ju=()=>{let{user:e,logout:t}=G(),{app:o,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:i}=_(),{acceptTerms:a,closePrivyModal:l}=M(),s=u=>{u?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};r.current=s;let c=async u=>{u.preventDefault(),await a(),e&&Zt(e,o?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:f=>console.error(f),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,Ve.jsx)(cv,{termsAndConditionsUrl:o?.legal.termsAndConditionsUrl,privacyPolicyUrl:o?.legal.privacyPolicyUrl,onAccept:c,onDecline:s})},cv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:o,onDecline:r})=>(0,Ve.jsxs)(Ve.Fragment,{children:[(0,Ve.jsx)(k,{closeable:!1}),(0,Ve.jsx)($u.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,Ve.jsx)(De,{style:{marginTop:24},children:"One last step"}),(0,Ve.jsx)(Me,{children:"By signing up, you agree to our terms and privacy policy."}),(0,Ve.jsxs)(no,{style:{marginTop:24},children:[e&&(0,Ve.jsxs)(mc,{target:"_blank",href:e,children:["View Terms ",(0,Ve.jsx)(vc.default,{style:{marginLeft:"auto"}})]}),t&&(0,Ve.jsxs)(mc,{target:"_blank",href:t,children:["View Privacy Policy ",(0,Ve.jsx)(vc.default,{style:{marginLeft:"auto"}})]})]}),(0,Ve.jsxs)(dv,{style:{marginTop:24},children:[(0,Ve.jsx)(bo,{onClick:r,children:"No thanks"}),(0,Ve.jsx)(U,{onClick:o,children:"Accept"})]}),(0,Ve.jsx)($,{protectedByPrivy:!0})]}),dv=qu.default.div`
568
+ `;var Ve=require("react/jsx-runtime"),Yu=()=>{let{user:e,logout:t}=G(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=A(),{acceptTerms:a,closePrivyModal:l}=W(),s=u=>{u?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=s;let c=async u=>{u.preventDefault(),await a(),e&&Xt(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:f=>console.error(f),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,Ve.jsx)(lv,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:c,onDecline:s})},lv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>(0,Ve.jsxs)(Ve.Fragment,{children:[(0,Ve.jsx)(k,{closeable:!1}),(0,Ve.jsx)(ju.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,Ve.jsx)(Oe,{style:{marginTop:24},children:"One last step"}),(0,Ve.jsx)(Re,{children:"By signing up, you agree to our terms and privacy policy."}),(0,Ve.jsxs)(ar,{style:{marginTop:24},children:[e&&(0,Ve.jsxs)(yc,{target:"_blank",href:e,children:["View Terms ",(0,Ve.jsx)(bc.default,{style:{marginLeft:"auto"}})]}),t&&(0,Ve.jsxs)(yc,{target:"_blank",href:t,children:["View Privacy Policy ",(0,Ve.jsx)(bc.default,{style:{marginLeft:"auto"}})]})]}),(0,Ve.jsxs)(cv,{style:{marginTop:24},children:[(0,Ve.jsx)(Cr,{onClick:o,children:"No thanks"}),(0,Ve.jsx)(U,{onClick:r,children:"Accept"})]}),(0,Ve.jsx)($,{protectedByPrivy:!0})]}),cv=Ku.default.div`
569
569
  display: flex;
570
570
  gap: 10px;
571
- `;var Ns=h(require("styled-components"));var Ku=h(require("styled-components")),Ls=Ku.default.span`
571
+ `;var Ls=h(require("styled-components"));var Ju=h(require("styled-components")),Ms=Ju.default.span`
572
572
  && {
573
573
  width: 82px;
574
574
  height: 82px;
@@ -583,7 +583,7 @@ Resources:
583
583
  transition: border-color 800ms;
584
584
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
585
585
  }
586
- `;var wc=require("react/jsx-runtime"),Os=({style:e,...t})=>(0,wc.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,wc.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 Ge=require("react/jsx-runtime"),Yu=()=>{let{navigate:e,app:t}=_(),o=t?.allowlistConfig.errorTitle||"You don't have access to this app",r=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(k,{}),(0,Ge.jsxs)(pv,{children:[(0,Ge.jsx)(mv,{children:(0,Ge.jsxs)("div",{children:[(0,Ge.jsx)(Ls,{}),(0,Ge.jsx)(Os,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,Ge.jsxs)(uv,{children:[typeof o=="string"?(0,Ge.jsx)("h3",{children:o}):(0,Ge.jsx)(Ge.Fragment,{children:o}),typeof r=="string"?(0,Ge.jsx)("p",{children:r}):(0,Ge.jsx)(Ge.Fragment,{children:r})]}),t?.allowlistConfig.errorCtaLink?(0,Ge.jsx)(U,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,Ge.jsx)(U,{onClick:()=>{e("LANDING")},children:n})]})]})},pv=Ns.default.div`
586
+ `;var Ec=require("react/jsx-runtime"),Ws=({style:e,...t})=>(0,Ec.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,Ec.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 Ge=require("react/jsx-runtime"),Zu=()=>{let{navigate:e,app:t}=A(),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,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(k,{}),(0,Ge.jsxs)(dv,{children:[(0,Ge.jsx)(uv,{children:(0,Ge.jsxs)("div",{children:[(0,Ge.jsx)(Ms,{}),(0,Ge.jsx)(Ws,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,Ge.jsxs)(pv,{children:[typeof r=="string"?(0,Ge.jsx)("h3",{children:r}):(0,Ge.jsx)(Ge.Fragment,{children:r}),typeof o=="string"?(0,Ge.jsx)("p",{children:o}):(0,Ge.jsx)(Ge.Fragment,{children:o})]}),t?.allowlistConfig.errorCtaLink?(0,Ge.jsx)(U,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,Ge.jsx)(U,{onClick:()=>{e("LANDING")},children:n})]})]})},dv=Ls.default.div`
587
587
  display: flex;
588
588
  flex-direction: column;
589
589
  align-items: center;
@@ -591,11 +591,11 @@ Resources:
591
591
  gap: 24px;
592
592
  width: 100%;
593
593
  padding-bottom: 16px;
594
- `,uv=Ns.default.div`
594
+ `,pv=Ls.default.div`
595
595
  display: flex;
596
596
  flex-direction: column;
597
597
  gap: 8px;
598
- `,mv=Ns.default.div`
598
+ `,uv=Ls.default.div`
599
599
  display: flex;
600
600
  flex-direction: column;
601
601
  justify-content: center;
@@ -618,7 +618,7 @@ Resources:
618
618
  left: -19px;
619
619
  top: -19px;
620
620
  }
621
- `;var rm=h(require("@heroicons/react/24/outline/EnvelopeIcon")),nm=h(require("@heroicons/react/24/outline/PhoneIcon")),Mr=require("react"),im=require("react-device-detect"),Gn=h(require("styled-components"));var Mt=h(require("styled-components")),io=Mt.default.div`
621
+ `;var im=h(require("@heroicons/react/24/outline/EnvelopeIcon")),am=h(require("@heroicons/react/24/outline/PhoneIcon")),No=require("react"),sm=require("react-device-detect"),zn=h(require("styled-components"));var Mt=h(require("styled-components")),sr=Mt.default.div`
622
622
  display: flex;
623
623
  flex-direction: column;
624
624
  align-items: flex-start;
@@ -626,27 +626,27 @@ Resources:
626
626
  margin-top: auto;
627
627
  gap: 16px;
628
628
  flex-grow: 100;
629
- `,ao=Mt.default.div`
629
+ `,lr=Mt.default.div`
630
630
  display: flex;
631
631
  flex-direction: column;
632
632
  align-items: center;
633
633
  justify-content: center;
634
634
  flex-grow: 1;
635
635
  width: 100%;
636
- `,Ju=Mt.default.div`
636
+ `,Qu=Mt.default.div`
637
637
  display: flex;
638
638
  flex-direction: column;
639
639
  align-items: center;
640
640
  width: 100%;
641
- `,Ds=(0,Mt.default)(ao)`
641
+ `,Os=(0,Mt.default)(lr)`
642
642
  padding: 20px 0;
643
- `,Eo=(0,Mt.default)(ao)`
643
+ `,br=(0,Mt.default)(lr)`
644
644
  gap: 16px;
645
- `,Cc=Mt.default.div`
645
+ `,Pc=Mt.default.div`
646
646
  display: flex;
647
647
  flex-direction: column;
648
648
  width: 100%;
649
- `,so=Mt.default.div`
649
+ `,cr=Mt.default.div`
650
650
  display: flex;
651
651
  flex-direction: column;
652
652
  gap: 8px;
@@ -655,7 +655,7 @@ Resources:
655
655
  flex-direction: column;
656
656
  justify-content: space-between;
657
657
  height: 100%;
658
- `,Zu=Mt.default.div`
658
+ `,Xu=Mt.default.div`
659
659
  display: flex;
660
660
  flex-direction: column;
661
661
  justify-content: flex-start;
@@ -682,9 +682,9 @@ Resources:
682
682
  height: 16px;
683
683
  `,te=Mt.default.div`
684
684
  height: 12px;
685
- `,Qu=Mt.default.div`
685
+ `,em=Mt.default.div`
686
686
  position: relative;
687
- `,Xu=Mt.default.div`
687
+ `,tm=Mt.default.div`
688
688
  background-color: var(--privy-color-accent);
689
689
  display: flex;
690
690
  justify-content: center;
@@ -692,9 +692,9 @@ Resources:
692
692
  border-radius: 50%;
693
693
  border-color: white;
694
694
  border-width: 2px !important;
695
- `;var Us=h(require("styled-components")),Po=require("react/jsx-runtime"),Hi=({title:e,description:t,children:o,...r})=>(0,Po.jsx)(em,{...r,children:(0,Po.jsxs)(Po.Fragment,{children:[(0,Po.jsx)("h3",{children:e}),typeof t=="string"?(0,Po.jsx)("p",{children:t}):t,o]})}),Go=(0,Us.default)(Hi)`
695
+ `;var Ns=h(require("styled-components")),Er=require("react/jsx-runtime"),Bi=({title:e,description:t,children:r,...o})=>(0,Er.jsx)(rm,{...o,children:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("h3",{children:e}),typeof t=="string"?(0,Er.jsx)("p",{children:t}):t,r]})}),Vr=(0,Ns.default)(Bi)`
696
696
  margin-bottom: 24px;
697
- `,Ue=({title:e,description:t,icon:o,children:r,...n})=>(0,Po.jsxs)(fv,{...n,children:[o||null,(0,Po.jsx)("h3",{children:e}),typeof t=="string"?(0,Po.jsx)("p",{children:t}):t,r]}),em=Us.default.div`
697
+ `,Ne=({title:e,description:t,icon:r,children:o,...n})=>(0,Er.jsxs)(mv,{...n,children:[r||null,(0,Er.jsx)("h3",{children:e}),typeof t=="string"?(0,Er.jsx)("p",{children:t}):t,o]}),rm=Ns.default.div`
698
698
  display: flex;
699
699
  flex-direction: column;
700
700
  justify-content: flex-start;
@@ -714,7 +714,7 @@ Resources:
714
714
  color: var(--privy-color-foreground-2);
715
715
  font-size: 14px;
716
716
  }
717
- `,fv=(0,Us.default)(em)`
717
+ `,mv=(0,Ns.default)(rm)`
718
718
  align-items: center;
719
719
  text-align: center;
720
720
  gap: 16px;
@@ -722,7 +722,7 @@ Resources:
722
722
  h3 {
723
723
  margin-bottom: 24px;
724
724
  }
725
- `;var se=require("react/jsx-runtime"),bc=6,tm=new Array(bc).fill(""),hv=1400;var am=()=>{let{app:e,navigate:t,navigateBack:o,setModalData:r,onUserCloseViaDialogOrKeybindRef:n}=_(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:u}=M(),{authenticated:f,user:g}=G(),[w,C]=(0,Mr.useState)(tm),[E,x]=(0,Mr.useState)(!1),[b,A]=(0,Mr.useState)(null),[W,I]=(0,Mr.useState)(null);n.current=()=>null;let S=s()?.email?0:1,B=e?.render.inDialog?bt:0,F=e?.render.inDialog?B-500:0;(0,Mr.useEffect)(()=>{if(f&&E&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let K=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},F);return()=>clearTimeout(K)}if(Zt(g,e?.embeddedWallets?.createOnLogin)){let K=setTimeout(()=>{r({createWallet:{onSuccess:()=>{},onFailure:re=>console.error(re),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},F);return()=>clearTimeout(K)}else{u();let K=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),B);return()=>clearTimeout(K)}}},[f,E,g]),(0,Mr.useEffect)(()=>{if(b&&W===0){let Y=setTimeout(()=>{C(tm),A(null),document.querySelector("input[name=code-0]")?.focus()},hv);return()=>clearTimeout(Y)}},[b]);let q=Y=>{Y.preventDefault();let K=Y.currentTarget.value.replace(" ","");if(K==="")return;if(isNaN(Number(K))){A("Code should be numeric"),I(1);return}A(null),I(null);let re=Number(Y.currentTarget.name?.charAt(5)),ue=[...K||[""]].slice(0,bc-re),J=[...w.slice(0,re),...ue,...w.slice(re+ue.length)];C(J);let it=ue.length,At=Math.min(Math.max(re+it,0),bc-1);isNaN(Number(Y.currentTarget.value))||document.querySelector(`input[name=code-${At}]`)?.focus(),J.every(Ut=>Ut&&!isNaN(+Ut))&&(document.querySelector(`input[name=code-${At}]`)?.blur(),c(J.join("")).then(()=>x(!0)).catch(at=>{at?.status===422?A("Invalid or expired verification code"):at instanceof No&&at.privyErrorCode==="cannot_link_more_of_type"?A(at.message):A("Issue verifying code"),I(0)}))},R=Y=>{W===1&&(A(null),I(null));let K=[...w.slice(0,Y),"",...w.slice(Y+1)];C(K),Y>0&&document.querySelector(`input[name=code-${Y-1}]`)?.focus()},Z=S==0?(0,se.jsx)(rm.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,se.jsx)(nm.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),D=S==0?(0,se.jsxs)("p",{children:["Please check ",(0,se.jsx)(om,{children:s()?.email})," for an email from privy.io and enter your code below."]}):(0,se.jsxs)("p",{children:["Please check ",(0,se.jsx)(om,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(k,{backFn:()=>o()},"header"),(0,se.jsxs)(yv,{children:[(0,se.jsx)(Ue,{title:"Enter confirmation code",description:D,icon:Z}),(0,se.jsxs)(Ju,{children:[(0,se.jsxs)(gv,{children:[(0,se.jsx)(vv,{fail:!!b,success:E,children:(0,se.jsx)("span",{children:b||(E?"Success!":"")})}),(0,se.jsx)("div",{children:w.map((Y,K)=>(0,se.jsx)("input",{name:`code-${K}`,type:"text",value:w[K],onChange:q,onKeyUp:re=>{re.key==="Backspace"&&R(K)},inputMode:"numeric",autoFocus:K===0,pattern:"[0-9]",className:`${E?"success":""} ${b?"fail":""}`,autoComplete:im.isMobile?"one-time-code":"off"},K))})]}),(0,se.jsx)(wv,{children:S==0?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)("span",{children:"Didn't get an email?"}),(0,se.jsx)("button",{onClick:a,children:"Resend code"})]}):(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)("span",{children:"Didn't get a message?"}),(0,se.jsx)("button",{onClick:l,children:"Resend code"})]})})]})]}),(0,se.jsx)($,{protectedByPrivy:!0})]})},yv=Gn.default.div`
725
+ `;var se=require("react/jsx-runtime"),Tc=6,om=new Array(Tc).fill(""),fv=1400;var lm=()=>{let{app:e,navigate:t,navigateBack:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=A(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:u}=W(),{authenticated:f,user:g}=G(),[w,C]=(0,No.useState)(om),[b,S]=(0,No.useState)(!1),[P,T]=(0,No.useState)(null),[M,I]=(0,No.useState)(null);n.current=()=>null;let _=s()?.email?0:1,F=e?.render.inDialog?bt:0,B=e?.render.inDialog?F-500:0;(0,No.useEffect)(()=>{if(f&&b&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let K=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},B);return()=>clearTimeout(K)}if(Xt(g,e?.embeddedWallets?.createOnLogin)){let K=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:ie=>console.error(ie),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},B);return()=>clearTimeout(K)}else{u();let K=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),F);return()=>clearTimeout(K)}}},[f,b,g]),(0,No.useEffect)(()=>{if(P&&M===0){let Y=setTimeout(()=>{C(om),T(null),document.querySelector("input[name=code-0]")?.focus()},fv);return()=>clearTimeout(Y)}},[P]);let q=Y=>{Y.preventDefault();let K=Y.currentTarget.value.replace(" ","");if(K==="")return;if(isNaN(Number(K))){T("Code should be numeric"),I(1);return}T(null),I(null);let ie=Number(Y.currentTarget.name?.charAt(5)),Ce=[...K||[""]].slice(0,Tc-ie),J=[...w.slice(0,ie),...Ce,...w.slice(ie+Ce.length)];C(J);let it=Ce.length,yt=Math.min(Math.max(ie+it,0),Tc-1);isNaN(Number(Y.currentTarget.value))||document.querySelector(`input[name=code-${yt}]`)?.focus(),J.every(Ut=>Ut&&!isNaN(+Ut))&&(document.querySelector(`input[name=code-${yt}]`)?.blur(),c(J.join("")).then(()=>S(!0)).catch(at=>{at?.status===422?T("Invalid or expired verification code"):at instanceof Dr&&at.privyErrorCode==="cannot_link_more_of_type"?T(at.message):T("Issue verifying code"),I(0)}))},R=Y=>{M===1&&(T(null),I(null));let K=[...w.slice(0,Y),"",...w.slice(Y+1)];C(K),Y>0&&document.querySelector(`input[name=code-${Y-1}]`)?.focus()},Q=_==0?(0,se.jsx)(im.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,se.jsx)(am.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),D=_==0?(0,se.jsxs)("p",{children:["Please check ",(0,se.jsx)(nm,{children:s()?.email})," for an email from privy.io and enter your code below."]}):(0,se.jsxs)("p",{children:["Please check ",(0,se.jsx)(nm,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(k,{backFn:()=>r()},"header"),(0,se.jsxs)(hv,{children:[(0,se.jsx)(Ne,{title:"Enter confirmation code",description:D,icon:Q}),(0,se.jsxs)(Qu,{children:[(0,se.jsxs)(yv,{children:[(0,se.jsx)(gv,{fail:!!P,success:b,children:(0,se.jsx)("span",{children:P||(b?"Success!":"")})}),(0,se.jsx)("div",{children:w.map((Y,K)=>(0,se.jsx)("input",{name:`code-${K}`,type:"text",value:w[K],onChange:q,onKeyUp:ie=>{ie.key==="Backspace"&&R(K)},inputMode:"numeric",autoFocus:K===0,pattern:"[0-9]",className:`${b?"success":""} ${P?"fail":""}`,autoComplete:sm.isMobile?"one-time-code":"off"},K))})]}),(0,se.jsx)(vv,{children:_==0?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)("span",{children:"Didn't get an email?"}),(0,se.jsx)("button",{onClick:a,children:"Resend code"})]}):(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)("span",{children:"Didn't get a message?"}),(0,se.jsx)("button",{onClick:l,children:"Resend code"})]})})]})]}),(0,se.jsx)($,{protectedByPrivy:!0})]})},hv=zn.default.div`
726
726
  display: flex;
727
727
  flex-direction: column;
728
728
  align-items: flex-start;
@@ -730,7 +730,7 @@ Resources:
730
730
  margin: auto;
731
731
  gap: 16px;
732
732
  flex-grow: 1;
733
- `,gv=Gn.default.div`
733
+ `,yv=zn.default.div`
734
734
  display: flex;
735
735
  flex-direction: column;
736
736
  width: 100%;
@@ -786,7 +786,7 @@ Resources:
786
786
  transform: translate(1px, 0px);
787
787
  }
788
788
  }
789
- `,vv=Gn.default.div`
789
+ `,gv=zn.default.div`
790
790
  line-height: 20px;
791
791
  height: 20px;
792
792
  font-size: 13px;
@@ -794,7 +794,7 @@ Resources:
794
794
  display: flex;
795
795
  justify-content: flex-end;
796
796
  width: 100%;
797
- `,wv=Gn.default.div`
797
+ `,vv=zn.default.div`
798
798
  font-size: 13px;
799
799
  color: var(--privy-color-foreground-3);
800
800
  display: flex;
@@ -808,10 +808,10 @@ Resources:
808
808
  > button {
809
809
  text-decoration: underline;
810
810
  }
811
- `,om=Gn.default.span`
811
+ `,nm=zn.default.span`
812
812
  font-weight: 500;
813
813
  word-break: break-all;
814
- `;var dm=h(require("@heroicons/react/24/solid/CheckCircleIcon")),pm=h(require("@heroicons/react/24/solid/XCircleIcon")),Ht=require("react"),um=h(require("styled-components"));var sm=h(require("styled-components"));var To=require("react/jsx-runtime"),lm=({icon:e})=>{let t=e;return(0,To.jsx)(To.Fragment,{children:(0,To.jsx)(Cv,{children:(0,To.jsxs)("div",{children:[(0,To.jsx)(kr,{}),typeof t=="string"?(0,To.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,To.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,To.jsx)("span",{})]})})})},Cv=sm.default.div`
814
+ `;var um=h(require("@heroicons/react/24/solid/CheckCircleIcon")),mm=h(require("@heroicons/react/24/solid/XCircleIcon")),Vt=require("react"),fm=h(require("styled-components"));var cm=h(require("styled-components"));var Pr=require("react/jsx-runtime"),dm=({icon:e})=>{let t=e;return(0,Pr.jsx)(Pr.Fragment,{children:(0,Pr.jsx)(wv,{children:(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(Wo,{}),typeof t=="string"?(0,Pr.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,Pr.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,Pr.jsx)("span",{})]})})})},wv=cm.default.div`
815
815
  display: flex;
816
816
  flex-direction: column;
817
817
  justify-content: center;
@@ -834,14 +834,14 @@ Resources:
834
834
  left: -19px;
835
835
  top: -19px;
836
836
  }
837
- `;var Qe=require("react/jsx-runtime"),mm=500,cm=mm*2,fm=()=>{let{lastScreen:e,currentScreen:t,data:o,navigateBack:r,navigate:n,setModalData:i}=_(),{status:a,token:l,waitForResult:s,reset:c,execute:u}=Ee(),f=(0,Ht.useRef)([]),g=Y=>{f.current=[Y,...f.current]},[w,C]=(0,Ht.useState)(!0);(0,Ht.useEffect)(()=>{let Y=setTimeout(C,cm,!1);return g(Y),()=>{f.current.forEach(K=>clearTimeout(K)),f.current=[]}},[]);let[E,x]=(0,Ht.useState)(""),[b,A]=(0,Ht.useState)("Checking that you are a human..."),[W,I]=(0,Ht.useState)((0,Qe.jsx)(U,{onClick:()=>{},disabled:!0,children:"Continue"})),[S,B]=(0,Ht.useState)(!1),[F,q]=(0,Ht.useState)(3),R=o?.captchaModalData,Z=async Y=>{try{await R?.callback(Y),R?.onSuccessNavigateTo&&n(R?.onSuccessNavigateTo,!1)}catch(K){if(K instanceof Co)return;{let re={error:K,previousScreen:e||"LANDING"};i({errorModalData:re}),n(R?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Ht.useEffect)(()=>{if(a==="success"){let Y=setTimeout(async()=>{let K=await s();!K||R?.userIntentRequired||Z(K)},cm);g(Y)}else if(a==="ready"){let Y=setTimeout(()=>{a==="ready"&&u()},mm);g(Y)}},[a]),(0,Ht.useEffect)(()=>{if(!w)switch(a){case"success":x("Success!"),A("CAPTCHA passed successfully."),I((0,Qe.jsx)(U,{onClick:()=>{B(!0),Z(l)},disabled:!R?.userIntentRequired,loading:S,children:R?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":x(""),A("Checking that you are a human..."),I((0,Qe.jsx)(U,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":x("Something went wrong"),F<=0?(A("If you use an adblocker or VPN, try disabling and re-attempting."),I(null)):(A("You did not pass CAPTCHA. Please try again."),I((0,Qe.jsx)(U,{onClick:D,children:"Retry"})));break;case"ready":default:break}},[a,w,S]);let D=async()=>{if(F<=0)return;q(K=>K-1),c(),u();let Y=await s();!Y||R?.userIntentRequired||Z(Y)};return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(k,{backFn:!e||t===e?void 0:r}),(0,Qe.jsxs)(bv,{children:[a==="success"?(0,Qe.jsx)(dm.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Qe.jsx)(pm.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Qe.jsx)(lm,{}),(0,Qe.jsxs)(so,{children:[E?(0,Qe.jsx)("h3",{children:E}):null,(0,Qe.jsx)("p",{children:b})]}),W]}),(0,Qe.jsx)(ne,{})]})},bv=um.default.div`
837
+ `;var Je=require("react/jsx-runtime"),hm=500,pm=hm*2,ym=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=A(),{status:a,token:l,waitForResult:s,reset:c,execute:u}=be(),f=(0,Vt.useRef)([]),g=Y=>{f.current=[Y,...f.current]},[w,C]=(0,Vt.useState)(!0);(0,Vt.useEffect)(()=>{let Y=setTimeout(C,pm,!1);return g(Y),()=>{f.current.forEach(K=>clearTimeout(K)),f.current=[]}},[]);let[b,S]=(0,Vt.useState)(""),[P,T]=(0,Vt.useState)("Checking that you are a human..."),[M,I]=(0,Vt.useState)((0,Je.jsx)(U,{onClick:()=>{},disabled:!0,children:"Continue"})),[_,F]=(0,Vt.useState)(!1),[B,q]=(0,Vt.useState)(3),R=r?.captchaModalData,Q=async Y=>{try{await R?.callback(Y),R?.onSuccessNavigateTo&&n(R?.onSuccessNavigateTo,!1)}catch(K){if(K instanceof wr)return;{let ie={error:K,previousScreen:e||"LANDING"};i({errorModalData:ie}),n(R?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Vt.useEffect)(()=>{if(a==="success"){let Y=setTimeout(async()=>{let K=await s();!K||R?.userIntentRequired||Q(K)},pm);g(Y)}else if(a==="ready"){let Y=setTimeout(()=>{a==="ready"&&u()},hm);g(Y)}},[a]),(0,Vt.useEffect)(()=>{if(!w)switch(a){case"success":S("Success!"),T("CAPTCHA passed successfully."),I((0,Je.jsx)(U,{onClick:()=>{F(!0),Q(l)},disabled:!R?.userIntentRequired,loading:_,children:R?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":S(""),T("Checking that you are a human..."),I((0,Je.jsx)(U,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":S("Something went wrong"),B<=0?(T("If you use an adblocker or VPN, try disabling and re-attempting."),I(null)):(T("You did not pass CAPTCHA. Please try again."),I((0,Je.jsx)(U,{onClick:D,children:"Retry"})));break;case"ready":default:break}},[a,w,_]);let D=async()=>{if(B<=0)return;q(K=>K-1),c(),u();let Y=await s();!Y||R?.userIntentRequired||Q(Y)};return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(k,{backFn:!e||t===e?void 0:o}),(0,Je.jsxs)(Cv,{children:[a==="success"?(0,Je.jsx)(um.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Je.jsx)(mm.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Je.jsx)(dm,{}),(0,Je.jsxs)(cr,{children:[b?(0,Je.jsx)("h3",{children:b}):null,(0,Je.jsx)("p",{children:P})]}),M]}),(0,Je.jsx)(oe,{})]})},Cv=fm.default.div`
838
838
  display: flex;
839
839
  flex-direction: column;
840
840
  align-items: center;
841
841
  justify-content: center;
842
842
  gap: 24px;
843
843
  width: 100%;
844
- `;var Cm=h(require("@heroicons/react/24/outline/WalletIcon")),bm=require("react-device-detect"),Em=h(require("styled-components"));var St=require("react/jsx-runtime"),hm=({...e})=>(0,St.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,St.jsx)("defs",{children:(0,St.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,St.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,St.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,St.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,St.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,St.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,St.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,St.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,St.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,St.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,St.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 Xe=require("react/jsx-runtime"),ym=({style:e,...t})=>(0,Xe.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,Xe.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,Xe.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Xe.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,Xe.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Xe.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,Xe.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,Xe.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,Xe.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,Xe.jsxs)("defs",{children:[(0,Xe.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Xe.jsx)("stop",{"stop-color":"#002D72"}),(0,Xe.jsx)("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),(0,Xe.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Xe.jsx)("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),(0,Xe.jsx)("stop",{offset:"1","stop-color":"#002D72"})]})]})]});var z=require("react/jsx-runtime"),gm=({style:e,...t})=>(0,z.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,z.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,z.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,z.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,z.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,z.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,z.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,z.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,z.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,z.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,z.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,z.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,z.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,z.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,z.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,z.jsxs)("defs",{children:[(0,z.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#174299"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,z.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,z.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,z.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FF4000"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,z.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#8754C9"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,z.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,z.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.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,z.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.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,z.jsx)("stop",{stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.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,z.jsx)("stop",{stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.jsx)("clipPath",{id:"clip0_5_32",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,z.jsx)("clipPath",{id:"clip1_5_32",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var Wt=require("react/jsx-runtime"),vm=({style:e,...t})=>(0,Wt.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,Wt.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,Wt.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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 sr=require("react/jsx-runtime"),wm=({style:e,...t})=>(0,sr.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,sr.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,sr.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,sr.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,sr.jsx)("defs",{children:(0,sr.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,sr.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var lr=require("react/jsx-runtime"),Vo={coinbase_wallet:{logo:Ba,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:kn,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Uo,displayName:"Phantom"},rainbow:{logo:gm,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Bi,displayName:"WalletConnect"},zerion:{logo:wm,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:hm,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:ym,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:vm,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="}},Qr=({provider:e,displayName:t,logo:o,connectOnly:r,connector:n})=>{let{navigate:i}=_(),{connectWallet:a}=M(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{br()?(a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(bm.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,lr.jsxs)(xv,{onClick:s,children:[(0,lr.jsx)(Tv,{icon:Pv(e,n.connectorType)??o,name:n.walletClientType}),(0,lr.jsx)("span",{children:Ev(e,n.connectorType)||t||n.walletClientType}),(0,lr.jsx)("span",{id:"connect-text",children:"Connect"})]})},Ev=(e,t)=>{if(Vo[e]?.displayName)return Vo[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},Pv=(e,t)=>{if(Vo[e]?.logo)return Vo[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Bi},Tv=({icon:e,name:t})=>typeof e=="string"?(0,lr.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,lr.jsx)(Cm.default,{}):e?(0,lr.jsx)(e,{}):null,xv=(0,Em.default)(Ne)`
844
+ `;var Em=h(require("@heroicons/react/24/outline/WalletIcon")),Pm=require("react-device-detect"),Tm=h(require("styled-components"));var St=require("react/jsx-runtime"),gm=({...e})=>(0,St.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,St.jsx)("defs",{children:(0,St.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,St.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,St.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,St.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,St.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,St.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,St.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,St.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,St.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,St.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,St.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 Ze=require("react/jsx-runtime"),vm=({style:e,...t})=>(0,Ze.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,Ze.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,Ze.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Ze.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,Ze.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Ze.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,Ze.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,Ze.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,Ze.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,Ze.jsxs)("defs",{children:[(0,Ze.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ze.jsx)("stop",{"stop-color":"#002D72"}),(0,Ze.jsx)("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),(0,Ze.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ze.jsx)("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),(0,Ze.jsx)("stop",{offset:"1","stop-color":"#002D72"})]})]})]});var z=require("react/jsx-runtime"),wm=({style:e,...t})=>(0,z.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,z.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,z.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,z.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,z.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,z.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,z.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,z.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,z.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,z.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,z.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,z.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,z.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,z.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,z.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,z.jsxs)("defs",{children:[(0,z.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#174299"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,z.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,z.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,z.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FF4000"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,z.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#8754C9"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,z.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,z.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.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,z.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.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,z.jsx)("stop",{stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.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,z.jsx)("stop",{stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.jsx)("clipPath",{id:"clip0_5_32",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,z.jsx)("clipPath",{id:"clip1_5_32",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var Wt=require("react/jsx-runtime"),Cm=({style:e,...t})=>(0,Wt.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,Wt.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,Wt.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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,Wt.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 po=require("react/jsx-runtime"),bm=({style:e,...t})=>(0,po.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,po.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,po.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,po.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,po.jsx)("defs",{children:(0,po.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,po.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var uo=require("react/jsx-runtime"),zr={coinbase_wallet:{logo:Fa,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:In,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Fr,displayName:"Phantom"},rainbow:{logo:wm,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Fi,displayName:"WalletConnect"},zerion:{logo:bm,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:gm,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:vm,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:Cm,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="}},rn=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=A(),{connectWallet:a}=W(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{xo()?(a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(Pm.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,uo.jsxs)(Tv,{onClick:s,children:[(0,uo.jsx)(Pv,{icon:Ev(e,n.connectorType)??r,name:n.walletClientType}),(0,uo.jsx)("span",{children:bv(e,n.connectorType)||t||n.walletClientType}),(0,uo.jsx)("span",{id:"connect-text",children:"Connect"})]})},bv=(e,t)=>{if(zr[e]?.displayName)return zr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},Ev=(e,t)=>{if(zr[e]?.logo)return zr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Fi},Pv=({icon:e,name:t})=>typeof e=="string"?(0,uo.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,uo.jsx)(Em.default,{}):e?(0,uo.jsx)(e,{}):null,Tv=(0,Tm.default)(Le)`
845
845
  /* Show "Connect" on hover */
846
846
  > #connect-text {
847
847
  font-weight: 500;
@@ -863,23 +863,23 @@ Resources:
863
863
  display: none;
864
864
  }
865
865
  }
866
- `;var xo=require("react/jsx-runtime"),Sv=["coinbase_wallet"],_v=["metamask","okx_wallet","rainbow","uniswap","zerion"],Av=["cryptocom"],kv=["phantom"],Vn=({connectOnly:e})=>{let{connectors:t}=M(),{app:o}=_(),r=Gi(o.appearance.walletList,t,e,o.appearance.walletList);return(0,xo.jsxs)(xo.Fragment,{children:[...r]})},Gi=(e,t,o,r)=>{let n=[],i=[],a=[],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:f})=>f==="uniswap_wallet_extension"?!r.includes("uniswap"):u==="injected"&&!r.includes(f));for(let u of c){let{walletClientType:f,walletBranding:g}=u;(f==="unknown"?i:n).push((0,xo.jsx)(Qr,{connectOnly:o,provider:f,logo:g.icon,displayName:g.name,connector:u},`${s}-${f}`))}}else if(kv.includes(s)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===s||u.connectorType===s);c&&n.push((0,xo.jsx)(Qr,{connectOnly:o,provider:s,connector:c},s))}else if(_v.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,xo.jsx)(Qr,{connectOnly:o,provider:s,connector:c},s))}else if(Sv.includes(s)){let c=t.find(({connectorType:u})=>u===s);c&&n.push((0,xo.jsx)(Qr,{connectOnly:o,provider:s,connector:c},s))}else Av.includes(s)?l&&a.push((0,xo.jsx)(Qr,{connectOnly:o,provider:s,connector:l},s)):s==="wallet_connect"&&l&&a.push((0,xo.jsx)(Qr,{connectOnly:o,provider:s,connector:l},s));return[...i,...n,...a]};var zo=require("react/jsx-runtime"),Pm=()=>{let{app:e}=_(),t=`Connect a wallet to ${e?.name}`;return(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsx)(k,{},"header"),(0,zo.jsx)(Go,{title:"Connect your wallet",description:t}),(0,zo.jsx)(no,{children:(0,zo.jsx)(Vn,{connectOnly:!0})}),(0,zo.jsx)($,{protectedByPrivy:!0})]})};var Am=h(require("styled-components"));var _m=h(require("styled-components"));var Tm=h(require("react"));var Sm=require("react/jsx-runtime"),xm=()=>{let{app:e}=_(),t=e?.appearance?.logo,o=`${e?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,Sm.jsx)("img",{src:t,alt:o,style:r}):t.type==="svg"||t.type==="img"?Tm.default.cloneElement(t,{alt:o,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var Ec=require("react/jsx-runtime"),zn=e=>{let{app:t}=_();return t?.appearance.logo?(0,Ec.jsx)(Rv,{...e,children:(0,Ec.jsx)(xm,{})}):null},Rv=_m.default.div`
866
+ `;var Tr=require("react/jsx-runtime"),xv=["coinbase_wallet"],Sv=["metamask","okx_wallet","rainbow","uniswap","zerion"],_v=["cryptocom"],Av=["phantom"],$n=({connectOnly:e})=>{let{connectors:t}=W(),{app:r}=A(),o=Hi(r.appearance.walletList,t,e,r.appearance.walletList);return(0,Tr.jsxs)(Tr.Fragment,{children:[...o]})},Hi=(e,t,r,o)=>{let n=[],i=[],a=[],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:f})=>f==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="injected"&&!o.includes(f));for(let u of c){let{walletClientType:f,walletBranding:g}=u;(f==="unknown"?i:n).push((0,Tr.jsx)(rn,{connectOnly:r,provider:f,logo:g.icon,displayName:g.name,connector:u},`${s}-${f}`))}}else if(Av.includes(s)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===s||u.connectorType===s);c&&n.push((0,Tr.jsx)(rn,{connectOnly:r,provider:s,connector:c},s))}else if(Sv.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,Tr.jsx)(rn,{connectOnly:r,provider:s,connector:c},s))}else if(xv.includes(s)){let c=t.find(({connectorType:u})=>u===s);c&&n.push((0,Tr.jsx)(rn,{connectOnly:r,provider:s,connector:c},s))}else _v.includes(s)?l&&a.push((0,Tr.jsx)(rn,{connectOnly:r,provider:s,connector:l},s)):s==="wallet_connect"&&l&&a.push((0,Tr.jsx)(rn,{connectOnly:r,provider:s,connector:l},s));return[...i,...n,...a]};var $r=require("react/jsx-runtime"),xm=()=>{let{app:e}=A(),t=`Connect a wallet to ${e?.name}`;return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(k,{},"header"),(0,$r.jsx)(Vr,{title:"Connect your wallet",description:t}),(0,$r.jsx)(ar,{children:(0,$r.jsx)($n,{connectOnly:!0})}),(0,$r.jsx)($,{protectedByPrivy:!0})]})};var Rm=h(require("styled-components"));var km=h(require("styled-components"));var Sm=h(require("react"));var Am=require("react/jsx-runtime"),_m=()=>{let{app:e}=A(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,Am.jsx)("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?Sm.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 xc=require("react/jsx-runtime"),qn=e=>{let{app:t}=A();return t?.appearance.logo?(0,xc.jsx)(kv,{...e,children:(0,xc.jsx)(_m,{})}):null},kv=km.default.div`
867
867
  display: flex;
868
868
  flex-direction: column;
869
869
  align-items: center;
870
870
  padding: 24px 0;
871
871
  flex-grow: 1;
872
872
  justify-content: center;
873
- `;var So=require("react/jsx-runtime"),km=()=>{let{app:e}=_();return(0,So.jsxs)(So.Fragment,{children:[(0,So.jsx)(k,{},"header"),(0,So.jsx)(Iv,{}),(0,So.jsx)(no,{children:(0,So.jsx)(Vn,{connectOnly:!0})}),e&&(0,So.jsx)(Bn,{app:e,alwaysShowImplicitConsent:!0}),(0,So.jsx)($,{protectedByPrivy:!0})]})},Iv=(0,Am.default)(zn)`
873
+ `;var xr=require("react/jsx-runtime"),Im=()=>{let{app:e}=A();return(0,xr.jsxs)(xr.Fragment,{children:[(0,xr.jsx)(k,{},"header"),(0,xr.jsx)(Rv,{}),(0,xr.jsx)(ar,{children:(0,xr.jsx)($n,{connectOnly:!0})}),e&&(0,xr.jsx)(Gn,{app:e,alwaysShowImplicitConsent:!0}),(0,xr.jsx)($,{protectedByPrivy:!0})]})},Rv=(0,Rm.default)(qn)`
874
874
  margin-bottom: 16px;
875
- `;var jn=require("react"),Wm=require("react-device-detect"),Lm=h(require("styled-components"));var lo=require("react"),qn=require("react-device-detect"),Im=require("react-use"),Tc=h(require("styled-components"));var $n=require("react");function Rm(){let[e,t]=(0,$n.useState)(!1),o=(0,$n.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,$n.useEffect)(()=>(document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)),[o]),{hasTabbedAway:e,reset:()=>t(!1)}}var ve=require("react/jsx-runtime"),Pc=2,xc=e=>e?.privyErrorCode==="linked_to_another_user"?rr.ERROR_USER_EXISTS:e instanceof Oe&&!e.details.default?e.details:e instanceof xn?rr.ERROR_TIMED_OUT:e instanceof Sn?rr.ERROR_USER_REJECTED_CONNECTION:rr.ERROR_WALLET_CONNECTION,Mm=()=>{let[e,t]=(0,lo.useState)(!1),[o,r]=(0,lo.useState)(!1),[n,i]=(0,lo.useState)(void 0),{authenticated:a}=G(),{app:l,navigate:s,navigateBack:c,lastScreen:u,currentScreen:f,setModalData:g}=_(),{getAuthFlow:w,walletConnectionStatus:C,closePrivyModal:E,initLoginWithWallet:x,loginWithWallet:b,updateWallets:A}=M(),{walletConnectors:W}=G(),[I,S]=(0,lo.useState)(0),{user:B}=G(),[F]=(0,lo.useState)(B?.linkedAccounts.length||0),[q,R]=(0,lo.useState)(""),[Z,D]=(0,lo.useState)(!1),{hasTabbedAway:Y}=Rm(),{enabled:K,token:re}=Ee(),ue=qn.isMobile&&C?.connector?.connectorType==="wallet_connect_v2"||qn.isMobile&&C?.connector?.connectorType==="coinbase_wallet"||qn.isMobile&&C?.connector?.connectorType==="injected"&&C?.connector?.walletClientType==="phantom",J=C?.status==="connected",it=C?.status==="switching_to_supported_chain";(0,lo.useEffect)(()=>{let H=w();if(J&&!H&&(K&&!re&&!a?(g({captchaModalData:{callback:Oo=>x(C.connectedWallet,Oo).then(()=>{D(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN",!1)):x(C.connectedWallet,re).then(()=>{D(!0)})),H&&ue&&J&&!H.preparedMessage){H.buildSiweMessage();return}!H||ue||!J||o||(async()=>{r(!0),i(void 0);try{C?.connector?.connectorType==="wallet_connect_v2"&&C?.connector?.walletClientType==="metamask"&&await Jl(2500),await Ut()}catch(Oo){console.warn("Auto-prompted signature failed",Oo)}finally{r(!1)}})()},[I,J,Z]),(0,lo.useEffect)(()=>{if(B&&e){let H=l?.render.inDialog?bt:0,Oo=l?.render.inDialog?H-500:0;if(l?.legal.requireUsersAcceptTerms&&!B.hasAcceptedTerms){let Re=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},Oo);return()=>clearTimeout(Re)}if(Zt(B,l?.embeddedWallets?.createOnLogin)){let Re=setTimeout(()=>{g({createWallet:{onSuccess:()=>{},onFailure:_i=>console.error(_i),callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Oo);return()=>clearTimeout(Re)}A();let Ae=setTimeout(()=>E({shouldCallAuthOnSuccess:!0,isSuccess:!0}),bt);return()=>clearTimeout(Ae)}},[B,e]);let At=H=>{if(H?.privyErrorCode==="allowlist_rejected"){s("ALLOWLIST_REJECTION_SCREEN");return}i(xc(H))};async function Ut(){try{if(await b(),!l?.render.inDialog)return E({shouldCallAuthOnSuccess:!0,isSuccess:!0});t(!0)}catch(H){At(H)}finally{r(!1)}}(0,lo.useEffect)(()=>{C?.connectError&&At(C?.connectError)},[C]),(0,Im.useInterval)(()=>{let H=at==="wallet_connect_v2"&&C?.connector instanceof Bo?C.connector.redirectUri:void 0;H&&R(H)},C?.connector instanceof Bo&&!q?500:null);let at=C?.connector?.connectorType||"injected",ce=C?.connector?.walletClientType||"unknown",gr=Vo[ce]?.displayName||C?.connector?.walletBranding.name||"Browser Extension",uo=Vo[ce]?.logo||C?.connector?.walletBranding.icon||(H=>(0,ve.jsx)(An,{...H})),Gr=gr==="Browser Extension"?gr.toLowerCase():gr,st;e?st=`Successfully connected with ${Gr}`:n?st=n.message:it?st="Switching networks":J?st=o&&ue?"Signing":"Sign to verify":st=`Waiting for ${Gr}`;let je="Don\u2019t see your wallet? Check your other browser windows.";if(e){let H=B?.linkedAccounts.length||0;F===H?je="Wallet was already linked.":je="You\u2019re good to go!"}else I>=Pc&&n?je="Unable to connect wallet":n?je=n.detail:it?je="Switch your wallet to the requested network.":J&&ue?je="Sign the message in your wallet to verify it belongs to you.":ce==="metamask"&&qn.isMobile?je="Click continue to open and connect MetaMask.":ce==="metamask"?je="For the best experience, connect only one wallet at a time.":at==="wallet_connect"?je="Open your mobile wallet app to continue":at==="coinbase_wallet"&&(Ep()||(ic(B)?je="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":je="Open the Coinbase app on your phone to continue."));let L=W?.walletConnectors?.find(H=>H.walletClientType==="coinbase_wallet"),ge=ce==="coinbase_wallet"&&(ic(B)||n===rr.ERROR_USER_EXISTS);return(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(k,{backFn:!u||f===u?void 0:c}),(0,ve.jsxs)(Wv,{children:[(0,ve.jsx)(Sc,{walletLogo:uo,success:e,fail:!!n}),(0,ve.jsxs)(so,{children:[(0,ve.jsx)("h3",{children:st}),(0,ve.jsx)("p",{children:je}),!J&&q&&!Y?(0,ve.jsxs)("p",{children:["Still here?"," ",(0,ve.jsx)("a",{href:q,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),ge?(0,ve.jsx)(U,{onClick:()=>L&&L?.disconnect(),disabled:e,children:"Use a different wallet"}):n==rr.ERROR_USER_EXISTS&&f!==u?(0,ve.jsx)(U,{onClick:c,children:"Use a different wallet"}):J&&!e&&ue?(0,ve.jsx)(U,{onClick:()=>{r(!0),Ut(),Mv(ce)},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&I<Pc?(0,ve.jsx)(U,{onClick:()=>{S(I+1),i(void 0),J?(r(!0),Ut()):C?.connectRetry()},disabled:!e&&(!n?.retryable||I>=Pc),children:"Retry"}):!e&&!n?(0,ve.jsx)(U,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,ve.jsx)(ne,{})]})},Mv=e=>{if(!qn.isMobile||!uu(e))return;let t=mu(e);t&&window.open(t,"_self","noopener,noreferrer")},Wv=Tc.default.div`
875
+ `;var Yn=require("react"),Om=require("react-device-detect"),Nm=h(require("styled-components"));var dr=require("react"),Kn=require("react-device-detect"),Wm=require("react-use"),_c=h(require("styled-components"));var jn=require("react");function Mm(){let[e,t]=(0,jn.useState)(!1),r=(0,jn.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,jn.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var ye=require("react/jsx-runtime"),Sc=2,Ac=e=>e?.privyErrorCode==="linked_to_another_user"?ao.ERROR_USER_EXISTS:e instanceof We&&!e.details.default?e.details:e instanceof Sn?ao.ERROR_TIMED_OUT:e instanceof _n?ao.ERROR_USER_REJECTED_CONNECTION:ao.ERROR_WALLET_CONNECTION,Lm=()=>{let[e,t]=(0,dr.useState)(!1),[r,o]=(0,dr.useState)(!1),[n,i]=(0,dr.useState)(void 0),{authenticated:a}=G(),{app:l,navigate:s,navigateBack:c,lastScreen:u,currentScreen:f,setModalData:g}=A(),{getAuthFlow:w,walletConnectionStatus:C,closePrivyModal:b,initLoginWithWallet:S,loginWithWallet:P,updateWallets:T}=W(),{walletConnectors:M}=G(),[I,_]=(0,dr.useState)(0),{user:F}=G(),[B]=(0,dr.useState)(F?.linkedAccounts.length||0),[q,R]=(0,dr.useState)(""),[Q,D]=(0,dr.useState)(!1),{hasTabbedAway:Y}=Mm(),{enabled:K,token:ie}=be(),Ce=Kn.isMobile&&C?.connector?.connectorType==="wallet_connect_v2"||Kn.isMobile&&C?.connector?.connectorType==="coinbase_wallet"||Kn.isMobile&&C?.connector?.connectorType==="injected"&&C?.connector?.walletClientType==="phantom",J=C?.status==="connected",it=C?.status==="switching_to_supported_chain";(0,dr.useEffect)(()=>{let H=w();if(J&&!H&&(K&&!ie&&!a?(g({captchaModalData:{callback:Or=>S(C.connectedWallet,Or).then(()=>{D(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN",!1)):S(C.connectedWallet,ie).then(()=>{D(!0)})),H&&Ce&&J&&!H.preparedMessage){H.buildSiweMessage();return}!H||Ce||!J||r||(async()=>{o(!0),i(void 0);try{C?.connector?.connectorType==="wallet_connect_v2"&&C?.connector?.walletClientType==="metamask"&&await ec(2500),await Ut()}catch(Or){console.warn("Auto-prompted signature failed",Or)}finally{o(!1)}})()},[I,J,Q]),(0,dr.useEffect)(()=>{if(F&&e){let H=l?.render.inDialog?bt:0,Or=l?.render.inDialog?H-500:0;if(l?.legal.requireUsersAcceptTerms&&!F.hasAcceptedTerms){let At=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},Or);return()=>clearTimeout(At)}if(Xt(F,l?.embeddedWallets?.createOnLogin)){let At=setTimeout(()=>{g({createWallet:{onSuccess:()=>{},onFailure:kt=>console.error(kt),callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Or);return()=>clearTimeout(At)}T();let _e=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),bt);return()=>clearTimeout(_e)}},[F,e]);let yt=H=>{if(H?.privyErrorCode==="allowlist_rejected"){s("ALLOWLIST_REJECTION_SCREEN");return}i(Ac(H))};async function Ut(){try{if(await P(),!l?.render.inDialog)return b({shouldCallAuthOnSuccess:!0,isSuccess:!0});t(!0)}catch(H){yt(H)}finally{o(!1)}}(0,dr.useEffect)(()=>{C?.connectError&&yt(C?.connectError)},[C]),(0,Wm.useInterval)(()=>{let H=at==="wallet_connect_v2"&&C?.connector instanceof Hr?C.connector.redirectUri:void 0;H&&R(H)},C?.connector instanceof Hr&&!q?500:null);let at=C?.connector?.connectorType||"injected",et=C?.connector?.walletClientType||"unknown",Be=zr[et]?.displayName||C?.connector?.walletBranding.name||"Browser Extension",bo=zr[et]?.logo||C?.connector?.walletBranding.icon||(H=>(0,ye.jsx)(Rn,{...H})),Lr=Be==="Browser Extension"?Be.toLowerCase():Be,Ft;e?Ft=`Successfully connected with ${Lr}`:n?Ft=n.message:it?Ft="Switching networks":J?Ft=r&&Ce?"Signing":"Sign to verify":Ft=`Waiting for ${Lr}`;let He="Don\u2019t see your wallet? Check your other browser windows.";if(e){let H=F?.linkedAccounts.length||0;B===H?He="Wallet was already linked.":He="You\u2019re good to go!"}else I>=Sc&&n?He="Unable to connect wallet":n?He=n.detail:it?He="Switch your wallet to the requested network.":J&&Ce?He="Sign the message in your wallet to verify it belongs to you.":et==="metamask"&&Kn.isMobile?He="Click continue to open and connect MetaMask.":et==="metamask"?He="For the best experience, connect only one wallet at a time.":at==="wallet_connect"?He="Open your mobile wallet app to continue":at==="coinbase_wallet"&&(Tp()||(lc(F)?He="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":He="Open the Coinbase app on your phone to continue."));let L=M?.walletConnectors?.find(H=>H.walletClientType==="coinbase_wallet"),pe=et==="coinbase_wallet"&&(lc(F)||n===ao.ERROR_USER_EXISTS);return(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(k,{backFn:!u||f===u?void 0:c}),(0,ye.jsxs)(Mv,{children:[(0,ye.jsx)(kc,{walletLogo:bo,success:e,fail:!!n}),(0,ye.jsxs)(cr,{children:[(0,ye.jsx)("h3",{children:Ft}),(0,ye.jsx)("p",{children:He}),!J&&q&&!Y?(0,ye.jsxs)("p",{children:["Still here?"," ",(0,ye.jsx)("a",{href:q,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),pe?(0,ye.jsx)(U,{onClick:()=>L&&L?.disconnect(),disabled:e,children:"Use a different wallet"}):n==ao.ERROR_USER_EXISTS&&f!==u?(0,ye.jsx)(U,{onClick:c,children:"Use a different wallet"}):J&&!e&&Ce?(0,ye.jsx)(U,{onClick:()=>{o(!0),Ut(),Iv(et)},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&I<Sc?(0,ye.jsx)(U,{onClick:()=>{_(I+1),i(void 0),J?(o(!0),Ut()):C?.connectRetry()},disabled:!e&&(!n?.retryable||I>=Sc),children:"Retry"}):!e&&!n?(0,ye.jsx)(U,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,ye.jsx)(oe,{})]})},Iv=e=>{if(!Kn.isMobile||!fu(e))return;let t=hu(e);t&&window.open(t,"_self","noopener,noreferrer")},Mv=_c.default.div`
876
876
  display: flex;
877
877
  flex-direction: column;
878
878
  align-items: center;
879
879
  justify-content: center;
880
880
  gap: 24px;
881
881
  width: 100%;
882
- `,Lv=Tc.default.div`
882
+ `,Wv=_c.default.div`
883
883
  display: flex;
884
884
  flex-direction: column;
885
885
  justify-content: center;
@@ -902,14 +902,14 @@ Resources:
902
902
  left: -19px;
903
903
  top: -19px;
904
904
  }
905
- `,Sc=e=>{let t=e.walletLogo;return(0,ve.jsx)(ve.Fragment,{children:(0,ve.jsx)(Lv,{children:(0,ve.jsxs)("div",{children:[(0,ve.jsx)(kr,{success:e.success,fail:e.fail}),typeof t=="string"?(0,ve.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,ve.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var ft=require("react/jsx-runtime"),Fs=2,Om=()=>{let{navigateBack:e,lastScreen:t,currentScreen:o}=_(),{walletConnectionStatus:r,closePrivyModal:n}=M(),[i,a]=(0,jn.useState)(void 0),[l,s]=(0,jn.useState)(0),c=r?.status==="connected",u=r?.status==="switching_to_supported_chain";(0,jn.useEffect)(()=>{if(c){let W=setTimeout(n,bt);return()=>clearTimeout(W)}},[c]);let f=W=>{a(xc(W))};(0,jn.useEffect)(()=>{r?.connectError&&f(r?.connectError)},[r]);let g=r?.connector?.connectorType||"injected",w=r?.connector?.walletClientType||"unknown",C=Vo[w]?.displayName||r?.connector?.walletBranding.name||"Browser Extension",E=Vo[w]?.logo||r?.connector?.walletBranding.icon||(W=>(0,ft.jsx)(An,{...W})),x=C==="Browser Extension"?C.toLowerCase():C,b;c?b=`Successfully connected with ${x}`:i?b=i.message:u?b="Switching networks":b=`Waiting for ${x}`;let A="Don\u2019t see your wallet? Check your other browser windows.";return c?A="You\u2019re good to go!":l>=Fs&&i?A="Unable to connect wallet":i?A=i.detail:u?A="Switch your wallet to the requested network.":w==="metamask"&&Wm.isMobile?A="Click to continue to open and connect MetaMask.":w==="metamask"?A="For the best experience, connect only one wallet at a time.":g==="wallet_connect_v2"?A="Open your mobile wallet app to continue":g==="coinbase_wallet"&&(A="Open the Coinbase app on your phone to continue."),(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(k,{backFn:o===t?void 0:e}),(0,ft.jsxs)(Ov,{children:[(0,ft.jsx)(Sc,{walletLogo:E,success:c,fail:!!i}),(0,ft.jsxs)(so,{children:[(0,ft.jsx)("h3",{children:b}),(0,ft.jsx)("p",{children:A})]}),i==rr.ERROR_USER_EXISTS?(0,ft.jsx)(U,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<Fs?(0,ft.jsx)(U,{onClick:()=>{s(l+1),a(void 0),r?.connectRetry()},disabled:!c&&(!i?.retryable||l>=Fs),children:"Retry"}):!c&&i&&l>=Fs?(0,ft.jsx)(U,{onClick:e,children:"Use a different wallet"}):null]}),(0,ft.jsx)(ne,{})]})},Ov=Lm.default.div`
905
+ `,kc=e=>{let t=e.walletLogo;return(0,ye.jsx)(ye.Fragment,{children:(0,ye.jsx)(Wv,{children:(0,ye.jsxs)("div",{children:[(0,ye.jsx)(Wo,{success:e.success,fail:e.fail}),typeof t=="string"?(0,ye.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,ye.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var mt=require("react/jsx-runtime"),Ds=2,Dm=()=>{let{navigateBack:e,lastScreen:t,currentScreen:r}=A(),{walletConnectionStatus:o,closePrivyModal:n}=W(),[i,a]=(0,Yn.useState)(void 0),[l,s]=(0,Yn.useState)(0),c=o?.status==="connected",u=o?.status==="switching_to_supported_chain";(0,Yn.useEffect)(()=>{if(c){let M=setTimeout(n,bt);return()=>clearTimeout(M)}},[c]);let f=M=>{a(Ac(M))};(0,Yn.useEffect)(()=>{o?.connectError&&f(o?.connectError)},[o]);let g=o?.connector?.connectorType||"injected",w=o?.connector?.walletClientType||"unknown",C=zr[w]?.displayName||o?.connector?.walletBranding.name||"Browser Extension",b=zr[w]?.logo||o?.connector?.walletBranding.icon||(M=>(0,mt.jsx)(Rn,{...M})),S=C==="Browser Extension"?C.toLowerCase():C,P;c?P=`Successfully connected with ${S}`:i?P=i.message:u?P="Switching networks":P=`Waiting for ${S}`;let T="Don\u2019t see your wallet? Check your other browser windows.";return c?T="You\u2019re good to go!":l>=Ds&&i?T="Unable to connect wallet":i?T=i.detail:u?T="Switch your wallet to the requested network.":w==="metamask"&&Om.isMobile?T="Click to continue to open and connect MetaMask.":w==="metamask"?T="For the best experience, connect only one wallet at a time.":g==="wallet_connect_v2"?T="Open your mobile wallet app to continue":g==="coinbase_wallet"&&(T="Open the Coinbase app on your phone to continue."),(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(k,{backFn:r===t?void 0:e}),(0,mt.jsxs)(Lv,{children:[(0,mt.jsx)(kc,{walletLogo:b,success:c,fail:!!i}),(0,mt.jsxs)(cr,{children:[(0,mt.jsx)("h3",{children:P}),(0,mt.jsx)("p",{children:T})]}),i==ao.ERROR_USER_EXISTS?(0,mt.jsx)(U,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<Ds?(0,mt.jsx)(U,{onClick:()=>{s(l+1),a(void 0),o?.connectRetry()},disabled:!c&&(!i?.retryable||l>=Ds),children:"Retry"}):!c&&i&&l>=Ds?(0,mt.jsx)(U,{onClick:e,children:"Use a different wallet"}):null]}),(0,mt.jsx)(oe,{})]})},Lv=Nm.default.div`
906
906
  display: flex;
907
907
  flex-direction: column;
908
908
  align-items: center;
909
909
  justify-content: center;
910
910
  gap: 24px;
911
911
  width: 100%;
912
- `;var Fm=h(require("@heroicons/react/24/solid/XCircleIcon")),Zn=require("react"),Bm=h(require("styled-components"));var Vi=h(require("styled-components")),Kn=require("react/jsx-runtime"),Yn=()=>(0,Kn.jsx)(Nv,{children:(0,Kn.jsxs)(Dv,{children:[(0,Kn.jsx)(Uv,{}),(0,Kn.jsx)(Fv,{})]})}),Nv=Vi.default.div`
912
+ `;var Hm=h(require("@heroicons/react/24/solid/XCircleIcon")),Xn=require("react"),Gm=h(require("styled-components"));var Gi=h(require("styled-components")),Jn=require("react/jsx-runtime"),Zn=()=>(0,Jn.jsx)(Ov,{children:(0,Jn.jsxs)(Nv,{children:[(0,Jn.jsx)(Dv,{}),(0,Jn.jsx)(Uv,{})]})}),Ov=Gi.default.div`
913
913
  display: flex;
914
914
  justify-content: center;
915
915
  align-items: center;
@@ -921,14 +921,14 @@ Resources:
921
921
  @media all and (display-mode: standalone) {
922
922
  margin-bottom: 30px;
923
923
  }
924
- `,Dv=Vi.default.div`
924
+ `,Nv=Gi.default.div`
925
925
  position: relative;
926
926
  height: 140px;
927
927
  width: 140px;
928
928
 
929
929
  opacity: 1;
930
930
  animation: fadein 200ms ease;
931
- `,Uv=Vi.default.div`
931
+ `,Dv=Gi.default.div`
932
932
  position: absolute;
933
933
  top: 0;
934
934
  right: 0;
@@ -941,7 +941,7 @@ Resources:
941
941
  border: 4px solid var(--privy-color-accent-light);
942
942
  border-radius: 50%;
943
943
  }
944
- `,Fv=Vi.default.div`
944
+ `,Uv=Gi.default.div`
945
945
  position: absolute;
946
946
  top: 0;
947
947
  right: 0;
@@ -965,20 +965,20 @@ Resources:
965
965
  transform: rotate(360deg);
966
966
  }
967
967
  }
968
- `;var Nm=["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 ze=class extends Error{constructor(o,r){super(r);this.type=o}};function Jn(e){let t=e.type;return typeof t=="string"&&Nm.includes(t)}function Bv(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function Xr(e){return Jn(e)&&e.type==="wallet_not_on_device"}function Dm(e){return Jn(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function en(e){return!!(Jn(e)&&e.type==="mfa_timeout")}function tn(e){return!!(Jn(e)&&e.type==="missing_or_invalid_mfa")}function Bs(e){return!!(Jn(e)&&e.type==="mfa_verification_max_attempts_reached")}function _c(e){return!!(Jn(e)&&e.message.includes("code 429"))}function Ac(e){return!!(Bv(e)&&e.message==="MFA canceled")}var Lt=require("react/jsx-runtime"),Um=1,Hm=()=>{let{authenticated:e,user:t,getAccessToken:o}=G(),{closePrivyModal:r,createAnalyticsEvent:n,walletProxy:i}=M(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=_(),u=(0,Zn.useMemo)(()=>Date.now(),[]),[f,g]=(0,Zn.useState)(!1),{onCompleteNavigateTo:w,onFailure:C}=l?.connectWallet,E=b=>{f||(g(!0),C(typeof b=="string"?new Error(b):b))};(0,Zn.useEffect)(()=>{let b=Ie(t),A;return!e||!b?E("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let I=await o();if(!I)return E("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:I,address:b.address});let S=(Date.now()-u)/1e3;w==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&S<Um?A=setTimeout(()=>{a(w)},(Um-S)*1e3):a(w)}catch(S){if(Xr(S)&&b.recoveryMethod==="privy"){let B=await o();if(!B)return E("User must be authenticated and have a Privy wallet before it can be recovered");try{n("embedded_wallet_pinless_recovery_started",{walletAddress:b.address}),(await i?.recover({address:b.address,accessToken:B}))?.address||E(new Error("Unable to recover wallet")),w?a(w):r({shouldCallAuthOnSuccess:!1}),n("embedded_wallet_recovery_completed",{walletAddress:b.address}),a(w)}catch{E("An error has occurred, please try again.")}}else Xr(S)?(s({...l,recoverWallet:{privyWallet:b,onCompleteNavigateTo:w,onFailure:C}}),a("EMBEDDED_WALLET_RECOVERY_SCREEN")):E(S)}})(),()=>clearTimeout(A)):void 0},[e,t,i]);let x=()=>{E("User exited before wallet could be connected"),r({shouldCallAuthOnSuccess:!1})};return c.current=x,(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(k,{onClose:x}),f?(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsxs)(Eo,{children:[(0,Lt.jsx)(Fm.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Lt.jsx)(Ue,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,Lt.jsx)(U,{onClick:()=>r({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,Lt.jsx)(Yn,{}),(0,Lt.jsx)(Hv,{})]})},Hv=Bm.default.div`
968
+ `;var Um=["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 ze=class extends Error{constructor(r,o){super(o);this.type=r}};function Qn(e){let t=e.type;return typeof t=="string"&&Um.includes(t)}function Fv(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function on(e){return Qn(e)&&e.type==="wallet_not_on_device"}function Fm(e){return Qn(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function nn(e){return!!(Qn(e)&&e.type==="mfa_timeout")}function an(e){return!!(Qn(e)&&e.type==="missing_or_invalid_mfa")}function Us(e){return!!(Qn(e)&&e.type==="mfa_verification_max_attempts_reached")}function Rc(e){return!!(Qn(e)&&e.message.includes("code 429"))}function Ic(e){return!!(Fv(e)&&e.message==="MFA canceled")}var Lt=require("react/jsx-runtime"),Bm=1,Vm=()=>{let{authenticated:e,user:t,getAccessToken:r}=G(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=W(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=A(),u=(0,Xn.useMemo)(()=>Date.now(),[]),[f,g]=(0,Xn.useState)(!1),{onCompleteNavigateTo:w,onFailure:C}=l?.connectWallet,b=P=>{f||(g(!0),C(typeof P=="string"?new Error(P):P))};(0,Xn.useEffect)(()=>{let P=ke(t),T;return!e||!P?b("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let I=await r();if(!I)return b("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:I,address:P.address});let _=(Date.now()-u)/1e3;w==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&_<Bm?T=setTimeout(()=>{a(w)},(Bm-_)*1e3):a(w)}catch(_){if(on(_)&&P.recoveryMethod==="privy"){let F=await r();if(!F)return b("User must be authenticated and have a Privy wallet before it can be recovered");try{n("embedded_wallet_pinless_recovery_started",{walletAddress:P.address}),(await i?.recover({address:P.address,accessToken:F}))?.address||b(new Error("Unable to recover wallet")),w?a(w):o({shouldCallAuthOnSuccess:!1}),n("embedded_wallet_recovery_completed",{walletAddress:P.address}),a(w)}catch{b("An error has occurred, please try again.")}}else on(_)?(s({...l,recoverWallet:{privyWallet:P,onCompleteNavigateTo:w,onFailure:C}}),a("EMBEDDED_WALLET_RECOVERY_SCREEN")):b(_)}})(),()=>clearTimeout(T)):void 0},[e,t,i]);let S=()=>{b("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=S,(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(k,{onClose:S}),f?(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsxs)(br,{children:[(0,Lt.jsx)(Hm.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Lt.jsx)(Ne,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,Lt.jsx)(U,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,Lt.jsx)(Zn,{}),(0,Lt.jsx)(Bv,{})]})},Bv=Gm.default.div`
969
969
  height: 44px;
970
- `;var Gm=h(require("@heroicons/react/24/solid/CheckCircleIcon")),Vm=require("react");var co=require("react/jsx-runtime"),zm=()=>{let{user:e}=G(),{closePrivyModal:t,isNewUserThisSession:o,updateWallets:r}=M(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=_(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,u=()=>{let f=Ie(e);f?(r(),l(f)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,Vm.useEffect)(()=>{let f=setTimeout(u,pp);return()=>clearTimeout(f)},[]),a.current=u,(0,co.jsxs)(co.Fragment,{children:[(0,co.jsx)(k,{onClose:u}),(0,co.jsx)(ee,{}),(0,co.jsxs)(Eo,{children:[(0,co.jsx)(Gm.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,co.jsx)(Ue,{title:o?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:o?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,co.jsx)(te,{}),(0,co.jsx)($,{protectedByPrivy:!0})]})};var jm=h(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),Km=h(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),cr=require("react"),dr=h(require("styled-components"));var ie=require("react/jsx-runtime"),Ym=()=>{let[e,t]=(0,cr.useState)(null),{authenticated:o,user:r,getAccessToken:n}=G(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=M(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),u=Ie(r)?.address,{onFailure:f,onSuccess:g,origin:w,appId:C}=s.keyExport,E=b=>{i({shouldCallAuthOnSuccess:!1}),f(typeof b=="string"?new Error(b):b)},x=()=>{i({shouldCallAuthOnSuccess:!1}),g(),a("embedded_wallet_key_export_completed",{walletAddress:u})};return(0,cr.useEffect)(()=>{let b=Ie(r);if(!o||!b)return E("User must be authenticated before exporting their wallet");n().then(t,E)},[o,r]),c.current=x,(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(k,{onClose:x}),(0,ie.jsxs)(zv,{children:[(0,ie.jsxs)(Ue,{icon:(0,ie.jsx)(Km.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,ie.jsxs)(Kv,{children:[(0,ie.jsx)(Vv,{style:{marginRight:6}}),Er(u)]}),(0,ie.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,ie.jsxs)($v,{children:[(0,ie.jsxs)($m,{children:[(0,ie.jsx)(qm,{children:"1"}),(0,ie.jsxs)("span",{children:[(0,ie.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,ie.jsxs)($m,{children:[(0,ie.jsx)(qm,{children:"2"}),(0,ie.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,ie.jsx)("div",{style:{width:"100%"},children:e&&(0,ie.jsx)(Gv,{origin:w,appId:C,accessToken:e,clientAnalyticsId:l,address:u,dimensions:{height:"44px"}})}),(0,ie.jsxs)(Yv,{children:[(0,ie.jsxs)("div",{children:[(0,ie.jsx)(jm.default,{viewBox:"0 0 20 18"}),(0,ie.jsx)("h4",{children:"Warning"})]}),(0,ie.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,ie.jsx)($,{protectedByPrivy:!0})]})};function Gv(e){let[t,o]=(0,cr.useState)(e.dimensions.width),[r,n]=(0,cr.useState)(void 0),i=(0,cr.useRef)(null);return(0,cr.useEffect)(()=>{if(i.current&&t===void 0){let{width:l}=i.current.getBoundingClientRect();o(l)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,ie.jsx)("div",{ref:i,children:t&&(0,ie.jsxs)(qv,{children:[(0,ie.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Ua(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...r})}),(0,ie.jsx)(jv,{children:"Loading..."})]})})}function Vv(e){return(0,ie.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,ie.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 zv=dr.default.div`
970
+ `;var zm=h(require("@heroicons/react/24/solid/CheckCircleIcon")),$m=require("react");var pr=require("react/jsx-runtime"),qm=()=>{let{user:e}=G(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=W(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=A(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,u=()=>{let f=ke(e);f?(o(),l(f)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,$m.useEffect)(()=>{let f=setTimeout(u,mp);return()=>clearTimeout(f)},[]),a.current=u,(0,pr.jsxs)(pr.Fragment,{children:[(0,pr.jsx)(k,{onClose:u}),(0,pr.jsx)(ee,{}),(0,pr.jsxs)(br,{children:[(0,pr.jsx)(zm.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,pr.jsx)(Ne,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,pr.jsx)(te,{}),(0,pr.jsx)($,{protectedByPrivy:!0})]})};var Ym=h(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),Jm=h(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),mo=require("react"),fo=h(require("styled-components"));var ne=require("react/jsx-runtime"),Zm=()=>{let[e,t]=(0,mo.useState)(null),{authenticated:r,user:o,getAccessToken:n}=G(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=W(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),u=ke(o)?.address,{onFailure:f,onSuccess:g,origin:w,appId:C}=s.keyExport,b=P=>{i({shouldCallAuthOnSuccess:!1}),f(typeof P=="string"?new Error(P):P)},S=()=>{i({shouldCallAuthOnSuccess:!1}),g(),a("embedded_wallet_key_export_completed",{walletAddress:u})};return(0,mo.useEffect)(()=>{let P=ke(o);if(!r||!P)return b("User must be authenticated before exporting their wallet");n().then(t,b)},[r,o]),c.current=S,(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(k,{onClose:S}),(0,ne.jsxs)(Vv,{children:[(0,ne.jsxs)(Ne,{icon:(0,ne.jsx)(Jm.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,ne.jsxs)(jv,{children:[(0,ne.jsx)(Gv,{style:{marginRight:6}}),So(u)]}),(0,ne.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,ne.jsxs)(zv,{children:[(0,ne.jsxs)(jm,{children:[(0,ne.jsx)(Km,{children:"1"}),(0,ne.jsxs)("span",{children:[(0,ne.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,ne.jsxs)(jm,{children:[(0,ne.jsx)(Km,{children:"2"}),(0,ne.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,ne.jsx)("div",{style:{width:"100%"},children:e&&(0,ne.jsx)(Hv,{origin:w,appId:C,accessToken:e,clientAnalyticsId:l,address:u,dimensions:{height:"44px"}})}),(0,ne.jsxs)(Kv,{children:[(0,ne.jsxs)("div",{children:[(0,ne.jsx)(Ym.default,{viewBox:"0 0 20 18"}),(0,ne.jsx)("h4",{children:"Warning"})]}),(0,ne.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,ne.jsx)($,{protectedByPrivy:!0})]})};function Hv(e){let[t,r]=(0,mo.useState)(e.dimensions.width),[o,n]=(0,mo.useState)(void 0),i=(0,mo.useRef)(null);return(0,mo.useEffect)(()=>{if(i.current&&t===void 0){let{width:l}=i.current.getBoundingClientRect();r(l)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,ne.jsx)("div",{ref:i,children:t&&(0,ne.jsxs)($v,{children:[(0,ne.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Na(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o})}),(0,ne.jsx)(qv,{children:"Loading..."})]})})}function Gv(e){return(0,ne.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,ne.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 Vv=fo.default.div`
971
971
  display: flex;
972
972
  flex-direction: column;
973
973
  text-align: left;
974
- `,$v=dr.default.div`
974
+ `,zv=fo.default.div`
975
975
  display: flex;
976
976
  flex-direction: column;
977
977
  gap: 24px;
978
978
  padding-bottom: 16px;
979
979
  margin-left: 11px;
980
980
  border-left: 1px solid var(--privy-color-foreground-4) !important;
981
- `,$m=dr.default.div`
981
+ `,jm=fo.default.div`
982
982
  display: flex;
983
983
  align-items: top;
984
984
  gap: 8px;
@@ -987,7 +987,7 @@ Resources:
987
987
  color: var(--privy-color-accent);
988
988
  text-decoration: underline;
989
989
  }
990
- `,qm=dr.default.div`
990
+ `,Km=fo.default.div`
991
991
  display: flex;
992
992
  align-items: center;
993
993
  justify-content: center;
@@ -1001,11 +1001,11 @@ Resources:
1001
1001
  border-radius: 100%;
1002
1002
  background: var(--privy-color-background);
1003
1003
  color: var(--privy-color-accent);
1004
- `,qv=dr.default.div`
1004
+ `,$v=fo.default.div`
1005
1005
  overflow: visible;
1006
1006
  position: relative;
1007
1007
  height: 44px;
1008
- `,jv=dr.default.div`
1008
+ `,qv=fo.default.div`
1009
1009
  position: absolute;
1010
1010
  display: flex;
1011
1011
  align-items: center;
@@ -1017,7 +1017,7 @@ Resources:
1017
1017
  border-radius: var(--privy-border-radius-md);
1018
1018
  background-color: var(--privy-color-background-2);
1019
1019
  color: var(--privy-color-foreground-3);
1020
- `,Kv=dr.default.div`
1020
+ `,jv=fo.default.div`
1021
1021
  display: flex;
1022
1022
  align-items: center;
1023
1023
  padding-top: 1px;
@@ -1030,7 +1030,7 @@ Resources:
1030
1030
  font-size: 12px;
1031
1031
  font-weight: 500;
1032
1032
  margin: auto;
1033
- `,Yv=dr.default.div`
1033
+ `,Kv=fo.default.div`
1034
1034
  border: 1px solid var(--privy-color-background-2) !important;
1035
1035
  border-radius: var(--privy-border-radius-md);
1036
1036
  padding: 16px;
@@ -1052,7 +1052,7 @@ Resources:
1052
1052
  color: var(--privy-color-error);
1053
1053
  }
1054
1054
  }
1055
- `;var Wf=h(require("@heroicons/react/24/solid/XCircleIcon")),_o=require("react"),Lf=h(require("styled-components"));var Ki=require("react");var rf=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),oi=require("react");var Jm=h(require("@heroicons/react/24/outline/ArrowPathIcon")),Zm=h(require("@heroicons/react/24/outline/EyeIcon")),Qm=h(require("@heroicons/react/24/outline/EyeSlashIcon")),Fe=h(require("styled-components"));var Jv=Fe.css`
1055
+ `;var Of=h(require("@heroicons/react/24/solid/XCircleIcon")),Sr=require("react"),Nf=h(require("styled-components"));var ji=require("react");var af=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ni=require("react");var Qm=h(require("@heroicons/react/24/outline/ArrowPathIcon")),Xm=h(require("@heroicons/react/24/outline/EyeIcon")),ef=h(require("@heroicons/react/24/outline/EyeSlashIcon")),De=h(require("styled-components"));var Yv=De.css`
1056
1056
  font-size: 14px;
1057
1057
  font-style: normal;
1058
1058
  font-weight: 400;
@@ -1060,8 +1060,8 @@ Resources:
1060
1060
  letter-spacing: -0.008px;
1061
1061
  text-align: left;
1062
1062
  transition: color 0.1s ease-in;
1063
- `,Hs=Fe.default.span`
1064
- ${Jv}
1063
+ `,Fs=De.default.span`
1064
+ ${Yv}
1065
1065
  transition: color 0.1s ease-in;
1066
1066
  color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1067
1067
  text-transform: ${({error:e})=>e?"":"capitalize"};
@@ -1069,18 +1069,18 @@ Resources:
1069
1069
  &[aria-hidden='true'] {
1070
1070
  visibility: hidden;
1071
1071
  }
1072
- `,Wr=Fe.default.div`
1072
+ `,Do=De.default.div`
1073
1073
  display: flex;
1074
1074
  flex-direction: column;
1075
1075
  justify-content: center;
1076
1076
  flex-grow: 1;
1077
- `,Lr=(0,Fe.default)(U)`
1078
- ${e=>e.hideAnimations&&Fe.css`
1077
+ `,Uo=(0,De.default)(U)`
1078
+ ${e=>e.hideAnimations&&De.css`
1079
1079
  && {
1080
1080
  transition: none;
1081
1081
  }
1082
1082
  `}
1083
- `,Xm=Fe.css`
1083
+ `,tf=De.css`
1084
1084
  && {
1085
1085
  width: 100%;
1086
1086
  border-width: 1px;
@@ -1095,8 +1095,8 @@ Resources:
1095
1095
  font-weight: 300;
1096
1096
  line-height: 22px; /* 137.5% */
1097
1097
  }
1098
- `,Qn=Fe.default.input`
1099
- ${Xm}
1098
+ `,ei=De.default.input`
1099
+ ${tf}
1100
1100
 
1101
1101
  &::placeholder {
1102
1102
  color: var(--privy-color-foreground-3);
@@ -1107,15 +1107,15 @@ Resources:
1107
1107
  overflow: hidden;
1108
1108
  text-overflow: ellipsis;
1109
1109
  white-space: nowrap;
1110
- `,ef=Fe.default.div`
1111
- ${Xm}
1112
- `,Or=Fe.default.div`
1110
+ `,rf=De.default.div`
1111
+ ${tf}
1112
+ `,Fo=De.default.div`
1113
1113
  position: relative;
1114
1114
  width: 100%;
1115
1115
  display: flex;
1116
1116
  align-items: center;
1117
1117
  justify-content: ${({centered:e})=>e?"center":"space-between"};
1118
- `,Nr=Fe.default.div`
1118
+ `,Bo=De.default.div`
1119
1119
  display: flex;
1120
1120
  flex-direction: column;
1121
1121
  align-items: center;
@@ -1137,12 +1137,12 @@ Resources:
1137
1137
  font-weight: 400;
1138
1138
  line-height: 20px;
1139
1139
  }
1140
- `,zi=Fe.default.div`
1140
+ `,Vi=De.default.div`
1141
1141
  display: flex;
1142
1142
  flex-direction: column;
1143
1143
  gap: 10px;
1144
1144
  padding-bottom: 1rem;
1145
- `,$i=Fe.default.div`
1145
+ `,zi=De.default.div`
1146
1146
  display: flex;
1147
1147
  text-align: left;
1148
1148
  align-items: center;
@@ -1162,13 +1162,13 @@ Resources:
1162
1162
  > :first-child {
1163
1163
  min-width: 24px;
1164
1164
  }
1165
- `,HP=Fe.default.div`
1165
+ `,HP=De.default.div`
1166
1166
  height: var(--privy-height-modal-full);
1167
1167
 
1168
1168
  @media (max-width: 440px) {
1169
1169
  height: var(--privy-height-modal-compact);
1170
1170
  }
1171
- `,kc=(0,Fe.default)(Ts)`
1171
+ `,Mc=(0,De.default)(Es)`
1172
1172
  display: flex;
1173
1173
  flex: 1;
1174
1174
  gap: 4px;
@@ -1180,7 +1180,7 @@ Resources:
1180
1180
  border-color: var(--privy-color-foreground-3);
1181
1181
  border-width: 1px;
1182
1182
  }
1183
- `,Xn=Fe.default.div`
1183
+ `,ti=De.default.div`
1184
1184
  position: absolute;
1185
1185
  right: 0.5rem;
1186
1186
 
@@ -1188,7 +1188,7 @@ Resources:
1188
1188
  flex-direction: row;
1189
1189
  justify-content: space-around;
1190
1190
  align-items: center;
1191
- `,tf=(0,Fe.default)(Jm.default)`
1191
+ `,of=(0,De.default)(Qm.default)`
1192
1192
  height: 1.25rem;
1193
1193
  width: 1.25rem;
1194
1194
  stroke: var(--privy-color-accent);
@@ -1197,7 +1197,7 @@ Resources:
1197
1197
  :active {
1198
1198
  stroke: var(--privy-color-accent-light);
1199
1199
  }
1200
- `,ei=(0,Fe.default)(Qm.default)`
1200
+ `,ri=(0,De.default)(ef.default)`
1201
1201
  height: 1.25rem;
1202
1202
  width: 1.25rem;
1203
1203
  stroke: var(--privy-color-accent);
@@ -1206,7 +1206,7 @@ Resources:
1206
1206
  :active {
1207
1207
  stroke: var(--privy-color-accent-light);
1208
1208
  }
1209
- `,ti=(0,Fe.default)(Zm.default)`
1209
+ `,oi=(0,De.default)(Xm.default)`
1210
1210
  height: 1.25rem;
1211
1211
  width: 1.25rem;
1212
1212
  stroke: var(--privy-color-accent);
@@ -1215,7 +1215,7 @@ Resources:
1215
1215
  :active {
1216
1216
  stroke: var(--privy-color-accent-light);
1217
1217
  }
1218
- `,of=Fe.default.progress`
1218
+ `,nf=De.default.progress`
1219
1219
  height: 4px;
1220
1220
  width: 100%;
1221
1221
  margin: 8px 0;
@@ -1231,14 +1231,14 @@ Resources:
1231
1231
  transition: all 0.1s ease-out;
1232
1232
  background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1233
1233
  }
1234
- `;var Be=require("react/jsx-runtime"),nf=({buttonHideAnimations:e,buttonLoading:t,password:o,onSubmit:r,onBack:n})=>{let[i,a]=(0,oi.useState)(!0),[l,s]=(0,oi.useState)(!1),[c,u]=(0,oi.useState)(""),f=o===c;return(0,oi.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)(k,{title:"Confirm Password",closeable:!1,backFn:n}),(0,Be.jsx)(ee,{}),(0,Be.jsxs)(Wr,{children:[(0,Be.jsxs)(Nr,{children:[(0,Be.jsx)(rf.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Be.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,Be.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,Be.jsxs)(Or,{children:[(0,Be.jsx)(Qn,{value:c,onChange:g=>u(g.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),(0,Be.jsx)(Xn,{style:{right:"0.75rem"},children:i?(0,Be.jsx)(ei,{onClick:()=>a(!1)}):(0,Be.jsx)(ti,{onClick:()=>a(!0)})})]}),(0,Be.jsx)(Hs,{"aria-hidden":!l||f,error:!0,children:"Passwords do not match"})]}),(0,Be.jsx)(Lr,{onClick:r,loading:t,disabled:!f,hideAnimations:e,children:"Continue"}),(0,Be.jsx)(te,{}),(0,Be.jsx)($,{protectedByPrivy:!0})]})};var cf=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),df=require("react"),pf=h(require("styled-components"));var qi=h(require("styled-components")),Dr=require("react/jsx-runtime"),af=({className:e,checked:t,color:o="var(--privy-color-accent)",...r})=>(0,Dr.jsx)("label",{children:(0,Dr.jsxs)(Zv,{className:e,children:[(0,Dr.jsx)(lf,{checked:t,...r}),(0,Dr.jsx)(Qv,{color:o,checked:t,children:(0,Dr.jsx)(sf,{viewBox:"0 0 24 24",children:(0,Dr.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})}),Zv=qi.default.div`
1234
+ `;var Ue=require("react/jsx-runtime"),sf=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=(0,ni.useState)(!0),[l,s]=(0,ni.useState)(!1),[c,u]=(0,ni.useState)(""),f=r===c;return(0,ni.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)(k,{title:"Confirm Password",closeable:!1,backFn:n}),(0,Ue.jsx)(ee,{}),(0,Ue.jsxs)(Do,{children:[(0,Ue.jsxs)(Bo,{children:[(0,Ue.jsx)(af.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Ue.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,Ue.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,Ue.jsxs)(Fo,{children:[(0,Ue.jsx)(ei,{value:c,onChange:g=>u(g.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),(0,Ue.jsx)(ti,{style:{right:"0.75rem"},children:i?(0,Ue.jsx)(ri,{onClick:()=>a(!1)}):(0,Ue.jsx)(oi,{onClick:()=>a(!0)})})]}),(0,Ue.jsx)(Fs,{"aria-hidden":!l||f,error:!0,children:"Passwords do not match"})]}),(0,Ue.jsx)(Uo,{onClick:o,loading:t,disabled:!f,hideAnimations:e,children:"Continue"}),(0,Ue.jsx)(te,{}),(0,Ue.jsx)($,{protectedByPrivy:!0})]})};var pf=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),uf=require("react"),mf=h(require("styled-components"));var $i=h(require("styled-components")),Ho=require("react/jsx-runtime"),lf=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>(0,Ho.jsx)("label",{children:(0,Ho.jsxs)(Jv,{className:e,children:[(0,Ho.jsx)(df,{checked:t,...o}),(0,Ho.jsx)(Zv,{color:r,checked:t,children:(0,Ho.jsx)(cf,{viewBox:"0 0 24 24",children:(0,Ho.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})}),Jv=$i.default.div`
1235
1235
  display: inline-block;
1236
1236
  vertical-align: middle;
1237
- `,sf=qi.default.svg`
1237
+ `,cf=$i.default.svg`
1238
1238
  fill: none;
1239
1239
  stroke: white;
1240
1240
  stroke-width: 3px;
1241
- `,lf=qi.default.input.attrs({type:"checkbox"})`
1241
+ `,df=$i.default.input.attrs({type:"checkbox"})`
1242
1242
  border: 0;
1243
1243
  clip: rect(0 0 0 0);
1244
1244
  clippath: inset(50%);
@@ -1249,7 +1249,7 @@ Resources:
1249
1249
  position: absolute;
1250
1250
  white-space: nowrap;
1251
1251
  width: 1px;
1252
- `,Qv=qi.default.div`
1252
+ `,Zv=$i.default.div`
1253
1253
  display: inline-block;
1254
1254
  width: 18px;
1255
1255
  height: 18px;
@@ -1264,30 +1264,30 @@ Resources:
1264
1264
  border-width: 1px;
1265
1265
  }
1266
1266
 
1267
- ${lf}:focus + & {
1267
+ ${df}:focus + & {
1268
1268
  box-shadow: 0 0 0 1px ${e=>e.color};
1269
1269
  }
1270
1270
 
1271
- ${sf} {
1271
+ ${cf} {
1272
1272
  visibility: ${e=>e.checked?"visible":"hidden"};
1273
1273
  }
1274
- `;var Le=require("react/jsx-runtime"),uf=({buttonHideAnimations:e,buttonLoading:t,onSubmit:o,onBack:r,config:n})=>{let[i,a]=(0,df.useState)(!1);return(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(k,{title:"Confirm Password",closeable:!1,backFn:r}),(0,Le.jsx)(ee,{}),(0,Le.jsxs)(Wr,{children:[(0,Le.jsxs)(Nr,{children:[(0,Le.jsx)(cf.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,Le.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,Le.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,Le.jsx)(zi,{children:(0,Le.jsxs)($i,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[(0,Le.jsx)(af,{color:"var(--privy-color-error)",checked:i}),(0,Le.jsx)(Le.Fragment,{children:"I understand losing my password means losing my account."})]})})]}),(0,Le.jsxs)(Xv,{children:[n.initiatedBy==="user"&&(0,Le.jsx)(bo,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,Le.jsx)(Lr,{onClick:o,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,Le.jsx)(te,{}),(0,Le.jsx)($,{protectedByPrivy:!0})]})},Xv=pf.default.div`
1274
+ `;var Me=require("react/jsx-runtime"),ff=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=(0,uf.useState)(!1);return(0,Me.jsxs)(Me.Fragment,{children:[(0,Me.jsx)(k,{title:"Confirm Password",closeable:!1,backFn:o}),(0,Me.jsx)(ee,{}),(0,Me.jsxs)(Do,{children:[(0,Me.jsxs)(Bo,{children:[(0,Me.jsx)(pf.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,Me.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,Me.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,Me.jsx)(Vi,{children:(0,Me.jsxs)(zi,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[(0,Me.jsx)(lf,{color:"var(--privy-color-error)",checked:i}),(0,Me.jsx)(Me.Fragment,{children:"I understand losing my password means losing my account."})]})})]}),(0,Me.jsxs)(Qv,{children:[n.initiatedBy==="user"&&(0,Me.jsx)(Cr,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,Me.jsx)(Uo,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,Me.jsx)(te,{}),(0,Me.jsx)($,{protectedByPrivy:!0})]})},Qv=mf.default.div`
1275
1275
  display: flex;
1276
1276
  gap: 10px;
1277
- `;var bf=h(require("@heroicons/react/24/outline/KeyIcon")),Rc=h(require("@heroicons/react/24/solid/CheckCircleIcon")),pr=require("react"),Ic=h(require("styled-components"));var mf=h(require("fast-password-entropy")),ff=h(require("secure-password-utilities")),hf=require("secure-password-utilities/wordlists"),ew=95,tw=8,ow=3,rw=.3,nw=/[a-z]/,iw=/[A-Z]/,aw=/[0-9]/,sw="a-zA-Z0-9",yf="!@#$%^&*()\\-_+.",gf=`${sw}${yf}`,lw=new RegExp(`[${yf}]`),cw=new RegExp(`[${gf}]`),vf=new RegExp(`^[${gf}]{6,}$`),wf=(e="")=>{let t=e.split("").filter(o=>!cw.test(o)).map(o=>o.replace(" ","SPACE"));return[...new Set(t)]},Gs=()=>ff.generatePassphrase(4,hf.DEFAULT_WORDLIST);function dw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function pw(e){if(e.length<tw)return 0;let t=0;nw.test(e)&&(t+=1),iw.test(e)&&(t+=1),aw.test(e)&&(t+=1),lw.test(e)&&(t+=1);let o=t/ow;return Math.max(0,Math.min(1,o))}function uw(e=""){let t=pw(e),o=(0,mf.default)(e)/ew;return(t*rw+o)/2}function Cf(e=""){let t=uw(e);return{value:t,label:dw(t)}}var le=require("react/jsx-runtime"),Ef=({buttonHideAnimations:e,buttonLoading:t,password:o="",config:r,onSubmit:n,onClose:i,onPasswordChange:a,onPasswordGenerate:l})=>{let[s,c]=(0,pr.useState)(!1),[u,f]=(0,pr.useState)(!1);(0,pr.useEffect)(()=>{o&&!u&&f(!0)},[o]);let g=(0,pr.useMemo)(()=>u?(o?.length||0)<6?"Password must be at least 6 characters":vf.test(o||"")?null:`Invalid characters used ( ${wf(o).join(" ")} )`:null,[o,u]),w=(0,pr.useMemo)(()=>g?{value:0,label:"Weak"}:Cf(o),[o,g]),C=(0,pr.useMemo)(()=>!!(!o?.length||g),[g,o]);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(k,{onClose:i,title:"Secure your account",closeable:r.initiatedBy==="user"}),(0,le.jsx)(ee,{}),(0,le.jsxs)(Wr,{children:[(0,le.jsxs)(Nr,{children:[(0,le.jsx)(bf.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,le.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),(0,le.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,le.jsxs)(Or,{children:[(0,le.jsx)(Qn,{value:o,onChange:E=>a(E.target.value),placeholder:"enter or generate a strong password",type:s?"password":"text",style:{paddingRight:"3.8rem"}}),(0,le.jsxs)(Xn,{style:{width:"3.5rem"},children:[s?(0,le.jsx)(ei,{onClick:()=>c(!1)}):(0,le.jsx)(ti,{onClick:()=>c(!0)}),(0,le.jsx)(tf,{onClick:l})]})]}),(0,le.jsx)(of,{value:w.value===0?.01:w.value,label:w.label}),(0,le.jsx)(Hs,{error:!!g,children:g||`Password Strength: ${u?w.label:"--"}`}),(0,le.jsxs)(fw,{children:[(0,le.jsx)(mw,{children:(0,le.jsxs)(zi,{children:[(0,le.jsxs)($i,{children:[(0,le.jsx)(Rc.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,le.jsxs)($i,{children:[(0,le.jsx)(Rc.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,le.jsx)(Lr,{onClick:n,loading:t,disabled:C,hideAnimations:e,children:"Continue"})]})]}),(0,le.jsx)(te,{}),(0,le.jsx)($,{protectedByPrivy:!0})]})},mw=(0,Ic.default)(zi)`
1277
+ `;var Pf=h(require("@heroicons/react/24/outline/KeyIcon")),Wc=h(require("@heroicons/react/24/solid/CheckCircleIcon")),ho=require("react"),Lc=h(require("styled-components"));var hf=h(require("fast-password-entropy")),yf=h(require("secure-password-utilities")),gf=require("secure-password-utilities/wordlists"),Xv=95,ew=8,tw=3,rw=.3,ow=/[a-z]/,nw=/[A-Z]/,iw=/[0-9]/,aw="a-zA-Z0-9",vf="!@#$%^&*()\\-_+.",wf=`${aw}${vf}`,sw=new RegExp(`[${vf}]`),lw=new RegExp(`[${wf}]`),Cf=new RegExp(`^[${wf}]{6,}$`),bf=(e="")=>{let t=e.split("").filter(r=>!lw.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},Bs=()=>yf.generatePassphrase(4,gf.DEFAULT_WORDLIST);function cw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function dw(e){if(e.length<ew)return 0;let t=0;ow.test(e)&&(t+=1),nw.test(e)&&(t+=1),iw.test(e)&&(t+=1),sw.test(e)&&(t+=1);let r=t/tw;return Math.max(0,Math.min(1,r))}function pw(e=""){let t=dw(e),r=(0,hf.default)(e)/Xv;return(t*rw+r)/2}function Ef(e=""){let t=pw(e);return{value:t,label:cw(t)}}var le=require("react/jsx-runtime"),Tf=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,onSubmit:n,onClose:i,onPasswordChange:a,onPasswordGenerate:l})=>{let[s,c]=(0,ho.useState)(!1),[u,f]=(0,ho.useState)(!1);(0,ho.useEffect)(()=>{r&&!u&&f(!0)},[r]);let g=(0,ho.useMemo)(()=>u?(r?.length||0)<6?"Password must be at least 6 characters":Cf.test(r||"")?null:`Invalid characters used ( ${bf(r).join(" ")} )`:null,[r,u]),w=(0,ho.useMemo)(()=>g?{value:0,label:"Weak"}:Ef(r),[r,g]),C=(0,ho.useMemo)(()=>!!(!r?.length||g),[g,r]);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(k,{onClose:i,title:"Secure your account",closeable:o.initiatedBy==="user"}),(0,le.jsx)(ee,{}),(0,le.jsxs)(Do,{children:[(0,le.jsxs)(Bo,{children:[(0,le.jsx)(Pf.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,le.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),(0,le.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,le.jsxs)(Fo,{children:[(0,le.jsx)(ei,{value:r,onChange:b=>a(b.target.value),placeholder:"enter or generate a strong password",type:s?"password":"text",style:{paddingRight:"3.8rem"}}),(0,le.jsxs)(ti,{style:{width:"3.5rem"},children:[s?(0,le.jsx)(ri,{onClick:()=>c(!1)}):(0,le.jsx)(oi,{onClick:()=>c(!0)}),(0,le.jsx)(of,{onClick:l})]})]}),(0,le.jsx)(nf,{value:w.value===0?.01:w.value,label:w.label}),(0,le.jsx)(Fs,{error:!!g,children:g||`Password Strength: ${u?w.label:"--"}`}),(0,le.jsxs)(mw,{children:[(0,le.jsx)(uw,{children:(0,le.jsxs)(Vi,{children:[(0,le.jsxs)(zi,{children:[(0,le.jsx)(Wc.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,le.jsxs)(zi,{children:[(0,le.jsx)(Wc.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,le.jsx)(Uo,{onClick:n,loading:t,disabled:C,hideAnimations:e,children:"Continue"})]})]}),(0,le.jsx)(te,{}),(0,le.jsx)($,{protectedByPrivy:!0})]})},uw=(0,Lc.default)(Vi)`
1278
1278
  flex: 1;
1279
1279
  padding-top: 1rem;
1280
- `,fw=Ic.default.div`
1280
+ `,mw=Lc.default.div`
1281
1281
  display: flex;
1282
1282
  flex-direction: column;
1283
1283
  height: 100%;
1284
- `;var Pf=h(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),Tf=h(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),xf=h(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),Sf=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ji=require("react");var we=require("react/jsx-runtime"),_f=({buttonHideAnimations:e,buttonLoading:t,appName:o,password:r,onSubmit:n,onBack:i})=>{let[a,l]=(0,ji.useState)(!1),s=(0,ji.useCallback)(()=>{l(!0),r&&navigator.clipboard.writeText(r)},[r]),c=(0,ji.useCallback)(()=>{let u=document.createElement("a"),f=o.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),g=new Blob([hw(o,r)],{type:"text/plain"}),w=URL.createObjectURL(g);u.href=w,u.target="_blank",u.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(w)},5e3)},[r]);return(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(k,{backFn:i,title:"Save Password",closeable:!1}),(0,we.jsx)(ee,{}),(0,we.jsxs)(Wr,{children:[(0,we.jsxs)(Nr,{children:[(0,we.jsx)(Sf.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,we.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,we.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,we.jsx)(Or,{centered:!0,children:(0,we.jsx)(ef,{children:r})}),(0,we.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,we.jsx)(kc,{onClick:s,children:a?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(Tf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(xf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,we.jsxs)(kc,{onClick:c,children:[(0,we.jsx)(Pf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,we.jsx)(Lr,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,we.jsx)(te,{}),(0,we.jsx)($,{protectedByPrivy:!0})]})},hw=(e,t)=>`Your wallet recovery password for ${e} is
1284
+ `;var xf=h(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),Sf=h(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),_f=h(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),Af=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),qi=require("react");var ge=require("react/jsx-runtime"),kf=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=(0,qi.useState)(!1),s=(0,qi.useCallback)(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=(0,qi.useCallback)(()=>{let u=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),g=new Blob([fw(r,o)],{type:"text/plain"}),w=URL.createObjectURL(g);u.href=w,u.target="_blank",u.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(w)},5e3)},[o]);return(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(k,{backFn:i,title:"Save Password",closeable:!1}),(0,ge.jsx)(ee,{}),(0,ge.jsxs)(Do,{children:[(0,ge.jsxs)(Bo,{children:[(0,ge.jsx)(Af.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,ge.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,ge.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,ge.jsx)(Fo,{centered:!0,children:(0,ge.jsx)(rf,{children:o})}),(0,ge.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,ge.jsx)(Mc,{onClick:s,children:a?(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(Sf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(_f.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,ge.jsxs)(Mc,{onClick:c,children:[(0,ge.jsx)(xf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,ge.jsx)(Uo,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,ge.jsx)(te,{}),(0,ge.jsx)($,{protectedByPrivy:!0})]})},fw=(e,t)=>`Your wallet recovery password for ${e} is
1285
1285
 
1286
1286
  ${t}
1287
1287
 
1288
- You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var Af=h(require("@heroicons/react/24/solid/CheckCircleIcon")),kf=h(require("@heroicons/react/24/solid/XCircleIcon"));var ht=require("react/jsx-runtime"),Rf=({error:e,onClose:t})=>(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsx)(k,{closeable:!1}),(0,ht.jsx)(ee,{}),e?(0,ht.jsxs)(Eo,{children:[(0,ht.jsx)(kf.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,ht.jsx)(Ue,{title:"Something went wrong",description:e})]}):(0,ht.jsxs)(Eo,{children:[(0,ht.jsx)(Af.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,ht.jsx)(Ue,{title:"Success"})]}),(0,ht.jsx)(U,{onClick:t,children:"Close"}),(0,ht.jsx)(te,{}),(0,ht.jsx)($,{protectedByPrivy:!0})]});var If=require("react"),yw=(e,t)=>{switch(e){case"creating":return t==="back"?e:"saving";case"saving":return t==="back"?"creating":"confirming";case"confirming":return t==="back"?"saving":"finalizing";case"finalizing":return t==="back"?"confirming":"done";default:return e}},Mf=()=>{let[e,t]=(0,If.useReducer)(yw,"creating");return{send:t,state:e}};var ri=require("react/jsx-runtime"),Vs=({onSubmit:e,...t})=>{let{send:o,state:r}=Mf(),n=(0,Ki.useCallback)(async()=>{r==="finalizing"&&await e(),o("next")},[r,o,e]);(0,Ki.useEffect)(()=>{let a;return r==="done"&&t.config.initiatedBy==="automatic"&&(a=setTimeout(()=>t.onClose?.(),bt)),()=>{a&&clearTimeout(a)}},[r,t.config.initiatedBy,t.onClose]);let i=(0,Ki.useCallback)(()=>{o("back")},[o]);return r==="creating"?(0,ri.jsx)(Ef,{...t,onSubmit:n}):r==="saving"?(0,ri.jsx)(_f,{...t,onSubmit:n,onBack:i}):r==="confirming"?(0,ri.jsx)(nf,{...t,onSubmit:n,onBack:i}):r==="finalizing"?(0,ri.jsx)(uf,{...t,onSubmit:n,onBack:i}):r==="done"?(0,ri.jsx)(Rf,{...t,onSubmit:n}):null};var Gt=require("react/jsx-runtime"),Of=()=>{let{app:e,navigate:t,data:o,onUserCloseViaDialogOrKeybindRef:r}=_(),[n,i]=(0,_o.useState)(""),[a,l]=(0,_o.useState)(!1),[s,c]=(0,_o.useState)(),[u,f]=(0,_o.useState)(null),[g,w]=(0,_o.useState)(null),C=(0,_o.useRef)(!1),{authenticated:E,getAccessToken:x}=G(),{refreshUser:b,closePrivyModal:A,createAnalyticsEvent:W,isNewUserThisSession:I,initializeWalletProxy:S}=M(),{onSuccess:B,onFailure:F,callAuthOnSuccessOnClose:q}=o.createWallet,R=e?.embeddedWallets.requireUserPasswordOnCreate===!0,Z=!!(!n||C.current)&&!R,D=new Ct(async()=>K());(0,_o.useEffect)(()=>{u||S(3e4).then(ue=>f(ue))},[u]),(0,_o.useEffect)(()=>{if(!E){t("LANDING"),F(new Error("User must be authenticated before creating a Privy wallet"));return}!R&&!a&&!C.current&&(l(!0),D.execute().finally(()=>l(!1)))},[R,E]);let Y=()=>{R&&g&&g?.recoveryMethod!=="user-passcode"?F(new Ft("User created a wallet but failed to set a password for it")):g?B(g):F(new Ft("User wallet creation failed")),A({shouldCallAuthOnSuccess:q})};r.current=()=>null;let K=async function(){let ue=await x();if(ue)try{W("embedded_wallet_creation_started");let J=await S(Pn);if(!J)throw new Error("walletProxy does not exist.");let it=1e4,At=new Promise((gr,uo)=>{setTimeout(()=>{uo(new Error("walletProxy.create timed out."))},it)});if(!await Promise.race([J.create({accessToken:ue,recoveryPassword:s}),At]))throw new Error("walletProxy.create did not send a response.");let at=await b();if(!at)throw new Error("Failed to refresh user.");let ce=Ie(at);if(!ce)throw new Error("Updated user is missing embedded wallet.");w(ce),W("embedded_wallet_creation_completed",{walletAddress:ce.address}),i(""),C.current=!0,R?t("EMBEDDED_WALLET_CREATED_SCREEN"):I?t("EMBEDDED_WALLET_CREATED_SCREEN"):ce&&(B(ce),A({shouldCallAuthOnSuccess:q}))}catch(J){if(C.current)return;W("embedded_wallet_creation_failed",{error:J.toString()}),i("An error has occurred, please try again."),console.warn(J)}else i("An error has occured, please login again."),W("embedded_wallet_creation_failed",{error:"Missing access token for user."})},re=async()=>{if(!R)return A({shouldCallAuthOnSuccess:q});l(!0);let ue=250;return D.execute().then(()=>new Promise(J=>setTimeout(J,ue))).finally(()=>l(!1))};return!R&&n?(0,Gt.jsxs)(Gt.Fragment,{children:[(0,Gt.jsx)(k,{closeable:!1}),(0,Gt.jsxs)(Eo,{children:[(0,Gt.jsx)(Wf.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Gt.jsx)(Ue,{title:"Something went wrong",description:n})]}),(0,Gt.jsx)(U,{onClick:Y,children:"Close"}),(0,Gt.jsx)(gw,{})]}):Z?(0,Gt.jsx)(Yn,{}):(0,Gt.jsx)(Vs,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:Z||!u,buttonLoading:a,buttonHideAnimations:!g&&a,error:n,password:s||"",onClose:Y,onPasswordChange:c,onPasswordGenerate:()=>c(Gs()),onSubmit:re})},gw=Lf.default.div`
1288
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var Rf=h(require("@heroicons/react/24/solid/CheckCircleIcon")),If=h(require("@heroicons/react/24/solid/XCircleIcon"));var ft=require("react/jsx-runtime"),Mf=({error:e,onClose:t})=>(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(k,{closeable:!1}),(0,ft.jsx)(ee,{}),e?(0,ft.jsxs)(br,{children:[(0,ft.jsx)(If.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,ft.jsx)(Ne,{title:"Something went wrong",description:e})]}):(0,ft.jsxs)(br,{children:[(0,ft.jsx)(Rf.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,ft.jsx)(Ne,{title:"Success"})]}),(0,ft.jsx)(U,{onClick:t,children:"Close"}),(0,ft.jsx)(te,{}),(0,ft.jsx)($,{protectedByPrivy:!0})]});var Wf=require("react"),hw=(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}},Lf=()=>{let[e,t]=(0,Wf.useReducer)(hw,"creating");return{send:t,state:e}};var ii=require("react/jsx-runtime"),Hs=({onSubmit:e,...t})=>{let{send:r,state:o}=Lf(),n=(0,ji.useCallback)(async()=>{o==="finalizing"&&await e(),r("next")},[o,r,e]);(0,ji.useEffect)(()=>{let a;return o==="done"&&t.config.initiatedBy==="automatic"&&(a=setTimeout(()=>t.onClose?.(),bt)),()=>{a&&clearTimeout(a)}},[o,t.config.initiatedBy,t.onClose]);let i=(0,ji.useCallback)(()=>{r("back")},[r]);return o==="creating"?(0,ii.jsx)(Tf,{...t,onSubmit:n}):o==="saving"?(0,ii.jsx)(kf,{...t,onSubmit:n,onBack:i}):o==="confirming"?(0,ii.jsx)(sf,{...t,onSubmit:n,onBack:i}):o==="finalizing"?(0,ii.jsx)(ff,{...t,onSubmit:n,onBack:i}):o==="done"?(0,ii.jsx)(Mf,{...t,onSubmit:n}):null};var zt=require("react/jsx-runtime"),Df=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=A(),[n,i]=(0,Sr.useState)(""),[a,l]=(0,Sr.useState)(!1),[s,c]=(0,Sr.useState)(),[u,f]=(0,Sr.useState)(null),[g,w]=(0,Sr.useState)(null),C=(0,Sr.useRef)(!1),{authenticated:b,getAccessToken:S}=G(),{refreshUser:P,closePrivyModal:T,createAnalyticsEvent:M,isNewUserThisSession:I,initializeWalletProxy:_}=W(),{onSuccess:F,onFailure:B,callAuthOnSuccessOnClose:q}=r.createWallet,R=e?.embeddedWallets.requireUserPasswordOnCreate===!0,Q=!!(!n||C.current)&&!R,D=new Ct(async()=>K());(0,Sr.useEffect)(()=>{u||_(3e4).then(Ce=>f(Ce))},[u]),(0,Sr.useEffect)(()=>{if(!b){t("LANDING"),B(new Error("User must be authenticated before creating a Privy wallet"));return}!R&&!a&&!C.current&&(l(!0),D.execute().finally(()=>l(!1)))},[R,b]);let Y=()=>{R&&g&&g?.recoveryMethod!=="user-passcode"?B(new Ht("User created a wallet but failed to set a password for it")):g?F(g):B(new Ht("User wallet creation failed")),T({shouldCallAuthOnSuccess:q})};o.current=()=>null;let K=async function(){let Ce=await S();if(Ce)try{M("embedded_wallet_creation_started");let J=await _(Tn);if(!J)throw new Error("walletProxy does not exist.");let it=1e4,yt=new Promise((Be,bo)=>{setTimeout(()=>{bo(new Error("walletProxy.create timed out."))},it)});if(!await Promise.race([J.create({accessToken:Ce,recoveryPassword:s}),yt]))throw new Error("walletProxy.create did not send a response.");let at=await P();if(!at)throw new Error("Failed to refresh user.");let et=ke(at);if(!et)throw new Error("Updated user is missing embedded wallet.");w(et),M("embedded_wallet_creation_completed",{walletAddress:et.address}),i(""),C.current=!0,R?t("EMBEDDED_WALLET_CREATED_SCREEN"):I?t("EMBEDDED_WALLET_CREATED_SCREEN"):et&&(F(et),T({shouldCallAuthOnSuccess:q}))}catch(J){if(C.current)return;M("embedded_wallet_creation_failed",{error:J.toString()}),i("An error has occurred, please try again."),console.warn(J)}else i("An error has occured, please login again."),M("embedded_wallet_creation_failed",{error:"Missing access token for user."})},ie=async()=>{if(!R)return T({shouldCallAuthOnSuccess:q});l(!0);let Ce=250;return D.execute().then(()=>new Promise(J=>setTimeout(J,Ce))).finally(()=>l(!1))};return!R&&n?(0,zt.jsxs)(zt.Fragment,{children:[(0,zt.jsx)(k,{closeable:!1}),(0,zt.jsxs)(br,{children:[(0,zt.jsx)(Of.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,zt.jsx)(Ne,{title:"Something went wrong",description:n})]}),(0,zt.jsx)(U,{onClick:Y,children:"Close"}),(0,zt.jsx)(yw,{})]}):Q?(0,zt.jsx)(Zn,{}):(0,zt.jsx)(Hs,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:Q||!u,buttonLoading:a,buttonHideAnimations:!g&&a,error:n,password:s||"",onClose:Y,onPasswordChange:c,onPasswordGenerate:()=>c(Bs()),onSubmit:ie})},yw=Nf.default.div`
1289
1289
  height: 44px;
1290
- `;var on=require("react");var Df=require("react/jsx-runtime"),Nf=()=>{let[e,t]=(0,on.useState)(null),[o,r]=(0,on.useState)(!1),[n,i]=(0,on.useState)(null),[a,l]=(0,on.useState)(""),{authenticated:s,getAccessToken:c,user:u}=G(),{walletProxy:f,refreshUser:g,closePrivyModal:w,createAnalyticsEvent:C}=M(),{app:E,navigate:x,data:b,onUserCloseViaDialogOrKeybindRef:A}=_(),{onSuccess:W,onFailure:I}=b.createWallet,S=Ie(u),B=e?.recoveryMethod==="user-passcode";(0,on.useEffect)(()=>{s||(x("LANDING"),I(new Pa("User must be authenticated before setting a password on a Privy wallet")))},[s]);let F=()=>{if(n){I(n),w({shouldCallAuthOnSuccess:!1});return}if(!B){I(new Ft("Exited before password was added to wallet")),w({shouldCallAuthOnSuccess:!1});return}W(e),w({shouldCallAuthOnSuccess:!1})};A.current=F;let q=async()=>{let Z=await c();if(Z&&S?.address&&a&&f)try{if(C("embedded_wallet_set_password_started",{walletAddress:S.address}),!(await f.setRecoveryPassword({accessToken:Z,address:S.address,recoveryPassword:a})).address){i(new Ft("Error setting password on privy wallet")),C("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"error setting password"});return}let Y=await g(),K=Ie(Y);if(!K){i(new Ft("Error setting password on privy wallet")),C("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"wallet disconnected"});return}t(K),C("embedded_wallet_set_password_completed",{walletAddress:S.address})}catch(D){console.warn(D),i(D instanceof Error?D:new Error("Error setting password on privy wallet")),C("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:D})}},R=async()=>{B?(W(e),w({shouldCallAuthOnSuccess:!1})):(r(!0),i(null),await q(),r(!1))};return(0,Df.jsx)(Vs,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:F},error:n?"An error has occurred, please try again.":void 0,buttonLoading:o,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(Gs()),onPasswordChange:l,onSubmit:R,onClose:F})};var Uf=h(require("@heroicons/react/24/outline/UserCircleIcon")),Ff=h(require("@heroicons/react/24/solid/LockClosedIcon"));var ot=require("react/jsx-runtime"),Bf=()=>{let{user:e}=G(),{closePrivyModal:t,createAnalyticsEvent:o}=M(),{data:r,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=_(),{onSuccess:l,onFailure:s}=r.setWalletPassword,c=()=>{s(new Ft("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,(0,ot.jsxs)(ot.Fragment,{children:[(0,ot.jsx)(k,{onClose:c}),(0,ot.jsx)(ee,{}),(0,ot.jsxs)(Eo,{children:[(0,ot.jsxs)(Qu,{children:[(0,ot.jsx)(Uf.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,ot.jsx)(Xu,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,ot.jsx)(Ff.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,ot.jsxs)(Ue,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,ot.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,ot.jsx)(U,{onClick:()=>{let f=Ie(e);o("embedded_wallet_set_password_started",{walletAddress:f?.address}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,ot.jsx)(te,{}),(0,ot.jsx)($,{protectedByPrivy:!0})]})};var Hf=h(require("@heroicons/react/24/outline/ShieldCheckIcon")),rn=require("react"),nn=h(require("styled-components"));var Pe=require("react/jsx-runtime"),Gf=()=>{let[e,t]=(0,rn.useState)(!0),{authenticated:o,getAccessToken:r}=G(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),[u,f]=(0,rn.useState)(void 0),[g,w]=(0,rn.useState)(""),[C,E]=(0,rn.useState)(!1),{privyWallet:x,onCompleteNavigateTo:b,onSuccess:A,onFailure:W}=s.recoverWallet,I=(F="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),W(typeof F=="string"?new Ft(F):F)};c.current=I,(0,rn.useEffect)(()=>{if(!o||!x)return I("User must be authenticated and have a Privy wallet before it can be recovered")},[o]);let S=F=>{F&&f(F)};return(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(k,{onClose:I}),(0,Pe.jsx)(ee,{}),(0,Pe.jsxs)(ww,{children:[(0,Pe.jsxs)(vw,{children:[(0,Pe.jsx)(Hf.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Pe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),(0,Pe.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,Pe.jsxs)("div",{children:[(0,Pe.jsxs)(Or,{children:[(0,Pe.jsx)(Qn,{type:e?"password":"text",onChange:F=>S(F.target.value),disabled:C,style:{paddingRight:"2.3rem"}}),(0,Pe.jsx)(Xn,{style:{right:"0.75rem"},children:e?(0,Pe.jsx)(ei,{onClick:()=>t(!1)}):(0,Pe.jsx)(ti,{onClick:()=>t(!0)})})]}),!!g&&(0,Pe.jsx)(Cw,{children:g})]}),(0,Pe.jsxs)("div",{children:[(0,Pe.jsxs)(Zu,{children:[(0,Pe.jsx)("h4",{children:"Why is this necessary?"}),(0,Pe.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Pe.jsx)(bw,{loading:C||!n,disabled:!u,onClick:async()=>{E(!0);let F=await r();if(F&&x&&u!==null)try{a("embedded_wallet_recovery_started",{walletAddress:x.address}),await n?.recover({address:x.address,accessToken:F,recoveryPin:u}),w(""),b?l(b):i({shouldCallAuthOnSuccess:!1}),A?.(x),a("embedded_wallet_recovery_completed",{walletAddress:x.address})}catch(q){Dm(q)?w("Invalid recovery password, please try again."):w("An error has occurred, please try again.")}finally{E(!1)}else return I("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!x&&C,children:"Recover your account"})]})]}),(0,Pe.jsx)(te,{}),(0,Pe.jsx)($,{protectedByPrivy:!0})]})},vw=nn.default.div`
1290
+ `;var sn=require("react");var Ff=require("react/jsx-runtime"),Uf=()=>{let[e,t]=(0,sn.useState)(null),[r,o]=(0,sn.useState)(!1),[n,i]=(0,sn.useState)(null),[a,l]=(0,sn.useState)(""),{authenticated:s,getAccessToken:c,user:u}=G(),{walletProxy:f,refreshUser:g,closePrivyModal:w,createAnalyticsEvent:C}=W(),{app:b,navigate:S,data:P,onUserCloseViaDialogOrKeybindRef:T}=A(),{onSuccess:M,onFailure:I}=P.createWallet,_=ke(u),F=e?.recoveryMethod==="user-passcode";(0,sn.useEffect)(()=>{s||(S("LANDING"),I(new Ea("User must be authenticated before setting a password on a Privy wallet")))},[s]);let B=()=>{if(n){I(n),w({shouldCallAuthOnSuccess:!1});return}if(!F){I(new Ht("Exited before password was added to wallet")),w({shouldCallAuthOnSuccess:!1});return}M(e),w({shouldCallAuthOnSuccess:!1})};T.current=B;let q=async()=>{let Q=await c();if(Q&&_?.address&&a&&f)try{if(C("embedded_wallet_set_password_started",{walletAddress:_.address}),!(await f.setRecoveryPassword({accessToken:Q,address:_.address,recoveryPassword:a})).address){i(new Ht("Error setting password on privy wallet")),C("embedded_wallet_set_password_failed",{walletAddress:_.address,reason:"error setting password"});return}let Y=await g(),K=ke(Y);if(!K){i(new Ht("Error setting password on privy wallet")),C("embedded_wallet_set_password_failed",{walletAddress:_.address,reason:"wallet disconnected"});return}t(K),C("embedded_wallet_set_password_completed",{walletAddress:_.address})}catch(D){console.warn(D),i(D instanceof Error?D:new Error("Error setting password on privy wallet")),C("embedded_wallet_set_password_failed",{walletAddress:_.address,reason:D})}},R=async()=>{F?(M(e),w({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await q(),o(!1))};return(0,Ff.jsx)(Hs,{appName:b?.name||"privy",config:{initiatedBy:"user",onCancel:B},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(Bs()),onPasswordChange:l,onSubmit:R,onClose:B})};var Bf=h(require("@heroicons/react/24/outline/UserCircleIcon")),Hf=h(require("@heroicons/react/24/solid/LockClosedIcon"));var rt=require("react/jsx-runtime"),Gf=()=>{let{user:e}=G(),{closePrivyModal:t,createAnalyticsEvent:r}=W(),{data:o,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=A(),{onSuccess:l,onFailure:s}=o.setWalletPassword,c=()=>{s(new Ht("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsx)(k,{onClose:c}),(0,rt.jsx)(ee,{}),(0,rt.jsxs)(br,{children:[(0,rt.jsxs)(em,{children:[(0,rt.jsx)(Bf.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,rt.jsx)(tm,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,rt.jsx)(Hf.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,rt.jsxs)(Ne,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,rt.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,rt.jsx)(U,{onClick:()=>{let f=ke(e);r("embedded_wallet_set_password_started",{walletAddress:f?.address}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,rt.jsx)(te,{}),(0,rt.jsx)($,{protectedByPrivy:!0})]})};var Vf=h(require("@heroicons/react/24/outline/ShieldCheckIcon")),ln=require("react"),cn=h(require("styled-components"));var Ee=require("react/jsx-runtime"),zf=()=>{let[e,t]=(0,ln.useState)(!0),{authenticated:r,getAccessToken:o}=G(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),[u,f]=(0,ln.useState)(void 0),[g,w]=(0,ln.useState)(""),[C,b]=(0,ln.useState)(!1),{privyWallet:S,onCompleteNavigateTo:P,onSuccess:T,onFailure:M}=s.recoverWallet,I=(B="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),M(typeof B=="string"?new Ht(B):B)};c.current=I,(0,ln.useEffect)(()=>{if(!r||!S)return I("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let _=B=>{B&&f(B)};return(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(k,{onClose:I}),(0,Ee.jsx)(ee,{}),(0,Ee.jsxs)(vw,{children:[(0,Ee.jsxs)(gw,{children:[(0,Ee.jsx)(Vf.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ee.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),(0,Ee.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,Ee.jsxs)("div",{children:[(0,Ee.jsxs)(Fo,{children:[(0,Ee.jsx)(ei,{type:e?"password":"text",onChange:B=>_(B.target.value),disabled:C,style:{paddingRight:"2.3rem"}}),(0,Ee.jsx)(ti,{style:{right:"0.75rem"},children:e?(0,Ee.jsx)(ri,{onClick:()=>t(!1)}):(0,Ee.jsx)(oi,{onClick:()=>t(!0)})})]}),!!g&&(0,Ee.jsx)(ww,{children:g})]}),(0,Ee.jsxs)("div",{children:[(0,Ee.jsxs)(Xu,{children:[(0,Ee.jsx)("h4",{children:"Why is this necessary?"}),(0,Ee.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Ee.jsx)(Cw,{loading:C||!n,disabled:!u,onClick:async()=>{b(!0);let B=await o();if(B&&S&&u!==null)try{a("embedded_wallet_recovery_started",{walletAddress:S.address}),await n?.recover({address:S.address,accessToken:B,recoveryPin:u}),w(""),P?l(P):i({shouldCallAuthOnSuccess:!1}),T?.(S),a("embedded_wallet_recovery_completed",{walletAddress:S.address})}catch(q){Fm(q)?w("Invalid recovery password, please try again."):w("An error has occurred, please try again.")}finally{b(!1)}else return I("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!S&&C,children:"Recover your account"})]})]}),(0,Ee.jsx)(te,{}),(0,Ee.jsx)($,{protectedByPrivy:!0})]})},gw=cn.default.div`
1291
1291
  display: flex;
1292
1292
  flex-direction: column;
1293
1293
  align-items: center;
@@ -1309,26 +1309,26 @@ You will need this password to access your ${e} wallet on a new device. Please k
1309
1309
  font-weight: 400;
1310
1310
  line-height: 20px;
1311
1311
  }
1312
- `,ww=nn.default.div`
1312
+ `,vw=cn.default.div`
1313
1313
  display: flex;
1314
1314
  flex-direction: column;
1315
1315
  justify-content: space-between;
1316
- `,Cw=nn.default.div`
1316
+ `,ww=cn.default.div`
1317
1317
  line-height: 20px;
1318
1318
  height: 20px;
1319
1319
  font-size: 13px;
1320
1320
  color: var(--privy-color-error);
1321
1321
  text-align: left;
1322
1322
  margin-top: 0.5rem;
1323
- `,bw=(0,nn.default)(U)`
1324
- ${e=>e.hideAnimations&&nn.css`
1323
+ `,Cw=(0,cn.default)(U)`
1324
+ ${e=>e.hideAnimations&&cn.css`
1325
1325
  && {
1326
1326
  // Remove animations because the recoverWallet task on the iframe partially
1327
1327
  // blocks the renderer, so the animation stutters and doesn't look good
1328
1328
  transition: none;
1329
1329
  }
1330
1330
  `}
1331
- `;var Vf=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),zf=h(require("@heroicons/react/24/outline/PhoneIcon")),zs=h(require("styled-components"));var $e=require("react/jsx-runtime"),Ew=e=>{let t=(0,$e.jsx)(Vf.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof T)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 ze&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,$e.jsx)(zf.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof ct)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,$e.jsx)(Os,{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,$e.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,$e.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 No&&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}}},$f=()=>{let{navigate:e,navigateBack:t,data:o,lastScreen:r,currentScreen:n}=_(),{reset:i}=Ee(),a=o?.errorModalData,l=Ew(a?.error||new Error),s=c=>{if(c instanceof ct)switch(c.privyErrorCode){case"invalid_captcha":return()=>i()}return()=>{}};return(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)(k,{backFn:!r||n===r?void 0:t}),(0,$e.jsxs)(Pw,{children:[(0,$e.jsx)(xw,{children:(0,$e.jsxs)("div",{children:[(0,$e.jsx)(Ls,{color:"var(--privy-color-error)"}),l.icon]})}),(0,$e.jsxs)(Tw,{children:[(0,$e.jsx)("h3",{children:l.title}),(0,$e.jsx)("p",{children:l.detail})]}),(0,$e.jsx)(U,{color:"var(--privy-color-error)",onClick:()=>{s(a?.error||new Error)(),e(r||"LANDING",!1)},children:l.ctaText})]})]})},Pw=zs.default.div`
1331
+ `;var $f=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),qf=h(require("@heroicons/react/24/outline/PhoneIcon")),Gs=h(require("styled-components"));var $e=require("react/jsx-runtime"),bw=e=>{let t=(0,$e.jsx)($f.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof x)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 ze&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,$e.jsx)(qf.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof lt)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,$e.jsx)(Ws,{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,$e.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,$e.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 Dr&&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}}},jf=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=A(),{reset:i}=be(),a=r?.errorModalData,l=bw(a?.error||new Error),s=c=>{if(c instanceof lt)switch(c.privyErrorCode){case"invalid_captcha":return()=>i()}return()=>{}};return(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)(k,{backFn:!o||n===o?void 0:t}),(0,$e.jsxs)(Ew,{children:[(0,$e.jsx)(Tw,{children:(0,$e.jsxs)("div",{children:[(0,$e.jsx)(Ms,{color:"var(--privy-color-error)"}),l.icon]})}),(0,$e.jsxs)(Pw,{children:[(0,$e.jsx)("h3",{children:l.title}),(0,$e.jsx)("p",{children:l.detail})]}),(0,$e.jsx)(U,{color:"var(--privy-color-error)",onClick:()=>{s(a?.error||new Error)(),e(o||"LANDING",!1)},children:l.ctaText})]})]})},Ew=Gs.default.div`
1332
1332
  display: flex;
1333
1333
  flex-direction: column;
1334
1334
  align-items: center;
@@ -1336,11 +1336,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1336
1336
  gap: 24px;
1337
1337
  width: 100%;
1338
1338
  padding-bottom: 16px;
1339
- `,Tw=zs.default.div`
1339
+ `,Pw=Gs.default.div`
1340
1340
  display: flex;
1341
1341
  flex-direction: column;
1342
1342
  gap: 8px;
1343
- `,xw=zs.default.div`
1343
+ `,Tw=Gs.default.div`
1344
1344
  display: flex;
1345
1345
  flex-direction: column;
1346
1346
  justify-content: center;
@@ -1363,7 +1363,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1363
1363
  left: -19px;
1364
1364
  top: -19px;
1365
1365
  }
1366
- `;var ur=require("react"),Oc=require("react-device-detect"),Nc=h(require("styled-components"));var jf=require("react"),Kf=h(require("styled-components"));var Mc=require("react/jsx-runtime"),$s=({style:e,color:t,...o})=>(0,Mc.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},...o,children:(0,Mc.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var qs=require("react/jsx-runtime"),qf=({color:e,...t})=>(0,qs.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,qs.jsx)("g",{children:(0,qs.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 Yi=require("react/jsx-runtime"),ni=e=>{let[t,o]=(0,jf.useState)(!1);return(0,Yi.jsxs)(Sw,{color:e.color,onClick:()=>{o(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>o(!1),1500)},justCopied:t,children:[t?(0,Yi.jsx)($s,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,Yi.jsx)(qf,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},Sw=Kf.default.button`
1366
+ `;var yo=require("react"),Uc=require("react-device-detect"),Fc=h(require("styled-components"));var Yf=require("react"),Jf=h(require("styled-components"));var Oc=require("react/jsx-runtime"),Vs=({style:e,color:t,...r})=>(0,Oc.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,Oc.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var zs=require("react/jsx-runtime"),Kf=({color:e,...t})=>(0,zs.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,zs.jsx)("g",{children:(0,zs.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 Ki=require("react/jsx-runtime"),ai=e=>{let[t,r]=(0,Yf.useState)(!1);return(0,Ki.jsxs)(xw,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,Ki.jsx)(Vs,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,Ki.jsx)(Kf,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},xw=Jf.default.button`
1367
1367
  display: flex;
1368
1368
  align-items: center;
1369
1369
  gap: 6px;
@@ -1401,7 +1401,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1401
1401
  width: 14px;
1402
1402
  height: 14px;
1403
1403
  }
1404
- `;var Yf=require("react"),Jf=h(require("styled-components")),Qf=require("react/jsx-runtime"),Zf=e=>{let[t,o]=(0,Yf.useState)(!1);return(0,Qf.jsx)(_w,{color:e.color,onClick:()=>{o(!0),window.open(e.url,"_blank"),setTimeout(()=>o(!1),1500)},justOpened:t,children:e.text})},_w=Jf.default.button`
1404
+ `;var Zf=require("react"),Qf=h(require("styled-components")),eh=require("react/jsx-runtime"),Xf=e=>{let[t,r]=(0,Zf.useState)(!1);return(0,eh.jsx)(Sw,{color:e.color,onClick:()=>{r(!0),window.open(e.url,"_blank"),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},Sw=Qf.default.button`
1405
1405
  display: flex;
1406
1406
  align-items: center;
1407
1407
  gap: 6px;
@@ -1439,7 +1439,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1439
1439
  width: 14px;
1440
1440
  height: 14px;
1441
1441
  }
1442
- `;var th=h(require("qrcode")),oh=h(require("react")),rh=h(require("styled-components"));var Wc=require("react/jsx-runtime"),Xf=()=>(0,Wc.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,Wc.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var _e=require("react/jsx-runtime"),Vt=7,Lc=(e,t,o,r,n)=>{for(let i=t;i<t+r;i++)for(let a=o;a<o+n;a++){let l=e?.[a];l&&l[i]&&(l[i]=0)}return e},Aw=e=>{let t=th.default.create(e,{errorCorrectionLevel:"high"}).modules,o=Tp(Array.from(t.data),t.size);return o=Lc(o,0,0,Vt,Vt),o=Lc(o,o.length-Vt,0,Vt,Vt),o=Lc(o,0,o.length-Vt,Vt,Vt),o},kw=({x:e,y:t,cellSize:o,bgColor:r,fgColor:n})=>(0,_e.jsx)(_e.Fragment,{children:[0,1,2].map(i=>(0,_e.jsx)("circle",{r:o*(Vt-i*2)/2,cx:e+o*Vt/2,cy:t+o*Vt/2,fill:i%2!==0?r:n},`finder-${e}-${t}-${i}`))}),Rw=({cellSize:e,matrixSize:t,bgColor:o,fgColor:r})=>{let n=[[0,0],[(t-Vt)*e,0],[0,(t-Vt)*e]];return(0,_e.jsx)(_e.Fragment,{children:n.map(([i,a])=>(0,_e.jsx)(kw,{x:i,y:a,cellSize:e,bgColor:o,fgColor:r},`finder-${i}-${a}`))})},Iw=({matrix:e,cellSize:t,color:o})=>(0,_e.jsx)(_e.Fragment,{children:e.map((r,n)=>r.map((i,a)=>i?(0,_e.jsx)("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:o},`circle-${n}-${a}`):(0,_e.jsx)(oh.default.Fragment,{},`circle-${n}-${a}`)))}),eh=(e,t)=>e-e%t,Mw=({outputSize:e,cellSize:t,element:o,size:r,padding:n,bgColor:i})=>{if(!o)return(0,_e.jsx)(_e.Fragment,{});let a=r||40,l=n||4,s=o,c=e/2-a/2-l;return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)("rect",{x:eh(c,t),y:eh(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),(0,_e.jsx)(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},Ww=e=>{let t=e.outputSize,o=Aw(e.url),r=t/o.length;return(0,_e.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,_e.jsx)(Iw,{matrix:o,cellSize:r,color:e.fgColor}),(0,_e.jsx)(Rw,{cellSize:r,matrixSize:o.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,_e.jsx)(Mw,{outputSize:e.outputSize,cellSize:r,element:e.logo?.element,bgColor:e.bgColor})]})},Lw=rh.default.div`
1442
+ `;var oh=h(require("qrcode")),nh=h(require("react")),ih=h(require("styled-components"));var Nc=require("react/jsx-runtime"),th=()=>(0,Nc.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,Nc.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var Se=require("react/jsx-runtime"),$t=7,Dc=(e,t,r,o,n)=>{for(let i=t;i<t+o;i++)for(let a=r;a<r+n;a++){let l=e?.[a];l&&l[i]&&(l[i]=0)}return e},_w=e=>{let t=oh.default.create(e,{errorCorrectionLevel:"high"}).modules,r=Sp(Array.from(t.data),t.size);return r=Dc(r,0,0,$t,$t),r=Dc(r,r.length-$t,0,$t,$t),r=Dc(r,0,r.length-$t,$t,$t),r},Aw=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>(0,Se.jsx)(Se.Fragment,{children:[0,1,2].map(i=>(0,Se.jsx)("circle",{r:r*($t-i*2)/2,cx:e+r*$t/2,cy:t+r*$t/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),kw=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-$t)*e,0],[0,(t-$t)*e]];return(0,Se.jsx)(Se.Fragment,{children:n.map(([i,a])=>(0,Se.jsx)(Aw,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},Rw=({matrix:e,cellSize:t,color:r})=>(0,Se.jsx)(Se.Fragment,{children:e.map((o,n)=>o.map((i,a)=>i?(0,Se.jsx)("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:r},`circle-${n}-${a}`):(0,Se.jsx)(nh.default.Fragment,{},`circle-${n}-${a}`)))}),rh=(e,t)=>e-e%t,Iw=({outputSize:e,cellSize:t,element:r,size:o,padding:n,bgColor:i})=>{if(!r)return(0,Se.jsx)(Se.Fragment,{});let a=o||40,l=n||4,s=r,c=e/2-a/2-l;return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)("rect",{x:rh(c,t),y:rh(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),(0,Se.jsx)(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},Mw=e=>{let t=e.outputSize,r=_w(e.url),o=t/r.length;return(0,Se.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,Se.jsx)(Rw,{matrix:r,cellSize:o,color:e.fgColor}),(0,Se.jsx)(kw,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,Se.jsx)(Iw,{outputSize:e.outputSize,cellSize:o,element:e.logo?.element,bgColor:e.bgColor})]})},Ww=ih.default.div`
1443
1443
  display: flex;
1444
1444
  justify-content: center;
1445
1445
  align-items: center;
@@ -1454,7 +1454,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1454
1454
  border-color: ${e=>e.fgColor};
1455
1455
  border-radius: var(--privy-border-radius-md);
1456
1456
  }
1457
- `,js=e=>{let t=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",r=e.size||160;return(0,_e.jsx)(Lw,{size:r,bgColor:t,fgColor:o,children:(0,_e.jsx)(Ww,{url:e.url,logo:{element:e.squareLogoElement??Xf},outputSize:r,bgColor:t,fgColor:o})})};var an=require("react/jsx-runtime"),Ji=({style:e,...t})=>(0,an.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,an.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,an.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,an.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,an.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var ae=require("react/jsx-runtime"),nh="#8a63d2",ah=1e3,Ow=ah*2,Nw=ah*120,sh=()=>{let{ready:e,authenticated:t,user:o}=G(),{lastScreen:r,navigate:n,navigateBack:i,setModalData:a,app:l}=_(),{getAuthFlow:s,loginWithFarcaster:c,closePrivyModal:u}=M(),[f,g]=(0,ur.useState)(void 0),[w,C]=(0,ur.useState)(!1),[E,x]=(0,ur.useState)(!1),b=(0,ur.useRef)([]),A=l?.render.inDialog?bt:0,W=s(),I=W?.meta.connectUri;return(0,ur.useEffect)(()=>{let S=Date.now(),B=setInterval(async()=>{let F=await W.pollForReady.execute(),q=Date.now()-S;if(F){clearInterval(B),C(!0);try{await c(),x(!0)}catch(R){let Z={retryable:!1,message:"Authentication failed"};if(R?.privyErrorCode==="allowlist_rejected"){n("ALLOWLIST_REJECTION_SCREEN");return}else R?.privyErrorCode==="linked_to_another_user"?Z.detail="This account has already been linked to another user.":R?.privyErrorCode==="invalid_credentials"?(Z.retryable=!0,Z.detail="Something went wrong. Try again."):R?.privyErrorCode==="too_many_requests"&&(Z.detail="Too many requests. Please wait before trying again.");g(Z)}}else q>Nw&&(clearInterval(B),g({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},Ow);return()=>{clearInterval(B),b.current.forEach(F=>clearTimeout(F))}},[]),(0,ur.useEffect)(()=>{if(e&&t&&E&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let B=setTimeout(()=>{n("AFFIRMATIVE_CONSENT_SCREEN")},A);return()=>clearTimeout(B)}E&&(Zt(o,l?.embeddedWallets.createOnLogin)?b.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:B=>console.error(B),callAuthOnSuccessOnClose:!0}}),n("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},A)):b.current.push(setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),A)))}},[E,e,t,o]),Oc.isMobile||w?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k,{backFn:r?i:void 0,onClose:u},"header"),(0,ae.jsx)(ee,{}),(0,ae.jsxs)(ih,{children:[(0,ae.jsx)(Dw,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(kr,{success:E,fail:!!f}),(0,ae.jsx)(Ji,{style:{width:"38px",height:"38px"}})]})}),(0,ae.jsxs)(so,{children:[(0,ae.jsx)(De,{children:f?f.message:"Signing in with Farcaster"}),(0,ae.jsx)(Me,{children:f?f.detail:"This should only take a moment"}),(0,ae.jsx)(ao,{children:I&&Oc.isMobile&&(0,ae.jsx)(Zf,{text:"Take me to Warpcast",url:I,color:nh})})]})]}),(0,ae.jsx)(ne,{})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k,{backFn:r?i:void 0,onClose:u},"header"),(0,ae.jsx)(ee,{}),(0,ae.jsx)(ih,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(De,{children:"Sign in with Farcaster"}),(0,ae.jsx)(Me,{children:"Scan with your phone's camera to continue."}),(0,ae.jsx)(Ds,{children:I?(0,ae.jsx)(js,{url:I,size:275,squareLogoElement:Ji}):(0,ae.jsx)(oo,{})}),(0,ae.jsxs)(ao,{children:[(0,ae.jsx)(Me,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),I&&(0,ae.jsx)(ni,{text:I,itemName:"link",color:nh})]})]})}),(0,ae.jsx)(ne,{})]})},ih=Nc.default.div`
1457
+ `,$s=e=>{let t=e.bgColor||"#FFFFFF",r=e.fgColor||"#000000",o=e.size||160;return(0,Se.jsx)(Ww,{size:o,bgColor:t,fgColor:r,children:(0,Se.jsx)(Mw,{url:e.url,logo:{element:e.squareLogoElement??th},outputSize:o,bgColor:t,fgColor:r})})};var dn=require("react/jsx-runtime"),Yi=({style:e,...t})=>(0,dn.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,dn.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,dn.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,dn.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,dn.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var ae=require("react/jsx-runtime"),ah="#8a63d2",lh=1e3,Lw=lh*2,Ow=lh*120,ch=()=>{let{ready:e,authenticated:t,user:r}=G(),{lastScreen:o,navigate:n,navigateBack:i,setModalData:a,app:l}=A(),{getAuthFlow:s,loginWithFarcaster:c,closePrivyModal:u}=W(),[f,g]=(0,yo.useState)(void 0),[w,C]=(0,yo.useState)(!1),[b,S]=(0,yo.useState)(!1),P=(0,yo.useRef)([]),T=l?.render.inDialog?bt:0,M=s(),I=M?.meta.connectUri;return(0,yo.useEffect)(()=>{let _=Date.now(),F=setInterval(async()=>{let B=await M.pollForReady.execute(),q=Date.now()-_;if(B){clearInterval(F),C(!0);try{await c(),S(!0)}catch(R){let Q={retryable:!1,message:"Authentication failed"};if(R?.privyErrorCode==="allowlist_rejected"){n("ALLOWLIST_REJECTION_SCREEN");return}else R?.privyErrorCode==="linked_to_another_user"?Q.detail="This account has already been linked to another user.":R?.privyErrorCode==="invalid_credentials"?(Q.retryable=!0,Q.detail="Something went wrong. Try again."):R?.privyErrorCode==="too_many_requests"&&(Q.detail="Too many requests. Please wait before trying again.");g(Q)}}else q>Ow&&(clearInterval(F),g({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},Lw);return()=>{clearInterval(F),P.current.forEach(B=>clearTimeout(B))}},[]),(0,yo.useEffect)(()=>{if(e&&t&&b&&r){if(l?.legal.requireUsersAcceptTerms&&!r.hasAcceptedTerms){let F=setTimeout(()=>{n("AFFIRMATIVE_CONSENT_SCREEN")},T);return()=>clearTimeout(F)}b&&(Xt(r,l?.embeddedWallets.createOnLogin)?P.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:F=>console.error(F),callAuthOnSuccessOnClose:!0}}),n("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},T)):P.current.push(setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),T)))}},[b,e,t,r]),Uc.isMobile||w?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k,{backFn:o?i:void 0,onClose:u},"header"),(0,ae.jsx)(ee,{}),(0,ae.jsxs)(sh,{children:[(0,ae.jsx)(Nw,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(Wo,{success:b,fail:!!f}),(0,ae.jsx)(Yi,{style:{width:"38px",height:"38px"}})]})}),(0,ae.jsxs)(cr,{children:[(0,ae.jsx)(Oe,{children:f?f.message:"Signing in with Farcaster"}),(0,ae.jsx)(Re,{children:f?f.detail:"This should only take a moment"}),(0,ae.jsx)(lr,{children:I&&Uc.isMobile&&(0,ae.jsx)(Xf,{text:"Take me to Warpcast",url:I,color:ah})})]})]}),(0,ae.jsx)(oe,{})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k,{backFn:o?i:void 0,onClose:u},"header"),(0,ae.jsx)(ee,{}),(0,ae.jsx)(sh,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(Oe,{children:"Sign in with Farcaster"}),(0,ae.jsx)(Re,{children:"Scan with your phone's camera to continue."}),(0,ae.jsx)(Os,{children:I?(0,ae.jsx)($s,{url:I,size:275,squareLogoElement:Yi}):(0,ae.jsx)(nr,{})}),(0,ae.jsxs)(lr,{children:[(0,ae.jsx)(Re,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),I&&(0,ae.jsx)(ai,{text:I,itemName:"link",color:ah})]})]})}),(0,ae.jsx)(oe,{})]})},sh=Fc.default.div`
1458
1458
  display: flex;
1459
1459
  flex-direction: column;
1460
1460
  align-items: center;
@@ -1462,7 +1462,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1462
1462
  margin-left: 27px;
1463
1463
  margin-right: 27px;
1464
1464
  gap: 24px;
1465
- `,Dw=Nc.default.div`
1465
+ `,Nw=Fc.default.div`
1466
1466
  display: flex;
1467
1467
  flex-direction: column;
1468
1468
  justify-content: center;
@@ -1485,7 +1485,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1485
1485
  left: -19px;
1486
1486
  top: -19px;
1487
1487
  }
1488
- `;var lh=h(require("@heroicons/react/24/outline/ClockIcon")),ch=h(require("@heroicons/react/24/outline/EyeSlashIcon")),dh=h(require("@heroicons/react/24/outline/LinkIcon")),Ao=h(require("styled-components"));var ii=require("react/jsx-runtime"),Ks=({size:e=61,...t})=>(0,ii.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,ii.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,ii.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,ii.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 Ce=require("react/jsx-runtime"),Dc=({title:e,desc:t,icon:o})=>(0,Ce.jsxs)(Vw,{children:[(0,Ce.jsx)($w,{children:o}),(0,Ce.jsxs)(zw,{children:[(0,Ce.jsx)(Hw,{children:e}),(0,Ce.jsx)(Gw,{children:t})]})]}),ph=({app:e,signedUrl:t,onContinue:o})=>(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)(Fw,{children:[(0,Ce.jsx)(Ks,{size:"3.75rem"}),(0,Ce.jsxs)(Bw,{children:[e?.name," uses ",(0,Ce.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,Ce.jsxs)(qw,{children:[(0,Ce.jsx)(Dc,{icon:(0,Ce.jsx)(dh.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,Ce.jsxs)(Ce.Fragment,{children:["Connect a payment method (",(0,Ce.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,Ce.jsx)(Dc,{icon:(0,Ce.jsx)(lh.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,Ce.jsx)(Dc,{icon:(0,Ce.jsx)(ch.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,Ce.jsx)(jw,{className:"mobile-only"})]}),(0,Ce.jsx)(Uw,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,Ce.jsx)(xs,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:o,children:"Continue to Moonpay"})]}),Uw=Ao.default.span`
1488
+ `;var dh=h(require("@heroicons/react/24/outline/ClockIcon")),ph=h(require("@heroicons/react/24/outline/EyeSlashIcon")),uh=h(require("@heroicons/react/24/outline/LinkIcon")),_r=h(require("styled-components"));var si=require("react/jsx-runtime"),qs=({size:e=61,...t})=>(0,si.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,si.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,si.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,si.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 ve=require("react/jsx-runtime"),Bc=({title:e,desc:t,icon:r})=>(0,ve.jsxs)(Gw,{children:[(0,ve.jsx)(zw,{children:r}),(0,ve.jsxs)(Vw,{children:[(0,ve.jsx)(Bw,{children:e}),(0,ve.jsx)(Hw,{children:t})]})]}),mh=({app:e,signedUrl:t,onContinue:r})=>(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsxs)(Uw,{children:[(0,ve.jsx)(qs,{size:"3.75rem"}),(0,ve.jsxs)(Fw,{children:[e?.name," uses ",(0,ve.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,ve.jsxs)($w,{children:[(0,ve.jsx)(Bc,{icon:(0,ve.jsx)(uh.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,ve.jsxs)(ve.Fragment,{children:["Connect a payment method (",(0,ve.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,ve.jsx)(Bc,{icon:(0,ve.jsx)(dh.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,ve.jsx)(Bc,{icon:(0,ve.jsx)(ph.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,ve.jsx)(qw,{className:"mobile-only"})]}),(0,ve.jsx)(Dw,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,ve.jsx)(Ps,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),Dw=_r.default.span`
1489
1489
  display: inline-block;
1490
1490
  color: var(--privy-color-foreground-3);
1491
1491
  text-align: center;
@@ -1494,13 +1494,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
1494
1494
  font-weight: 400;
1495
1495
  line-height: 140%; /* 0.875rem */
1496
1496
  margin-bottom: 0.25rem;
1497
- `,Fw=Ao.default.div`
1497
+ `,Uw=_r.default.div`
1498
1498
  display: flex;
1499
1499
  flex-direction: column;
1500
1500
  align-items: center;
1501
1501
  justify-content: center;
1502
1502
  padding: 1.5rem 0;
1503
- `,Bw=Ao.default.span`
1503
+ `,Fw=_r.default.span`
1504
1504
  color: var(--privy-color-foreground);
1505
1505
  text-align: center;
1506
1506
  font-size: 1.125rem;
@@ -1509,46 +1509,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
1509
1509
  margin: 1.5rem 0;
1510
1510
  text-align: center;
1511
1511
  max-width: 19.5rem;
1512
- `,Hw=Ao.default.span`
1512
+ `,Bw=_r.default.span`
1513
1513
  color: var(--privy-color-foreground);
1514
1514
  font-size: 0.875rem;
1515
1515
  font-weight: 500;
1516
1516
  line-height: 1.225rem;
1517
1517
  width: 100%;
1518
- `,Gw=Ao.default.span`
1518
+ `,Hw=_r.default.span`
1519
1519
  color: var(--privy-color-foreground-2);
1520
1520
  font-size: 0.875rem;
1521
1521
  font-weight: 400;
1522
1522
  line-height: 1.225rem;
1523
- `,Vw=Ao.default.div`
1523
+ `,Gw=_r.default.div`
1524
1524
  display: flex;
1525
1525
  align-items: flex-start;
1526
1526
  gap: 0.5rem;
1527
1527
  align-self: stretch;
1528
- `,zw=Ao.default.div`
1528
+ `,Vw=_r.default.div`
1529
1529
  display: flex;
1530
1530
  flex-direction: column;
1531
1531
  gap: 0.25rem;
1532
1532
  align-items: flex-start;
1533
1533
  text-align: left;
1534
1534
  flex: 1 0 0;
1535
- `,$w=Ao.default.div`
1535
+ `,zw=_r.default.div`
1536
1536
  padding-top: 2px;
1537
- `,qw=Ao.default.div`
1537
+ `,$w=_r.default.div`
1538
1538
  display: flex;
1539
1539
  flex-direction: column;
1540
1540
  gap: 1.25rem;
1541
1541
  margin: 0 0.5rem;
1542
- `,jw=Ao.default.div`
1542
+ `,qw=_r.default.div`
1543
1543
  margin: 30px 0;
1544
- `;var mh=require("ofetch"),ai=require("react");var Ys="moonpay",uh="sdk_fiat_on_ramp_completed_with_status";async function fh(e,t,o,r,n=!1){let i=o.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=o.uiConfig||{accentColor:r.accent,theme:r.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...o,...i,...a}})}async function Kw(e,t){let o=t?mp:up,r=t?hp:fp;return(0,mh.ofetch)(`${o}/transactions/ext/${e}`,{query:{apiKey:r}})}function hh(e,t=!1){let[o,r]=(0,ai.useState)(null),{createAnalyticsEvent:n}=M(),i=(0,ai.useRef)(0);return(0,ai.useEffect)(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await Kw(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;r(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n(uh,{status:s,provider:Ys,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(a))}catch(l){l.response?.status!==404&&(i.current+=1),i.current>=3&&(r("serviceFailure"),n(uh,{status:"serviceFailure",provider:Ys}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),o}var Ur=require("react/jsx-runtime"),yh=()=>{let{app:e,data:t,navigate:o}=_(),{createAnalyticsEvent:r}=M(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(k,{title:"Fund account"},"header"),(0,Ur.jsx)(ph,{app:e,signedUrl:n,onContinue:()=>{r("sdk_fiat_on_ramp_started",{provider:Ys}),o("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,Ur.jsx)($,{protectedByPrivy:!0})]})};var gh=h(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),vh=h(require("@heroicons/react/24/solid/CheckCircleIcon")),wh=h(require("@heroicons/react/24/solid/XCircleIcon")),Ch=require("react"),Uc=h(require("styled-components"));var he=require("react/jsx-runtime"),bh=()=>{let{app:e,data:t}=_(),{closePrivyModal:o}=M(),{externalTransactionId:r}=t?.fiatOnRampStatus,n=hh(r||null,e.fiatOnRamp.useSandbox);return(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)(k,{title:"Fund account"},"header"),(0,he.jsx)(Jw,{status:n,onClickCta:o}),(0,he.jsx)($,{protectedByPrivy:!0})]})},Yw=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,he.jsxs)(he.Fragment,{children:[(0,he.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,he.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,he.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:""}}},Jw=({status:e,onClickCta:t})=>{let{title:o,body:r,cta:n}=(0,Ch.useMemo)(()=>Yw(e),[e]);return(0,he.jsxs)(he.Fragment,{children:[(0,he.jsxs)(t2,{children:[(0,he.jsx)(Xw,{status:e}),(0,he.jsxs)(so,{children:[(0,he.jsx)("h3",{children:o}),(0,he.jsx)(e2,{children:r})]})]}),n&&(0,he.jsx)(U,{onClick:t,children:n})]})},Zw=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)",Qw=e=>{switch(e){case"serviceFailure":case"failed":return wh.default;case"completed":return vh.default;case"waitingAuthorization":return()=>(0,he.jsx)(gh.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}},Xw=({status:e})=>{if(!e||e==="pending"){let r="var(--privy-color-foreground-4)";return(0,he.jsxs)("div",{style:{position:"relative"},children:[(0,he.jsx)(oo,{color:r,style:{position:"absolute"}}),(0,he.jsx)(dc,{color:r}),(0,he.jsx)(Ks,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=Qw(e),o=Zw(e);return(0,he.jsx)("div",{style:{borderColor:o,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,he.jsx)(t,{width:"4rem",height:"4rem",color:o})})},e2=Uc.default.p`
1544
+ `;var hh=require("ofetch"),li=require("react");var js="moonpay",fh="sdk_fiat_on_ramp_completed_with_status";async function yh(e,t,r,o,n=!1){let i=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...i,...a}})}async function jw(e,t){let r=t?hp:fp,o=t?gp:yp;return(0,hh.ofetch)(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function gh(e,t=!1){let[r,o]=(0,li.useState)(null),{createAnalyticsEvent:n}=W(),i=(0,li.useRef)(0);return(0,li.useEffect)(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await jw(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;o(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n(fh,{status:s,provider:js,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(a))}catch(l){l.response?.status!==404&&(i.current+=1),i.current>=3&&(o("serviceFailure"),n(fh,{status:"serviceFailure",provider:js}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),r}var Go=require("react/jsx-runtime"),vh=()=>{let{app:e,data:t,navigate:r}=A(),{createAnalyticsEvent:o}=W(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(k,{title:"Fund account"},"header"),(0,Go.jsx)(mh,{app:e,signedUrl:n,onContinue:()=>{o("sdk_fiat_on_ramp_started",{provider:js}),r("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,Go.jsx)($,{protectedByPrivy:!0})]})};var wh=h(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),Ch=h(require("@heroicons/react/24/solid/CheckCircleIcon")),bh=h(require("@heroicons/react/24/solid/XCircleIcon")),Eh=require("react"),Hc=h(require("styled-components"));var fe=require("react/jsx-runtime"),Ph=()=>{let{app:e,data:t}=A(),{closePrivyModal:r}=W(),{externalTransactionId:o}=t?.fiatOnRampStatus,n=gh(o||null,e.fiatOnRamp.useSandbox);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(k,{title:"Fund account"},"header"),(0,fe.jsx)(Yw,{status:n,onClickCta:r}),(0,fe.jsx)($,{protectedByPrivy:!0})]})},Kw=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"failed":return{title:"Something went wrong!",body:(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,fe.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,fe.jsx)("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},Yw=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,Eh.useMemo)(()=>Kw(e),[e]);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsxs)(e0,{children:[(0,fe.jsx)(Qw,{status:e}),(0,fe.jsxs)(cr,{children:[(0,fe.jsx)("h3",{children:r}),(0,fe.jsx)(Xw,{children:o})]})]}),n&&(0,fe.jsx)(U,{onClick:t,children:n})]})},Jw=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)",Zw=e=>{switch(e){case"serviceFailure":case"failed":return bh.default;case"completed":return Ch.default;case"waitingAuthorization":return()=>(0,fe.jsx)(wh.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}},Qw=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return(0,fe.jsxs)("div",{style:{position:"relative"},children:[(0,fe.jsx)(nr,{color:o,style:{position:"absolute"}}),(0,fe.jsx)(mc,{color:o}),(0,fe.jsx)(qs,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=Zw(e),r=Jw(e);return(0,fe.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,fe.jsx)(t,{width:"4rem",height:"4rem",color:r})})},Xw=Hc.default.p`
1545
1545
  font-size: 1rem;
1546
1546
  color: var(--privy-color-foreground-3);
1547
1547
  margin-bottom: 1rem;
1548
1548
  display: flex;
1549
1549
  flex-direction: column;
1550
1550
  gap: 1rem;
1551
- `,t2=Uc.default.div`
1551
+ `,e0=Hc.default.div`
1552
1552
  display: flex;
1553
1553
  flex-direction: column;
1554
1554
  align-items: center;
@@ -1556,7 +1556,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1556
1556
  margin-left: 1.75rem;
1557
1557
  margin-right: 1.75rem;
1558
1558
  padding: 2rem 0;
1559
- `;var Eh=h(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),Ph=h(require("styled-components"));var zt=require("react/jsx-runtime"),Th=()=>{let{closePrivyModal:e}=M();return(0,zt.jsxs)(zt.Fragment,{children:[(0,zt.jsx)(k,{},"header"),(0,zt.jsx)(o2,{children:(0,zt.jsx)(Eh.default,{style:{width:32,height:32}})}),(0,zt.jsx)(Go,{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,zt.jsx)(io,{children:(0,zt.jsx)(U,{onClick:()=>e(),children:"Close"})}),(0,zt.jsx)(te,{}),(0,zt.jsx)($,{protectedByPrivy:!0})]})},o2=Ph.default.div`
1559
+ `;var Th=h(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),xh=h(require("styled-components"));var qt=require("react/jsx-runtime"),Sh=()=>{let{closePrivyModal:e}=W();return(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(k,{},"header"),(0,qt.jsx)(t0,{children:(0,qt.jsx)(Th.default,{style:{width:32,height:32}})}),(0,qt.jsx)(Vr,{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,qt.jsx)(sr,{children:(0,qt.jsx)(U,{onClick:()=>e(),children:"Close"})}),(0,qt.jsx)(te,{}),(0,qt.jsx)($,{protectedByPrivy:!0})]})},t0=xh.default.div`
1560
1560
  border-radius: 50%;
1561
1561
  height: 68px;
1562
1562
  width: 68px;
@@ -1566,18 +1566,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1566
1566
  background-color: var(--privy-color-accent);
1567
1567
  color: white;
1568
1568
  margin: 0 auto 24px auto;
1569
- `;var _h=h(require("react-device-detect")),Ah=h(require("styled-components"));var Js=h(require("styled-components"));var Fc=require("react/jsx-runtime"),xh=({style:e,...t})=>(0,Fc.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,Fc.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 Qs=require("react/jsx-runtime"),Sh=Js.default.div`
1569
+ `;var kh=h(require("react-device-detect")),Rh=h(require("styled-components"));var Ks=h(require("styled-components"));var Gc=require("react/jsx-runtime"),_h=({style:e,...t})=>(0,Gc.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,Gc.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 Js=require("react/jsx-runtime"),Ah=Ks.default.div`
1570
1570
  display: flex;
1571
1571
  flex-direction: column;
1572
1572
  justify-content: flex-start;
1573
1573
  gap: 4px;
1574
- `,Bc=Js.default.div`
1574
+ `,Vc=Ks.default.div`
1575
1575
  &&& {
1576
1576
  margin-left: 7px; /* TODO: This is a total hack */
1577
1577
  border-left: 2px solid var(--privy-color-foreground-4);
1578
1578
  height: 12px;
1579
1579
  }
1580
- `,Zs=({children:e})=>(0,Qs.jsxs)(r2,{children:[(0,Qs.jsx)(xh,{style:{width:"16px",height:"16px"}}),e]}),r2=Js.default.div`
1580
+ `,Ys=({children:e})=>(0,Js.jsxs)(r0,{children:[(0,Js.jsx)(_h,{style:{width:"16px",height:"16px"}}),e]}),r0=Ks.default.div`
1581
1581
  display: flex;
1582
1582
  justify-content: flex-start;
1583
1583
  justify-items: center;
@@ -1595,15 +1595,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
1595
1595
  margin-bottom: auto;
1596
1596
  }
1597
1597
  }
1598
- `;var Te=require("react/jsx-runtime"),n2=()=>(0,Te.jsxs)(i2,{children:[(0,Te.jsx)(Hi,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,Te.jsx)(ao,{children:(0,Te.jsx)(Uo,{style:{width:"152px",height:"152px"}})}),(0,Te.jsxs)(Sh,{children:[(0,Te.jsx)(Zs,{children:(0,Te.jsxs)("div",{children:[(0,Te.jsx)("span",{children:"Install the "}),(0,Te.jsx)("a",{href:_h.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,Te.jsx)(Bc,{}),(0,Te.jsx)(Zs,{children:"Set up your first wallet"}),(0,Te.jsx)(Bc,{}),(0,Te.jsx)(Zs,{children:"Store your recovery phrase in a safe place!"})]}),(0,Te.jsx)(Ss,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),kh=()=>{let{navigateBack:e}=_();return(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(k,{backFn:e},"header"),(0,Te.jsx)(ee,{}),(0,Te.jsx)(n2,{}),(0,Te.jsx)(te,{}),(0,Te.jsxs)(ne,{children:[(0,Te.jsx)("span",{children:"Still not sure? "}),(0,Te.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},i2=(0,Ah.default)(ao)`
1598
+ `;var Pe=require("react/jsx-runtime"),o0=()=>(0,Pe.jsxs)(n0,{children:[(0,Pe.jsx)(Bi,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,Pe.jsx)(lr,{children:(0,Pe.jsx)(Fr,{style:{width:"152px",height:"152px"}})}),(0,Pe.jsxs)(Ah,{children:[(0,Pe.jsx)(Ys,{children:(0,Pe.jsxs)("div",{children:[(0,Pe.jsx)("span",{children:"Install the "}),(0,Pe.jsx)("a",{href:kh.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,Pe.jsx)(Vc,{}),(0,Pe.jsx)(Ys,{children:"Set up your first wallet"}),(0,Pe.jsx)(Vc,{}),(0,Pe.jsx)(Ys,{children:"Store your recovery phrase in a safe place!"})]}),(0,Pe.jsx)(Ts,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),Ih=()=>{let{navigateBack:e}=A();return(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(k,{backFn:e},"header"),(0,Pe.jsx)(ee,{}),(0,Pe.jsx)(o0,{}),(0,Pe.jsx)(te,{}),(0,Pe.jsxs)(oe,{children:[(0,Pe.jsx)("span",{children:"Still not sure? "}),(0,Pe.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},n0=(0,Rh.default)(lr)`
1599
1599
  gap: 30px;
1600
1600
 
1601
1601
  > :first-child > svg {
1602
1602
  margin-top: 20px;
1603
1603
  }
1604
- `;var Gh=h(require("@heroicons/react/24/outline/UserCircleIcon")),ra=require("react"),Vh=require("react-device-detect"),zh=h(require("styled-components"));var Ih=h(require("@heroicons/react/24/outline/EnvelopeIcon")),Mh=require("react");var Rh=h(require("@heroicons/react/24/outline/EnvelopeIcon")),Zi=require("react"),Hc=h(require("styled-components"));var ko=require("react/jsx-runtime"),Xs=(0,Zi.forwardRef)((e,t)=>{let[o,r]=(0,Zi.useState)(""),[n,i]=(0,Zi.useState)(!1),{authenticated:a}=G(),{initLoginWithEmail:l}=M(),{navigate:s,setModalData:c,currentScreen:u}=_(),{enabled:f,token:g}=Ee(),w=Da(o),C=n,E=n||!w,x=A=>{i(!0),l(o,A).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(W=>{c({errorModalData:{error:W,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},b=()=>{f&&!g&&!a?(c({captchaModalData:{callback:A=>l(o,A),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):x(g)};return(0,ko.jsxs)(ko.Fragment,{children:[(0,ko.jsx)(a2,{children:(0,ko.jsxs)(s2,{stacked:e.stacked,children:[(0,ko.jsx)(Rh.default,{}),(0,ko.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:A=>r(A.target.value),onKeyUp:A=>{A.key==="Enter"&&b()},value:o,autoComplete:"email"}),e.stacked?null:(0,ko.jsx)(Fn,{isSubmitting:C,onClick:b,disabled:E,children:"Submit"})]})}),e.stacked?(0,ko.jsx)(U,{loadingText:null,loading:C,disabled:E,onClick:b,children:"Submit"}):null]})}),a2=Hc.default.div`
1604
+ `;var zh=h(require("@heroicons/react/24/outline/UserCircleIcon")),ra=require("react"),$h=require("react-device-detect"),qh=h(require("styled-components"));var Wh=h(require("@heroicons/react/24/outline/EnvelopeIcon")),Lh=require("react");var Mh=h(require("@heroicons/react/24/outline/EnvelopeIcon")),Ji=require("react"),zc=h(require("styled-components"));var Ar=require("react/jsx-runtime"),Zs=(0,Ji.forwardRef)((e,t)=>{let[r,o]=(0,Ji.useState)(""),[n,i]=(0,Ji.useState)(!1),{authenticated:a}=G(),{initLoginWithEmail:l}=W(),{navigate:s,setModalData:c,currentScreen:u}=A(),{enabled:f,token:g}=be(),w=Oa(r),C=n,b=n||!w,S=T=>{i(!0),l(r,T).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(M=>{c({errorModalData:{error:M,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},P=()=>{f&&!g&&!a?(c({captchaModalData:{callback:T=>l(r,T),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):S(g)};return(0,Ar.jsxs)(Ar.Fragment,{children:[(0,Ar.jsx)(i0,{children:(0,Ar.jsxs)(a0,{stacked:e.stacked,children:[(0,Ar.jsx)(Mh.default,{}),(0,Ar.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:T=>o(T.target.value),onKeyUp:T=>{T.key==="Enter"&&P()},value:r,autoComplete:"email"}),e.stacked?null:(0,Ar.jsx)(Hn,{isSubmitting:C,onClick:P,disabled:b,children:"Submit"})]})}),e.stacked?(0,Ar.jsx)(U,{loadingText:null,loading:C,disabled:b,onClick:P,children:"Submit"}):null]})}),i0=zc.default.div`
1605
1605
  width: 100%;
1606
- `,s2=Hc.default.label`
1606
+ `,a0=zc.default.label`
1607
1607
  display: block;
1608
1608
  position: relative;
1609
1609
  width: 100%;
@@ -1666,9 +1666,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1666
1666
  && > input::placeholder {
1667
1667
  color: var(--privy-color-foreground-3);
1668
1668
  }
1669
- `;var $o=require("react/jsx-runtime"),el=({isEditable:e,setIsEditable:t})=>{let o=(0,Mh.useRef)(null);return(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)(ar,{if:!e,children:(0,$o.jsx)(Xs,{ref:o})}),(0,$o.jsx)(ar,{if:e,children:(0,$o.jsxs)(Ne,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[(0,$o.jsx)(Ih.default,{})," Continue with Email"]})})]})};var Wh=require("react");var si=require("react/jsx-runtime"),tl=()=>{let[e,t]=(0,Wh.useState)(!1),{currentScreen:o,navigate:r,setModalData:n}=_(),{enabled:i,token:a}=Ee(),{initLoginWithFarcaster:l}=M();return(0,si.jsxs)(Ne,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:c=>l(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await l(a),r("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:o||"LANDING"}}),r("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,si.jsx)(Ji,{})," Farcaster",e&&(0,si.jsx)("span",{children:(0,si.jsx)(Zr,{})})]})};var Fh=h(require("@heroicons/react/24/outline/PhoneIcon")),Bh=require("react");var li=require("react"),Gc=h(require("styled-components"));var Lh=h(require("libphonenumber-js/examples.mobile.json")),$t=require("libphonenumber-js/min"),rl=require("react/jsx-runtime");var Qi=(e,t)=>(0,$t.isPossiblePhoneNumber)(String(e),t),ol=(e,t)=>`+${(0,$t.getCountryCallingCode)(t)} ${e}`,Oh=e=>`*${e.replaceAll("-","").slice(-4)}`,Nh=e=>new $t.AsYouType(e),l2=(0,$t.getCountries)().map(e=>({code:e,callCode:(0,$t.getCountryCallingCode)(e)})),Dh=e=>{let t=(0,$t.getExampleNumber)(e,Lh.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},Uh=({value:e,onChange:t})=>(0,rl.jsx)("select",{value:e,onChange:t,children:l2.map(o=>(0,rl.jsxs)("option",{value:o.code,children:[o.code," +",o.callCode]},o.code))});var Ro=require("react/jsx-runtime"),ci=(0,li.forwardRef)((e,t)=>{let{app:o}=_(),[r,n]=(0,li.useState)(""),[i,a]=(0,li.useState)(o?.intl.defaultCountry??"US"),l=Qi(r,i),s=Nh(i),c=Dh(i),u=(0,$t.getCountryCallingCode)(i),f=!l,[g,w]=(0,li.useState)(!1),C=u.length,E=A=>{let W=A.target.value;a(W),n(""),e.onChange&&e.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:ol(r,W),countryCode:W,isValid:Qi(r,i)})},x=A=>{try{let W=A.replace(/\D/g,""),I=r.replace(/\D/g,""),S=W===I?A:s.input(A);n(S),e.onChange&&e.onChange({rawPhoneNumber:S,qualifiedPhoneNumber:ol(A,i),countryCode:i,isValid:Qi(A,i)})}catch(W){console.error("Error processing phone number:",W)}},b=()=>{w(!0);let A=ol(r,i);e.onSubmit({rawPhoneNumber:r,qualifiedPhoneNumber:A,countryCode:i,isValid:Qi(r,i)}).finally(()=>w(!1))};return(0,Ro.jsxs)(Ro.Fragment,{children:[(0,Ro.jsx)(c2,{children:(0,Ro.jsxs)(d2,{callingCodeLength:C,stacked:e.stacked,children:[(0,Ro.jsx)(Uh,{value:i,onChange:E}),(0,Ro.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:A=>{x(A.target.value)},onKeyUp:A=>{A.key==="Enter"&&b()},value:r,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,Ro.jsx)(Fn,{isSubmitting:g,onClick:b,disabled:f,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,Ro.jsx)(U,{loading:g,loadingText:null,onClick:b,disabled:f,children:"Submit"}):null]})}),c2=Gc.default.div`
1669
+ `;var qr=require("react/jsx-runtime"),Qs=({isEditable:e,setIsEditable:t})=>{let r=(0,Lh.useRef)(null);return(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(co,{if:!e,children:(0,qr.jsx)(Zs,{ref:r})}),(0,qr.jsx)(co,{if:e,children:(0,qr.jsxs)(Le,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,qr.jsx)(Wh.default,{})," Continue with Email"]})})]})};var Oh=require("react");var ci=require("react/jsx-runtime"),Xs=()=>{let[e,t]=(0,Oh.useState)(!1),{currentScreen:r,navigate:o,setModalData:n}=A(),{enabled:i,token:a}=be(),{initLoginWithFarcaster:l}=W();return(0,ci.jsxs)(Le,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:c=>l(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,ci.jsx)(Yi,{})," Farcaster",e&&(0,ci.jsx)("span",{children:(0,ci.jsx)(tn,{})})]})};var Hh=h(require("@heroicons/react/24/outline/PhoneIcon")),Gh=require("react");var di=require("react"),$c=h(require("styled-components"));var Nh=h(require("libphonenumber-js/examples.mobile.json")),jt=require("libphonenumber-js/min"),tl=require("react/jsx-runtime");var Zi=(e,t)=>(0,jt.isPossiblePhoneNumber)(String(e),t),el=(e,t)=>`+${(0,jt.getCountryCallingCode)(t)} ${e}`,Dh=e=>`*${e.replaceAll("-","").slice(-4)}`,Uh=e=>new jt.AsYouType(e),s0=(0,jt.getCountries)().map(e=>({code:e,callCode:(0,jt.getCountryCallingCode)(e)})),Fh=e=>{let t=(0,jt.getExampleNumber)(e,Nh.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},Bh=({value:e,onChange:t})=>(0,tl.jsx)("select",{value:e,onChange:t,children:s0.map(r=>(0,tl.jsxs)("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});var kr=require("react/jsx-runtime"),pi=(0,di.forwardRef)((e,t)=>{let{app:r}=A(),[o,n]=(0,di.useState)(""),[i,a]=(0,di.useState)(r?.intl.defaultCountry??"US"),l=Zi(o,i),s=Uh(i),c=Fh(i),u=(0,jt.getCountryCallingCode)(i),f=!l,[g,w]=(0,di.useState)(!1),C=u.length,b=T=>{let M=T.target.value;a(M),n(""),e.onChange&&e.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:el(o,M),countryCode:M,isValid:Zi(o,i)})},S=T=>{try{let M=T.replace(/\D/g,""),I=o.replace(/\D/g,""),_=M===I?T:s.input(T);n(_),e.onChange&&e.onChange({rawPhoneNumber:_,qualifiedPhoneNumber:el(T,i),countryCode:i,isValid:Zi(T,i)})}catch(M){console.error("Error processing phone number:",M)}},P=()=>{w(!0);let T=el(o,i);e.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:T,countryCode:i,isValid:Zi(o,i)}).finally(()=>w(!1))};return(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(l0,{children:(0,kr.jsxs)(c0,{callingCodeLength:C,stacked:e.stacked,children:[(0,kr.jsx)(Bh,{value:i,onChange:b}),(0,kr.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:T=>{S(T.target.value)},onKeyUp:T=>{T.key==="Enter"&&P()},value:o,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,kr.jsx)(Hn,{isSubmitting:g,onClick:P,disabled:f,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,kr.jsx)(U,{loading:g,loadingText:null,onClick:P,disabled:f,children:"Submit"}):null]})}),l0=$c.default.div`
1670
1670
  width: 100%;
1671
- `,d2=Gc.default.label`
1671
+ `,c0=$c.default.label`
1672
1672
  --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
1673
1673
  --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
1674
1674
  display: block;
@@ -1759,11 +1759,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1759
1759
  && > input::placeholder {
1760
1760
  color: var(--privy-color-foreground-3);
1761
1761
  }
1762
- `;var qo=require("react/jsx-runtime"),nl=({isEditable:e,setIsEditable:t})=>{let o=(0,Bh.useRef)(null),{authenticated:r}=G(),{navigate:n,setModalData:i,currentScreen:a}=_(),{initLoginWithSms:l}=M(),{enabled:s,token:c}=Ee();async function u({qualifiedPhoneNumber:f}){if(s&&!c&&!r)i({captchaModalData:{callback:g=>l(f,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(f,c),n("AWAITING_PASSWORDLESS_CODE")}catch(g){i({errorModalData:{error:g,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,qo.jsxs)(qo.Fragment,{children:[(0,qo.jsx)(ar,{if:!e,children:(0,qo.jsx)(ci,{ref:o,onSubmit:u})}),(0,qo.jsx)(ar,{if:e,children:(0,qo.jsxs)(Ne,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[(0,qo.jsx)(Fh.default,{})," Continue with SMS"]})})]})};var Xi=require("react/jsx-runtime"),il=({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 Fr=require("react/jsx-runtime"),al=({style:e,...t})=>(0,Fr.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,Fr.jsx)("g",{clipPath:"url(#clip0)",children:(0,Fr.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,Fr.jsx)("defs",{children:(0,Fr.jsx)("clipPath",{id:"clip0",children:(0,Fr.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Vc=require("react/jsx-runtime"),sl=({style:e,...t})=>(0,Vc.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,Vc.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 sn=require("react/jsx-runtime"),ll=({style:e,...t})=>(0,sn.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,sn.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,sn.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,sn.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,sn.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 cl({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 dl(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 di=require("react/jsx-runtime");function pl(e){return(0,di.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,di.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,di.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,di.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 zc=require("react/jsx-runtime"),ul=({style:e,...t})=>(0,zc.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,zc.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 Io=require("react/jsx-runtime"),p2={apple:{logo:(0,Io.jsx)(il,{}),displayName:"Apple"},discord:{logo:(0,Io.jsx)(al,{}),displayName:"Discord"},github:{logo:(0,Io.jsx)(sl,{}),displayName:"GitHub"},google:{logo:(0,Io.jsx)(ll,{}),displayName:"Google"},linkedin:{logo:(0,Io.jsx)(cl,{}),displayName:"LinkedIn"},spotify:{logo:(0,Io.jsx)(dl,{}),displayName:"Spotify"},twitter:{logo:(0,Io.jsx)(ul,{}),displayName:"Twitter"},tiktok:{logo:(0,Io.jsx)(pl,{}),displayName:"TikTok"}},rt=({provider:e})=>{let{enabled:t,token:o}=Ee(),{navigate:r,setModalData:n}=_(),{initLoginWithOAuth:i}=M(),{displayName:a,logo:l}=p2[e];return(0,Io.jsxs)(Ne,{onClick:()=>{t&&!o?(n({captchaModalData:{callback:c=>i(e,c),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):i(e)},children:[l," ",a]})};var Hh=h(require("@heroicons/react/24/outline/ChevronRightIcon"));var oa=require("react/jsx-runtime"),ml=({onClick:e,text:t,icon:o})=>(0,oa.jsxs)(Ne,{onClick:e,children:[o,(0,oa.jsx)(As,{children:t}),(0,oa.jsx)(Hh.default,{})]});var be=require("react/jsx-runtime"),hl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=M(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=_(),i=r.loginMethodsAndOrder?.primary??[],a=r.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=(0,ra.useState)("default"),[u,f]=(0,ra.useState)("email");(0,ra.useEffect)(()=>{let S=l.indexOf("sms"),B=l.indexOf("email");S>-1&&S<B&&f("sms")},[i,a]);let g=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=g;let w=S=>S==="email"?(0,be.jsx)(el,{isEditable:u==="email",setIsEditable:()=>{f("email")}},S):S==="sms"?(0,be.jsx)(nl,{isEditable:u==="sms",setIsEditable:()=>{f("sms")}},S):S==="apple"?(0,be.jsx)(rt,{provider:"apple"},S):S==="discord"?(0,be.jsx)(rt,{provider:"discord"},S):S==="farcaster"?(0,be.jsx)(tl,{},S):S==="github"?(0,be.jsx)(rt,{provider:"github"},S):S==="google"?(0,be.jsx)(rt,{provider:"google"},S):S==="linkedin"?(0,be.jsx)(rt,{provider:"linkedin"},S):S==="tiktok"?(0,be.jsx)(rt,{provider:"tiktok"},S):S==="twitter"&&(!Vh.isMobile||r?.loginConfig.twitterOAuthOnMobileEnabled)?(0,be.jsx)(rt,{provider:"twitter"},S):Gi([S],o,e,l),C=i.map(w).flat(),E=a.map(w).flat(),x=[...C,...E],b=u2({primary:C.length,overflow:E.length}),[A,W]=Pp(x,b);return(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(k,{title:"Log in or sign up",onClose:g,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&(0,be.jsx)(m2,{}),(0,be.jsx)(ks,{style:{overflow:"hidden",padding:2},children:(0,be.jsxs)(no,{children:[s==="default"&&(0,be.jsxs)(be.Fragment,{children:[...A,W.length>0&&(0,be.jsx)(ml,{text:"More options",icon:(0,be.jsx)(Gh.default,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&(0,be.jsxs)(be.Fragment,{children:[...W]})]})}),r&&(0,be.jsx)(Bn,{app:r}),(0,be.jsx)($,{protectedByPrivy:!0})]})},fl=5,u2=({primary:e,overflow:t})=>e<fl?e:e===fl&&t===0?fl:fl-1,m2=(0,zh.default)(zn)`
1762
+ `;var jr=require("react/jsx-runtime"),rl=({isEditable:e,setIsEditable:t})=>{let r=(0,Gh.useRef)(null),{authenticated:o}=G(),{navigate:n,setModalData:i,currentScreen:a}=A(),{initLoginWithSms:l}=W(),{enabled:s,token:c}=be();async function u({qualifiedPhoneNumber:f}){if(s&&!c&&!o)i({captchaModalData:{callback:g=>l(f,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(f,c),n("AWAITING_PASSWORDLESS_CODE")}catch(g){i({errorModalData:{error:g,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,jr.jsxs)(jr.Fragment,{children:[(0,jr.jsx)(co,{if:!e,children:(0,jr.jsx)(pi,{ref:r,onSubmit:u})}),(0,jr.jsx)(co,{if:e,children:(0,jr.jsxs)(Le,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,jr.jsx)(Hh.default,{})," Continue with SMS"]})})]})};var Qi=require("react/jsx-runtime"),ol=({style:e,...t})=>(0,Qi.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,Qi.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,Qi.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"),nl=({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 qc=require("react/jsx-runtime"),il=({style:e,...t})=>(0,qc.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,qc.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 pn=require("react/jsx-runtime"),al=({style:e,...t})=>(0,pn.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,pn.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,pn.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,pn.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,pn.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 Xi=require("react/jsx-runtime");function sl({style:e,...t}){return(0,Xi.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,Xi.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,Xi.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,Xi.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 ea=require("react/jsx-runtime");function ll(e){return(0,ea.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,ea.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,ea.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 ui=require("react/jsx-runtime");function cl(e){return(0,ui.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,ui.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,ui.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,ui.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 jc=require("react/jsx-runtime"),dl=({style:e,...t})=>(0,jc.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,jc.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 Rr=require("react/jsx-runtime"),d0={apple:{logo:(0,Rr.jsx)(ol,{}),displayName:"Apple"},discord:{logo:(0,Rr.jsx)(nl,{}),displayName:"Discord"},github:{logo:(0,Rr.jsx)(il,{}),displayName:"GitHub"},google:{logo:(0,Rr.jsx)(al,{}),displayName:"Google"},linkedin:{logo:(0,Rr.jsx)(sl,{}),displayName:"LinkedIn"},spotify:{logo:(0,Rr.jsx)(ll,{}),displayName:"Spotify"},twitter:{logo:(0,Rr.jsx)(dl,{}),displayName:"Twitter"},tiktok:{logo:(0,Rr.jsx)(cl,{}),displayName:"TikTok"}},ot=({provider:e})=>{let{enabled:t,token:r}=be(),{navigate:o,setModalData:n}=A(),{initLoginWithOAuth:i}=W(),{displayName:a,logo:l}=d0[e];return(0,Rr.jsxs)(Le,{onClick:()=>{t&&!r?(n({captchaModalData:{callback:c=>i(e,c),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):i(e)},children:[l," ",a]})};var Vh=h(require("@heroicons/react/24/outline/ChevronRightIcon"));var ta=require("react/jsx-runtime"),pl=({onClick:e,text:t,icon:r})=>(0,ta.jsxs)(Le,{onClick:e,children:[r,(0,ta.jsx)(Ss,{children:t}),(0,ta.jsx)(Vh.default,{})]});var we=require("react/jsx-runtime"),ml=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=A(),i=o.loginMethodsAndOrder?.primary??[],a=o.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=(0,ra.useState)("default"),[u,f]=(0,ra.useState)("email");(0,ra.useEffect)(()=>{let _=l.indexOf("sms"),F=l.indexOf("email");_>-1&&_<F&&f("sms")},[i,a]);let g=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=g;let w=_=>_==="email"?(0,we.jsx)(Qs,{isEditable:u==="email",setIsEditable:()=>{f("email")}},_):_==="sms"?(0,we.jsx)(rl,{isEditable:u==="sms",setIsEditable:()=>{f("sms")}},_):_==="apple"?(0,we.jsx)(ot,{provider:"apple"},_):_==="discord"?(0,we.jsx)(ot,{provider:"discord"},_):_==="farcaster"?(0,we.jsx)(Xs,{},_):_==="github"?(0,we.jsx)(ot,{provider:"github"},_):_==="google"?(0,we.jsx)(ot,{provider:"google"},_):_==="linkedin"?(0,we.jsx)(ot,{provider:"linkedin"},_):_==="tiktok"?(0,we.jsx)(ot,{provider:"tiktok"},_):_==="twitter"&&(!$h.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)?(0,we.jsx)(ot,{provider:"twitter"},_):Hi([_],r,e,l),C=i.map(w).flat(),b=a.map(w).flat(),S=[...C,...b],P=p0({primary:C.length,overflow:b.length}),[T,M]=xp(S,P);return(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(k,{title:"Log in or sign up",onClose:g,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&(0,we.jsx)(u0,{}),(0,we.jsx)(_s,{style:{overflow:"hidden",padding:2},children:(0,we.jsxs)(ar,{children:[s==="default"&&(0,we.jsxs)(we.Fragment,{children:[...T,M.length>0&&(0,we.jsx)(pl,{text:"More options",icon:(0,we.jsx)(zh.default,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&(0,we.jsxs)(we.Fragment,{children:[...M]})]})}),o&&(0,we.jsx)(Gn,{app:o}),(0,we.jsx)($,{protectedByPrivy:!0})]})},ul=5,p0=({primary:e,overflow:t})=>e<ul?e:e===ul&&t===0?ul:ul-1,u0=(0,qh.default)(qn)`
1763
1763
  margin-bottom: 16px;
1764
- `;var Yh=h(require("@heroicons/react/24/outline/EnvelopeIcon")),Jh=h(require("@heroicons/react/24/outline/PhoneIcon")),Zh=h(require("@heroicons/react/24/outline/UserCircleIcon")),na=require("react"),Qh=require("react-device-detect"),Xh=h(require("styled-components"));var mr=require("react/jsx-runtime"),$h=({...e})=>(0,mr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,mr.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,mr.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,mr.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,mr.jsx)("defs",{children:(0,mr.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,mr.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var qh=h(require("@heroicons/react/24/outline/ChevronRightIcon")),jh=h(require("@heroicons/react/24/outline/WalletIcon"));var pi=require("react/jsx-runtime"),Kh=({onClick:e,text:t})=>(0,pi.jsxs)(Ne,{onClick:e,children:[(0,pi.jsx)(jh.default,{}),(0,pi.jsx)(As,{children:t}),(0,pi.jsx)(qh.default,{})]});var oe=require("react/jsx-runtime"),yl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=M(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=_(),{email:i,sms:a,google:l,twitter:s,discord:c,github:u,spotify:f,tiktok:g,linkedin:w,apple:C,wallet:E,farcaster:x}=r?.loginMethods??{},b=r?.appearance.loginGroupPriority||"web2-first",A=r?.appearance.hideDirectWeb2Inputs,[W,I]=(0,na.useState)("default"),[S,B]=(0,na.useState)(i?"email":"sms");(0,na.useEffect)(()=>{B(i?"email":"sms")},[i]);let F=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{I("default")},150)};n.current=F;let q=[i&&(0,oe.jsx)(el,{isEditable:S==="email",setIsEditable:()=>{B("email")}}),a&&(0,oe.jsx)(nl,{isEditable:S==="sms",setIsEditable:()=>{B("sms")}})].filter(Boolean),R=[l&&(0,oe.jsx)(rt,{provider:"google"}),s&&(!Qh.isMobile||r?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,oe.jsx)(rt,{provider:"twitter"}),c&&(0,oe.jsx)(rt,{provider:"discord"}),u&&(0,oe.jsx)(rt,{provider:"github"}),f&&(0,oe.jsx)(rt,{provider:"spotify"}),g&&(0,oe.jsx)(rt,{provider:"tiktok"}),w&&(0,oe.jsx)(rt,{provider:"linkedin"}),C&&(0,oe.jsx)(rt,{provider:"apple"}),x&&(0,oe.jsx)(tl,{})].filter(Boolean),Z=Gi(r.appearance.walletList,o,e,r.appearance.walletList),D=W==="default"?void 0:()=>{I("default")},Y=h2({priority:b,email:i,sms:a,social:R}),K=y2({priority:b,email:i,sms:a,social:R}),re=g2({priority:b,email:i,sms:a,social:R}),ue=(0,oe.jsx)(Kh,{text:re,onClick:()=>I("web3-overflow")}),J=(0,oe.jsx)(ml,{text:Y,icon:K,onClick:()=>I("web2-overflow")}),it=A?0:1;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(k,{title:"Log in or sign up",onClose:F,backFn:D}),W==="default"&&(0,oe.jsx)(f2,{}),(0,oe.jsx)(ks,{style:{overflow:"hidden",padding:2},children:(0,oe.jsxs)(no,{children:[W==="default"&&b==="web2-first"&&(0,oe.jsxs)(oe.Fragment,{children:[...q,...R.length+q.length>4?R.slice(0,3-q.length):R,q.length+R.length>4&&J,E&&ue]}),W==="default"&&b==="web3-first"&&(0,oe.jsxs)(oe.Fragment,{children:[E&&(0,oe.jsxs)(oe.Fragment,{children:[...Z.length>4?Z.slice(0,3):Z,Z.length>4&&ue]}),q.length+R.length>it&&J,q.length+R.length===it&&q.length?q[0]:null,q.length+R.length===it&&R.length?R[0]:null]}),W==="web2-overflow"&&(0,oe.jsxs)(oe.Fragment,{children:[...b==="web3-first"?q:[],...R]}),...W==="web3-overflow"?Z:[]]})}),r&&(0,oe.jsx)(Bn,{app:r}),(0,oe.jsx)($,{protectedByPrivy:!0})]})},f2=(0,Xh.default)(zn)`
1764
+ `;var Zh=h(require("@heroicons/react/24/outline/EnvelopeIcon")),Qh=h(require("@heroicons/react/24/outline/PhoneIcon")),Xh=h(require("@heroicons/react/24/outline/UserCircleIcon")),oa=require("react"),ey=require("react-device-detect"),ty=h(require("styled-components"));var go=require("react/jsx-runtime"),jh=({...e})=>(0,go.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,go.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,go.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,go.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,go.jsx)("defs",{children:(0,go.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,go.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var Kh=h(require("@heroicons/react/24/outline/ChevronRightIcon")),Yh=h(require("@heroicons/react/24/outline/WalletIcon"));var mi=require("react/jsx-runtime"),Jh=({onClick:e,text:t})=>(0,mi.jsxs)(Le,{onClick:e,children:[(0,mi.jsx)(Yh.default,{}),(0,mi.jsx)(Ss,{children:t}),(0,mi.jsx)(Kh.default,{})]});var re=require("react/jsx-runtime"),fl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=A(),{email:i,sms:a,google:l,twitter:s,discord:c,github:u,spotify:f,tiktok:g,linkedin:w,apple:C,wallet:b,farcaster:S}=o?.loginMethods??{},P=o?.appearance.loginGroupPriority||"web2-first",T=o?.appearance.hideDirectWeb2Inputs,[M,I]=(0,oa.useState)("default"),[_,F]=(0,oa.useState)(i?"email":"sms");(0,oa.useEffect)(()=>{F(i?"email":"sms")},[i]);let B=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{I("default")},150)};n.current=B;let q=[i&&(0,re.jsx)(Qs,{isEditable:_==="email",setIsEditable:()=>{F("email")}}),a&&(0,re.jsx)(rl,{isEditable:_==="sms",setIsEditable:()=>{F("sms")}})].filter(Boolean),R=[l&&(0,re.jsx)(ot,{provider:"google"}),s&&(!ey.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,re.jsx)(ot,{provider:"twitter"}),c&&(0,re.jsx)(ot,{provider:"discord"}),u&&(0,re.jsx)(ot,{provider:"github"}),f&&(0,re.jsx)(ot,{provider:"spotify"}),g&&(0,re.jsx)(ot,{provider:"tiktok"}),w&&(0,re.jsx)(ot,{provider:"linkedin"}),C&&(0,re.jsx)(ot,{provider:"apple"}),S&&(0,re.jsx)(Xs,{})].filter(Boolean),Q=Hi(o.appearance.walletList,r,e,o.appearance.walletList),D=M==="default"?void 0:()=>{I("default")},Y=f0({priority:P,email:i,sms:a,social:R}),K=h0({priority:P,email:i,sms:a,social:R}),ie=y0({priority:P,email:i,sms:a,social:R}),Ce=(0,re.jsx)(Jh,{text:ie,onClick:()=>I("web3-overflow")}),J=(0,re.jsx)(pl,{text:Y,icon:K,onClick:()=>I("web2-overflow")}),it=T?0:1;return(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(k,{title:"Log in or sign up",onClose:B,backFn:D}),M==="default"&&(0,re.jsx)(m0,{}),(0,re.jsx)(_s,{style:{overflow:"hidden",padding:2},children:(0,re.jsxs)(ar,{children:[M==="default"&&P==="web2-first"&&(0,re.jsxs)(re.Fragment,{children:[...q,...R.length+q.length>4?R.slice(0,3-q.length):R,q.length+R.length>4&&J,b&&Ce]}),M==="default"&&P==="web3-first"&&(0,re.jsxs)(re.Fragment,{children:[b&&(0,re.jsxs)(re.Fragment,{children:[...Q.length>4?Q.slice(0,3):Q,Q.length>4&&Ce]}),q.length+R.length>it&&J,q.length+R.length===it&&q.length?q[0]:null,q.length+R.length===it&&R.length?R[0]:null]}),M==="web2-overflow"&&(0,re.jsxs)(re.Fragment,{children:[...P==="web3-first"?q:[],...R]}),...M==="web3-overflow"?Q:[]]})}),o&&(0,re.jsx)(Gn,{app:o}),(0,re.jsx)($,{protectedByPrivy:!0})]})},m0=(0,ty.default)(qn)`
1765
1765
  margin-bottom: 16px;
1766
- `,h2=({priority:e,email:t,sms:o,social:r})=>e==="web2-first"?"Other socials":t&&o&&r.length>0||t&&r.length>0?"Log in with email or socials":o&&r.length>0?"Log in with sms or socials":t&&o?"Continue with email or sms":t?"Continue with email":o?"Continue with sms":"Log in with a social account",y2=({priority:e,email:t,sms:o,social:r})=>e==="web2-first"||r.length>0?(0,oe.jsx)(Zh.default,{}):t&&o?(0,oe.jsx)($h,{}):t?(0,oe.jsx)(Yh.default,{}):o?(0,oe.jsx)(Jh.default,{}):null,g2=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var $c=require("react/jsx-runtime"),ey=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,$c.jsx)(hl,{connectOnly:!0}):(0,$c.jsx)(yl,{connectOnly:!0})};var qc=require("react/jsx-runtime"),ty=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,qc.jsx)(hl,{connectOnly:!1}):(0,qc.jsx)(yl,{connectOnly:!1})};var oy=h(require("@heroicons/react/24/outline/EnvelopeIcon"));var qt=require("react/jsx-runtime"),ry=()=>{let{app:e}=_();return(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(k,{},"header"),(0,qt.jsx)(ee,{}),(0,qt.jsx)(Ue,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,qt.jsx)(oy.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,qt.jsx)(io,{children:(0,qt.jsx)(Xs,{stacked:!0})}),(0,qt.jsx)(te,{}),(0,qt.jsx)($,{protectedByPrivy:!0})]})};var ny=h(require("@heroicons/react/24/outline/PhoneIcon"));var jt=require("react/jsx-runtime"),iy=()=>{let{app:e,currentScreen:t,data:o,navigate:r,setModalData:n}=_(),{initLoginWithSms:i}=M();async function a({qualifiedPhoneNumber:l}){try{await i(l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:o?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return(0,jt.jsxs)(jt.Fragment,{children:[(0,jt.jsx)(k,{},"header"),(0,jt.jsx)(ee,{}),(0,jt.jsx)(Ue,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,jt.jsx)(ny.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,jt.jsx)(io,{children:(0,jt.jsx)(ci,{stacked:!0,onSubmit:a})}),(0,jt.jsx)(te,{}),(0,jt.jsx)($,{protectedByPrivy:!0})]})};var jo=require("react/jsx-runtime"),ay=()=>{let{linkingHint:e}=M(),{app:t}=_(),o=e?`Select the wallet with ${Er(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(k,{},"header"),(0,jo.jsx)(Go,{title:`${e?"Reconnect":"Connect"} your wallet`,description:o}),(0,jo.jsx)(no,{children:(0,jo.jsx)(Vn,{connectOnly:!1})}),(0,jo.jsx)($,{protectedByPrivy:!0})]})};var ia=require("react/jsx-runtime"),sy=({style:e,...t})=>(0,ia.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,ia.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,ia.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 Ot=require("react/jsx-runtime"),ly=()=>{let{closePrivyModal:e}=M(),{navigate:t}=_();return(0,Ot.jsxs)(Ot.Fragment,{children:[(0,Ot.jsx)(k,{},"header"),(0,Ot.jsx)(ee,{}),(0,Ot.jsx)(sy,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Ot.jsx)(Go,{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,Ot.jsxs)(io,{children:[(0,Ot.jsx)(U,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Ot.jsx)(bo,{onClick:()=>e(),children:"Cancel"})]}),(0,Ot.jsx)(te,{}),(0,Ot.jsx)($,{protectedByPrivy:!0})]})};var Yc=h(require("@heroicons/react/20/solid/CheckIcon")),Cy=h(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),by=h(require("@heroicons/react/24/outline/FingerPrintIcon")),Ey=h(require("@heroicons/react/24/outline/PhoneIcon")),Jc=h(require("@heroicons/react/24/outline/TrashIcon")),Py=h(require("@heroicons/react/24/solid/CheckBadgeIcon")),Zc=h(require("@heroicons/react/24/solid/CheckCircleIcon")),Qc=h(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Ty=h(require("@heroicons/react/24/solid/IdentificationIcon")),Cl=h(require("@heroicons/react/24/solid/PhoneIcon")),wl=h(require("@heroicons/react/24/solid/ShieldCheckIcon")),Kt=require("react");var vl=require("react"),uy=require("react-device-detect"),Kc=h(require("styled-components"));var ln=require("@headlessui/react"),gl=h(require("react")),cn=h(require("styled-components")),fr=require("react/jsx-runtime"),cy=({children:e,open:t,onClick:o,...r})=>(0,fr.jsx)(ln.Transition,{show:t,as:gl.default.Fragment,children:(0,fr.jsxs)(ln.Dialog,{onClose:o,...r,as:w2,children:[(0,fr.jsx)(ln.Transition.Child,{as:gl.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,fr.jsx)(v2,{"aria-hidden":"true"})}),(0,fr.jsx)(C2,{children:(0,fr.jsx)(ln.Transition.Child,{as:gl.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,fr.jsx)(ln.Dialog.Panel,{as:b2,children:e})})})]})}),ui=cn.default.div`
1766
+ `,f0=({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",h0=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,re.jsx)(Xh.default,{}):t&&r?(0,re.jsx)(jh,{}):t?(0,re.jsx)(Zh.default,{}):r?(0,re.jsx)(Qh.default,{}):null,y0=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var Kc=require("react/jsx-runtime"),ry=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Kc.jsx)(ml,{connectOnly:!0}):(0,Kc.jsx)(fl,{connectOnly:!0})};var Yc=require("react/jsx-runtime"),oy=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Yc.jsx)(ml,{connectOnly:!1}):(0,Yc.jsx)(fl,{connectOnly:!1})};var ny=h(require("@heroicons/react/24/outline/EnvelopeIcon"));var Kt=require("react/jsx-runtime"),iy=()=>{let{app:e}=A();return(0,Kt.jsxs)(Kt.Fragment,{children:[(0,Kt.jsx)(k,{},"header"),(0,Kt.jsx)(ee,{}),(0,Kt.jsx)(Ne,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Kt.jsx)(ny.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Kt.jsx)(sr,{children:(0,Kt.jsx)(Zs,{stacked:!0})}),(0,Kt.jsx)(te,{}),(0,Kt.jsx)($,{protectedByPrivy:!0})]})};var ay=h(require("@heroicons/react/24/outline/PhoneIcon"));var Yt=require("react/jsx-runtime"),sy=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=A(),{initLoginWithSms:i}=W();async function a({qualifiedPhoneNumber:l}){try{await i(l),o("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(k,{},"header"),(0,Yt.jsx)(ee,{}),(0,Yt.jsx)(Ne,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Yt.jsx)(ay.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Yt.jsx)(sr,{children:(0,Yt.jsx)(pi,{stacked:!0,onSubmit:a})}),(0,Yt.jsx)(te,{}),(0,Yt.jsx)($,{protectedByPrivy:!0})]})};var Kr=require("react/jsx-runtime"),ly=()=>{let{linkingHint:e}=W(),{app:t}=A(),r=e?`Select the wallet with ${So(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(k,{},"header"),(0,Kr.jsx)(Vr,{title:`${e?"Reconnect":"Connect"} your wallet`,description:r}),(0,Kr.jsx)(ar,{children:(0,Kr.jsx)($n,{connectOnly:!1})}),(0,Kr.jsx)($,{protectedByPrivy:!0})]})};var na=require("react/jsx-runtime"),cy=({style:e,...t})=>(0,na.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,na.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,na.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 Ot=require("react/jsx-runtime"),dy=()=>{let{closePrivyModal:e}=W(),{navigate:t}=A();return(0,Ot.jsxs)(Ot.Fragment,{children:[(0,Ot.jsx)(k,{},"header"),(0,Ot.jsx)(ee,{}),(0,Ot.jsx)(cy,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Ot.jsx)(Vr,{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,Ot.jsxs)(sr,{children:[(0,Ot.jsx)(U,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Ot.jsx)(Cr,{onClick:()=>e(),children:"Cancel"})]}),(0,Ot.jsx)(te,{}),(0,Ot.jsx)($,{protectedByPrivy:!0})]})};var Qc=h(require("@heroicons/react/20/solid/CheckIcon")),Ey=h(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),Py=h(require("@heroicons/react/24/outline/FingerPrintIcon")),Ty=h(require("@heroicons/react/24/outline/PhoneIcon")),Xc=h(require("@heroicons/react/24/outline/TrashIcon")),xy=h(require("@heroicons/react/24/solid/CheckBadgeIcon")),ed=h(require("@heroicons/react/24/solid/CheckCircleIcon")),td=h(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Sy=h(require("@heroicons/react/24/solid/IdentificationIcon")),vl=h(require("@heroicons/react/24/solid/PhoneIcon")),gl=h(require("@heroicons/react/24/solid/ShieldCheckIcon")),Jt=require("react");var yl=require("react"),fy=require("react-device-detect"),Zc=h(require("styled-components"));var un=require("@headlessui/react"),hl=h(require("react")),mn=h(require("styled-components")),vo=require("react/jsx-runtime"),py=({children:e,open:t,onClick:r,...o})=>(0,vo.jsx)(un.Transition,{show:t,as:hl.default.Fragment,children:(0,vo.jsxs)(un.Dialog,{onClose:r,...o,as:v0,children:[(0,vo.jsx)(un.Transition.Child,{as:hl.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,vo.jsx)(g0,{"aria-hidden":"true"})}),(0,vo.jsx)(w0,{children:(0,vo.jsx)(un.Transition.Child,{as:hl.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,vo.jsx)(un.Dialog.Panel,{as:C0,children:e})})})]})}),fi=mn.default.div`
1767
1767
  display: flex;
1768
1768
  flex-direction: column;
1769
1769
  text-align: center;
@@ -1786,7 +1786,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1786
1786
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
1787
1787
  border-radius: var(--privy-border-radius-lg);
1788
1788
  }
1789
- `,v2=cn.default.div`
1789
+ `,g0=mn.default.div`
1790
1790
  position: fixed;
1791
1791
  inset: 0;
1792
1792
 
@@ -1799,10 +1799,10 @@ You will need this password to access your ${e} wallet on a new device. Please k
1799
1799
  backdrop-filter: unset;
1800
1800
  -webkit-backdrop-filter: unset;
1801
1801
  }
1802
- `,w2=cn.default.div`
1802
+ `,v0=mn.default.div`
1803
1803
  position: relative;
1804
1804
  z-index: 999999;
1805
- `,C2=cn.default.div`
1805
+ `,w0=mn.default.div`
1806
1806
  position: fixed;
1807
1807
  inset: 0;
1808
1808
  display: flex;
@@ -1810,7 +1810,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1810
1810
  justify-content: center;
1811
1811
  width: 100vw;
1812
1812
  min-height: 100vh;
1813
- `,b2=cn.default.div`
1813
+ `,C0=mn.default.div`
1814
1814
  // reset some default dialog styles
1815
1815
  padding: 0;
1816
1816
  background: transparent;
@@ -1857,19 +1857,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
1857
1857
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
1858
1858
  border-radius: var(--privy-border-radius-lg);
1859
1859
  }
1860
- `,dy=cn.default.div`
1860
+ `,uy=mn.default.div`
1861
1861
  display: flex;
1862
1862
  flex-direction: column;
1863
1863
  align-items: center;
1864
1864
  justify-content: center;
1865
1865
  height: 100%;
1866
- `;var Ko=require("react/jsx-runtime"),aa=6,E2=new Array(aa).fill("");function P2(e){return e.replace(/\s+/g,"")}function jc(e){return/^[0-9]{1}$/.test(e)}function py(e){return e.length===aa&&e.every(jc)}function T2(e,t){return e.reduce((o,r)=>o+Number(t(r)),0)}var mi=({onChange:e,disabled:t,errorReasonOverride:o,success:r})=>{let[n,i]=(0,vl.useState)(E2),[a,l]=(0,vl.useState)(null),[s,c]=(0,vl.useState)(null),u=async C=>{C.preventDefault();let E=P2(C.currentTarget.value);if(E==="")return;let x=T2(n,jc),b=E.split(""),A=!b.every(jc),W=b.length+x>aa;if(A){l("Passcode can only be numbers"),c(1);return}if(W){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let I=Number(C.currentTarget.name?.charAt(4)),S=[...E||[""]].slice(0,aa-I),B=[...n.slice(0,I),...S,...n.slice(I+S.length)];i(B);let F=S.length,q=Math.min(Math.max(I+F,0),aa-1);if(document.querySelector(`input[name=pin-${q}]`)?.focus(),py(B))try{await e(B.join("")),document.querySelector(`input[name=pin-${q}]`)?.blur()}catch(Z){c(1),l(Z.message)}else try{await e(null)}catch(Z){c(1),l(Z.message)}},f=C=>{s===1&&(l(null),c(null));let E=[...n.slice(0,C),"",...n.slice(C+1)];i(E),C>0&&document.querySelector(`input[name=pin-${C-1}]`)?.focus(),py(E)?e(E.join("")):e(null)},w=r?"success":!!(o||a)?"fail":"";return(0,Ko.jsx)(Ko.Fragment,{children:(0,Ko.jsxs)(x2,{children:[(0,Ko.jsx)("div",{children:n.map((C,E)=>(0,Ko.jsx)("input",{name:`pin-${E}`,type:"text",value:n[E],onChange:u,onKeyUp:x=>{x.key==="Backspace"&&f(E)},inputMode:"numeric",autoFocus:E===0,pattern:"[0-9]",className:w,autoComplete:uy.isMobile?"one-time-code":"off",disabled:t},E))}),(0,Ko.jsx)("div",{children:(0,Ko.jsx)(S2,{fail:!!o||!!a,children:o||a})})]})})},x2=Kc.default.div`
1866
+ `;var Yr=require("react/jsx-runtime"),ia=6,b0=new Array(ia).fill("");function E0(e){return e.replace(/\s+/g,"")}function Jc(e){return/^[0-9]{1}$/.test(e)}function my(e){return e.length===ia&&e.every(Jc)}function P0(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var hi=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=(0,yl.useState)(b0),[a,l]=(0,yl.useState)(null),[s,c]=(0,yl.useState)(null),u=async C=>{C.preventDefault();let b=E0(C.currentTarget.value);if(b==="")return;let S=P0(n,Jc),P=b.split(""),T=!P.every(Jc),M=P.length+S>ia;if(T){l("Passcode can only be numbers"),c(1);return}if(M){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let I=Number(C.currentTarget.name?.charAt(4)),_=[...b||[""]].slice(0,ia-I),F=[...n.slice(0,I),..._,...n.slice(I+_.length)];i(F);let B=_.length,q=Math.min(Math.max(I+B,0),ia-1);if(document.querySelector(`input[name=pin-${q}]`)?.focus(),my(F))try{await e(F.join("")),document.querySelector(`input[name=pin-${q}]`)?.blur()}catch(Q){c(1),l(Q.message)}else try{await e(null)}catch(Q){c(1),l(Q.message)}},f=C=>{s===1&&(l(null),c(null));let b=[...n.slice(0,C),"",...n.slice(C+1)];i(b),C>0&&document.querySelector(`input[name=pin-${C-1}]`)?.focus(),my(b)?e(b.join("")):e(null)},w=o?"success":!!(r||a)?"fail":"";return(0,Yr.jsx)(Yr.Fragment,{children:(0,Yr.jsxs)(T0,{children:[(0,Yr.jsx)("div",{children:n.map((C,b)=>(0,Yr.jsx)("input",{name:`pin-${b}`,type:"text",value:n[b],onChange:u,onKeyUp:S=>{S.key==="Backspace"&&f(b)},inputMode:"numeric",autoFocus:b===0,pattern:"[0-9]",className:w,autoComplete:fy.isMobile?"one-time-code":"off",disabled:t},b))}),(0,Yr.jsx)("div",{children:(0,Yr.jsx)(x0,{fail:!!r||!!a,children:r||a})})]})})},T0=Zc.default.div`
1867
1867
  display: flex;
1868
1868
  flex-direction: column;
1869
1869
  width: 100%;
1870
1870
  gap: 8px;
1871
1871
 
1872
- ${ui}[data-height='medium'] & {
1872
+ ${fi}[data-height='medium'] & {
1873
1873
  margin-top: 22px;
1874
1874
  }
1875
1875
 
@@ -1934,7 +1934,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1934
1934
  transform: translate(1px, 0px);
1935
1935
  }
1936
1936
  }
1937
- `,S2=Kc.default.div`
1937
+ `,x0=Zc.default.div`
1938
1938
  line-height: 20px;
1939
1939
  font-size: 13px;
1940
1940
  display: flex;
@@ -1942,7 +1942,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1942
1942
  width: 100%;
1943
1943
 
1944
1944
  color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1945
- `;var my=require("react");function dn(){let{promptMfa:e,init:t,submit:o,cancel:r}=(0,my.useContext)(de);return{promptMfa:e,init:t,submit:o,cancel:r}}var fy=require("react");function fi(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:r,unenroll:n,enrollInMfa:i}=(0,fy.useContext)(de);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:r,unenrollWithSms:()=>n("sms"),unenrollWithTotp:()=>n("totp"),showMfaEnrollmentModal:()=>i(!0),closeMfaEnrollmentModal:()=>i(!1)}}var hy=h(require("styled-components")),sa=require("react/jsx-runtime"),yy=e=>(0,sa.jsxs)(_2,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,sa.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,sa.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"})]}),_2=hy.default.svg`
1945
+ `;var hy=require("react");function fn(){let{promptMfa:e,init:t,submit:r,cancel:o}=(0,hy.useContext)(ce);return{promptMfa:e,init:t,submit:r,cancel:o}}var yy=require("react");function yi(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:o,unenroll:n,enrollInMfa:i}=(0,yy.useContext)(ce);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:o,unenrollWithSms:()=>n("sms"),unenrollWithTotp:()=>n("totp"),showMfaEnrollmentModal:()=>i(!0),closeMfaEnrollmentModal:()=>i(!1)}}var gy=h(require("styled-components")),aa=require("react/jsx-runtime"),vy=e=>(0,aa.jsxs)(S0,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,aa.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,aa.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"})]}),S0=gy.default.svg`
1946
1946
  height: 90px;
1947
1947
  width: 90px;
1948
1948
 
@@ -1953,7 +1953,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1953
1953
  > path {
1954
1954
  fill: white;
1955
1955
  }
1956
- `;var gy=h(require("@heroicons/react/24/solid/ShieldCheckIcon"));var wy=require("react/jsx-runtime");var vy=({size:e,authUrl:t})=>(0,wy.jsx)(js,{url:t,squareLogoElement:gy.default,size:e,fgColor:"#1F1F1F"});var m=require("react/jsx-runtime"),xy=()=>{let{user:e,enrollInMfa:t}=G(),[o,r]=(0,Kt.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i}=fi(),{app:a,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),{closePrivyModal:u}=M(),{promptMfa:f}=dn(),[g,w]=(0,Kt.useState)(s?.mfaEnrollmentFlow?.seenIntro||!1),[C,E]=(0,Kt.useState)(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),x=()=>{u({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{r(null),E(null)},500)};c.current=x;let b=e?.mfaMethods.includes("sms"),A=!!e?.phone,W=e?.mfaMethods.includes("totp"),I=b||W;(0,Kt.useEffect)(()=>{I&&w(!0)},[I]);function S(){r(null),E(null)}function B(){w(!1)}async function F(D){await f(),E(D)}if(!l||!e||!a)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:x},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(yy,{})}),(0,m.jsx)(Rr,{children:(0,m.jsx)(oo,{})}),(0,m.jsx)(ne,{})]});async function q(){r(null);try{await n()}catch{r(null)}}async function R(){r(null);try{await i()}catch{r(null)}}if(o==="sms")return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:S,onClose:x},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(Cl.default,{})})}),(0,m.jsx)(De,{children:"Remove SMS verification?"}),(0,m.jsxs)(Me,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,m.jsx)(Ir,{children:(0,m.jsx)(U,{warn:!0,onClick:q,children:"Remove SMS for MFA"})}),(0,m.jsx)(ne,{})]});if(o==="totp")return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:S,onClose:x},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(Qc.default,{})})}),(0,m.jsx)(De,{children:"Remove Authenticator App verification?"}),(0,m.jsxs)(Me,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,m.jsx)(Ir,{children:(0,m.jsx)(U,{warn:!0,onClick:R,children:"Remove Authenticator App for MFA"})}),(0,m.jsx)(ne,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!I)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:x},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(wl.default,{})})}),(0,m.jsx)(De,{children:"Add more security"}),(0,m.jsxs)(Me,{children:[a?.name," does not have any verification methods enabled."]}),(0,m.jsx)(Ir,{children:(0,m.jsx)(U,{onClick:x,children:"Close"})}),(0,m.jsx)(ne,{})]});let Z=!I&&!g;if(Z)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:x},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(wl.default,{})})}),(0,m.jsx)(De,{children:"Transaction Protection"}),(0,m.jsx)(Me,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,m.jsxs)(Vu,{children:[(0,m.jsxs)(hc,{children:[(0,m.jsx)(fc,{children:(0,m.jsx)(Py.default,{})}),"Enable 2-Step verification for your ",a?.name," wallet."]}),(0,m.jsxs)(hc,{children:[(0,m.jsx)(fc,{children:(0,m.jsx)(Ty.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,m.jsxs)(Ir,{children:[(0,m.jsx)(U,{onClick:()=>w(!0),children:"Continue"}),(0,m.jsx)(bo,{onClick:x,children:"Not now"})]}),(0,m.jsx)(ne,{})]});switch(C){case"sms":return(0,m.jsx)(A2,{onComplete:x,onReset:S,onClose:x});case"totp":return(0,m.jsx)(k2,{onComplete:x,onClose:x,onReset:S});default:return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:Z?B:void 0,onClose:x},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(wl.default,{})})}),(0,m.jsx)(De,{children:"Choose a verification method"}),I?(0,m.jsx)(Me,{children:"To add or delete verification methods, verification is required."}):(0,m.jsx)(Me,{children:"How would you like to verify your identity? You can change this later."}),(0,m.jsxs)(Rs,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||W)&&(0,m.jsxs)(Is,{children:[(0,m.jsx)(Ne,{disabled:W,onClick:()=>F("totp"),children:(0,m.jsxs)(Ws,{children:[(0,m.jsxs)(Ms,{children:[(0,m.jsx)(Cy.default,{}),"Authenticator App"]}),W?(0,m.jsxs)(Hn,{children:[(0,m.jsx)(Yc.default,{}),"Added"]}):(0,m.jsx)(Hn,{children:"Recommended"})]})}),W&&(0,m.jsx)(yc,{id:"remove",onClick:()=>r("totp"),children:(0,m.jsx)(Jc.default,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||b)&&(0,m.jsxs)(Is,{children:[(0,m.jsx)(Ne,{disabled:b||A,onClick:()=>F("sms"),children:(0,m.jsxs)(Ws,{children:[(0,m.jsxs)(Ms,{children:[(0,m.jsx)(Ey.default,{}),"SMS"]}),b&&(0,m.jsxs)(Hn,{children:[(0,m.jsx)(Yc.default,{}),"Added"]}),A&&(0,m.jsx)(Hn,{children:"Disabled"})]})}),b&&(0,m.jsx)(yc,{id:"remove",onClick:()=>r("sms"),children:(0,m.jsx)(Jc.default,{})})]},"sms"),(0,m.jsx)(Is,{children:(0,m.jsx)(Ne,{disabled:!0,children:(0,m.jsxs)(Ws,{children:[(0,m.jsxs)(Ms,{children:[(0,m.jsx)(by.default,{}),"Passkey"]}),(0,m.jsx)(Hn,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),(0,m.jsx)(ne,{})]})}},A2=({onComplete:e,onReset:t,onClose:o})=>{let[r,n]=(0,Kt.useState)(""),[i,a]=(0,Kt.useState)(!1),[l,s]=(0,Kt.useState)("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:u}=fi(),{app:f,data:g,currentScreen:w,navigate:C,setModalData:E}=_();function x(){g?.mfaEnrollmentFlow?.onSuccess(),e()}async function b({qualifiedPhoneNumber:I}){try{await c({phoneNumber:I}),n(I),s("verify")}catch(S){E({mfaEnrollmentFlow:g?.mfaEnrollmentFlow?{...g?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:S,previousScreen:w||"MFA_ENROLLMENT_FLOW_SCREEN"}}),C("ERROR_SCREEN")}}async function A(I){try{if(!I)return;await u({phoneNumber:r,mfaCode:I}),a(!0)}catch(S){throw _c(S)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):tn(S)?new Error("The code you entered is not valid"):en(S)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Ac(S)?new Error("Verification canceled"):new Error("Unknown error")}}function W(){l==="verify"?s("enroll"):t()}return l==="enroll"?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:t,onClose:o},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(Cl.default,{})})}),(0,m.jsx)(De,{children:"Set up SMS verification"}),(0,m.jsx)(Me,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,m.jsxs)(Rr,{children:[(0,m.jsx)(ci,{onSubmit:b}),(0,m.jsxs)(zu,{children:["By providing your mobile number, you agree to receive text messages from ",f?.name,". Some carrier charges may apply"]})]}),(0,m.jsx)(ne,{})]}):i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:x},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{status:"success",children:(0,m.jsx)(Zc.default,{})})}),(0,m.jsx)(De,{children:"SMS verification added"}),(0,m.jsx)(Me,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,m.jsx)(Ir,{children:(0,m.jsx)(U,{onClick:x,children:"Done"})}),(0,m.jsx)(ne,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:W,onClose:o},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(Cl.default,{})})}),(0,m.jsx)(De,{children:"Enter enrollment code"}),(0,m.jsxs)(Rr,{children:[(0,m.jsx)(mi,{onChange:A}),(0,m.jsxs)(Me,{children:["To continue, enter the 6-digit code sent to ",(0,m.jsx)("strong",{children:Oh(r)})]})]}),(0,m.jsx)(ne,{})]})},k2=({onComplete:e,onClose:t,onReset:o})=>{let[r,n]=(0,Kt.useState)("enroll"),[i,a]=(0,Kt.useState)(null),[l,s]=(0,Kt.useState)(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:u}=fi(),{data:f}=_();(0,Kt.useEffect)(()=>{a(null),c().then(x=>{a(x)}).catch(()=>{a(null),o()})},[]);function g(){f?.mfaEnrollmentFlow?.onSuccess(),e()}function w(){n("verify")}async function C(x){try{if(!x)return;await u({mfaCode:x}),s(!0)}catch(b){throw _c(b)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):tn(b)?new Error("The code you entered is not valid"):en(b)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Ac(b)?new Error("Verification canceled"):new Error("Unknown error")}}function E(){r==="verify"?n("enroll"):o()}return r==="enroll"?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:o,onClose:t},"header"),(0,m.jsx)(De,{children:"Scan QR code"}),(0,m.jsx)(Me,{children:"Open your authenticator app and scan the QR code to continue."}),(0,m.jsx)(Ds,{children:i?.authUrl?(0,m.jsx)(vy,{authUrl:i.authUrl,size:200}):(0,m.jsx)(oo,{})}),(0,m.jsxs)(Ir,{children:[(0,m.jsx)(ao,{children:i?.secret&&(0,m.jsx)(ni,{itemName:"secret",text:i.secret})}),(0,m.jsx)(U,{onClick:w,children:"Continue"})]}),(0,m.jsx)(ne,{})]}):l?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:g},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{status:"success",children:(0,m.jsx)(Zc.default,{})})}),(0,m.jsx)(De,{children:"Authenticator app verification added"}),(0,m.jsx)(Me,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,m.jsx)(Ir,{children:(0,m.jsx)(U,{onClick:g,children:"Done"})}),(0,m.jsx)(ne,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:E,onClose:t},"header"),(0,m.jsx)(mt,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(Qc.default,{})})}),(0,m.jsx)(De,{children:"Enter enrollment code"}),(0,m.jsx)(Rr,{children:(0,m.jsx)(mi,{onChange:C})}),(0,m.jsxs)(Me,{children:["To continue, enter the 6-digit code generated from your ",(0,m.jsx)("strong",{children:"authenticator app"})]}),(0,m.jsx)(ne,{})]})};var lg=h(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),cg=h(require("@heroicons/react/24/outline/PhoneIcon")),dg=h(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),pg=h(require("@heroicons/react/24/solid/PhoneIcon")),ug=h(require("@heroicons/react/24/solid/ShieldCheckIcon")),Pi=require("react");var ag=require("@ethersproject/providers"),mn=require("react"),sg=h(require("styled-components"));var id=h(require("styled-components"));var Xc=h(require("styled-components")),la=require("react/jsx-runtime"),bl=({label:e,children:t,valueStyles:o})=>(0,la.jsxs)(R2,{children:[(0,la.jsx)("div",{children:e}),(0,la.jsx)(I2,{style:{...o},children:t})]}),R2=Xc.default.div`
1956
+ `;var wy=h(require("@heroicons/react/24/solid/ShieldCheckIcon"));var by=require("react/jsx-runtime");var Cy=({size:e,authUrl:t})=>(0,by.jsx)($s,{url:t,squareLogoElement:wy.default,size:e,fgColor:"#1F1F1F"});var m=require("react/jsx-runtime"),_y=()=>{let{user:e,enrollInMfa:t}=G(),[r,o]=(0,Jt.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i}=yi(),{app:a,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),{closePrivyModal:u}=W(),{promptMfa:f}=fn(),[g,w]=(0,Jt.useState)(s?.mfaEnrollmentFlow?.seenIntro||!1),[C,b]=(0,Jt.useState)(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),S=()=>{u({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),b(null)},500)};c.current=S;let P=e?.mfaMethods.includes("sms"),T=!!e?.phone,M=e?.mfaMethods.includes("totp"),I=P||M;(0,Jt.useEffect)(()=>{I&&w(!0)},[I]);function _(){o(null),b(null)}function F(){w(!1)}async function B(D){await f(),b(D)}if(!l||!e||!a)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:S},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(vy,{})}),(0,m.jsx)(Lo,{children:(0,m.jsx)(nr,{})}),(0,m.jsx)(oe,{})]});async function q(){o(null);try{await n()}catch{o(null)}}async function R(){o(null);try{await i()}catch{o(null)}}if(r==="sms")return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:_,onClose:S},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(vl.default,{})})}),(0,m.jsx)(Oe,{children:"Remove SMS verification?"}),(0,m.jsxs)(Re,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,m.jsx)(Oo,{children:(0,m.jsx)(U,{warn:!0,onClick:q,children:"Remove SMS for MFA"})}),(0,m.jsx)(oe,{})]});if(r==="totp")return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:_,onClose:S},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(td.default,{})})}),(0,m.jsx)(Oe,{children:"Remove Authenticator App verification?"}),(0,m.jsxs)(Re,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,m.jsx)(Oo,{children:(0,m.jsx)(U,{warn:!0,onClick:R,children:"Remove Authenticator App for MFA"})}),(0,m.jsx)(oe,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!I)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:S},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(gl.default,{})})}),(0,m.jsx)(Oe,{children:"Add more security"}),(0,m.jsxs)(Re,{children:[a?.name," does not have any verification methods enabled."]}),(0,m.jsx)(Oo,{children:(0,m.jsx)(U,{onClick:S,children:"Close"})}),(0,m.jsx)(oe,{})]});let Q=!I&&!g;if(Q)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:S},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(gl.default,{})})}),(0,m.jsx)(Oe,{children:"Transaction Protection"}),(0,m.jsx)(Re,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,m.jsxs)($u,{children:[(0,m.jsxs)(vc,{children:[(0,m.jsx)(gc,{children:(0,m.jsx)(xy.default,{})}),"Enable 2-Step verification for your ",a?.name," wallet."]}),(0,m.jsxs)(vc,{children:[(0,m.jsx)(gc,{children:(0,m.jsx)(Sy.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,m.jsxs)(Oo,{children:[(0,m.jsx)(U,{onClick:()=>w(!0),children:"Continue"}),(0,m.jsx)(Cr,{onClick:S,children:"Not now"})]}),(0,m.jsx)(oe,{})]});switch(C){case"sms":return(0,m.jsx)(_0,{onComplete:S,onReset:_,onClose:S});case"totp":return(0,m.jsx)(A0,{onComplete:S,onClose:S,onReset:_});default:return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:Q?F:void 0,onClose:S},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(gl.default,{})})}),(0,m.jsx)(Oe,{children:"Choose a verification method"}),I?(0,m.jsx)(Re,{children:"To add or delete verification methods, verification is required."}):(0,m.jsx)(Re,{children:"How would you like to verify your identity? You can change this later."}),(0,m.jsxs)(As,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||M)&&(0,m.jsxs)(ks,{children:[(0,m.jsx)(Le,{disabled:M,onClick:()=>B("totp"),children:(0,m.jsxs)(Is,{children:[(0,m.jsxs)(Rs,{children:[(0,m.jsx)(Ey.default,{}),"Authenticator App"]}),M?(0,m.jsxs)(Vn,{children:[(0,m.jsx)(Qc.default,{}),"Added"]}):(0,m.jsx)(Vn,{children:"Recommended"})]})}),M&&(0,m.jsx)(wc,{id:"remove",onClick:()=>o("totp"),children:(0,m.jsx)(Xc.default,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||P)&&(0,m.jsxs)(ks,{children:[(0,m.jsx)(Le,{disabled:P||T,onClick:()=>B("sms"),children:(0,m.jsxs)(Is,{children:[(0,m.jsxs)(Rs,{children:[(0,m.jsx)(Ty.default,{}),"SMS"]}),P&&(0,m.jsxs)(Vn,{children:[(0,m.jsx)(Qc.default,{}),"Added"]}),T&&(0,m.jsx)(Vn,{children:"Disabled"})]})}),P&&(0,m.jsx)(wc,{id:"remove",onClick:()=>o("sms"),children:(0,m.jsx)(Xc.default,{})})]},"sms"),(0,m.jsx)(ks,{children:(0,m.jsx)(Le,{disabled:!0,children:(0,m.jsxs)(Is,{children:[(0,m.jsxs)(Rs,{children:[(0,m.jsx)(Py.default,{}),"Passkey"]}),(0,m.jsx)(Vn,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),(0,m.jsx)(oe,{})]})}},_0=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,Jt.useState)(""),[i,a]=(0,Jt.useState)(!1),[l,s]=(0,Jt.useState)("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:u}=yi(),{app:f,data:g,currentScreen:w,navigate:C,setModalData:b}=A();function S(){g?.mfaEnrollmentFlow?.onSuccess(),e()}async function P({qualifiedPhoneNumber:I}){try{await c({phoneNumber:I}),n(I),s("verify")}catch(_){b({mfaEnrollmentFlow:g?.mfaEnrollmentFlow?{...g?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:_,previousScreen:w||"MFA_ENROLLMENT_FLOW_SCREEN"}}),C("ERROR_SCREEN")}}async function T(I){try{if(!I)return;await u({phoneNumber:o,mfaCode:I}),a(!0)}catch(_){throw Rc(_)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):an(_)?new Error("The code you entered is not valid"):nn(_)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Ic(_)?new Error("Verification canceled"):new Error("Unknown error")}}function M(){l==="verify"?s("enroll"):t()}return l==="enroll"?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:t,onClose:r},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(vl.default,{})})}),(0,m.jsx)(Oe,{children:"Set up SMS verification"}),(0,m.jsx)(Re,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,m.jsxs)(Lo,{children:[(0,m.jsx)(pi,{onSubmit:P}),(0,m.jsxs)(qu,{children:["By providing your mobile number, you agree to receive text messages from ",f?.name,". Some carrier charges may apply"]})]}),(0,m.jsx)(oe,{})]}):i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:S},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{status:"success",children:(0,m.jsx)(ed.default,{})})}),(0,m.jsx)(Oe,{children:"SMS verification added"}),(0,m.jsx)(Re,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,m.jsx)(Oo,{children:(0,m.jsx)(U,{onClick:S,children:"Done"})}),(0,m.jsx)(oe,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:M,onClose:r},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(vl.default,{})})}),(0,m.jsx)(Oe,{children:"Enter enrollment code"}),(0,m.jsxs)(Lo,{children:[(0,m.jsx)(hi,{onChange:T}),(0,m.jsxs)(Re,{children:["To continue, enter the 6-digit code sent to ",(0,m.jsx)("strong",{children:Dh(o)})]})]}),(0,m.jsx)(oe,{})]})},A0=({onComplete:e,onClose:t,onReset:r})=>{let[o,n]=(0,Jt.useState)("enroll"),[i,a]=(0,Jt.useState)(null),[l,s]=(0,Jt.useState)(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:u}=yi(),{data:f}=A();(0,Jt.useEffect)(()=>{a(null),c().then(S=>{a(S)}).catch(()=>{a(null),r()})},[]);function g(){f?.mfaEnrollmentFlow?.onSuccess(),e()}function w(){n("verify")}async function C(S){try{if(!S)return;await u({mfaCode:S}),s(!0)}catch(P){throw Rc(P)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):an(P)?new Error("The code you entered is not valid"):nn(P)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Ic(P)?new Error("Verification canceled"):new Error("Unknown error")}}function b(){o==="verify"?n("enroll"):r()}return o==="enroll"?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:r,onClose:t},"header"),(0,m.jsx)(Oe,{children:"Scan QR code"}),(0,m.jsx)(Re,{children:"Open your authenticator app and scan the QR code to continue."}),(0,m.jsx)(Os,{children:i?.authUrl?(0,m.jsx)(Cy,{authUrl:i.authUrl,size:200}):(0,m.jsx)(nr,{})}),(0,m.jsxs)(Oo,{children:[(0,m.jsx)(lr,{children:i?.secret&&(0,m.jsx)(ai,{itemName:"secret",text:i.secret})}),(0,m.jsx)(U,{onClick:w,children:"Continue"})]}),(0,m.jsx)(oe,{})]}):l?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{onClose:g},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{status:"success",children:(0,m.jsx)(ed.default,{})})}),(0,m.jsx)(Oe,{children:"Authenticator app verification added"}),(0,m.jsx)(Re,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,m.jsx)(Oo,{children:(0,m.jsx)(U,{onClick:g,children:"Done"})}),(0,m.jsx)(oe,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(k,{backFn:b,onClose:t},"header"),(0,m.jsx)(ut,{children:(0,m.jsx)(xt,{children:(0,m.jsx)(td.default,{})})}),(0,m.jsx)(Oe,{children:"Enter enrollment code"}),(0,m.jsx)(Lo,{children:(0,m.jsx)(hi,{onChange:C})}),(0,m.jsxs)(Re,{children:["To continue, enter the 6-digit code generated from your ",(0,m.jsx)("strong",{children:"authenticator app"})]}),(0,m.jsx)(oe,{})]})};var cg=h(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),dg=h(require("@heroicons/react/24/outline/PhoneIcon")),pg=h(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),ug=h(require("@heroicons/react/24/solid/PhoneIcon")),mg=h(require("@heroicons/react/24/solid/ShieldCheckIcon")),xi=require("react");var gn=require("react"),lg=h(require("styled-components"));var ld=h(require("styled-components"));var rd=h(require("styled-components")),sa=require("react/jsx-runtime"),wl=({label:e,children:t,valueStyles:r})=>(0,sa.jsxs)(k0,{children:[(0,sa.jsx)("div",{children:e}),(0,sa.jsx)(R0,{style:{...r},children:t})]}),k0=rd.default.div`
1957
1957
  display: flex;
1958
1958
  align-items: center;
1959
1959
  justify-content: space-between;
@@ -1968,7 +1968,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1968
1968
  color: var(--privy-color-foreground-2);
1969
1969
  text-align: right;
1970
1970
  }
1971
- `,I2=Xc.default.div`
1971
+ `,R0=rd.default.div`
1972
1972
  font-size: 14px;
1973
1973
  line-height: 100%;
1974
1974
  display: flex;
@@ -1977,28 +1977,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
1977
1977
  border-radius: var(--privy-border-radius-full);
1978
1978
  background-color: var(--privy-color-background-2);
1979
1979
  padding: 4px 8px;
1980
- `;var da=h(require("styled-components"));var ed=require("@ethersproject/bignumber"),td=require("@ethersproject/units");var ca=(e,t)=>{let o=(t*parseFloat((0,td.formatEther)(e))).toFixed(2);return o!=="0.00"?`$${o}`:"<$0.01"},Yo=(e,t,o=6,r=!1)=>{let i=parseFloat((0,td.formatEther)(e)).toFixed(o).replace(/0+$/,"").replace(/\.$/,"");return r?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},od=e=>e.map(yt).reduce((t,o)=>t.add(o),ed.BigNumber.from(0)).toHexString(),Sy=(e,t)=>{let{chains:o}=M(),r=`https://etherscan.io/address/${t}`,n=`${kp(e,o)}/address/${t}`;if(!n)return r;try{new URL(n)}catch{return r}return n},yt=e=>ed.BigNumber.from(e);var Jo=require("react/jsx-runtime"),_y=({weiQuantities:e,tokenPrice:t,tokenSymbol:o})=>{let r=od(e),n=t?ca(r,t):void 0,i=Yo(r,o);return(0,Jo.jsx)(Ay,{children:n||i})},rd=({weiQuantities:e,tokenPrice:t,tokenSymbol:o})=>{let r=od(e),n=t?ca(r,t):void 0,i=Yo(r,o);return(0,Jo.jsx)(Ay,{children:n?(0,Jo.jsxs)(Jo.Fragment,{children:[(0,Jo.jsx)(M2,{children:"USD"}),n==="<$0.01"?(0,Jo.jsxs)(L2,{children:[(0,Jo.jsx)(W2,{children:"<"}),"$0.01"]}):n]}):i})},Ay=da.default.span`
1980
+ `;var ca=h(require("styled-components"));var od=require("@ethersproject/bignumber"),nd=require("@ethersproject/units");var la=(e,t)=>{let r=(t*parseFloat((0,nd.formatEther)(e))).toFixed(2);return r!=="0.00"?`$${r}`:"<$0.01"},Jr=(e,t,r=6,o=!1)=>{let i=parseFloat((0,nd.formatEther)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},id=e=>e.map(ht).reduce((t,r)=>t.add(r),od.BigNumber.from(0)).toHexString(),Ay=(e,t)=>{let{chains:r}=W(),o=`https://etherscan.io/address/${t}`,n=`${Ip(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n},ht=e=>od.BigNumber.from(e);var Zr=require("react/jsx-runtime"),ky=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=id(e),n=t?la(o,t):void 0,i=Jr(o,r);return(0,Zr.jsx)(Ry,{children:n||i})},ad=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=id(e),n=t?la(o,t):void 0,i=Jr(o,r);return(0,Zr.jsx)(Ry,{children:n?(0,Zr.jsxs)(Zr.Fragment,{children:[(0,Zr.jsx)(I0,{children:"USD"}),n==="<$0.01"?(0,Zr.jsxs)(W0,{children:[(0,Zr.jsx)(M0,{children:"<"}),"$0.01"]}):n]}):i})},Ry=ca.default.span`
1981
1981
  font-size: 14px;
1982
1982
  line-height: 140%;
1983
1983
  display: flex;
1984
1984
  gap: 4px;
1985
1985
  align-items: center;
1986
- `,M2=da.default.span`
1986
+ `,I0=ca.default.span`
1987
1987
  font-size: 12px;
1988
1988
  line-height: 12px;
1989
1989
  color: var(--privy-color-foreground-3);
1990
- `,W2=da.default.span`
1990
+ `,M0=ca.default.span`
1991
1991
  font-size: 10px;
1992
- `,L2=da.default.span`
1992
+ `,W0=ca.default.span`
1993
1993
  display: flex;
1994
1994
  align-items: center;
1995
- `;var El=h(require("styled-components"));var Nt=require("react/jsx-runtime"),ky=({gas:e,tokenPrice:t,tokenSymbol:o})=>(0,Nt.jsxs)(Cc,{style:{paddingBottom:"12px"},children:[(0,Nt.jsxs)(Iy,{children:[(0,Nt.jsx)(Wy,{children:"Est. Fees"}),(0,Nt.jsx)("div",{children:(0,Nt.jsx)(rd,{weiQuantities:[e],tokenPrice:t,tokenSymbol:o})})]}),t&&(0,Nt.jsx)(My,{children:`${Yo(e,o)}`})]}),Ry=({transactionData:e,gas:t,tokenPrice:o,tokenSymbol:r})=>{let n=yt(e.value||0).add(yt(t)).toHexString();return(0,Nt.jsxs)(Cc,{children:[(0,Nt.jsxs)(Iy,{children:[(0,Nt.jsx)(Wy,{children:"Total (including fees)"}),(0,Nt.jsx)("div",{children:(0,Nt.jsx)(rd,{weiQuantities:[e.value||0,t],tokenPrice:o,tokenSymbol:r})})]}),o&&(0,Nt.jsx)(My,{children:Yo(n,r)})]})},Iy=El.default.div`
1995
+ `;var Cl=h(require("styled-components"));var Nt=require("react/jsx-runtime"),Iy=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,Nt.jsxs)(Pc,{style:{paddingBottom:"12px"},children:[(0,Nt.jsxs)(Wy,{children:[(0,Nt.jsx)(Oy,{children:"Est. Fees"}),(0,Nt.jsx)("div",{children:(0,Nt.jsx)(ad,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,Nt.jsx)(Ly,{children:`${Jr(e,r)}`})]}),My=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=ht(e.value||0).add(ht(t)).toHexString();return(0,Nt.jsxs)(Pc,{children:[(0,Nt.jsxs)(Wy,{children:[(0,Nt.jsx)(Oy,{children:"Total (including fees)"}),(0,Nt.jsx)("div",{children:(0,Nt.jsx)(ad,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&(0,Nt.jsx)(Ly,{children:Jr(n,o)})]})},Wy=Cl.default.div`
1996
1996
  display: flex;
1997
1997
  flex-direction: row;
1998
1998
  justify-content: space-between;
1999
1999
  align-items: center;
2000
2000
  padding-top: 4px;
2001
- `,My=El.default.div`
2001
+ `,Ly=Cl.default.div`
2002
2002
  display: flex;
2003
2003
  flex-direction: row;
2004
2004
  height: 12px;
@@ -2007,23 +2007,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
2007
2007
  line-height: 12px;
2008
2008
  color: var(--privy-color-foreground-3);
2009
2009
  font-weight: 400;
2010
- `,Wy=El.default.div`
2010
+ `,Oy=Cl.default.div`
2011
2011
  font-size: 14px;
2012
2012
  line-height: 22.4px;
2013
2013
  font-weight: 400;
2014
- `;var Ly=h(require("@heroicons/react/24/outline/ChevronDownIcon")),Zo=require("react"),hr=h(require("styled-components"));var Pl=require("react"),hi=(0,Pl.createContext)(void 0);var pa=(0,Pl.createContext)(void 0);var nt=require("react/jsx-runtime"),Oy=({defaultValue:e,children:t})=>{let[o,r]=(0,Zo.useState)(e||null),n=i=>{r(o===i?null:i)};return(0,nt.jsx)(hi.Provider,{value:{activePanel:o,togglePanel:n},children:(0,nt.jsx)(O2,{children:t})})},Ny=({value:e,children:t})=>{let{activePanel:o,togglePanel:r}=(0,Zo.useContext)(hi),n=o===e;return(0,nt.jsx)(pa.Provider,{value:{onToggle:()=>r(e),value:e},children:(0,nt.jsx)(F2,{isActive:n,"data-open":n,children:t})})},Dy=({children:e})=>{let{activePanel:t}=(0,Zo.useContext)(hi),{onToggle:o,value:r}=(0,Zo.useContext)(pa),n=t===r;return(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsxs)(N2,{onClick:o,"data-open":n,children:[(0,nt.jsx)(U2,{children:e}),(0,nt.jsx)(H2,{isactive:n,children:(0,nt.jsx)(Ly.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,nt.jsx)(D2,{})]})},Uy=({children:e})=>{let{activePanel:t}=(0,Zo.useContext)(hi),{value:o}=(0,Zo.useContext)(pa);return(0,nt.jsx)(B2,{"data-open":t===o,children:(0,nt.jsx)(By,{children:e})})},Fy=({children:e})=>{let{activePanel:t}=(0,Zo.useContext)(hi),{value:o}=(0,Zo.useContext)(pa);return(0,nt.jsx)(By,{children:typeof e=="function"?e({isActive:t===o}):e})},O2=hr.default.div`
2014
+ `;var Ny=h(require("@heroicons/react/24/outline/ChevronDownIcon")),Qr=require("react"),wo=h(require("styled-components"));var bl=require("react"),gi=(0,bl.createContext)(void 0);var da=(0,bl.createContext)(void 0);var nt=require("react/jsx-runtime"),Dy=({defaultValue:e,children:t})=>{let[r,o]=(0,Qr.useState)(e||null),n=i=>{o(r===i?null:i)};return(0,nt.jsx)(gi.Provider,{value:{activePanel:r,togglePanel:n},children:(0,nt.jsx)(L0,{children:t})})},Uy=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=(0,Qr.useContext)(gi),n=r===e;return(0,nt.jsx)(da.Provider,{value:{onToggle:()=>o(e),value:e},children:(0,nt.jsx)(U0,{isActive:n,"data-open":n,children:t})})},Fy=({children:e})=>{let{activePanel:t}=(0,Qr.useContext)(gi),{onToggle:r,value:o}=(0,Qr.useContext)(da),n=t===o;return(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsxs)(O0,{onClick:r,"data-open":n,children:[(0,nt.jsx)(D0,{children:e}),(0,nt.jsx)(B0,{isactive:n,children:(0,nt.jsx)(Ny.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,nt.jsx)(N0,{})]})},By=({children:e})=>{let{activePanel:t}=(0,Qr.useContext)(gi),{value:r}=(0,Qr.useContext)(da);return(0,nt.jsx)(F0,{"data-open":t===r,children:(0,nt.jsx)(Gy,{children:e})})},Hy=({children:e})=>{let{activePanel:t}=(0,Qr.useContext)(gi),{value:r}=(0,Qr.useContext)(da);return(0,nt.jsx)(Gy,{children:typeof e=="function"?e({isActive:t===r}):e})},L0=wo.default.div`
2015
2015
  display: flex;
2016
2016
  flex-direction: column;
2017
2017
  width: 100%;
2018
2018
  gap: 8px;
2019
- `,N2=hr.default.div`
2019
+ `,O0=wo.default.div`
2020
2020
  display: flex;
2021
2021
  justify-content: space-between;
2022
2022
  align-items: center;
2023
2023
  width: 100%;
2024
2024
  cursor: pointer;
2025
2025
  padding-bottom: 8px;
2026
- `,D2=hr.default.div`
2026
+ `,N0=wo.default.div`
2027
2027
  width: 100%;
2028
2028
 
2029
2029
  && {
@@ -2031,13 +2031,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2031
2031
  border-color: var(--privy-color-foreground-4);
2032
2032
  }
2033
2033
  padding-bottom: 12px;
2034
- `,U2=hr.default.div`
2034
+ `,D0=wo.default.div`
2035
2035
  font-size: 14px;
2036
2036
  font-weight: 500;
2037
2037
  line-height: 19.6px;
2038
2038
  width: 100%;
2039
2039
  padding-right: 8px;
2040
- `,F2=hr.default.div`
2040
+ `,U0=wo.default.div`
2041
2041
  display: flex;
2042
2042
  flex-direction: column;
2043
2043
  width: 100%;
@@ -2049,7 +2049,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2049
2049
  border-color: var(--privy-color-foreground-4);
2050
2050
  border-radius: var(--privy-border-radius-md);
2051
2051
  }
2052
- `,B2=hr.default.div`
2052
+ `,F0=wo.default.div`
2053
2053
  position: relative;
2054
2054
  overflow: hidden;
2055
2055
  transition: max-height 25ms ease-out;
@@ -2061,38 +2061,38 @@ You will need this password to access your ${e} wallet on a new device. Please k
2061
2061
  &[data-open='false'] {
2062
2062
  max-height: 0;
2063
2063
  }
2064
- `,By=hr.default.div`
2064
+ `,Gy=wo.default.div`
2065
2065
  display: flex;
2066
2066
  flex-direction: column;
2067
2067
  gap: 12px;
2068
2068
  flex: 1 1 auto;
2069
2069
  min-height: 1px;
2070
- `,H2=hr.default.div`
2070
+ `,B0=wo.default.div`
2071
2071
  transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2072
- `;var Hy=h(require("styled-components"));var Gy=require("react/jsx-runtime"),nd=({walletAddress:e,chainId:t=or})=>(0,Gy.jsx)(G2,{href:Sy(t,e),target:"_blank",children:Er(e)}),G2=Hy.default.a`
2072
+ `;var Vy=h(require("styled-components"));var zy=require("react/jsx-runtime"),sd=({walletAddress:e,chainId:t=no})=>(0,zy.jsx)(H0,{href:Ay(t,e),target:"_blank",children:So(e)}),H0=Vy.default.a`
2073
2073
  &:hover {
2074
2074
  text-decoration: underline;
2075
2075
  }
2076
- `;var et=require("react/jsx-runtime"),yi=({from:e,to:t,txn:o,transactionInfo:r,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=o?.value||0;return(0,et.jsx)(Oy,{children:(0,et.jsxs)(Ny,{value:"details",children:[(0,et.jsx)(Dy,{children:(0,et.jsxs)(V2,{children:[(0,et.jsx)("div",{children:r?.title||r?.actionDescription||"Details"}),(0,et.jsx)(z2,{children:(0,et.jsx)(_y,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),(0,et.jsxs)(Uy,{children:[(0,et.jsx)(bl,{label:"From",children:(0,et.jsx)(nd,{walletAddress:e,chainId:o.chainId||or})}),(0,et.jsx)(bl,{label:"To",children:(0,et.jsx)(nd,{walletAddress:t,chainId:o.chainId||or})}),r&&r.action&&(0,et.jsx)(bl,{label:"Action",children:r.action}),i&&(0,et.jsx)(ky,{transactionData:o,gas:i,tokenPrice:n,tokenSymbol:a})]}),(0,et.jsx)(Fy,{children:({isActive:s})=>(0,et.jsx)(Ry,{transactionData:o,displayFee:s,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},V2=id.default.div`
2076
+ `;var Qe=require("react/jsx-runtime"),vi=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0;return(0,Qe.jsx)(Dy,{children:(0,Qe.jsxs)(Uy,{value:"details",children:[(0,Qe.jsx)(Fy,{children:(0,Qe.jsxs)(G0,{children:[(0,Qe.jsx)("div",{children:o?.title||o?.actionDescription||"Details"}),(0,Qe.jsx)(V0,{children:(0,Qe.jsx)(ky,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),(0,Qe.jsxs)(By,{children:[(0,Qe.jsx)(wl,{label:"From",children:(0,Qe.jsx)(sd,{walletAddress:e,chainId:r.chainId||no})}),(0,Qe.jsx)(wl,{label:"To",children:(0,Qe.jsx)(sd,{walletAddress:t,chainId:r.chainId||no})}),o&&o.action&&(0,Qe.jsx)(wl,{label:"Action",children:o.action}),i&&(0,Qe.jsx)(Iy,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),(0,Qe.jsx)(Hy,{children:({isActive:s})=>(0,Qe.jsx)(My,{transactionData:r,displayFee:s,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},G0=ld.default.div`
2077
2077
  display: flex;
2078
2078
  flex-direction: row;
2079
2079
  justify-content: space-between;
2080
- `,z2=id.default.div`
2080
+ `,V0=ld.default.div`
2081
2081
  flex-shrink: 0;
2082
2082
  padding-left: 8px;
2083
- `;var gi=h(require("styled-components")),Br=require("react/jsx-runtime"),ad=({description:e,contractInfo:t})=>(0,Br.jsxs)($2,{children:[t.imgUrl&&(0,Br.jsx)(q2,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&(0,Br.jsx)(j2,{children:(0,Br.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&(0,Br.jsx)(K2,{children:t.name}),(0,Br.jsx)(Y2,{children:e||t.actionText})]}),$2=gi.default.div`
2083
+ `;var wi=h(require("styled-components")),zo=require("react/jsx-runtime"),cd=({description:e,contractInfo:t})=>(0,zo.jsxs)(z0,{children:[t.imgUrl&&(0,zo.jsx)($0,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&(0,zo.jsx)(q0,{children:(0,zo.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&(0,zo.jsx)(j0,{children:t.name}),(0,zo.jsx)(K0,{children:e||t.actionText})]}),z0=wi.default.div`
2084
2084
  display: flex;
2085
2085
  flex-direction: column;
2086
2086
  align-items: center;
2087
2087
  margin-bottom: 8px;
2088
- `,q2=gi.default.img`
2088
+ `,$0=wi.default.img`
2089
2089
  && {
2090
2090
  height: ${e=>e.size==="sm"?"65px":"140px"};
2091
2091
  width: ${e=>e.size==="sm"?"65px":"140px"};
2092
2092
  border-radius: 16px;
2093
2093
  margin-bottom: 12px;
2094
2094
  }
2095
- `,j2=gi.default.div`
2095
+ `,q0=wi.default.div`
2096
2096
  font-size: 12px;
2097
2097
  line-height: 12px;
2098
2098
  padding: 7px;
@@ -2105,7 +2105,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2105
2105
  text-decoration: underline;
2106
2106
  }
2107
2107
  }
2108
- `,K2=gi.default.div`
2108
+ `,j0=wi.default.div`
2109
2109
  font-size: 18px;
2110
2110
  line-height: 18px;
2111
2111
  font-weight: 500;
@@ -2113,7 +2113,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2113
2113
  white-space: nowrap;
2114
2114
  max-width: 275px;
2115
2115
  text-overflow: ellipsis;
2116
- `,Y2=gi.default.div`
2116
+ `,K0=wi.default.div`
2117
2117
  font-size: 16px;
2118
2118
  line-height: 140%;
2119
2119
  font-weight: 400;
@@ -2121,7 +2121,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2121
2121
  overflow: hidden;
2122
2122
  max-width: 275px;
2123
2123
  text-overflow: ellipsis;
2124
- `;var Vy=h(require("@heroicons/react/24/outline/WalletIcon")),Tl=h(require("styled-components"));var pn=require("react/jsx-runtime"),zy=({address:e,txn:t,balance:o,hasFunds:r})=>{let n=!!o,{nativeTokenSymbolForChainId:i}=M(),a=i(t.chainId)||"ETH";return(0,pn.jsxs)(J2,{children:[(0,pn.jsxs)(Z2,{children:[(0,pn.jsx)(Vy.default,{strokeWidth:"2",width:"16px",height:"16px"}),(0,pn.jsx)("div",{children:Er(e)})]}),(0,pn.jsxs)(Q2,{displayBalanceColor:n,hasFunds:r,children:[o?Yo(o,a,6,!0):0," available"]})]})},J2=Tl.default.div`
2124
+ `;var $y=h(require("@heroicons/react/24/outline/WalletIcon")),El=h(require("styled-components"));var hn=require("react/jsx-runtime"),qy=({address:e,txn:t,balance:r,hasFunds:o})=>{let n=!!r,{nativeTokenSymbolForChainId:i}=W(),a=i(t.chainId)||"ETH";return(0,hn.jsxs)(Y0,{children:[(0,hn.jsxs)(J0,{children:[(0,hn.jsx)($y.default,{strokeWidth:"2",width:"16px",height:"16px"}),(0,hn.jsx)("div",{children:So(e)})]}),(0,hn.jsxs)(Z0,{displayBalanceColor:n,hasFunds:o,children:[r?Jr(r,a,6,!0):0," available"]})]})},Y0=El.default.div`
2125
2125
  display: flex;
2126
2126
  flex-direction: row;
2127
2127
  justify-content: space-between;
@@ -2134,12 +2134,12 @@ You will need this password to access your ${e} wallet on a new device. Please k
2134
2134
  border: 1px solid var(--privy-color-foreground-4);
2135
2135
  border-radius: var(--privy-border-radius-md);
2136
2136
  }
2137
- `,Z2=Tl.default.div`
2137
+ `,J0=El.default.div`
2138
2138
  display: flex;
2139
2139
  flex-direction: row;
2140
2140
  align-items: center;
2141
2141
  gap: 8px;
2142
- `,Q2=Tl.default.div`
2142
+ `,Z0=El.default.div`
2143
2143
  display: flex;
2144
2144
  align-items: center;
2145
2145
  justify-content: center;
@@ -2149,35 +2149,35 @@ You will need this password to access your ${e} wallet on a new device. Please k
2149
2149
  background-color: var(--privy-color-background-2);
2150
2150
  padding: 5px 8px;
2151
2151
  color: ${e=>e.displayBalanceColor?e.hasFunds?"var(--privy-color-success-dark)":"var(--privy-color-error)":"inherit"};
2152
- `;var ua=h(require("styled-components"));var po=require("react/jsx-runtime"),qy=({description:e,txn:t,tokenSymbol:o,tokenPrice:r})=>{let n=t.value||0,i=r?ca(n,r):void 0,a=Yo(n,o);return(0,po.jsxs)(X2,{children:[i?(0,po.jsxs)(po.Fragment,{children:[(0,po.jsx)($y,{children:i}),(0,po.jsx)(e0,{children:a})]}):(0,po.jsx)(po.Fragment,{children:(0,po.jsx)($y,{children:a})}),(0,po.jsx)(t0,{children:e})]})},X2=ua.default.div`
2152
+ `;var pa=h(require("styled-components"));var ur=require("react/jsx-runtime"),Ky=({description:e,txn:t,tokenSymbol:r,tokenPrice:o})=>{let n=t.value||0,i=o?la(n,o):void 0,a=Jr(n,r);return(0,ur.jsxs)(Q0,{children:[i?(0,ur.jsxs)(ur.Fragment,{children:[(0,ur.jsx)(jy,{children:i}),(0,ur.jsx)(X0,{children:a})]}):(0,ur.jsx)(ur.Fragment,{children:(0,ur.jsx)(jy,{children:a})}),(0,ur.jsx)(e2,{children:e})]})},Q0=pa.default.div`
2153
2153
  display: flex;
2154
2154
  flex-direction: column;
2155
2155
  align-items: center;
2156
2156
  margin-bottom: 20px;
2157
- `,$y=ua.default.h2`
2157
+ `,jy=pa.default.h2`
2158
2158
  && {
2159
2159
  font-size: 48px;
2160
2160
  line-height: 48px;
2161
2161
  margin: 8px auto;
2162
2162
  }
2163
- `,e0=ua.default.p`
2163
+ `,X0=pa.default.p`
2164
2164
  margin-bottom: 12px;
2165
2165
  && {
2166
2166
  font-size: 17px;
2167
2167
  line-height: 17px;
2168
2168
  color: var(--privy-color-foreground-3);
2169
2169
  }
2170
- `,t0=ua.default.div`
2170
+ `,e2=pa.default.div`
2171
2171
  font-size: 16px;
2172
2172
  line-height: 22.4px;
2173
2173
  font-weight: 400;
2174
2174
  overflow: hidden;
2175
2175
  max-width: 275px;
2176
2176
  text-overflow: ellipsis;
2177
- `;var ng=require("@ethersproject/abstract-signer"),n0=require("@ethersproject/providers");var sd=require("@ethersproject/bignumber");var un=require("@ethersproject/bignumber"),jy=require("@ethersproject/contracts"),Ky=require("@ethersproject/transactions");var vi=e=>[es.id,ts.id,os.id,ns.id,is.id,as.id,ss.id,cs.id,ls.id].includes(e),Yy=async(e,t)=>{if(!vi(e.chainId))throw new Error("Invalid chain ID for OP Stack gas estimation.");if(e.maxPriorityFeePerGas&&e.maxFeePerGas||e.gasPrice)return e;try{if(e.type===void 0&&(e.type=2),!e.maxPriorityFeePerGas){let o=await t.send("eth_maxPriorityFeePerGas",[]);e.maxPriorityFeePerGas=o}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:o}=await t.getFeeData();if(!o)throw new Error("Unable to fetch baseFee for last block.");let i=un.BigNumber.from(o).mul(un.BigNumber.from(126)).div(un.BigNumber.from(100)).add(un.BigNumber.from(e.maxPriorityFeePerGas));e.maxFeePerGas=ma(i)}}catch(o){throw new Error(`Failed to set gas price for OP stack transaction: ${o}.`)}return e};async function Jy(e,t){if(!e.chainId||e.chainId&&!vi(e.chainId))return un.BigNumber.from(0);let o=un.BigNumber.from(0);try{let r=new jy.Contract(yp,gp,t),n=Zy(e),i=(0,Ky.serialize)(n);o=await r.getL1Fee(i)}catch{}return o}async function Qy(e,t){try{let r={...e,from:void 0};return(await t.estimateGas(r)).toHexString()}catch{}return(await t.estimateGas(e)).toHexString()}var Xy=async(e,t)=>{if(e.type===void 0&&(e.type=2),e.type===2){if(!e.maxFeePerGas||!e.maxPriorityFeePerGas){let o=await t.getFeeData();e.maxFeePerGas||(e.maxFeePerGas=o.maxFeePerGas?.toHexString()),e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=o.maxPriorityFeePerGas?.toHexString())}}else if(!e.gasPrice){let o=await t.getFeeData();e.gasPrice=o.gasPrice?.toHexString()}return e};async function wi(e,t){if(!e.gasLimit)throw new Oe("gasLimit was not successfully set for transaction.");let o=yt(e.gasLimit),r=sd.BigNumber.from(0);if(e.type==2)if(e.maxFeePerGas)r=yt(e.maxFeePerGas);else throw new Oe("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)r=yt(e.gasPrice);else throw new Oe("gasPrice was not successfully set for transaction of type 0 or 1.");let n=o.mul(r),i=sd.BigNumber.from(0);if(e.chainId&&vi(e.chainId))try{i=await Jy(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}var xl=require("@ethersproject/bignumber");var ld=e=>[Za.id,Qa.id,Xa.id].includes(e),eg=async(e,t)=>{if(!ld(e.chainId))throw new Error("Invalid chain ID for Arbitrum gas estimation.");if(e.maxFeePerGas)return e;e.type===void 0&&(e.type=2);try{let{lastBaseFeePerGas:o}=await t.getFeeData();if(o){let r=o.mul(xl.BigNumber.from(120)).div(xl.BigNumber.from(100));e.maxFeePerGas=ma(r),e.maxPriorityFeePerGas=ma(xl.BigNumber.from(0))}}catch(o){throw new Error(`Failed to set gas price for Arbitrum transaction: ${o}.`)}return e};var cd=e=>[56,97].includes(e),tg=async(e,t)=>{if(!cd(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 o=await t.getFeeData();e.gasPrice=o.gasPrice?.toHexString()}return e};var pd=require("@ethersproject/units"),og=require("ofetch");var ud=e=>[Ui.id,Fi.id].includes(e),dd=e=>({maxPriorityFee:(0,pd.parseUnits)(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:(0,pd.parseUnits)(e.maxFee.toFixed(9),"gwei").toHexString()}),o0=e=>({safeLow:dd(e.safeLow),standard:dd(e.standard),fast:dd(e.fast)}),r0=async e=>{let t="";switch(e){case Ui.id:t="https://gasstation.polygon.technology/v2";break;case Fi.id:t="https://gasstation-testnet.polygon.technology/v2";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return o0(await(0,og.ofetch)(t))};async function rg(e){if(!ud(e.chainId))throw new Error("Invalid chain ID for Polygon gas estimation.");if(e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;e.type===void 0&&(e.type=2);try{let{standard:t}=await r0(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 ma(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 Zy(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=yt(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=yt(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=yt(e.gasPrice)),e.value!==void 0&&(t.value=yt(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=yt(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=yt(e.maxPriorityFeePerGas)),t}async function Ci(e,t,o){if(t.chainId=Number(t.chainId),ig(t),!t.nonce){let r=new ng.VoidSigner(e,o);t.nonce=await r.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await Qy(t,o)),t.from||(t.from=e),ud(t.chainId)?t=await rg(t):ld(t.chainId)?t=await eg(t,o):vi(t.chainId)?t=await Yy(t,o):cd(t.chainId)?t=await tg(t,o):t=await Xy(t,o),t}async function Sl(e,t,o,r,n){r=Object.assign({chainId:or},r),ig(r);let a=(await o.rpc({address:t,accessToken:e,request:{method:"eth_signTransaction",params:[r]}})).response.data;return await n.sendTransaction(a)}async function _l(e,t,o,r){let n=await r.getBalance(e),i=t.value||0,l=!n.sub(yt(i)).sub(o).isNegative();return{balance:n,hasSufficientFunds:l}}function ig(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let o of t){let r=e[o];if(!(typeof r>"u")&&!i0(r))throw new Error(`Transaction request property '${o}' 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 i0(e){let t=typeof e=="number",o=typeof e=="bigint",r=typeof e=="string"&&a0(e);return t||o||r}function a0(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Al(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 bi=require("react");var kl=e=>{let{showFiatPrices:t,getUsdTokenPrice:o,chains:r}=M(),[n,i]=(0,bi.useState)(!0),[a,l]=(0,bi.useState)(void 0),[s,c]=(0,bi.useState)(void 0);return(0,bi.useEffect)(()=>{let u=e.chainId||or,f=r.find(w=>w.id===Number(u));if(!f)throw new X(`Unsupported chain: ${u}`);(async()=>{if(!t){i(!1);return}try{i(!0);let w=await o(f);w?c(w):l(new Error(`Unable to fetch token price on chain id ${f.id}`))}catch(w){l(w)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var Rl=require("react"),md=(0,Rl.createContext)(null);function Ei(){let e=(0,Rl.useContext)(md);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var fd=require("react/jsx-runtime"),hd=({pendingTransaction:e})=>{let{getAccessToken:t}=G(),{wallets:o}=Ei(),{walletProxy:r,rpcConfig:n,chains:i,nativeTokenSymbolForChainId:a}=M(),[l,s]=(0,mn.useState)(null),[c,u]=(0,mn.useState)(e),{tokenPrice:f}=kl(c),g=a(e.chainId)||"ETH",w=(0,mn.useMemo)(()=>o.find(C=>C.walletClientType==="privy"),[o]);return(0,mn.useEffect)(()=>{async function C(){if(!await t()||!r||!w)return c;let x=new ag.StaticJsonRpcProvider(yo(c.chainId,i,n)),b=await Ci(w.address,c,x),{totalGasEstimate:A}=await wi(b,x);return s(A.toHexString()),b}C().then(E=>{u(E)})},[r]),w?(0,fd.jsx)(s0,{children:(0,fd.jsx)(yi,{from:w.address,to:c.to,txn:c,gas:l??void 0,tokenPrice:f,tokenSymbol:g})}):null},s0=sg.default.div`
2177
+ `;var ag=require("@ethersproject/abstract-signer"),o2=require("@ethersproject/providers");var dd=require("@ethersproject/bignumber");var yn=require("@ethersproject/bignumber"),Yy=require("@ethersproject/contracts"),Jy=require("@ethersproject/transactions");var Ci=e=>[Xa.id,es.id,ts.id,rs.id,os.id,ns.id,is.id,ss.id,as.id].includes(e),Zy=async(e,t)=>{if(!Ci(e.chainId))throw new Error("Invalid chain ID for OP Stack gas estimation.");if(e.maxPriorityFeePerGas&&e.maxFeePerGas||e.gasPrice)return e;try{if(e.type===void 0&&(e.type=2),!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 i=yn.BigNumber.from(r).mul(yn.BigNumber.from(126)).div(yn.BigNumber.from(100)).add(yn.BigNumber.from(e.maxPriorityFeePerGas));e.maxFeePerGas=ua(i)}}catch(r){throw new Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return e};async function Qy(e,t){if(!e.chainId||e.chainId&&!Ci(e.chainId))return yn.BigNumber.from(0);let r=yn.BigNumber.from(0);try{let o=new Yy.Contract(vp,wp,t),n=Xy(e),i=(0,Jy.serialize)(n);r=await o.getL1Fee(i)}catch{}return r}async function eg(e,t){try{let o={...e,from:void 0};return(await t.estimateGas(o)).toHexString()}catch{}return(await t.estimateGas(e)).toHexString()}var tg=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 bi(e,t){if(!e.gasLimit)throw new We("gasLimit was not successfully set for transaction.");let r=ht(e.gasLimit),o=dd.BigNumber.from(0);if(e.type==2)if(e.maxFeePerGas)o=ht(e.maxFeePerGas);else throw new We("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)o=ht(e.gasPrice);else throw new We("gasPrice was not successfully set for transaction of type 0 or 1.");let n=r.mul(o),i=dd.BigNumber.from(0);if(e.chainId&&Ci(e.chainId))try{i=await Qy(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}var Pl=require("@ethersproject/bignumber");var pd=e=>[Ja.id,Za.id,Qa.id].includes(e),rg=async(e,t)=>{if(!pd(e.chainId))throw new Error("Invalid chain ID for Arbitrum gas estimation.");if(e.maxFeePerGas)return e;e.type===void 0&&(e.type=2);try{let{lastBaseFeePerGas:r}=await t.getFeeData();if(r){let o=r.mul(Pl.BigNumber.from(120)).div(Pl.BigNumber.from(100));e.maxFeePerGas=ua(o),e.maxPriorityFeePerGas=ua(Pl.BigNumber.from(0))}}catch(r){throw new Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return e};var ud=e=>[56,97].includes(e),og=async(e,t)=>{if(!ud(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 fd=require("@ethersproject/units"),ng=require("ofetch");var hd=e=>[Di.id,Ui.id].includes(e),md=e=>({maxPriorityFee:(0,fd.parseUnits)(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:(0,fd.parseUnits)(e.maxFee.toFixed(9),"gwei").toHexString()}),t2=e=>({safeLow:md(e.safeLow),standard:md(e.standard),fast:md(e.fast)}),r2=async e=>{let t="";switch(e){case Di.id:t="https://gasstation.polygon.technology/v2";break;case Ui.id:t="https://gasstation-testnet.polygon.technology/v2";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return t2(await(0,ng.ofetch)(t))};async function ig(e){if(!hd(e.chainId))throw new Error("Invalid chain ID for Polygon gas estimation.");if(e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;e.type===void 0&&(e.type=2);try{let{standard:t}=await r2(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 ua(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 Xy(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=ht(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=ht(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=ht(e.gasPrice)),e.value!==void 0&&(t.value=ht(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=ht(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=ht(e.maxPriorityFeePerGas)),t}async function Ei(e,t,r){if(t.chainId=Number(t.chainId),sg(t),!t.nonce){let o=new ag.VoidSigner(e,r);t.nonce=await o.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await eg(t,r)),t.from||(t.from=e),hd(t.chainId)?t=await ig(t):pd(t.chainId)?t=await rg(t,r):Ci(t.chainId)?t=await Zy(t,r):ud(t.chainId)?t=await og(t,r):t=await tg(t,r),t}async function Tl(e,t,r,o,n){o=Object.assign({chainId:no},o),sg(o);let a=(await r.rpc({address:t,accessToken:e,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(a)}async function xl(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(ht(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function sg(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!n2(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 n2(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&i2(e);return t||r||o}function i2(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Sl(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 Pi=require("react");var _l=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=W(),[n,i]=(0,Pi.useState)(!0),[a,l]=(0,Pi.useState)(void 0),[s,c]=(0,Pi.useState)(void 0);return(0,Pi.useEffect)(()=>{let u=e.chainId||no,f=o.find(w=>w.id===Number(u));if(!f)throw new X(`Unsupported chain: ${u}`);(async()=>{if(!t){i(!1);return}try{i(!0);let w=await r(f);w?c(w):l(new Error(`Unable to fetch token price on chain id ${f.id}`))}catch(w){l(w)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var Al=require("react"),yd=(0,Al.createContext)(null);function Ti(){let e=(0,Al.useContext)(yd);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var gd=require("react/jsx-runtime"),vd=({pendingTransaction:e})=>{let{getAccessToken:t}=G(),{wallets:r}=Ti(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=W(),[s,c]=(0,gn.useState)(null),[u,f]=(0,gn.useState)(e),{tokenPrice:g}=_l(u),w=l(e.chainId)||"ETH",C=(0,gn.useMemo)(()=>r.find(b=>b.walletClientType==="privy"),[r]);return(0,gn.useEffect)(()=>{async function b(){if(!await t()||!o||!C)return u;let P=io(u.chainId,i,n,{appId:a}),T=await Ei(C.address,u,P),{totalGasEstimate:M}=await bi(T,P);return c(M.toHexString()),T}b().then(S=>{f(S)})},[o]),C?(0,gd.jsx)(a2,{children:(0,gd.jsx)(vi,{from:C.address,to:u.to,txn:u,gas:s??void 0,tokenPrice:g,tokenSymbol:w})}):null},a2=lg.default.div`
2178
2178
  width: 100%;
2179
2179
  padding: 1rem 0;
2180
- `;var j=require("react/jsx-runtime"),yd=({open:e,onClose:t})=>{let{user:o}=G(),[r,n]=(0,Pi.useState)(null),{init:i,cancel:a}=dn();(0,Pi.useEffect)(()=>{e&&o?.mfaMethods&&o.mfaMethods.length>0?l(o.mfaMethods[0]):n(null)},[o?.mfaMethods,e]);async function l(c){try{n(c),await i(c)}catch(u){console.error(u)}}let s=()=>{n(null),a(),t()};return!e||!o?null:r?(0,j.jsx)(l0,{selectedMethod:r,onClose:s,onBack:o.mfaMethods.length>1?()=>n(null):void 0}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k,{onClose:s},"header"),(0,j.jsx)(mt,{children:(0,j.jsx)(xt,{children:(0,j.jsx)(ug.default,{})})}),(0,j.jsx)(De,{children:"Verify your identity"}),(0,j.jsx)(Me,{children:"Choose a verification method"}),(0,j.jsxs)(Rs,{children:[o.mfaMethods.includes("totp")&&(0,j.jsxs)(Ne,{onClick:()=>l("totp"),children:[(0,j.jsx)(lg.default,{}),"Authenticator App"]},"totp"),o.mfaMethods.includes("sms")&&(0,j.jsxs)(Ne,{onClick:()=>l("sms"),children:[(0,j.jsx)(cg.default,{}),"SMS"]},"sms")]}),(0,j.jsx)(ne,{})]})},l0=({selectedMethod:e,onClose:t,onBack:o})=>{let{app:r}=_(),{pendingTransaction:n}=M(),[i,a]=(0,Pi.useState)(!1),[l,s]=(0,Pi.useState)(!1),{submit:c}=dn();async function u(f){try{if(!f)return;await c(e,f),s(!0),a(!1),t()}catch(g){throw Bs(g)?(a(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):tn(g)?(a(!1),new Error("The code you entered is not valid")):en(g)?(a(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(a(!1),new Error("Unknown error"))}}switch(e){case"sms":return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k,{onClose:t},"header"),(0,j.jsx)(mt,{children:(0,j.jsx)(xt,{children:(0,j.jsx)(pg.default,{})})}),(0,j.jsx)(De,{children:"Enter verification code"}),(0,j.jsxs)(Rr,{children:[(0,j.jsx)(mi,{success:l,disabled:i,onChange:u}),(0,j.jsxs)(Me,{children:["To continue, please enter the 6-digit code sent to your ",(0,j.jsx)("strong",{children:"mobile device"})]}),n&&(0,j.jsx)(hd,{pendingTransaction:n})]}),o&&(0,j.jsx)(gc,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),(0,j.jsx)(bo,{onClick:t,children:"Not now"}),(0,j.jsx)(ne,{})]});case"totp":return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k,{onClose:t},"header"),(0,j.jsx)(mt,{children:(0,j.jsx)(xt,{children:(0,j.jsx)(dg.default,{})})}),(0,j.jsx)(De,{children:"Enter verification code"}),(0,j.jsxs)(Rr,{children:[(0,j.jsx)(mi,{success:l,disabled:i,onChange:u}),(0,j.jsxs)(Me,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,j.jsx)("strong",{children:"authenticator app"})]}),n&&(0,j.jsx)(hd,{pendingTransaction:n})]}),o&&(0,j.jsx)(gc,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),(0,j.jsx)(bo,{onClick:t,children:"Not now"}),(0,j.jsx)(ne,{})]});default:return null}};var Ti=require("react"),gd=h(require("styled-components"));var tt=require("react/jsx-runtime"),mg={google:{name:"Google",component:ll},discord:{name:"Discord",component:al},github:{name:"Github",component:sl},linkedin:{name:"LinkedIn",component:cl},twitter:{name:"Twitter",component:ul},spotify:{name:"Spotify",component:dl},tiktok:{name:"Tiktok",component:pl},apple:{name:"Apple",component:il}},fg=()=>{let{ready:e,user:t,authenticated:o}=G(),{app:r,setModalData:n,navigate:i,resetNavigation:a}=_(),{getAuthMeta:l,initLoginWithOAuth:s,loginWithOAuth:c,updateWallets:u,setReadyToTrue:f,closePrivyModal:g}=M(),[w,C]=(0,Ti.useState)(!1),[E,x]=(0,Ti.useState)(void 0),b=l()?.provider||"google",A=mg[b].name,W=mg[b].component,I=r?.render.inDialog?bt:0;(0,Ti.useEffect)(()=>{c(b).then(()=>{C(!0)}).catch(F=>{if(F?.privyErrorCode==="allowlist_rejected"){x(void 0),a(),i("ALLOWLIST_REJECTION_SCREEN");return}let{retryable:q,detail:R}=Cp(F,b);x({retryable:q,detail:R,message:"Authentication failed"})}).finally(()=>{Oi(),f()})},[A,b]),(0,Ti.useEffect)(()=>{if(e&&o&&w&&t){if(r?.legal.requireUsersAcceptTerms&&!t.hasAcceptedTerms){let q=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},I);return()=>clearTimeout(q)}if(Zt(t,r?.embeddedWallets?.createOnLogin)){let q=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:R=>console.error(R),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},I);return()=>clearTimeout(q)}else{let q=setTimeout(()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0}),I);return u(),()=>clearTimeout(q)}}},[e,o,w,t]);let S=w?`Successfully connected with ${A}`:E?E.message:`Verifying connection to ${A}`,B="";return w?B="You\u2019re good to go!":E?B=E.detail:B="Just a few moments more",(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(k,{}),(0,tt.jsx)(ee,{}),(0,tt.jsxs)(c0,{children:[(0,tt.jsx)(d0,{children:(0,tt.jsxs)("div",{children:[(0,tt.jsx)(kr,{success:w,fail:!!E}),(0,tt.jsx)(W,{style:{width:"38px",height:"38px"}})]})}),(0,tt.jsxs)(so,{children:[(0,tt.jsx)("h3",{children:S}),(0,tt.jsx)("p",{children:B})]}),E&&E?.retryable?(0,tt.jsx)(Ss,{onClick:()=>{Oi(),s(b),x(void 0)},disabled:!w&&!E?.retryable,children:"Retry"}):null]}),(0,tt.jsx)(te,{}),(0,tt.jsx)(ne,{})]})},c0=gd.default.div`
2180
+ `;var j=require("react/jsx-runtime"),wd=({open:e,onClose:t})=>{let{user:r}=G(),[o,n]=(0,xi.useState)(null),{init:i,cancel:a}=fn();(0,xi.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 i(c)}catch(u){console.error(u)}}let s=()=>{n(null),a(),t()};return!e||!r?null:o?(0,j.jsx)(s2,{selectedMethod:o,onClose:s,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k,{onClose:s},"header"),(0,j.jsx)(ut,{children:(0,j.jsx)(xt,{children:(0,j.jsx)(mg.default,{})})}),(0,j.jsx)(Oe,{children:"Verify your identity"}),(0,j.jsx)(Re,{children:"Choose a verification method"}),(0,j.jsxs)(As,{children:[r.mfaMethods.includes("totp")&&(0,j.jsxs)(Le,{onClick:()=>l("totp"),children:[(0,j.jsx)(cg.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,j.jsxs)(Le,{onClick:()=>l("sms"),children:[(0,j.jsx)(dg.default,{}),"SMS"]},"sms")]}),(0,j.jsx)(oe,{})]})},s2=({selectedMethod:e,onClose:t,onBack:r})=>{let{app:o}=A(),{pendingTransaction:n}=W(),[i,a]=(0,xi.useState)(!1),[l,s]=(0,xi.useState)(!1),{submit:c}=fn();async function u(f){try{if(!f)return;await c(e,f),s(!0),a(!1),t()}catch(g){throw Us(g)?(a(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):an(g)?(a(!1),new Error("The code you entered is not valid")):nn(g)?(a(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(a(!1),new Error("Unknown error"))}}switch(e){case"sms":return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k,{onClose:t},"header"),(0,j.jsx)(ut,{children:(0,j.jsx)(xt,{children:(0,j.jsx)(ug.default,{})})}),(0,j.jsx)(Oe,{children:"Enter verification code"}),(0,j.jsxs)(Lo,{children:[(0,j.jsx)(hi,{success:l,disabled:i,onChange:u}),(0,j.jsxs)(Re,{children:["To continue, please enter the 6-digit code sent to your ",(0,j.jsx)("strong",{children:"mobile device"})]}),n&&(0,j.jsx)(vd,{pendingTransaction:n})]}),r&&(0,j.jsx)(Cc,{theme:o?.appearance.palette.colorScheme,onClick:r,children:"Choose another method"}),(0,j.jsx)(Cr,{onClick:t,children:"Not now"}),(0,j.jsx)(oe,{})]});case"totp":return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k,{onClose:t},"header"),(0,j.jsx)(ut,{children:(0,j.jsx)(xt,{children:(0,j.jsx)(pg.default,{})})}),(0,j.jsx)(Oe,{children:"Enter verification code"}),(0,j.jsxs)(Lo,{children:[(0,j.jsx)(hi,{success:l,disabled:i,onChange:u}),(0,j.jsxs)(Re,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,j.jsx)("strong",{children:"authenticator app"})]}),n&&(0,j.jsx)(vd,{pendingTransaction:n})]}),r&&(0,j.jsx)(Cc,{theme:o?.appearance.palette.colorScheme,onClick:r,children:"Choose another method"}),(0,j.jsx)(Cr,{onClick:t,children:"Not now"}),(0,j.jsx)(oe,{})]});default:return null}};var Si=require("react"),Cd=h(require("styled-components"));var Xe=require("react/jsx-runtime"),fg={google:{name:"Google",component:al},discord:{name:"Discord",component:nl},github:{name:"Github",component:il},linkedin:{name:"LinkedIn",component:sl},twitter:{name:"Twitter",component:dl},spotify:{name:"Spotify",component:ll},tiktok:{name:"Tiktok",component:cl},apple:{name:"Apple",component:ol}},hg=()=>{let{ready:e,user:t,authenticated:r}=G(),{app:o,setModalData:n,navigate:i,resetNavigation:a}=A(),{getAuthMeta:l,initLoginWithOAuth:s,loginWithOAuth:c,updateWallets:u,setReadyToTrue:f,closePrivyModal:g}=W(),[w,C]=(0,Si.useState)(!1),[b,S]=(0,Si.useState)(void 0),P=l()?.provider||"google",T=fg[P].name,M=fg[P].component,I=o?.render.inDialog?bt:0;(0,Si.useEffect)(()=>{c(P).then(()=>{C(!0)}).catch(B=>{if(B?.privyErrorCode==="allowlist_rejected"){S(void 0),a(),i("ALLOWLIST_REJECTION_SCREEN");return}let{retryable:q,detail:R}=Ep(B,P);S({retryable:q,detail:R,message:"Authentication failed"})}).finally(()=>{Li(),f()})},[T,P]),(0,Si.useEffect)(()=>{if(e&&r&&w&&t){if(o?.legal.requireUsersAcceptTerms&&!t.hasAcceptedTerms){let q=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},I);return()=>clearTimeout(q)}if(Xt(t,o?.embeddedWallets?.createOnLogin)){let q=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:R=>console.error(R),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},I);return()=>clearTimeout(q)}else{let q=setTimeout(()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0}),I);return u(),()=>clearTimeout(q)}}},[e,r,w,t]);let _=w?`Successfully connected with ${T}`:b?b.message:`Verifying connection to ${T}`,F="";return w?F="You\u2019re good to go!":b?F=b.detail:F="Just a few moments more",(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(k,{}),(0,Xe.jsx)(ee,{}),(0,Xe.jsxs)(l2,{children:[(0,Xe.jsx)(c2,{children:(0,Xe.jsxs)("div",{children:[(0,Xe.jsx)(Wo,{success:w,fail:!!b}),(0,Xe.jsx)(M,{style:{width:"38px",height:"38px"}})]})}),(0,Xe.jsxs)(cr,{children:[(0,Xe.jsx)("h3",{children:_}),(0,Xe.jsx)("p",{children:F})]}),b&&b?.retryable?(0,Xe.jsx)(Ts,{onClick:()=>{Li(),s(P),S(void 0)},disabled:!w&&!b?.retryable,children:"Retry"}):null]}),(0,Xe.jsx)(te,{}),(0,Xe.jsx)(oe,{})]})},l2=Cd.default.div`
2181
2181
  display: flex;
2182
2182
  flex-direction: column;
2183
2183
  align-items: center;
@@ -2185,7 +2185,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2185
2185
  margin-left: 27px;
2186
2186
  margin-right: 27px;
2187
2187
  gap: 24px;
2188
- `,d0=gd.default.div`
2188
+ `,c2=Cd.default.div`
2189
2189
  display: flex;
2190
2190
  flex-direction: column;
2191
2191
  justify-content: center;
@@ -2208,55 +2208,55 @@ You will need this password to access your ${e} wallet on a new device. Please k
2208
2208
  left: -19px;
2209
2209
  top: -19px;
2210
2210
  }
2211
- `;var fa=require("react"),gg=h(require("styled-components"));var hg=require("react-device-detect");var yg=(e,t)=>{let o=new URL(window.location.href),r=encodeURIComponent(o.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!br()&&hg.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`};var _t=require("react/jsx-runtime"),vg=()=>{let{forkSession:e,ready:t,authenticated:o}=G(),[r,n]=(0,fa.useState)(""),[i,a]=(0,fa.useState)(!1);(0,fa.useEffect)(()=>{t&&o&&e().then(n)},[t,o]);let l=yg(r,!i),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(k,{},"header"),(0,_t.jsx)(ee,{}),(0,_t.jsx)(Go,{title:s.title,description:s.description}),(0,_t.jsxs)(io,{children:[(0,_t.jsx)(p0,{children:(0,_t.jsx)(Uo,{style:{width:"72px",height:"72px"}})}),(0,_t.jsx)(xs,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?(0,_t.jsx)("p",{children:s.footnote}):null]}),(0,_t.jsx)(te,{}),(0,_t.jsx)($,{protectedByPrivy:!0})]})},p0=(0,gg.default)(ao)`
2211
+ `;var ma=require("react"),vg=h(require("styled-components"));var yg=require("react-device-detect");var gg=(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(!xo()&&yg.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};var _t=require("react/jsx-runtime"),wg=()=>{let{forkSession:e,ready:t,authenticated:r}=G(),[o,n]=(0,ma.useState)(""),[i,a]=(0,ma.useState)(!1);(0,ma.useEffect)(()=>{t&&r&&e().then(n)},[t,r]);let l=gg(o,!i),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(k,{},"header"),(0,_t.jsx)(ee,{}),(0,_t.jsx)(Vr,{title:s.title,description:s.description}),(0,_t.jsxs)(sr,{children:[(0,_t.jsx)(d2,{children:(0,_t.jsx)(Fr,{style:{width:"72px",height:"72px"}})}),(0,_t.jsx)(Ps,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?(0,_t.jsx)("p",{children:s.footnote}):null]}),(0,_t.jsx)(te,{}),(0,_t.jsx)($,{protectedByPrivy:!0})]})},d2=(0,vg.default)(lr)`
2212
2212
  margin: 16px auto;
2213
- `;var vd=require("@ethersproject/bignumber"),Pg=require("@ethersproject/providers"),qe=require("react"),fn=h(require("styled-components"));function wg(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var Il=require("@ethersproject/bignumber"),Cg=h(require("styled-components"));var Qo=require("react/jsx-runtime"),u0=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let o=Il.BigNumber.from(e.gasUsed),r=Il.BigNumber.from(e.effectiveGasPrice),n=o.mul(r);if(t){let i=Il.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},bg=({txn:e,receipt:t,transactionInfo:o,onClose:r,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a})=>(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(k,{onClose:r}),(0,Qo.jsx)(Hi,{title:"Transaction complete!",description:"You're all set."}),(0,Qo.jsx)(yi,{tokenPrice:n,from:t.from,to:t.to,gas:u0(t,a),txn:e,transactionInfo:o,tokenSymbol:i}),(0,Qo.jsx)(m0,{loading:!1,onClick:r,children:"All Done"}),(0,Qo.jsx)(ne,{})]}),m0=(0,Cg.default)(U)`
2213
+ `;var bd=require("@ethersproject/bignumber"),qe=require("react"),vn=h(require("styled-components"));function Cg(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var kl=require("@ethersproject/bignumber"),bg=h(require("styled-components"));var Xr=require("react/jsx-runtime"),p2=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=kl.BigNumber.from(e.gasUsed),o=kl.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=kl.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},Eg=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a})=>(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsx)(k,{onClose:o}),(0,Xr.jsx)(Bi,{title:"Transaction complete!",description:"You're all set."}),(0,Xr.jsx)(vi,{tokenPrice:n,from:t.from,to:t.to,gas:p2(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),(0,Xr.jsx)(u2,{loading:!1,onClick:o,children:"All Done"}),(0,Xr.jsx)(oe,{})]}),u2=(0,bg.default)(U)`
2214
2214
  && {
2215
2215
  margin-top: 24px;
2216
2216
  }
2217
2217
  transition: color 350ms ease, background-color 350ms ease;
2218
- `;var ye=require("react/jsx-runtime");var f0=({txn:e,txnFamily:t,uiOptions:o,tokenSymbol:r,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(o.transactionInfo?.contractInfo)return(0,ye.jsx)(ad,{contractInfo:o.transactionInfo.contractInfo,description:o.description});if(o.senderInfo)return(0,ye.jsx)(ad,{contractInfo:o.senderInfo,description:o.description||o.senderInfo.actionText})}return(0,ye.jsx)(ye.Fragment,{children:(0,ye.jsx)(qy,{description:o.description||o.transactionInfo?.description||"",txn:e,tokenSymbol:r,tokenPrice:n})})},Tg=()=>{let{authenticated:e,getAccessToken:t}=G(),{wallets:o}=Ei(),{walletProxy:r,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s}=M(),{app:c,navigate:u,data:f,onUserCloseViaDialogOrKeybindRef:g,setModalData:w}=_(),{transactionRequest:C,onSuccess:E,onFailure:x,uiOptions:b,fundWalletConfig:A}=f.sendTransaction,[W,I]=(0,qe.useState)(null),[S,B]=(0,qe.useState)(null),[F,q]=(0,qe.useState)(""),[R,Z]=(0,qe.useState)(),[D,Y]=(0,qe.useState)(!1),K=()=>{q(""),Z(void 0)},re=(kt,lt,vr)=>{q(kt),Z(new Oe(new Qt(lt??kt,vr??pt.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[ue,J]=(0,qe.useState)(!1),[it,At]=(0,qe.useState)(!0),[Ut,at]=(0,qe.useState)(null),[ce,gr]=(0,qe.useState)(C),{tokenPrice:uo,isTokenPriceLoading:Gr}=kl(ce),st=s(C.chainId)||"ETH",[je,L]=(0,qe.useState)(null),[ge,H]=(0,qe.useState)(null),[Oo,Ae]=(0,qe.useState)(!0);(0,qe.useEffect)(()=>{e||(u("LANDING"),x(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let Re=(0,qe.useMemo)(()=>o.find(kt=>kt.walletClientType==="privy"),[o]),_i=async()=>{if(!Re)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:kt,externalTransactionId:lt}=await i(Re.address,{config:A?.config||{}});w({fiatOnRampPrompt:{signedUrl:kt},fiatOnRampStatus:{externalTransactionId:lt}}),u("FIAT_ON_RAMP_PROMPT_SCREEN")},yn=(0,qe.useMemo)(()=>new Pg.StaticJsonRpcProvider(yo(ce.chainId,l,a)),[ce.chainId,a]);(0,qe.useEffect)(()=>{async function kt(){let lt=ce;if(!await t()||!r||!Re)return;try{lt=await Ci(Re.address,ce,yn),gr(lt)}catch(wr){re("There was an error preparing your transaction. Please try again.",wr.reason)}let Vr=vd.BigNumber.from(0),zr=vd.BigNumber.from(0);try{({totalGasEstimate:Vr,l1ExecutionFeeEstimate:zr}=await wi(lt,yn)),L(Vr.toHexString()),H(zr.toHexString())}catch{L(null)}try{let{balance:wr,hasSufficientFunds:wa}=await _l(Re.address,lt,Vr,yn);at(wr.toHexString()),wa||(At(!1),re("Wallet has insufficient funds for this transaction."),c?.fiatOnRamp.enabled&&Y(!0))}catch(wr){console.warn(`Failed to fetch wallet balance with error: ${wr}`)}Ae(!1)}kt()},[r]);let gn=wg(ce),vn=gn==="SEND"?`Send ${st}`:"Review transaction",Ai={modalTitle:b.header||b.modalTitle||vn,buttonText:b.buttonText||"Submit"},Ke=()=>{ue||(S?E(S):x(R||new Oe(new Qt("The user rejected the request",pt.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return g.current=Ke,uo===void 0&&Gr||Oo?(0,ye.jsxs)(ye.Fragment,{children:[b.transactionInfo?.contractInfo?.imgUrl&&(0,ye.jsx)(Ja,{src:b.transactionInfo?.contractInfo?.imgUrl}),(0,ye.jsx)(k,{title:Ai.modalTitle,onClose:Ke}),(0,ye.jsx)(Eg,{children:(0,ye.jsx)(Yn,{})})]}):W!==null?(0,ye.jsx)(bg,{txn:ce,onClose:Ke,receipt:W,transactionInfo:b.transactionInfo,tokenPrice:uo,tokenSymbol:st,l1GasEstimate:ge}):(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(k,{title:Ai.modalTitle,onClose:Ke}),(0,ye.jsxs)(Eg,{children:[(0,ye.jsxs)(v0,{children:[(0,ye.jsx)(f0,{txn:ce,txnFamily:gn,uiOptions:b,tokenSymbol:st,tokenPrice:uo}),Re?(0,ye.jsx)(yi,{from:Re.address,to:ce.to,txn:ce,transactionInfo:b.transactionInfo,gas:je||void 0,tokenPrice:uo,tokenSymbol:st}):null]}),(0,ye.jsxs)(w0,{children:[(0,ye.jsx)(h0,{children:F}),(0,ye.jsx)(zy,{txn:ce,address:Re?.address??"",hasFunds:it,balance:Ut}),(0,ye.jsxs)(y0,{children:[D&&(0,ye.jsx)(U,{onClick:_i,children:"Add Funds"}),(0,ye.jsx)(g0,{disabled:ue||!it,loading:!r||ue,loadingText:ue?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{J(!0);let kt=await t();if(kt&&!ue&&Re)try{let lt=await Sl(kt,Re.address,r,ce,yn);B(lt);let vr=await lt.wait();I(Al(vr)),K()}catch(lt){let vr="There was an error processing your transaction. Please contact support.";console.warn({transaction:ce,error:lt}),re(vr,lt.reason)}finally{J(!1)}},children:Ai.buttonText})]})]})]})]})},Eg=fn.default.div`
2218
+ `;var he=require("react/jsx-runtime");var m2=({txn:e,txnFamily:t,uiOptions:r,tokenSymbol:o,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(r.transactionInfo?.contractInfo)return(0,he.jsx)(cd,{contractInfo:r.transactionInfo.contractInfo,description:r.description});if(r.senderInfo)return(0,he.jsx)(cd,{contractInfo:r.senderInfo,description:r.description||r.senderInfo.actionText})}return(0,he.jsx)(he.Fragment,{children:(0,he.jsx)(Ky,{description:r.description||r.transactionInfo?.description||"",txn:e,tokenSymbol:o,tokenPrice:n})})},Tg=()=>{let{authenticated:e,getAccessToken:t}=G(),{wallets:r}=Ti(),{walletProxy:o,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s,appId:c}=W(),{app:u,navigate:f,data:g,onUserCloseViaDialogOrKeybindRef:w,setModalData:C}=A(),{transactionRequest:b,onSuccess:S,onFailure:P,uiOptions:T,fundWalletConfig:M}=g.sendTransaction,[I,_]=(0,qe.useState)(null),[F,B]=(0,qe.useState)(null),[q,R]=(0,qe.useState)(""),[Q,D]=(0,qe.useState)(),[Y,K]=(0,qe.useState)(!1),ie=()=>{R(""),D(void 0)},Ce=(Bt,st,Nr)=>{R(Bt),D(new We(new er(st??Bt,Nr??dt.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[J,it]=(0,qe.useState)(!1),[yt,Ut]=(0,qe.useState)(!0),[at,et]=(0,qe.useState)(null),[Be,bo]=(0,qe.useState)(b),{tokenPrice:Lr,isTokenPriceLoading:Ft}=_l(Be),He=s(b.chainId)||"ETH",[L,pe]=(0,qe.useState)(null),[H,Or]=(0,qe.useState)(null),[_e,At]=(0,qe.useState)(!0);(0,qe.useEffect)(()=>{e||(f("LANDING"),P(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let kt=(0,qe.useMemo)(()=>r.find(Bt=>Bt.walletClientType==="privy"),[r]),Ol=async()=>{if(!kt)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:Bt,externalTransactionId:st}=await i(kt.address,{config:M?.config||{}});C({fiatOnRampPrompt:{signedUrl:Bt},fiatOnRampStatus:{externalTransactionId:st}}),f("FIAT_ON_RAMP_PROMPT_SCREEN")},Eo=(0,qe.useMemo)(()=>io(Be.chainId,l,a,{appId:c}),[Be.chainId,a]);(0,qe.useEffect)(()=>{async function Bt(){let st=Be;if(!await t()||!o||!kt)return;try{st=await Ei(kt.address,Be,Eo),bo(st)}catch(ro){Ce("There was an error preparing your transaction. Please try again.",ro.reason)}let Po=bd.BigNumber.from(0),va=bd.BigNumber.from(0);try{({totalGasEstimate:Po,l1ExecutionFeeEstimate:va}=await bi(st,Eo)),pe(Po.toHexString()),Or(va.toHexString())}catch{pe(null)}try{let{balance:ro,hasSufficientFunds:Dl}=await xl(kt.address,st,Po,Eo);et(ro.toHexString()),Dl||(Ut(!1),Ce("Wallet has insufficient funds for this transaction."),u?.fiatOnRamp.enabled&&K(!0))}catch(ro){console.warn(`Failed to fetch wallet balance with error: ${ro}`)}At(!1)}Bt()},[o]);let qo=Cg(Be),Nl=qo==="SEND"?`Send ${He}`:"Review transaction",tt={modalTitle:T.header||T.modalTitle||Nl,buttonText:T.buttonText||"Submit"},jo=()=>{J||(F?S(F):P(Q||new We(new er("The user rejected the request",dt.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return w.current=jo,Lr===void 0&&Ft||_e?(0,he.jsxs)(he.Fragment,{children:[T.transactionInfo?.contractInfo?.imgUrl&&(0,he.jsx)(Ya,{src:T.transactionInfo?.contractInfo?.imgUrl}),(0,he.jsx)(k,{title:tt.modalTitle,onClose:jo}),(0,he.jsx)(Pg,{children:(0,he.jsx)(Zn,{})})]}):I!==null?(0,he.jsx)(Eg,{txn:Be,onClose:jo,receipt:I,transactionInfo:T.transactionInfo,tokenPrice:Lr,tokenSymbol:He,l1GasEstimate:H}):(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)(k,{title:tt.modalTitle,onClose:jo}),(0,he.jsxs)(Pg,{children:[(0,he.jsxs)(g2,{children:[(0,he.jsx)(m2,{txn:Be,txnFamily:qo,uiOptions:T,tokenSymbol:He,tokenPrice:Lr}),kt?(0,he.jsx)(vi,{from:kt.address,to:Be.to,txn:Be,transactionInfo:T.transactionInfo,gas:L||void 0,tokenPrice:Lr,tokenSymbol:He}):null]}),(0,he.jsxs)(v2,{children:[(0,he.jsx)(f2,{children:q}),(0,he.jsx)(qy,{txn:Be,address:kt?.address??"",hasFunds:yt,balance:at}),(0,he.jsxs)(h2,{children:[Y&&(0,he.jsx)(U,{onClick:Ol,children:"Add Funds"}),(0,he.jsx)(y2,{disabled:J||!yt,loading:!o||J,loadingText:J?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{it(!0);let Bt=await t();if(Bt&&!J&&kt)try{let st=await Tl(Bt,kt.address,o,Be,Eo);B(st);let Nr=await st.wait();_(Sl(Nr)),ie()}catch(st){let Nr="There was an error processing your transaction. Please contact support.";console.warn({transaction:Be,error:st}),Ce(Nr,st.reason)}finally{it(!1)}},children:tt.buttonText})]})]})]})]})},Pg=vn.default.div`
2219
2219
  display: flex;
2220
2220
  flex-direction: column;
2221
2221
  justify-content: space-between;
2222
2222
  flex-grow: 1;
2223
2223
  padding-bottom: 16px;
2224
- `,h0=fn.default.div`
2224
+ `,f2=vn.default.div`
2225
2225
  font-size: 13px;
2226
2226
  color: var(--privy-color-error);
2227
2227
  width: 100%;
2228
2228
  margin-top: 16px;
2229
- `,y0=fn.default.div`
2229
+ `,h2=vn.default.div`
2230
2230
  display: flex;
2231
2231
  direction: row;
2232
2232
  justify-content: space-between;
2233
2233
  align-items: center;
2234
2234
  gap: 8px;
2235
- `,g0=(0,fn.default)(U)`
2235
+ `,y2=(0,vn.default)(U)`
2236
2236
  transition: color 350ms ease, background-color 350ms ease;
2237
- `,v0=fn.default.div`
2237
+ `,g2=vn.default.div`
2238
2238
  height: 100%;
2239
2239
  display: flex;
2240
2240
  flex-direction: column;
2241
2241
  justify-content: space-evenly;
2242
2242
  flex-grow: 1;
2243
- `,w0=fn.default.div`
2243
+ `,v2=vn.default.div`
2244
2244
  display: flex;
2245
2245
  flex-direction: column;
2246
2246
  gap: 8px;
2247
- `;var xg=require("@ethersproject/bytes"),Sg=require("@ethersproject/strings"),Hr=require("react"),Mo=h(require("styled-components"));var pe=require("react/jsx-runtime"),C0=e=>{if(!(0,xg.isHexString)(e))return e;try{return(0,Sg.toUtf8String)(e)}catch{return e}},b0=e=>JSON.stringify(e,null,2),E0=({data:e})=>{let t=o=>typeof o=="object"&&o!==null?(0,pe.jsx)(_0,{children:Object.entries(o).map(([r,n])=>(0,pe.jsxs)("li",{children:[(0,pe.jsxs)("strong",{children:[r,":"]})," ",t(n)]},r))}):(0,pe.jsx)("span",{children:String(o)});return(0,pe.jsx)("div",{children:t(e)})},P0=e=>{let{types:t,primaryType:o,...r}=e.typedData;return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ag,{children:(0,pe.jsx)(E0,{data:r})}),(0,pe.jsx)(ni,{text:b0(e.typedData),itemName:"full payload to clipboard"})," "]})},_g=()=>{let{authenticated:e}=G(),{initializeWalletProxy:t,closePrivyModal:o}=M(),{navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=_(),[a,l]=(0,Hr.useState)(!0),[s,c]=(0,Hr.useState)(""),[u,f]=(0,Hr.useState)(),[g,w]=(0,Hr.useState)(null),C=g!==null;(0,Hr.useEffect)(()=>{e||r("LANDING")},[e]),(0,Hr.useEffect)(()=>{t(Pn).then(F=>{l(!1),F||(c("An error has occurred, please try again."),f(new Oe(new Qt(s,pt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:E,data:x,confirmAndSign:b,onSuccess:A,onFailure:W,uiOptions:I}=n.signMessage,S={title:I.title||"Sign message",description:I.description||"Signing this message will not cost you any fees.",buttonText:I.buttonText||"Sign and continue"},B=F=>{F?A(F):W(u||new Oe(new Qt("The user rejected the request.",pt.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1}),w(null),c(""),f(void 0)};return i.current=()=>{B(g)},(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(k,{onClose:()=>B(g)}),(0,pe.jsx)(ee,{}),(0,pe.jsxs)(T0,{children:[(0,pe.jsx)(x0,{children:S.title}),(0,pe.jsx)(S0,{children:S.description}),E==="personal_sign"&&(0,pe.jsx)(Ag,{children:C0(x)}),E==="eth_signTypedData_v4"&&(0,pe.jsx)(P0,{typedData:x}),(0,pe.jsx)(A0,{fail:!0,children:s}),(0,pe.jsx)(R0,{success:C,loading:a,disabled:C,onClick:async()=>{try{let F=await b();w(F),c(""),setTimeout(()=>{B(F)},bt)}catch{c("An error has occurred, please try again."),f(new Oe(new Qt(s,pt.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:C?(0,pe.jsxs)(k0,{children:[(0,pe.jsx)($s,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,pe.jsx)("span",{children:"Success"})]}):S.buttonText})]}),(0,pe.jsx)(te,{}),(0,pe.jsx)($,{protectedByPrivy:!0})]})},T0=Mo.default.div`
2247
+ `;var xg=require("@ethersproject/bytes"),Sg=require("@ethersproject/strings"),$o=require("react"),Ir=h(require("styled-components"));var de=require("react/jsx-runtime"),w2=e=>{if(!(0,xg.isHexString)(e))return e;try{return(0,Sg.toUtf8String)(e)}catch{return e}},C2=e=>JSON.stringify(e,null,2),b2=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?(0,de.jsx)(S2,{children:Object.entries(r).map(([o,n])=>(0,de.jsxs)("li",{children:[(0,de.jsxs)("strong",{children:[o,":"]})," ",t(n)]},o))}):(0,de.jsx)("span",{children:String(r)});return(0,de.jsx)("div",{children:t(e)})},E2=e=>{let{types:t,primaryType:r,...o}=e.typedData;return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(Ag,{children:(0,de.jsx)(b2,{data:o})}),(0,de.jsx)(ai,{text:C2(e.typedData),itemName:"full payload to clipboard"})," "]})},_g=()=>{let{authenticated:e}=G(),{initializeWalletProxy:t,closePrivyModal:r}=W(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=A(),[a,l]=(0,$o.useState)(!0),[s,c]=(0,$o.useState)(""),[u,f]=(0,$o.useState)(),[g,w]=(0,$o.useState)(null),C=g!==null;(0,$o.useEffect)(()=>{e||o("LANDING")},[e]),(0,$o.useEffect)(()=>{t(Tn).then(B=>{l(!1),B||(c("An error has occurred, please try again."),f(new We(new er(s,dt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:b,data:S,confirmAndSign:P,onSuccess:T,onFailure:M,uiOptions:I}=n.signMessage,_={title:I.title||"Sign message",description:I.description||"Signing this message will not cost you any fees.",buttonText:I.buttonText||"Sign and continue"},F=B=>{B?T(B):M(u||new We(new er("The user rejected the request.",dt.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),w(null),c(""),f(void 0)};return i.current=()=>{F(g)},(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(k,{onClose:()=>F(g)}),(0,de.jsx)(ee,{}),(0,de.jsxs)(P2,{children:[(0,de.jsx)(T2,{children:_.title}),(0,de.jsx)(x2,{children:_.description}),b==="personal_sign"&&(0,de.jsx)(Ag,{children:w2(S)}),b==="eth_signTypedData_v4"&&(0,de.jsx)(E2,{typedData:S}),(0,de.jsx)(_2,{fail:!0,children:s}),(0,de.jsx)(k2,{success:C,loading:a,disabled:C,onClick:async()=>{try{let B=await P();w(B),c(""),setTimeout(()=>{F(B)},bt)}catch{c("An error has occurred, please try again."),f(new We(new er(s,dt.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:C?(0,de.jsxs)(A2,{children:[(0,de.jsx)(Vs,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,de.jsx)("span",{children:"Success"})]}):_.buttonText})]}),(0,de.jsx)(te,{}),(0,de.jsx)($,{protectedByPrivy:!0})]})},P2=Ir.default.div`
2248
2248
  display: flex;
2249
2249
  flex-direction: column;
2250
2250
  align-items: center;
2251
2251
  justify-content: center;
2252
- `,x0=Mo.default.span`
2252
+ `,T2=Ir.default.span`
2253
2253
  color: var(--privy-color-foreground);
2254
2254
  text-align: center;
2255
2255
  font-size: 1.125rem;
2256
2256
  font-weight: 500;
2257
2257
  line-height: 1.25rem; /* 111.111% */
2258
2258
  text-align: center;
2259
- `,S0=Mo.default.span`
2259
+ `,x2=Ir.default.span`
2260
2260
  margin-top: 4px;
2261
2261
  color: var(--privy-color-foreground);
2262
2262
  text-align: center;
@@ -2266,7 +2266,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2266
2266
  font-weight: 400;
2267
2267
  line-height: 20px; /* 142.857% */
2268
2268
  letter-spacing: -0.008px;
2269
- `,Ag=Mo.default.div`
2269
+ `,Ag=Ir.default.div`
2270
2270
  margin-top: 1.5rem;
2271
2271
  background-color: var(--privy-color-background-2);
2272
2272
  border-radius: var(--privy-border-radius-md);
@@ -2285,7 +2285,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2285
2285
  display: none; /* Safari and Chrome */
2286
2286
  }
2287
2287
  }
2288
- `,_0=Mo.default.ul`
2288
+ `,S2=Ir.default.ul`
2289
2289
  margin-left: 12px !important;
2290
2290
  white-space: nowrap;
2291
2291
 
@@ -2297,7 +2297,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2297
2297
  font-weight: 500 !important;
2298
2298
  }
2299
2299
  }
2300
- `,A0=Mo.default.div`
2300
+ `,_2=Ir.default.div`
2301
2301
  line-height: 20px;
2302
2302
  height: 20px;
2303
2303
  font-size: 13px;
@@ -2307,22 +2307,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
2307
2307
  width: 100%;
2308
2308
  margin-top: 16px;
2309
2309
  margin-bottom: 4px;
2310
- `,k0=Mo.default.span`
2310
+ `,A2=Ir.default.span`
2311
2311
  display: flex;
2312
2312
  align-items: center;
2313
2313
  gap: 8px;
2314
- `,R0=(0,Mo.default)(U)`
2314
+ `,k2=(0,Ir.default)(U)`
2315
2315
  transition: color 350ms ease, background-color 350ms ease;
2316
2316
 
2317
- ${e=>e.success&&Mo.css`
2317
+ ${e=>e.success&&Ir.css`
2318
2318
  &&&& {
2319
2319
  background-color: var(--privy-color-success);
2320
2320
  color: #ffffff;
2321
2321
  }
2322
2322
  `}
2323
- `;var Ig=h(require("@heroicons/react/24/outline/EnvelopeIcon"));var kg=h(require("@heroicons/react/24/outline/EnvelopeIcon")),ha=require("react"),wd=h(require("styled-components"));var Wo=require("react/jsx-runtime"),Rg=(0,ha.forwardRef)((e,t)=>{let[o,r]=(0,ha.useState)(""),[n,i]=(0,ha.useState)(!1),{authenticated:a,user:l}=G(),{initUpdateEmail:s}=M(),{navigate:c,setModalData:u,currentScreen:f}=_(),{enabled:g,token:w}=Ee(),C=Da(o),E=n,x=n||!C,b=async W=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");i(!0);try{await s(l.email.address,o,W),c("AWAITING_PASSWORDLESS_CODE")}catch(I){u({errorModalData:{error:I,previousScreen:f||"LANDING"}})}i(!1)},A=()=>{g&&!w&&!a?(u({captchaModalData:{callback:W=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,o,W)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):b(w)};return(0,Wo.jsxs)(Wo.Fragment,{children:[(0,Wo.jsx)(I0,{children:(0,Wo.jsxs)(M0,{children:[(0,Wo.jsx)(kg.default,{}),(0,Wo.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:W=>r(W.target.value),onKeyUp:W=>{W.key==="Enter"&&A()},value:o,autoComplete:"email"}),e.stacked?null:(0,Wo.jsx)(Fn,{isSubmitting:E,onClick:A,disabled:x,children:"Submit"})]})}),e.stacked?(0,Wo.jsx)(U,{loadingText:null,loading:E,disabled:x,onClick:A,children:"Submit"}):null]})}),I0=wd.default.div`
2323
+ `;var Ig=h(require("@heroicons/react/24/outline/EnvelopeIcon"));var kg=h(require("@heroicons/react/24/outline/EnvelopeIcon")),fa=require("react"),Ed=h(require("styled-components"));var Mr=require("react/jsx-runtime"),Rg=(0,fa.forwardRef)((e,t)=>{let[r,o]=(0,fa.useState)(""),[n,i]=(0,fa.useState)(!1),{authenticated:a,user:l}=G(),{initUpdateEmail:s}=W(),{navigate:c,setModalData:u,currentScreen:f}=A(),{enabled:g,token:w}=be(),C=Oa(r),b=n,S=n||!C,P=async M=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");i(!0);try{await s(l.email.address,r,M),c("AWAITING_PASSWORDLESS_CODE")}catch(I){u({errorModalData:{error:I,previousScreen:f||"LANDING"}})}i(!1)},T=()=>{g&&!w&&!a?(u({captchaModalData:{callback:M=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,M)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):P(w)};return(0,Mr.jsxs)(Mr.Fragment,{children:[(0,Mr.jsx)(R2,{children:(0,Mr.jsxs)(I2,{children:[(0,Mr.jsx)(kg.default,{}),(0,Mr.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:M=>o(M.target.value),onKeyUp:M=>{M.key==="Enter"&&T()},value:r,autoComplete:"email"}),e.stacked?null:(0,Mr.jsx)(Hn,{isSubmitting:b,onClick:T,disabled:S,children:"Submit"})]})}),e.stacked?(0,Mr.jsx)(U,{loadingText:null,loading:b,disabled:S,onClick:T,children:"Submit"}):null]})}),R2=Ed.default.div`
2324
2324
  width: 100%;
2325
- `,M0=wd.default.label`
2325
+ `,I2=Ed.default.label`
2326
2326
  display: block;
2327
2327
  position: relative;
2328
2328
  width: 100%;
@@ -2380,7 +2380,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2380
2380
  && > input::placeholder {
2381
2381
  color: var(--privy-color-foreground-3);
2382
2382
  }
2383
- `;var Yt=require("react/jsx-runtime"),Mg=()=>(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(k,{},"header"),(0,Yt.jsx)(ee,{}),(0,Yt.jsx)(Ue,{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,Yt.jsx)(Ig.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Yt.jsx)(io,{children:(0,Yt.jsx)(Rg,{stacked:!0})}),(0,Yt.jsx)(te,{}),(0,Yt.jsx)($,{protectedByPrivy:!0})]});var Ml=h(require("styled-components"));var W0=`
2383
+ `;var Zt=require("react/jsx-runtime"),Mg=()=>(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)(k,{},"header"),(0,Zt.jsx)(ee,{}),(0,Zt.jsx)(Ne,{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,Zt.jsx)(Ig.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Zt.jsx)(sr,{children:(0,Zt.jsx)(Rg,{stacked:!0})}),(0,Zt.jsx)(te,{}),(0,Zt.jsx)($,{protectedByPrivy:!0})]});var Rl=h(require("styled-components"));var M2=`
2384
2384
  *,
2385
2385
  ::before,
2386
2386
  ::after {
@@ -2610,7 +2610,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2610
2610
  [hidden] {
2611
2611
  display: none;
2612
2612
  }
2613
- `,Wg=W0;var Lg=Ml.createGlobalStyle`
2613
+ `,Wg=M2;var Lg=Rl.createGlobalStyle`
2614
2614
  :root {
2615
2615
  // Borders
2616
2616
  --privy-border-radius-sm: 6px;
@@ -2642,7 +2642,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2642
2642
  --privy-height-modal-full: 620px;
2643
2643
  --privy-height-modal-compact: 480px;
2644
2644
  };
2645
- `,Og=Ml.default.div`
2645
+ `,Og=Rl.default.div`
2646
2646
  // css normalize only the privy application to avoid conflicts
2647
2647
  // with consuming application
2648
2648
  ${Wg}
@@ -2704,4 +2704,4 @@ You will need this password to access your ${e} wallet on a new device. Please k
2704
2704
  opacity: 1;
2705
2705
  }
2706
2706
  }
2707
- `;var He=require("react/jsx-runtime"),L0={["LANDING"]:ty,["CONNECT_OR_CREATE"]:ey,["AWAITING_PASSWORDLESS_CODE"]:am,["AWAITING_CONNECTION"]:Mm,["AWAITING_CONNECT_ONLY_CONNECTION"]:Om,["AWAITING_FARCASTER_CONNECTION"]:sh,["PHANTOM_INTERSTITIAL_SCREEN"]:vg,["LOGIN_FAILED_SCREEN"]:ly,["AWAITING_OAUTH_SCREEN"]:fg,["ALLOWLIST_REJECTION_SCREEN"]:Yu,["INSTALL_PHANTOM_SCREEN"]:kh,["LINK_EMAIL_SCREEN"]:ry,["LINK_PHONE_SCREEN"]:iy,["LINK_WALLET_SCREEN"]:ay,["UPDATE_EMAIL_SCREEN"]:Mg,["CONNECT_ONLY_LANDING_SCREEN"]:km,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Pm,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Of,["EMBEDDED_WALLET_CREATED_SCREEN"]:zm,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Hm,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:Gf,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Ym,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:_g,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:Tg,["FIAT_ON_RAMP_PROMPT_SCREEN"]:yh,["FIAT_ON_RAMP_STATUS_SCREEN"]:bh,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Bf,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Nf,["MFA_ENROLLMENT_FLOW_SCREEN"]:xy,["CAPTCHA_SCREEN"]:fm,["ERROR_SCREEN"]:$f,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Th,["AFFIRMATIVE_CONSENT_SCREEN"]:ju},O0=["LANDING","AWAITING_CONNECTION"],N0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:o,isModalOpen:r}=G(),{headless:n}=M(),{ready:i,currentScreen:a}=_(),{status:l,execute:s,reset:c,enabled:u}=Ee(),f=(0,yr.useRef)(null),g=Wu(f),w=r&&a&&O0.includes(a)&&!n&&l==="ready";if((0,yr.useEffect)(()=>{w&&s()},[w]),(0,yr.useEffect)(()=>{!r&&u&&c()},[r,u]),(!o||!i)&&a!=="AWAITING_OAUTH_SCREEN")return(0,He.jsxs)(ui,{children:[(0,He.jsx)(k,{}),(0,He.jsx)(ee,{}),(0,He.jsx)(dy,{children:(0,He.jsx)(oo,{})}),(0,He.jsx)(te,{}),(0,He.jsx)(ne,{})]});if(!a&&e)return(0,He.jsx)(ui,{style:{height:g},children:(0,He.jsx)("div",{ref:f,children:(0,He.jsx)(yd,{open:e,onClose:t})})});if(!a)return null;let C=L0[a];return(0,He.jsx)(ui,{style:{height:g},children:(0,He.jsxs)("div",{ref:f,children:[(0,He.jsx)(ar,{if:!!e,children:(0,He.jsx)(C,{})}),(0,He.jsx)(ar,{if:!e,children:(0,He.jsx)(yd,{open:e,onClose:t})})]})})},D0=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=_();return{gracefulClosePrivyModal:(0,yr.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Dg=({open:e})=>{let{app:t}=_(),{gracefulClosePrivyModal:o}=D0(),[r,n]=(0,yr.useState)(!1);Es({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=(0,He.jsx)(Og,{children:(0,He.jsx)(N0,{isMfaVerifying:r,onMfaVerificationComplete:()=>n(!1)})}),a=e||r,l=t?.render.inDialog?(0,He.jsx)(cy,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>o(),children:i}):i;if(typeof window<"u"&&t?.render.inParentNodeId){let s=document.getElementById(t.render.inParentNodeId);if(s)return Ng.default.createPortal(l,s)}return l};var ya=require("react");var Wl=class{constructor(){this.callbacks={}}enqueue(t,o){this.callbacks[t]=o}dequeue(t,o){let r=this.callbacks[o];if(!r)throw new Error(`cannot dequeue ${t} event: no event found for id ${o}`);switch(delete this.callbacks[o],t){case"privy:iframe:ready":return r;case"privy:wallet:create":return r;case"privy:wallet:connect":return r;case"privy:wallet:recover":return r;case"privy:wallet:rpc":return r;case"privy:wallet:set-recovery-password":return r;case"privy:mfa:verify":return r;case"privy:mfa:init-enrollment":return r;case"privy:mfa:submit-enrollment":return r;case"privy:mfa:unenroll":return r;default:throw new Error(`invalid wallet event type ${t}`)}}};async function hn(e,t,o,r,n,i=!1){let a=i,l=async u=>{if(a&&t&&t.length>0){u===(i?0:1)?n("configureMfa","onMfaRequired",t):r.current?.reject(new ze("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((g,w)=>{o.current={resolve:g,reject:w};let C=1e3*60*5;setTimeout(()=>{let E=new ze("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(E),w(E)},C)});return await e(f)}return await e()},s=4,c=null;for(let u=0;u<s;u++)try{c=await l(u),r.current?.resolve(void 0);break}catch(f){if(f.type==="missing_or_invalid_mfa")a=!0;else throw r.current?.resolve(void 0),f}if(c===null){let u=new ze("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(u),u}return c}var Fg=require("react/jsx-runtime"),U0=function(e){return()=>`id-${e++}`}(0);function F0(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Xo(e){return e.error!==void 0}var Lo=new Wl,Cd=new Map,B0=(e,t)=>typeof t=="bigint"?t.toString():t,H0=(e,t)=>`${e}${JSON.stringify(t,B0)}`;function er(e,t,o,r){let n=o.contentWindow;if(!n)throw new Error("iframe not initialized");let i=H0(e,t);if(e==="privy:wallet:create"){let l=Cd.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=U0();Lo.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},r)}).finally(()=>{Cd.delete(i)});return Cd.set(i,a),a}function G0(e){switch(e.event){case"privy:iframe:ready":let t=Lo.dequeue(e.event,e.id);return Xo(e)?t.reject(new ze(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=Lo.dequeue(e.event,e.id);return Xo(e)?o.reject(new ze(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=Lo.dequeue(e.event,e.id);return Xo(e)?r.reject(new ze(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=Lo.dequeue(e.event,e.id);return Xo(e)?n.reject(new ze(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=Lo.dequeue(e.event,e.id);return Xo(e)?i.reject(new ze(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=Lo.dequeue(e.event,e.id);return Xo(e)?a.reject(new ze(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=Lo.dequeue(e.event,e.id);return Xo(e)?l.reject(new ze(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=Lo.dequeue(e.event,e.id);return Xo(e)?s.reject(new ze(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=Lo.dequeue(e.event,e.id);return Xo(e)?s.reject(new ze(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=Lo.dequeue(e.event,e.id);return Xo(e)?s.reject(new ze(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function Ug(e){let t=(0,ya.useRef)(null),o=(0,ya.useRef)(e.mfaMethods),r=Nu();return(0,ya.useEffect)(()=>{o.current=e.mfaMethods},[e.mfaMethods]),(0,Fg.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>{let i=t.current;if(!i)return;function a(f){f&&f.origin===e.origin&&F0(f.data)&&G0(f.data)}let l={create(f){return er("privy:wallet:create",f,i,e.origin)},connect(f){return er("privy:wallet:connect",f,i,e.origin)},recover(f){return hn(g=>er("privy:wallet:recover",{...f,...g},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r,!0)},rpc(f){return hn(g=>er("privy:wallet:rpc",{...f,...g},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r)},setRecoveryPassword(f){return hn(g=>er("privy:wallet:set-recovery-password",{...f,...g},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r)},verifyMfa(f){return hn(g=>er("privy:mfa:verify",{...f,...g},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r,!0)},initEnrollMfa(f){return hn(g=>er("privy:mfa:init-enrollment",{...f,...g},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r)},submitEnrollMfa(f){return er("privy:mfa:submit-enrollment",f,i,e.origin)},unenrollMfa(f){return hn(g=>er("privy:mfa:unenroll",{...f,...g},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r,!0)}};window.addEventListener("message",a);let s=()=>e.onLoad(l),c=(...f)=>{console.warn("Privy iframe failed to load: ",...f),e.onLoadFailed()},u=new AbortController;return Sp(()=>er("privy:iframe:ready",{},i,e.origin),{abortSignal:u.signal}).then(s,c),()=>{window.removeEventListener("message",a),u.abort()}},src:Ua(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function Ll(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(r=>t.includes(r))}var Ol=class{constructor(t,o){this.meta={action:t,phoneNumber:o}}async init(){if(!this.meta.action)throw new T("action required");if(!this.api)throw new T("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new T("phone number must be set when initialzing authentication.");try{await this.api.post(ep,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw me(t)}}async authenticate(){if(!this.meta.action)throw new T("action required");if(!this.api)throw new T("Mfa flow has no API instance");if(!this.meta.smsCode)throw new T("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new T("phone number must be set prior to calling authenticate.");try{let t=await this.api.post(tp,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return Bt(t)}catch(t){throw me(t)}}};var Dt=require("react/jsx-runtime"),xi;function V0(e){return typeof e=="string"&&e.length===25}function Ye(){if(!xi){let e=fe.get($r);return Promise.resolve(e||null)}return xi.getAccessToken()}var Hg,Wp=(e,t)=>Hg(e,t),Gg,Lp=(e,t)=>Gg(e,t),Vg,Op=(e,t)=>Vg(e,t),zg,Np=()=>zg(),z0=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;fe.put(Ri,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},$g=({config:e,...t})=>{if(!V0(t.appId))throw new T("Cannot initialize the Privy provider with an invalid Privy app ID");xi||(xi=new Dn({appId:t.appId,apiUrl:t.apiUrl||ka}));let o=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&o.embeddedWallets?.createOnLogin===void 0&&(o.embeddedWallets||(o.embeddedWallets={}),o.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,Dt.jsx)(lu,{client:xi,clientConfig:o,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,Dt.jsx)($0,{...t,config:o,client:xi})})},$0=e=>{let t=e.client,[o,r]=(0,Q.useState)(!1),[n,i]=(0,Q.useState)(!1),[a,l]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),[u,f]=(0,Q.useState)([]),g=(0,Q.useRef)(u),[w,C]=(0,Q.useState)(!1),[E,x]=(0,Q.useState)(null),[b,A]=(0,Q.useState)(!1),[W,I]=(0,Q.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:P}),[S,B]=(0,Q.useState)(null),[F,q]=(0,Q.useState)(null),[R,Z]=(0,Q.useState)(null),D=ds(),Y=ps(),[K,re]=(0,Q.useState)(!0),[ue,J]=(0,Q.useState)({}),[it,At]=(0,Q.useState)(null),[Ut,at]=(0,Q.useState)(null),[ce,gr]=(0,Q.useState)(!1),[uo,Gr]=(0,Q.useState)(!1),st=(0,Q.useRef)(null),je=(0,Q.useRef)(null),L=(0,Q.useRef)(Lu);t.onStoreToken=d=>{d&&N(L,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{N(L,"accessToken","onAccessTokenRemoved")};let ge=(0,Q.useRef)(null),H=(0,Q.useRef)(null),Oo=(0,Q.useCallback)(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(v=>v.type==="wallet"&&v.walletClientType==="privy")?p&&d?.some(v=>v?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),Ae=d=>{x(d),setTimeout(()=>{r(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},Re=d=>{D.embeddedWallets.createOnLogin!=="off"&&re(!0),Ae(d)};(0,Q.useEffect)(()=>{if(!R||!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=s?.linkedAccounts.filter(p=>p.type==="wallet"&&p.walletClientType==="privy");if(d&&d.length>0){let p=d[0].address;t.connectors?.addEmbeddedWalletConnector(R,p,D.defaultChain)}},[R,s]),(0,Q.useEffect)(()=>{R&&Ut?.(R)},[R]),(0,Q.useEffect)(()=>{(async()=>{if(!D.customAuth?.enabled)return;re(!0);let{getCustomAccessToken:p,isLoading:y}=D.customAuth;if(!(!n||y))try{let v=await p();if(!v){await wn.logout();return}if(a)return;t.startAuthFlow(new bn(v));let{user:O,isNewUser:V}=await t.authenticate();O||await wn.logout(),c(O||null),C(V||!1),l(!0),Gr(!0)}catch(v){console.warn(v),a&&await wn.logout()}})()},[D.customAuth?.enabled,D.customAuth?.getCustomAccessToken,D.customAuth?.isLoading,n,a]),(0,Q.useEffect)(()=>{uo&&R&&s&&Zt(s,e.config?.embeddedWallets?.createOnLogin)&&(Gr(!1),wa(s,Pn).catch(console.error))},[uo&&R&&s]),(0,Q.useEffect)(()=>{async function d(){let p=_i();z0();let y=(0,Bg.createStore)();B(y),t.initializeConnectorManager(D.walletConnectCloudProjectId,D.rpcConfig,D.chains,D.defaultChain,y,D.appearance.walletList,D.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{Ai()});let v=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!v),v&&N(L,"login","onComplete",v,!1,!0,null),c(v)),p||xe.setReadyToTrue(),p&&(v?H.current="link":H.current="login")}!n&&Y&&d()},[t,it,n,Y]);let _i=()=>{let d=Li();return!d.inProgress||d.headless?!1:(t.startAuthFlow(new Do(d)),Re("AWAITING_OAUTH_SCREEN"),!0)},yn=async(d,p,y,v)=>{let O=await t.connectors?.createWalletConnector(d,p)||null;gn(O,p,y,v)};async function gn(d,p,y,v){if(!d)return I({status:"disconnected",connectedWallet:null,connectError:new X("Unable to connect to wallet."),connector:null,connectRetry:P}),v?.(null,y);d instanceof Bo&&p&&await d.resetConnection(p),I({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>gn(d,p,y,v)});try{let O=await d.connect({showPrompt:!0});if(D.shouldEnforceDefaultChainOnConnect&&!D.chains.find(V=>V.id===Number(O?.chainId))&&!(O?.connectorType==="wallet_connect_v2"&&O?.walletClientType==="metamask")){I(V=>({...V,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:P}));try{await O?.switchChain(D.defaultChain.id),O&&(O.chainId=Tn(Jr(D.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${D.defaultChain.id}`)}}return I(V=>({...V,status:"connected",connectedWallet:O,connectError:null,connectRetry:P})),O&&!H.current&&N(L,"connectWallet","onSuccess",O),v?.(O,y)}catch(O){return O instanceof ct?(console.warn(O.cause?O.cause:O.message),H.current||N(L,"connectWallet","onError",O.privyErrorCode||"generic_connect_wallet_error")):(console.warn(O),H.current||N(L,"connectWallet","onError","unknown_connect_wallet_error")),I(V=>({...V,status:"disconnected",connectedWallet:null,connectError:O})),v?.(null,y)}}let vn=async(d,p)=>{if(d===null)return;let y=new Kr(d,p);t.startAuthFlow(y)},Ai=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),y=d.get("privy_wallet_client");if(!p||!y)return;if(y==="phantom"&&!br()&&Re("LOGIN_FAILED_SCREEN"),!t.connectors)throw new T("Connector not initialized");Ae("AWAITING_CONNECTION");let v=new URL(window.location.href);v.searchParams.delete("privy_connector"),v.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",v),yn(p,y,void 0,vn)};(0,Q.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let Ke=()=>{if(!a)throw N(L,"linkAccount","onError","must_be_authenticated"),new T("User must be authenticated before linking an account.")},kt=()=>{Ke(),ge.current="siwe",H.current="link",Ae("LINK_WALLET_SCREEN")},lt=d=>{if(!a||!s)return!1;if(d.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},vr=async d=>{if(!t.connectors)throw new T("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(I(y=>({...y,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:P})),D.captchaEnabled&&!a){let y={callback:v=>vn(d,v),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};J({captchaModalData:y}),Re("CAPTCHA_SCREEN")}else await vn(d),Re("AWAITING_CONNECTION")},Vr=async(d,p)=>{if(!D.fiatOnRamp.enabled)throw new T("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:y,externalTransactionId:v}=await fh(t,d,p?.config??{},D.appearance.palette,D.fiatOnRamp.useSandbox);return{signedUrl:y,externalTransactionId:v}}else throw new T("Unsupported fund provider. Currently supported option is `moonpay`.")},zr=()=>{f(d=>{let p=t.connectors?.wallets.map(y=>({...y,linked:lt(y),loginOrLink:async()=>{if(!await y.isConnected())throw new T("Wallet is not connected");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new T("Cannot link or login with embedded wallet");vr(y)},fund:async v=>{let{signedUrl:O,externalTransactionId:V}=await Vr(y.address,v);J({fiatOnRampPrompt:{signedUrl:O},fiatOnRampStatus:{externalTransactionId:V}}),Ae("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new T("User is not authenticated.");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new T("Cannot unlink an embedded wallet");let v=await t.unlinkWallet(y.address);c(v)}}))||[];return gr(Oo(p)),Ga(d,p)?d:p})};(0,Q.useEffect)(()=>{zr()},[s?.linkedAccounts,a,n]),(0,Q.useEffect)(()=>{if(n){if(!t.connectors)throw new T("Connector not initialized");zr(),t.connectors.on("walletsUpdated",zr)}},[n]);let wr=()=>{Ae(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,Q.useEffect)(()=>{if(!u[0])return;let d=u[0],p=g.current.find(v=>v.address===d.address),y;if(d.walletClientType==="privy"?y=s?.linkedAccounts.find(v=>v.type==="wallet"&&v.address===d.address&&v.walletClientType==="privy"):y=s?.linkedAccounts.find(v=>v.type==="wallet"&&v.address===d.address&&v.walletClientType!=="privy"),!p&&y){let v=Object.assign({},s);v.wallet=y&&{address:y.address,chainType:y.chainType,chainId:y.chainId,walletClient:y.walletClient,walletClientType:y.walletClientType,connectorType:y.connectorType},c(v)}g.current=u},[u]);let wa=async(d,p)=>{if(Ie(d))throw N(L,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[v,O]=await Promise.all([xe.initializeWalletProxy(p),Ye()]);if(!v&&e.config?.customAuth?.enabled)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!v||!O||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((V,Se)=>{re(!0),J({createWallet:{onSuccess:Rt=>{N(L,"createWallet","onSuccess",Rt),V(Rt)},onFailure:Rt=>{N(L,"createWallet","onError","unknown_embedded_wallet_error"),Se(Rt)},callAuthOnSuccessOnClose:!1}}),Ae("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await v.create({accessToken:O});let V=await xe.refreshUser(),Se=Ie(V);if(!Se)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return N(L,"createWallet","onSuccess",Se),Se}},w1=d=>{if(!D.chains.map(p=>p.id).includes(d))throw new X(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Pd=(d,p,y)=>new Promise(async(v,O)=>{if(!a||!s){N(L,"sendTransaction","onError","must_be_authenticated"),O(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=Ie(s);if(!V){N(L,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have a Privy wallet before signing"));return}re(!0);let Se=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,gt=d.chainId?Number(d.chainId):Se.chainId;w1(gt);let Rt=Object.assign({},d,{chainId:gt}),tr=async()=>{let vt=await Ye();if(!vt||!R){N(L,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await xe.recoverEmbeddedWallet()){N(L,"sendTransaction","onError","unknown_connect_wallet_error"),O(new Error("Unable to connect to wallet"));return}let ho=new Si.StaticJsonRpcProvider(yo(Rt.chainId,D.chains,D.rpcConfig)),Nl=await Ci(V.address,Rt,ho);if(D.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:b1}=await wi(Nl,ho),{hasSufficientFunds:E1}=await _l(V.address,Nl,b1,ho);if(!E1)throw new Oe(new Qt("Wallet has insufficient funds for this transaction.",pt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Sd=await Sl(vt,V.address,R,Nl,ho);N(L,"sendTransaction","onSuccess",Sd),v(Sd)}catch(fo){N(L,"sendTransaction","onError","transaction_failure"),O(fo)}};if(D.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),tr();else{let vt={transactionRequest:Rt,onSuccess:ho=>{N(L,"sendTransaction","onSuccess",ho),v(ho)},onFailure:ho=>{N(L,"sendTransaction","onError","transaction_failure"),O(ho)},uiOptions:p||{},fundWalletConfig:y},fo={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:ho=>{N(L,"sendTransaction","onError","unknown_connect_wallet_error"),O(ho)}};J({connectWallet:fo,sendTransaction:vt}),Ae("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Td(){return new Promise(async(d,p)=>{let y=await Ye();if(!y||!R)throw new Error("Must have valid access token to enroll in MFA");try{await R.verifyMfa({accessToken:y}),d()}catch(v){p(v)}})}let mo=d=>{if(s?.[d])throw N(L,"linkAccount","onError","cannot_link_more_of_type"),new T(`User already has an account of type ${d} linked.`)},wn={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:wr,linkWallet:kt,linkEmail:()=>{Ke(),mo("email"),ge.current="email",H.current="link",Ae("LINK_EMAIL_SCREEN")},linkPhone:()=>{Ke(),mo("phone"),ge.current="sms",H.current="link",Ae("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Ke(),mo("google"),H.current="link",await xe.initLoginWithOAuth("google")},linkTwitter:async()=>{Ke(),mo("twitter"),H.current="link",await xe.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Ke(),mo("discord"),H.current="link",await xe.initLoginWithOAuth("discord")},linkGithub:async()=>{Ke(),mo("github"),H.current="link",await xe.initLoginWithOAuth("github")},linkSpotify:async()=>{Ke(),mo("spotify"),H.current="link",await xe.initLoginWithOAuth("spotify")},linkTiktok:async()=>{Ke(),mo("tiktok"),H.current="link",await xe.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Ke(),mo("linkedin"),H.current="link",await xe.initLoginWithOAuth("linkedin")},linkApple:async()=>{Ke(),mo("apple"),H.current="link",await xe.initLoginWithOAuth("apple")},linkFarcaster:async()=>{Ke(),mo("farcaster"),await xe.initLoginWithFarcaster(),H.current="link",ge.current="farcaster",Ae("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Ke(),!s?.email)throw new T("User does not have an email linked to their account.");H.current="link",ge.current="email",Ae("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{At(()=>d)}),At(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}H.current="login",Re("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{At(()=>d)}),At(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(u[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}Re("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),x(null),N(L,"logout","onSuccess"),H.current=null,ge.current=null,r(!1),fe.del(Ii)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new ke;let d=u.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(v=>v.address===d?.address));return!d||!p?new ke:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Si.Web3Provider(new vo(new ke));let d=u.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(v=>v.address===d?.address));return!d||!p?new Si.Web3Provider(new vo(new ke)):new Si.Web3Provider(new vo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Tr(new ke);let d=u.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(v=>v.address===d?.address));return!d||!p?new Tr(new ke):new Tr(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},setActiveWallet:async d=>{let p=u.find(v=>(0,ga.getAddress)(v.address)===(0,ga.getAddress)(d)),y=s?.linkedAccounts.find(v=>v.type==="wallet"&&(0,ga.getAddress)(v.address)===(0,ga.getAddress)(d));if(!p||!await p.isConnected())q(d),kt();else if(!p.linked)p.loginOrLink();else{let v=Object.assign({},s);v.wallet=y&&{address:y.address,chainType:y.chainType,chainId:y.chainId,walletClient:y.walletClient,walletClientType:y.walletClientType,connectorType:y.connectorType},c(v)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw N(L,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return wa(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw N(L,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=Ie(s);if(!d||!R)throw N(L,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw N(L,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await Td()}catch(p){throw N(L,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,y)=>{re(!0);let v={onSuccess:V=>{N(L,"setWalletPassword","onSuccess",V),p(V)},onFailure:V=>{N(L,"setWalletPassword","onError","user_exited_set_password_flow"),y(V)},callAuthOnSuccessOnClose:!1},O={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:V=>{N(L,"setWalletPassword","onError","unknown_connect_wallet_error"),y(V)}};J({setWalletPassword:v,connectWallet:O}),Ae("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(y,v)=>{if(!a||!s){N(L,"signMessage","onError","must_be_authenticated"),v(new Error("User must be authenticated before signing with a Privy wallet"));return}let O=Ie(s);if(!O){N(L,"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(L,"signMessage","onError","invalid_message"),v(new Error("Message must be a non-empty string"));return}re(!0);let V=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Se=await Ye();if(!R||!Se)throw new Error("Unable to connect to wallet");if(!await xe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:O.address});let{response:Rt}=await R.rpc({accessToken:Se,address:O.address,request:{method:"personal_sign",params:[d,O.address]}}),tr=Rt.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:O.address}),tr};if(D.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Se=await V();N(L,"signMessage","onSuccess",Se),y(Se)}catch(Se){N(L,"signMessage","onError","unable_to_sign"),v(Se??new Oe("Unable to sign message"))}}else{let Rt={method:"personal_sign",data:d,confirmAndSign:V,onSuccess:vt=>{N(L,"signMessage","onSuccess",vt),y(vt)},onFailure:vt=>{N(L,"signMessage","onError","unable_to_sign"),v(vt)},uiOptions:p||{}},tr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:vt=>{N(L,"signMessage","onError","unknown_connect_wallet_error"),v(vt)}};J({signMessage:Rt,connectWallet:tr}),Ae("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(y,v)=>{if(!a||!s){N(L,"signTypedData","onError","must_be_authenticated"),v(new Error("User must be authenticated before signing with a Privy wallet"));return}let O=Ie(s);if(!O){N(L,"signTypedData","onError","embedded_wallet_not_found"),v(new Error("Must have a Privy wallet before signing"));return}re(!0);let V=Fa(d),Se=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let gt=await Ye();if(!R||!gt)throw new Error("Unable to connect to wallet");if(!await xe.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:O.address});let{response:tr}=await R.rpc({accessToken:gt,address:O.address,request:{method:"eth_signTypedData_v4",params:[O.address,V]}}),vt=tr.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:O.address}),vt};if(D.embeddedWallets.noPromptOnSignature||(D.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let gt=await Se();N(L,"signTypedData","onSuccess",gt),y(gt)}catch(gt){N(L,"signTypedData","onError","unable_to_sign"),v(gt??new Oe("Unable to sign message"))}}else{let tr={method:"eth_signTypedData_v4",data:V,confirmAndSign:Se,onSuccess:fo=>{N(L,"signTypedData","onSuccess",fo),y(fo)},onFailure:fo=>{N(L,"signTypedData","onError","unable_to_sign"),v(fo)},uiOptions:p||{}},vt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:fo=>{N(L,"signMessage","onError","unknown_connect_wallet_error"),v(fo)}};J({signMessage:tr,connectWallet:vt}),Ae("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,y)=>{let O=await(await Pd(d,p,y)).wait();return Al(O)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=Ie(s);if(!y){p(new Error("Must have a Privy wallet before exporting"));return}re(!0);let v={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},O=await Ye();if(!O||!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:O,address:y.address}),await R.verifyMfa({accessToken:O})}catch(Se){if(Xr(Se))await xe.recoverEmbeddedWallet();else throw Se}}catch(Se){p(Se);return}let V={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};J({keyExport:V,connectWallet:v}),Ae("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Td,async init(d){let p;switch(d){case"sms":p=new Ol("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":st.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((y,v)=>{je.current={resolve:y,reject:v}});break;default:throw st.current?.reject(new T("Unsupported MFA method")),new T(`Unsupported MFA method: ${d}`)}},cancel(){st.current?.reject(new T("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ye();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,y)=>{if(!d){xe.closePrivyModal(),p();return}D.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."),J({mfaEnrollmentFlow:{mfaMethods:D.mfa.methods,onSuccess:p,onFailure:y}}),Ae("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ye();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 Ye();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 y=await t.getAuthenticatedUser();c(y)},async submitEnrollmentWithTotp(d){let p=await Ye();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 y=await t.getAuthenticatedUser();c(y)},async unenroll(d){let p=await Ye();if(!p||!R)throw new Error("Must have valid access token to remove MFA");await R.unenrollMfa({method:d,accessToken:p});let y=await t.getAuthenticatedUser();c(y)},isHeadlessOAuthLoading:b,loginWithCode(d){return xe.loginWithCode(d)},initLoginWithEmail(d){return xe.initLoginWithEmail(d)},initLoginWithSms(d){return xe.initLoginWithSms(d)},fundWallet(d,p){return xe.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return xe.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return xe.loginWithHeadlessOAuth(d)},isModalOpen:o};Hg=wn.signMessage,Gg=wn.signTypedData,Vg=async(...d)=>{let p=await Pd(...d);return D.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let xd=!!e.config?.headless,xe=(()=>({headless:xd,isNewUserThisSession:w,linkingHint:F,pendingTransaction:null,walletConnectionStatus:W,mipdStore:S,connectors:t.connectors?.walletConnectors??[],rpcConfig:D.rpcConfig,chains:D.chains,showFiatPrices:D.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>D.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(R)return R;let p=new Promise(O=>{at(()=>V=>O(V))}),y=new Promise(O=>setTimeout(()=>O(null),d)),v=await Promise.race([p,y]);return at(null),v},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s;H.current==="login"?d.shouldCallAuthOnSuccess&&p?(N(L,"login","onComplete",s,w,!1,ge.current??null),e.onSuccess?.(s,w)):N(L,"login","onError","exited_auth_flow"):H.current==="link"&&ge.current&&(d.isSuccess&&p?N(L,"linkAccount","onSuccess",s,ge.current):N(L,"linkAccount","onError","exited_link_flow")),q(null),H.current=null,ge.current=null,C(!1),r(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:Ae,connectWallet:gn,initLoginWithWallet:async(d,p)=>{ge.current="siwe",vn(d,p)},loginWithWallet:async()=>{if(!n)throw new Cn;if(!(t.authFlow instanceof Kr))throw new T("Must initialize SIWE flow first.");let d,p;if(a)try{d=await t.link(),ge.current="siwe"}catch(y){throw N(L,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}else try{({user:d,isNewUser:p}=await t.authenticate()),ge.current="siwe"}catch(y){throw N(L,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}c(d||s||null),C(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new ki(d);t.startAuthFlow(p);try{ge.current="farcaster",await p.initializeFarcasterConnect()}catch(y){throw H.current==="login"?N(L,"login","onError",y.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"linkAccount","onError",y.privyErrorCode||"unknown_auth_error"),y}},loginWithFarcaster:async()=>{if(!n)throw new Cn;if(!(t.authFlow instanceof ki))throw new T("Must initialize Farcaster flow first.");let d,p;if(a)try{d=await t.link(),ge.current="farcaster"}catch(y){throw N(L,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}else try{({user:d,isNewUser:p}=await t.authenticate()),ge.current="farcaster"}catch(y){throw N(L,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}c(d||null),C(p||!1),l(!0)},async initLoginWithOAuth(d,p){if(ge.current=d,ql()){if(d==="google"&&Ll(window.navigator.userAgent)){Re("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Re("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let y=new Do({provider:d});p&&y.addCaptchaToken(p),t.startAuthFlow(y);let v=await t.authFlow.getAuthorizationUrl();v&&v.url&&window.location.assign(v.url)},async loginWithOAuth(d){if(!(t.authFlow instanceof Do))throw new T("Must initialize OAuth flow before calling loginWithOAuth");let p=dt.get(qr),y=t.authFlow.meta.stateCode;if(p!==y)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:y??""}),new T("Unexpected auth flow. This may be a phishing attempt.");let v,O;if(a)try{v=await t.link(),ge.current=d}catch(V){throw N(L,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account"),V}else try{({user:v,isNewUser:O}=await t.authenticate()),ge.current=d}catch(V){throw H.current==="login"?N(L,"login","onError",V.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account"),V}c(v),C(O||!1),l(!0)},async initLoginWithHeadlessOAuth(d,p){if(ql()){if(d==="google"&&Ll(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 y=new Do({provider:d,headless:!0});p&&y.addCaptchaToken(p);let v=await t.startAuthFlow(y).getAuthorizationUrl();v?.url&&window.location.assign(v.url)},async loginWithHeadlessOAuth(d){A(!0),t.startAuthFlow(new Do(d));let p=dt.get(qr),y=d.stateCode;if(p!==y)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d.provider,storedStateCode:p??"",returnedStateCode:y??""}),A(!1),new T("Unexpected auth flow. This may be a phishing attempt.");let v,O;if(a)try{v=await t.link(),ge.current=d.provider}catch(V){throw N(L,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account"),V}else try{({user:v,isNewUser:O}=await t.authenticate()),ge.current=d.provider}catch(V){throw H.current==="login"?N(L,"login","onError",V.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account"),V}return c(v),C(O||!1),l(!0),A(!1),v??void 0},initLoginWithEmail:async(d,p)=>{let y=new Cr(d,p);t.startAuthFlow(y);try{ge.current="email",await y.sendCodeEmail()}catch(v){throw H.current==="login"?N(L,"login","onError",v.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"linkAccount","onError",v.privyErrorCode||"failed_to_link_account"),v}},initUpdateEmail:async(d,p,y)=>{let v=new _a(d,p,y);t.startAuthFlow(v),await v.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let y=new Yr(d,p);t.startAuthFlow(y);try{ge.current="sms",await y.sendSmsCode()}catch(v){throw H.current==="login"?N(L,"login","onError",v.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"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(!n)throw new Cn;if(t.authFlow instanceof Cr)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof Yr)t.authFlow.meta.smsCode=d.trim();else throw new T("Must initialize a passwordless code flow first");let p,y;if(a)try{p=await t.link()}catch(v){throw N(L,"linkAccount","onError",v.privyErrorCode||"failed_to_link_account"),v}else try{({user:p,isNewUser:y}=await t.authenticate())}catch(v){throw N(L,"login","onError",v.privyErrorCode||"unknown_auth_error"),v}c(p||s||null),C(y||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:R,createAnalyticsEvent:(d,p,y)=>t.createAnalyticsEvent(d,p,y),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let y=s?.linkedAccounts.find(O=>O.type==="wallet"&&O.walletClientType==="privy"),v=await Ye();if(!v||!R||!y){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}re(!0);try{await R.connect({accessToken:v,address:y.address}),d(!0)}catch(O){Xr(O)&&y.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:y.address}),(await R.recover({address:y.address,accessToken:v})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:y.address}),d(!0)):Xr(O)?(J({recoverWallet:{privyWallet:y,onFailure:p,onSuccess:()=>d(!0)}}),Ae("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(O)}}),getFiatOnRampConfig:Vr,setReadyToTrue:()=>{i(!0),it?.()},updateWallets:()=>zr(),fundWallet:async(d,p)=>{let{signedUrl:y,externalTransactionId:v}=await Vr(d,p);J({fiatOnRampPrompt:{signedUrl:y},fiatOnRampStatus:{externalTransactionId:v}}),Ae("FIAT_ON_RAMP_PROMPT_SCREEN")}}))();zg=xe.recoverEmbeddedWallet;let C1=(0,Q.useMemo)(()=>({wallets:u,ready:ce}),[u,ce]);return(0,Dt.jsx)(de.Provider,{value:wn,children:(0,Dt.jsx)(cc.Provider,{value:L,children:(0,Dt.jsx)(md.Provider,{value:C1,children:(0,Dt.jsxs)(Ru,{...D,children:[e.children,(0,Dt.jsxs)(lc.Provider,{value:xe,children:[!xd&&D.captchaEnabled&&n&&!a&&(0,Dt.jsx)(vs,{delayedExecution:!1}),(0,Dt.jsx)(Lg,{theme:{...D.appearance.palette||{}}}),(0,Dt.jsx)(pu,{data:ue,setModalData:J,setInitialScreen:x,initialScreen:E,authenticated:a,open:o,children:(0,Dt.jsx)(Dg,{open:o})}),K&&Y?(0,Dt.jsx)(Ug,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:st,mfaSubmitPromise:je,onLoad:Z,onLoadFailed:()=>null}):null]})]})})})})};var qg=require("react");function jg(e){let{login:t}=(0,qg.useContext)(de);return We("login",e),{login:t}}var Kg=require("react");function Yg(e){let{logout:t}=(0,Kg.useContext)(de);return We("logout",e),{logout:t}}var va=require("react");function Jg(){let e=Ee(),t=ps(),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:r,isHeadlessOAuthLoading:n,ready:i,user:a}=G(),l=(0,va.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new Co(e.error,null,"captcha_failure");return o(c.provider,e.token)},[o,e]),s=(0,va.useCallback)(async()=>{let c=Li();if(a)return console.warn("Cannot login with OAuth when already logged in"),a;if(!c.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");try{return await r(c)}catch(u){throw u}finally{Oi()}},[r]);return(0,va.useEffect)(()=>{let c=Li();i&&t&&c.inProgress&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}var bd=require("react");var Zg=()=>{let e=Ee(),{initLoginWithEmail:t,loginWithCode:o}=G(),r=(0,bd.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=(0,bd.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new Co(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var Ed=require("react");var Qg=()=>{let e=Ee(),{initLoginWithSms:t,loginWithCode:o}=G(),r=(0,Ed.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return t(i)},[t]),n=(0,Ed.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new Co(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var Xg=require("react");function e1(e){let{linkEmail:t,linkPhone:o,linkWallet:r,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:f,linkFarcaster:g}=(0,Xg.useContext)(de);return We("linkAccount",e),{linkEmail:t,linkPhone:o,linkWallet:r,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:f,linkFarcaster:g}}var t1=require("react");function o1(e){let{connectWallet:t}=(0,t1.useContext)(de);return We("connectWallet",e),{connectWallet:t}}var r1=require("react");function n1(e){let{createWallet:t}=(0,r1.useContext)(de);return We("createWallet",e),{createWallet:t}}var i1=()=>{let{fundWallet:e}=G();return{fundWallet:e}};var a1=require("react");function s1(e){let{sendTransaction:t}=(0,a1.useContext)(de);return We("sendTransaction",e),{sendTransaction:t}}var l1=require("react");function c1(e){let{setWalletPassword:t}=(0,l1.useContext)(de);return We("setWalletPassword",e),{setWalletPassword:t}}var d1=require("react");function p1(e){let{signMessage:t}=(0,d1.useContext)(de);return We("signMessage",e),{signMessage:t}}var u1=require("react");function m1(e){let{signTypedData:t}=(0,u1.useContext)(de);return We("signTypedData",e),{signTypedData:t}}var f1=require("react");var h1=()=>{let{isModalOpen:e}=(0,f1.useContext)(de);return{isOpen:e}};var y1=require("react");function g1(e){let{getAccessToken:t}=(0,y1.useContext)(de);return We("accessToken",e),{getAccessToken:t}}function v1(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,useFundWallet,useLinkAccount,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSignMessage,useSignTypedData,useToken,useWallets});
2707
+ `;var Fe=require("react/jsx-runtime"),W2={["LANDING"]:oy,["CONNECT_OR_CREATE"]:ry,["AWAITING_PASSWORDLESS_CODE"]:lm,["AWAITING_CONNECTION"]:Lm,["AWAITING_CONNECT_ONLY_CONNECTION"]:Dm,["AWAITING_FARCASTER_CONNECTION"]:ch,["PHANTOM_INTERSTITIAL_SCREEN"]:wg,["LOGIN_FAILED_SCREEN"]:dy,["AWAITING_OAUTH_SCREEN"]:hg,["ALLOWLIST_REJECTION_SCREEN"]:Zu,["INSTALL_PHANTOM_SCREEN"]:Ih,["LINK_EMAIL_SCREEN"]:iy,["LINK_PHONE_SCREEN"]:sy,["LINK_WALLET_SCREEN"]:ly,["UPDATE_EMAIL_SCREEN"]:Mg,["CONNECT_ONLY_LANDING_SCREEN"]:Im,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:xm,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Df,["EMBEDDED_WALLET_CREATED_SCREEN"]:qm,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Vm,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:zf,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Zm,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:_g,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:Tg,["FIAT_ON_RAMP_PROMPT_SCREEN"]:vh,["FIAT_ON_RAMP_STATUS_SCREEN"]:Ph,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Gf,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Uf,["MFA_ENROLLMENT_FLOW_SCREEN"]:_y,["CAPTCHA_SCREEN"]:ym,["ERROR_SCREEN"]:jf,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Sh,["AFFIRMATIVE_CONSENT_SCREEN"]:Yu},L2=["LANDING","AWAITING_CONNECTION"],O2=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=G(),{headless:n}=W(),{ready:i,currentScreen:a}=A(),{status:l,execute:s,reset:c,enabled:u}=be(),f=(0,Co.useRef)(null),g=Ou(f),w=o&&a&&L2.includes(a)&&!n&&l==="ready";if((0,Co.useEffect)(()=>{w&&s()},[w]),(0,Co.useEffect)(()=>{!o&&u&&c()},[o,u]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN")return(0,Fe.jsxs)(fi,{children:[(0,Fe.jsx)(k,{}),(0,Fe.jsx)(ee,{}),(0,Fe.jsx)(uy,{children:(0,Fe.jsx)(nr,{})}),(0,Fe.jsx)(te,{}),(0,Fe.jsx)(oe,{})]});if(!a&&e)return(0,Fe.jsx)(fi,{style:{height:g},children:(0,Fe.jsx)("div",{ref:f,children:(0,Fe.jsx)(wd,{open:e,onClose:t})})});if(!a)return null;let C=W2[a];return(0,Fe.jsx)(fi,{style:{height:g},children:(0,Fe.jsxs)("div",{ref:f,children:[(0,Fe.jsx)(co,{if:!!e,children:(0,Fe.jsx)(C,{})}),(0,Fe.jsx)(co,{if:!e,children:(0,Fe.jsx)(wd,{open:e,onClose:t})})]})})},N2=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=A();return{gracefulClosePrivyModal:(0,Co.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Dg=({open:e})=>{let{app:t}=A(),{gracefulClosePrivyModal:r}=N2(),[o,n]=(0,Co.useState)(!1);Cs({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=(0,Fe.jsx)(Og,{children:(0,Fe.jsx)(O2,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})}),a=e||o,l=t?.render.inDialog?(0,Fe.jsx)(py,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:i}):i;if(typeof window<"u"&&t?.render.inParentNodeId){let s=document.getElementById(t.render.inParentNodeId);if(s)return Ng.default.createPortal(l,s)}return l};var ha=require("react");var Il=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;default:throw new Error(`invalid wallet event type ${t}`)}}};async function wn(e,t,r,o,n,i=!1){let a=i,l=async u=>{if(a&&t&&t.length>0){u===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new ze("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((g,w)=>{r.current={resolve:g,reject:w};let C=1e3*60*5;setTimeout(()=>{let b=new ze("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(b),w(b)},C)});return await e(f)}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(f){if(f.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),f}if(c===null){let u=new ze("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}var Fg=require("react/jsx-runtime"),D2=function(e){return()=>`id-${e++}`}(0);function U2(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function eo(e){return e.error!==void 0}var Wr=new Il,Pd=new Map,F2=(e,t)=>typeof t=="bigint"?t.toString():t,B2=(e,t)=>`${e}${JSON.stringify(t,F2)}`;function to(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=B2(e,t);if(e==="privy:wallet:create"){let l=Pd.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=D2();Wr.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{Pd.delete(i)});return Pd.set(i,a),a}function H2(e){switch(e.event){case"privy:iframe:ready":let t=Wr.dequeue(e.event,e.id);return eo(e)?t.reject(new ze(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=Wr.dequeue(e.event,e.id);return eo(e)?r.reject(new ze(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:connect":let o=Wr.dequeue(e.event,e.id);return eo(e)?o.reject(new ze(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:recover":let n=Wr.dequeue(e.event,e.id);return eo(e)?n.reject(new ze(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=Wr.dequeue(e.event,e.id);return eo(e)?i.reject(new ze(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=Wr.dequeue(e.event,e.id);return eo(e)?a.reject(new ze(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=Wr.dequeue(e.event,e.id);return eo(e)?l.reject(new ze(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=Wr.dequeue(e.event,e.id);return eo(e)?s.reject(new ze(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=Wr.dequeue(e.event,e.id);return eo(e)?s.reject(new ze(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=Wr.dequeue(e.event,e.id);return eo(e)?s.reject(new ze(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function Ug(e){let t=(0,ha.useRef)(null),r=(0,ha.useRef)(e.mfaMethods),o=Uu();return(0,ha.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,Fg.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>{let i=t.current;if(!i)return;function a(f){f&&f.origin===e.origin&&U2(f.data)&&H2(f.data)}let l={create(f){return to("privy:wallet:create",f,i,e.origin)},connect(f){return to("privy:wallet:connect",f,i,e.origin)},recover(f){return wn(g=>to("privy:wallet:recover",{...f,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(f){return wn(g=>to("privy:wallet:rpc",{...f,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(f){return wn(g=>to("privy:wallet:set-recovery-password",{...f,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return wn(g=>to("privy:mfa:verify",{...f,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return wn(g=>to("privy:mfa:init-enrollment",{...f,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return to("privy:mfa:submit-enrollment",f,i,e.origin)},unenrollMfa(f){return wn(g=>to("privy:mfa:unenroll",{...f,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)}};window.addEventListener("message",a);let s=()=>e.onLoad(l),c=(...f)=>{console.warn("Privy iframe failed to load: ",...f),e.onLoadFailed()},u=new AbortController;return Ap(()=>to("privy:iframe:ready",{},i,e.origin),{abortSignal:u.signal}).then(s,c),()=>{window.removeEventListener("message",a),u.abort()}},src:Na(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function Ml(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(o=>t.includes(o))}var Wl=class{constructor(t,r){this.meta={action:t,phoneNumber:r}}async init(){if(!this.meta.action)throw new x("action required");if(!this.api)throw new x("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new x("phone number must be set when initialzing authentication.");try{await this.api.post(op,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw ue(t)}}async authenticate(){if(!this.meta.action)throw new x("action required");if(!this.api)throw new x("Mfa flow has no API instance");if(!this.meta.smsCode)throw new x("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new x("phone number must be set prior to calling authenticate.");try{let t=await this.api.post(np,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return Gt(t)}catch(t){throw ue(t)}}};var Dt=require("react/jsx-runtime"),_i;function G2(e){return typeof e=="string"&&e.length===25}function je(){if(!_i){let e=me.get(Ko);return Promise.resolve(e||null)}return _i.getAccessToken()}var Hg,Op=(e,t)=>Hg(e,t),Gg,Np=(e,t)=>Gg(e,t),Vg,Dp=(e,t)=>Vg(e,t),zg,Up=()=>zg(),V2=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;me.put(ki,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},$g=({config:e,...t})=>{if(!G2(t.appId))throw new x("Cannot initialize the Privy provider with an invalid Privy app ID");_i||(_i=new Fn({appId:t.appId,apiUrl:t.apiUrl||_a}));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,Dt.jsx)(du,{client:_i,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,Dt.jsx)(z2,{...t,config:r,client:_i})})},z2=e=>{let t=e.client,[r,o]=(0,Z.useState)(!1),[n,i]=(0,Z.useState)(!1),[a,l]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(null),[u,f]=(0,Z.useState)([]),g=(0,Z.useRef)(u),[w,C]=(0,Z.useState)(!1),[b,S]=(0,Z.useState)(null),[P,T]=(0,Z.useState)(!1),[M,I]=(0,Z.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:E}),[_,F]=(0,Z.useState)(null),[B,q]=(0,Z.useState)(null),[R,Q]=(0,Z.useState)(null),D=ls(),Y=cs(),[K,ie]=(0,Z.useState)(!0),[Ce,J]=(0,Z.useState)({}),[it,yt]=(0,Z.useState)(null),[Ut,at]=(0,Z.useState)(null),[et,Be]=(0,Z.useState)(!1),[bo,Lr]=(0,Z.useState)(!1),Ft=(0,Z.useRef)(null),He=(0,Z.useRef)(null),L=(0,Z.useRef)(Nu);t.onStoreToken=d=>{d&&N(L,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{N(L,"accessToken","onAccessTokenRemoved")};let pe=(0,Z.useRef)(null),H=(0,Z.useRef)(null),Or=(0,Z.useCallback)(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(v=>v.type==="wallet"&&v.walletClientType==="privy")?p&&d?.some(v=>v?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),_e=d=>{S(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},At=d=>{D.embeddedWallets.createOnLogin!=="off"&&ie(!0),_e(d)};(0,Z.useEffect)(()=>{if(!R||!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=s?.linkedAccounts.filter(p=>p.type==="wallet"&&p.walletClientType==="privy");if(d&&d.length>0){let p=d[0].address;t.connectors?.addEmbeddedWalletConnector(R,p,D.defaultChain,e.appId)}},[R,s]),(0,Z.useEffect)(()=>{R&&Ut?.(R)},[R]),(0,Z.useEffect)(()=>{(async()=>{if(!D.customAuth?.enabled)return;ie(!0);let{getCustomAccessToken:p,isLoading:y}=D.customAuth;if(!(!n||y))try{let v=await p();if(!v){await Cn.logout();return}if(a)return;t.startAuthFlow(new En(v));let{user:O,isNewUser:V}=await t.authenticate();O||await Cn.logout(),c(O||null),C(V||!1),l(!0),Lr(!0)}catch(v){console.warn(v),a&&await Cn.logout()}})()},[D.customAuth?.enabled,D.customAuth?.getCustomAccessToken,D.customAuth?.isLoading,n,a]),(0,Z.useEffect)(()=>{bo&&R&&s&&Xt(s,e.config?.embeddedWallets?.createOnLogin)&&(Lr(!1),ro(s,Tn).catch(console.error))},[bo&&R&&s]),(0,Z.useEffect)(()=>{async function d(){let p=kt();V2();let y=(0,Bg.createStore)();F(y),t.initializeConnectorManager(D.walletConnectCloudProjectId,D.rpcConfig,D.chains,D.defaultChain,y,D.appearance.walletList,D.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{Nl()});let v=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!v),v&&N(L,"login","onComplete",v,!1,!0,null),c(v)),p||Te.setReadyToTrue(),p&&(v?H.current="link":H.current="login")}!n&&Y&&d()},[t,it,n,Y]);let kt=()=>{let d=Wi();return!d.inProgress||d.headless?!1:(t.startAuthFlow(new Ur(d)),At("AWAITING_OAUTH_SCREEN"),!0)},Ol=async(d,p,y,v)=>{let O=await t.connectors?.createWalletConnector(d,p)||null;Eo(O,p,y,v)};async function Eo(d,p,y,v){if(!d)return I({status:"disconnected",connectedWallet:null,connectError:new X("Unable to connect to wallet."),connector:null,connectRetry:E}),v?.(null,y);d instanceof Hr&&p&&await d.resetConnection(p),I({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Eo(d,p,y,v)});try{let O=await d.connect({showPrompt:!0});if(D.shouldEnforceDefaultChainOnConnect&&!D.chains.find(V=>V.id===Number(O?.chainId))&&!(O?.connectorType==="wallet_connect_v2"&&O?.walletClientType==="metamask")){I(V=>({...V,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:E}));try{await O?.switchChain(D.defaultChain.id),O&&(O.chainId=xn(en(D.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${D.defaultChain.id}`)}}return I(V=>({...V,status:"connected",connectedWallet:O,connectError:null,connectRetry:E})),O&&!H.current&&N(L,"connectWallet","onSuccess",O),v?.(O,y)}catch(O){return O instanceof lt?(console.warn(O.cause?O.cause:O.message),H.current||N(L,"connectWallet","onError",O.privyErrorCode||"generic_connect_wallet_error")):(console.warn(O),H.current||N(L,"connectWallet","onError","unknown_connect_wallet_error")),I(V=>({...V,status:"disconnected",connectedWallet:null,connectError:O})),v?.(null,y)}}let qo=async(d,p)=>{if(d===null)return;let y=new Zo(d,p);t.startAuthFlow(y)},Nl=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),y=d.get("privy_wallet_client");if(!p||!y)return;if(y==="phantom"&&!xo()&&At("LOGIN_FAILED_SCREEN"),!t.connectors)throw new x("Connector not initialized");_e("AWAITING_CONNECTION");let v=new URL(window.location.href);v.searchParams.delete("privy_connector"),v.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",v),Ol(p,y,void 0,qo)};(0,Z.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let tt=()=>{if(!a)throw N(L,"linkAccount","onError","must_be_authenticated"),new x("User must be authenticated before linking an account.")},jo=()=>{tt(),pe.current="siwe",H.current="link",_e("LINK_WALLET_SCREEN")},Bt=d=>{if(!a||!s)return!1;if(d.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},st=async d=>{if(!t.connectors)throw new x("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(I(y=>({...y,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:E})),D.captchaEnabled&&!a){let y={callback:v=>qo(d,v),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};J({captchaModalData:y}),At("CAPTCHA_SCREEN")}else await qo(d),At("AWAITING_CONNECTION")},Nr=async(d,p)=>{if(!D.fiatOnRamp.enabled)throw new x("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:y,externalTransactionId:v}=await yh(t,d,p?.config??{},D.appearance.palette,D.fiatOnRamp.useSandbox);return{signedUrl:y,externalTransactionId:v}}else throw new x("Unsupported fund provider. Currently supported option is `moonpay`.")},Po=()=>{f(d=>{let p=t.connectors?.wallets.map(y=>({...y,linked:Bt(y),loginOrLink:async()=>{if(!await y.isConnected())throw new x("Wallet is not connected");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new x("Cannot link or login with embedded wallet");st(y)},fund:async v=>{let{signedUrl:O,externalTransactionId:V}=await Nr(y.address,v);J({fiatOnRampPrompt:{signedUrl:O},fiatOnRampStatus:{externalTransactionId:V}}),_e("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new x("User is not authenticated.");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new x("Cannot unlink an embedded wallet");let v=await t.unlinkWallet(y.address);c(v)}}))||[];return Be(Or(p)),Ha(d,p)?d:p})};(0,Z.useEffect)(()=>{Po()},[s?.linkedAccounts,a,n]),(0,Z.useEffect)(()=>{if(n){if(!t.connectors)throw new x("Connector not initialized");Po(),t.connectors.on("walletsUpdated",Po)}},[n]);let va=()=>{_e(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,Z.useEffect)(()=>{if(!u[0])return;let d=u[0],p=g.current.find(v=>v.address===d.address),y;if(d.walletClientType==="privy"?y=s?.linkedAccounts.find(v=>v.type==="wallet"&&v.address===d.address&&v.walletClientType==="privy"):y=s?.linkedAccounts.find(v=>v.type==="wallet"&&v.address===d.address&&v.walletClientType!=="privy"),!p&&y){let v=Object.assign({},s);v.wallet=y&&{address:y.address,chainType:y.chainType,chainId:y.chainId,walletClient:y.walletClient,walletClientType:y.walletClientType,connectorType:y.connectorType},c(v)}g.current=u},[u]);let ro=async(d,p)=>{if(ke(d))throw N(L,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[v,O]=await Promise.all([Te.initializeWalletProxy(p),je()]);if(!v&&e.config?.customAuth?.enabled)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!v||!O||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((V,xe)=>{ie(!0),J({createWallet:{onSuccess:Rt=>{N(L,"createWallet","onSuccess",Rt),V(Rt)},onFailure:Rt=>{N(L,"createWallet","onError","unknown_embedded_wallet_error"),xe(Rt)},callAuthOnSuccessOnClose:!1}}),_e("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await v.create({accessToken:O});let V=await Te.refreshUser(),xe=ke(V);if(!xe)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return N(L,"createWallet","onSuccess",xe),xe}},Dl=d=>{if(!D.chains.map(p=>p.id).includes(d))throw new X(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Sd=(d,p,y)=>new Promise(async(v,O)=>{if(!a||!s){N(L,"sendTransaction","onError","must_be_authenticated"),O(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=ke(s);if(!V){N(L,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have a Privy wallet before signing"));return}ie(!0);let xe=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,gt=d.chainId?Number(d.chainId):xe.chainId;Dl(gt);let Rt=Object.assign({},d,{chainId:gt}),oo=async()=>{let vt=await je();if(!vt||!R){N(L,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await Te.recoverEmbeddedWallet()){N(L,"sendTransaction","onError","unknown_connect_wallet_error"),O(new Error("Unable to connect to wallet"));return}let hr=io(Rt.chainId,D.chains,D.rpcConfig,{appId:e.appId}),Ul=await Ei(V.address,Rt,hr);if(D.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:C1}=await bi(Ul,hr),{hasSufficientFunds:b1}=await xl(V.address,Ul,C1,hr);if(!b1)throw new We(new er("Wallet has insufficient funds for this transaction.",dt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let kd=await Tl(vt,V.address,R,Ul,hr);N(L,"sendTransaction","onSuccess",kd),v(kd)}catch(fr){N(L,"sendTransaction","onError","transaction_failure"),O(fr)}};if(D.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),oo();else{let vt={transactionRequest:Rt,onSuccess:hr=>{N(L,"sendTransaction","onSuccess",hr),v(hr)},onFailure:hr=>{N(L,"sendTransaction","onError","transaction_failure"),O(hr)},uiOptions:p||{},fundWalletConfig:y},fr={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:hr=>{N(L,"sendTransaction","onError","unknown_connect_wallet_error"),O(hr)}};J({connectWallet:fr,sendTransaction:vt}),_e("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function _d(){return new Promise(async(d,p)=>{let y=await je();if(!y||!R)throw new Error("Must have valid access token to enroll in MFA");try{await R.verifyMfa({accessToken:y}),d()}catch(v){p(v)}})}let mr=d=>{if(s?.[d])throw N(L,"linkAccount","onError","cannot_link_more_of_type"),new x(`User already has an account of type ${d} linked.`)},Cn={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:va,linkWallet:jo,linkEmail:()=>{tt(),mr("email"),pe.current="email",H.current="link",_e("LINK_EMAIL_SCREEN")},linkPhone:()=>{tt(),mr("phone"),pe.current="sms",H.current="link",_e("LINK_PHONE_SCREEN")},linkGoogle:async()=>{tt(),mr("google"),H.current="link",await Te.initLoginWithOAuth("google")},linkTwitter:async()=>{tt(),mr("twitter"),H.current="link",await Te.initLoginWithOAuth("twitter")},linkDiscord:async()=>{tt(),mr("discord"),H.current="link",await Te.initLoginWithOAuth("discord")},linkGithub:async()=>{tt(),mr("github"),H.current="link",await Te.initLoginWithOAuth("github")},linkSpotify:async()=>{tt(),mr("spotify"),H.current="link",await Te.initLoginWithOAuth("spotify")},linkTiktok:async()=>{tt(),mr("tiktok"),H.current="link",await Te.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{tt(),mr("linkedin"),H.current="link",await Te.initLoginWithOAuth("linkedin")},linkApple:async()=>{tt(),mr("apple"),H.current="link",await Te.initLoginWithOAuth("apple")},linkFarcaster:async()=>{tt(),mr("farcaster"),await Te.initLoginWithFarcaster(),H.current="link",pe.current="farcaster",_e("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(tt(),!s?.email)throw new x("User does not have an email linked to their account.");H.current="link",pe.current="email",_e("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{yt(()=>d)}),yt(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}H.current="login",At("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{yt(()=>d)}),yt(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(u[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}At("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),S(null),N(L,"logout","onSuccess"),H.current=null,pe.current=null,o(!1),me.del(Ri)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Ae;let d=u.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(v=>v.address===d?.address));return!d||!p?new Ae:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Ll.Web3Provider(new gr(new Ae));let d=u.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(v=>v.address===d?.address));return!d||!p?new Ll.Web3Provider(new gr(new Ae)):new Ll.Web3Provider(new gr(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Ao(new Ae);let d=u.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(v=>v.address===d?.address));return!d||!p?new Ao(new Ae):new Ao(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},setActiveWallet:async d=>{let p=u.find(v=>(0,ya.getAddress)(v.address)===(0,ya.getAddress)(d)),y=s?.linkedAccounts.find(v=>v.type==="wallet"&&(0,ya.getAddress)(v.address)===(0,ya.getAddress)(d));if(!p||!await p.isConnected())q(d),jo();else if(!p.linked)p.loginOrLink();else{let v=Object.assign({},s);v.wallet=y&&{address:y.address,chainType:y.chainType,chainId:y.chainId,walletClient:y.walletClient,walletClientType:y.walletClientType,connectorType:y.connectorType},c(v)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw N(L,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return ro(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw N(L,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=ke(s);if(!d||!R)throw N(L,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw N(L,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await _d()}catch(p){throw N(L,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,y)=>{ie(!0);let v={onSuccess:V=>{N(L,"setWalletPassword","onSuccess",V),p(V)},onFailure:V=>{N(L,"setWalletPassword","onError","user_exited_set_password_flow"),y(V)},callAuthOnSuccessOnClose:!1},O={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:V=>{N(L,"setWalletPassword","onError","unknown_connect_wallet_error"),y(V)}};J({setWalletPassword:v,connectWallet:O}),_e("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(y,v)=>{if(!a||!s){N(L,"signMessage","onError","must_be_authenticated"),v(new Error("User must be authenticated before signing with a Privy wallet"));return}let O=ke(s);if(!O){N(L,"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(L,"signMessage","onError","invalid_message"),v(new Error("Message must be a non-empty string"));return}ie(!0);let V=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let xe=await je();if(!R||!xe)throw new Error("Unable to connect to wallet");if(!await Te.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:O.address});let{response:Rt}=await R.rpc({accessToken:xe,address:O.address,request:{method:"personal_sign",params:[d,O.address]}}),oo=Rt.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:O.address}),oo};if(D.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let xe=await V();N(L,"signMessage","onSuccess",xe),y(xe)}catch(xe){N(L,"signMessage","onError","unable_to_sign"),v(xe??new We("Unable to sign message"))}}else{let Rt={method:"personal_sign",data:d,confirmAndSign:V,onSuccess:vt=>{N(L,"signMessage","onSuccess",vt),y(vt)},onFailure:vt=>{N(L,"signMessage","onError","unable_to_sign"),v(vt)},uiOptions:p||{}},oo={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:vt=>{N(L,"signMessage","onError","unknown_connect_wallet_error"),v(vt)}};J({signMessage:Rt,connectWallet:oo}),_e("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(y,v)=>{if(!a||!s){N(L,"signTypedData","onError","must_be_authenticated"),v(new Error("User must be authenticated before signing with a Privy wallet"));return}let O=ke(s);if(!O){N(L,"signTypedData","onError","embedded_wallet_not_found"),v(new Error("Must have a Privy wallet before signing"));return}ie(!0);let V=Ua(d),xe=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let gt=await je();if(!R||!gt)throw new Error("Unable to connect to wallet");if(!await Te.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:O.address});let{response:oo}=await R.rpc({accessToken:gt,address:O.address,request:{method:"eth_signTypedData_v4",params:[O.address,V]}}),vt=oo.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:O.address}),vt};if(D.embeddedWallets.noPromptOnSignature||(D.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let gt=await xe();N(L,"signTypedData","onSuccess",gt),y(gt)}catch(gt){N(L,"signTypedData","onError","unable_to_sign"),v(gt??new We("Unable to sign message"))}}else{let oo={method:"eth_signTypedData_v4",data:V,confirmAndSign:xe,onSuccess:fr=>{N(L,"signTypedData","onSuccess",fr),y(fr)},onFailure:fr=>{N(L,"signTypedData","onError","unable_to_sign"),v(fr)},uiOptions:p||{}},vt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:fr=>{N(L,"signMessage","onError","unknown_connect_wallet_error"),v(fr)}};J({signMessage:oo,connectWallet:vt}),_e("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,y)=>{let O=await(await Sd(d,p,y)).wait();return Sl(O)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=ke(s);if(!y){p(new Error("Must have a Privy wallet before exporting"));return}ie(!0);let v={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},O=await je();if(!O||!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:O,address:y.address}),await R.verifyMfa({accessToken:O})}catch(xe){if(on(xe))await Te.recoverEmbeddedWallet();else throw xe}}catch(xe){p(xe);return}let V={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};J({keyExport:V,connectWallet:v}),_e("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:_d,async init(d){let p;switch(d){case"sms":p=new Wl("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((y,v)=>{He.current={resolve:y,reject:v}});break;default:throw Ft.current?.reject(new x("Unsupported MFA method")),new x(`Unsupported MFA method: ${d}`)}},cancel(){Ft.current?.reject(new x("MFA canceled"))},async initEnrollmentWithSms(d){let p=await je();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,y)=>{if(!d){Te.closePrivyModal(),p();return}D.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."),J({mfaEnrollmentFlow:{mfaMethods:D.mfa.methods,onSuccess:p,onFailure:y}}),_e("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await je();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 je();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 y=await t.getAuthenticatedUser();c(y)},async submitEnrollmentWithTotp(d){let p=await je();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 y=await t.getAuthenticatedUser();c(y)},async unenroll(d){let p=await je();if(!p||!R)throw new Error("Must have valid access token to remove MFA");await R.unenrollMfa({method:d,accessToken:p});let y=await t.getAuthenticatedUser();c(y)},isHeadlessOAuthLoading:P,loginWithCode(d){return Te.loginWithCode(d)},initLoginWithEmail(d){return Te.initLoginWithEmail(d)},initLoginWithSms(d){return Te.initLoginWithSms(d)},fundWallet(d,p){return Te.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return Te.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return Te.loginWithHeadlessOAuth(d)},isModalOpen:r};Hg=Cn.signMessage,Gg=Cn.signTypedData,Vg=async(...d)=>{let p=await Sd(...d);return D.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let Ad=!!e.config?.headless,Te=(()=>({headless:Ad,isNewUserThisSession:w,linkingHint:B,pendingTransaction:null,walletConnectionStatus:M,mipdStore:_,connectors:t.connectors?.walletConnectors??[],rpcConfig:D.rpcConfig,chains:D.chains,appId:e.appId,showFiatPrices:D.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>D.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(R)return R;let p=new Promise(O=>{at(()=>V=>O(V))}),y=new Promise(O=>setTimeout(()=>O(null),d)),v=await Promise.race([p,y]);return at(null),v},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s;H.current==="login"?d.shouldCallAuthOnSuccess&&p?(N(L,"login","onComplete",s,w,!1,pe.current??null),e.onSuccess?.(s,w)):N(L,"login","onError","exited_auth_flow"):H.current==="link"&&pe.current&&(d.isSuccess&&p?N(L,"linkAccount","onSuccess",s,pe.current):N(L,"linkAccount","onError","exited_link_flow")),q(null),H.current=null,pe.current=null,C(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:_e,connectWallet:Eo,initLoginWithWallet:async(d,p)=>{pe.current="siwe",qo(d,p)},loginWithWallet:async()=>{if(!n)throw new bn;if(!(t.authFlow instanceof Zo))throw new x("Must initialize SIWE flow first.");let d,p;if(a)try{d=await t.link(),pe.current="siwe"}catch(y){throw N(L,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}else try{({user:d,isNewUser:p}=await t.authenticate()),pe.current="siwe"}catch(y){throw N(L,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}c(d||s||null),C(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new Ai(d);t.startAuthFlow(p);try{pe.current="farcaster",await p.initializeFarcasterConnect()}catch(y){throw H.current==="login"?N(L,"login","onError",y.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"linkAccount","onError",y.privyErrorCode||"unknown_auth_error"),y}},loginWithFarcaster:async()=>{if(!n)throw new bn;if(!(t.authFlow instanceof Ai))throw new x("Must initialize Farcaster flow first.");let d,p;if(a)try{d=await t.link(),pe.current="farcaster"}catch(y){throw N(L,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}else try{({user:d,isNewUser:p}=await t.authenticate()),pe.current="farcaster"}catch(y){throw N(L,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}c(d||null),C(p||!1),l(!0)},async initLoginWithOAuth(d,p){if(pe.current=d,Jl()){if(d==="google"&&Ml(window.navigator.userAgent)){At("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{At("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let y=new Ur({provider:d});p&&y.addCaptchaToken(p),t.startAuthFlow(y);let v=await t.authFlow.getAuthorizationUrl();v&&v.url&&window.location.assign(v.url)},async loginWithOAuth(d){if(!(t.authFlow instanceof Ur))throw new x("Must initialize OAuth flow before calling loginWithOAuth");let p=ct.get(Yo),y=t.authFlow.meta.stateCode;if(p!==y)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:y??""}),new x("Unexpected auth flow. This may be a phishing attempt.");let v,O;if(a)try{v=await t.link(),pe.current=d}catch(V){throw N(L,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account"),V}else try{({user:v,isNewUser:O}=await t.authenticate()),pe.current=d}catch(V){throw H.current==="login"?N(L,"login","onError",V.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account"),V}c(v),C(O||!1),l(!0)},async initLoginWithHeadlessOAuth(d,p){if(Jl()){if(d==="google"&&Ml(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 y=new Ur({provider:d,headless:!0});p&&y.addCaptchaToken(p);let v=await t.startAuthFlow(y).getAuthorizationUrl();v?.url&&window.location.assign(v.url)},async loginWithHeadlessOAuth(d){T(!0),t.startAuthFlow(new Ur(d));let p=ct.get(Yo),y=d.stateCode;if(p!==y)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d.provider,storedStateCode:p??"",returnedStateCode:y??""}),T(!1),new x("Unexpected auth flow. This may be a phishing attempt.");let v,O;if(a)try{v=await t.link(),pe.current=d.provider}catch(V){throw N(L,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account"),V}else try{({user:v,isNewUser:O}=await t.authenticate()),pe.current=d.provider}catch(V){throw H.current==="login"?N(L,"login","onError",V.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account"),V}return c(v),C(O||!1),l(!0),T(!1),v??void 0},initLoginWithEmail:async(d,p)=>{let y=new To(d,p);t.startAuthFlow(y);try{pe.current="email",await y.sendCodeEmail()}catch(v){throw H.current==="login"?N(L,"login","onError",v.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"linkAccount","onError",v.privyErrorCode||"failed_to_link_account"),v}},initUpdateEmail:async(d,p,y)=>{let v=new Sa(d,p,y);t.startAuthFlow(v),await v.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let y=new Qo(d,p);t.startAuthFlow(y);try{pe.current="sms",await y.sendSmsCode()}catch(v){throw H.current==="login"?N(L,"login","onError",v.privyErrorCode||"unknown_auth_error"):H.current==="link"&&N(L,"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(!n)throw new bn;if(t.authFlow instanceof To)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof Qo)t.authFlow.meta.smsCode=d.trim();else throw new x("Must initialize a passwordless code flow first");let p,y;if(a)try{p=await t.link()}catch(v){throw N(L,"linkAccount","onError",v.privyErrorCode||"failed_to_link_account"),v}else try{({user:p,isNewUser:y}=await t.authenticate())}catch(v){throw N(L,"login","onError",v.privyErrorCode||"unknown_auth_error"),v}c(p||s||null),C(y||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:R,createAnalyticsEvent:(d,p,y)=>t.createAnalyticsEvent(d,p,y),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let y=s?.linkedAccounts.find(O=>O.type==="wallet"&&O.walletClientType==="privy"),v=await je();if(!v||!R||!y){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}ie(!0);try{await R.connect({accessToken:v,address:y.address}),d(!0)}catch(O){on(O)&&y.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:y.address}),(await R.recover({address:y.address,accessToken:v})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:y.address}),d(!0)):on(O)?(J({recoverWallet:{privyWallet:y,onFailure:p,onSuccess:()=>d(!0)}}),_e("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(O)}}),getFiatOnRampConfig:Nr,setReadyToTrue:()=>{i(!0),it?.()},updateWallets:()=>Po(),fundWallet:async(d,p)=>{let{signedUrl:y,externalTransactionId:v}=await Nr(d,p);J({fiatOnRampPrompt:{signedUrl:y},fiatOnRampStatus:{externalTransactionId:v}}),_e("FIAT_ON_RAMP_PROMPT_SCREEN")}}))();zg=Te.recoverEmbeddedWallet;let w1=(0,Z.useMemo)(()=>({wallets:u,ready:et}),[u,et]);return(0,Dt.jsx)(ce.Provider,{value:Cn,children:(0,Dt.jsx)(uc.Provider,{value:L,children:(0,Dt.jsx)(yd.Provider,{value:w1,children:(0,Dt.jsxs)(Mu,{...D,children:[e.children,(0,Dt.jsxs)(pc.Provider,{value:Te,children:[!Ad&&D.captchaEnabled&&n&&!a&&(0,Dt.jsx)(ys,{delayedExecution:!1}),(0,Dt.jsx)(Lg,{theme:{...D.appearance.palette||{}}}),(0,Dt.jsx)(mu,{data:Ce,setModalData:J,setInitialScreen:S,initialScreen:b,authenticated:a,open:r,children:(0,Dt.jsx)(Dg,{open:r})}),K&&Y?(0,Dt.jsx)(Ug,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Ft,mfaSubmitPromise:He,onLoad:Q,onLoadFailed:()=>null}):null]})]})})})})};var qg=require("react");function jg(e){let{login:t}=(0,qg.useContext)(ce);return Ie("login",e),{login:t}}var Kg=require("react");function Yg(e){let{logout:t}=(0,Kg.useContext)(ce);return Ie("logout",e),{logout:t}}var ga=require("react");function Jg(){let e=be(),t=cs(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=G(),l=(0,ga.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new wr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=(0,ga.useCallback)(async()=>{let c=Wi();if(a)return console.warn("Cannot login with OAuth when already logged in"),a;if(!c.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");try{return await o(c)}catch(u){throw u}finally{Li()}},[o]);return(0,ga.useEffect)(()=>{let c=Wi();i&&t&&c.inProgress&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}var Td=require("react");var Zg=()=>{let e=be(),{initLoginWithEmail:t,loginWithCode:r}=G(),o=(0,Td.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=(0,Td.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new wr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var xd=require("react");var Qg=()=>{let e=be(),{initLoginWithSms:t,loginWithCode:r}=G(),o=(0,xd.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return t(i)},[t]),n=(0,xd.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new wr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var Xg=require("react");function e1(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:f,linkFarcaster:g}=(0,Xg.useContext)(ce);return Ie("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:f,linkFarcaster:g}}var t1=require("react");function r1(e){let{connectWallet:t}=(0,t1.useContext)(ce);return Ie("connectWallet",e),{connectWallet:t}}var o1=require("react");function n1(e){let{createWallet:t}=(0,o1.useContext)(ce);return Ie("createWallet",e),{createWallet:t}}var i1=()=>{let{fundWallet:e}=G();return{fundWallet:e}};var a1=require("react");function s1(e){let{sendTransaction:t}=(0,a1.useContext)(ce);return Ie("sendTransaction",e),{sendTransaction:t}}var l1=require("react");function c1(e){let{setWalletPassword:t}=(0,l1.useContext)(ce);return Ie("setWalletPassword",e),{setWalletPassword:t}}var d1=require("react");function p1(e){let{signMessage:t}=(0,d1.useContext)(ce);return Ie("signMessage",e),{signMessage:t}}var u1=require("react");function m1(e){let{signTypedData:t}=(0,u1.useContext)(ce);return Ie("signTypedData",e),{signTypedData:t}}var f1=require("react");var h1=()=>{let{isModalOpen:e}=(0,f1.useContext)(ce);return{isOpen:e}};var y1=require("react");function g1(e){let{getAccessToken:t}=(0,y1.useContext)(ce);return Ie("accessToken",e),{getAccessToken:t}}function v1(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,useFundWallet,useLinkAccount,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSignMessage,useSignTypedData,useToken,useWallets});