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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
- var $s=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)};var qc=(e,t,o)=>($s(e,t,"read from private field"),o?o.call(e):t.get(e)),Wi=(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)},qs=(e,t,o,r)=>($s(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o);var jc=(e,t,o)=>($s(e,t,"access private method"),o);import{getAddress as Vs}from"@ethersproject/address";import{StaticJsonRpcProvider as u4,Web3Provider as Hc}from"@ethersproject/providers";import{createStore as m4}from"mipd";import{useCallback as f4,useEffect as Ao,useMemo as h4,useRef as In,useState as ke}from"react";import{FetchError as Iy}from"ofetch";var Ge=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}]`:""}`}},Qt=class extends Ge{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},P=class extends Ge{constructor(o,r,n){super(o,r,n);this.type="client_error"}},Li=class extends P{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var J=class extends Ge{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},ae=e=>{if(e instanceof Ge)return e;if(!(e instanceof Iy))return Qe(e);if(!e.response)return new Qt("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new Qt(t||"ApiError",e.response.status,o||r,e,n)},Qe=e=>e instanceof Ge?e:e instanceof Error?new P(e.message,e):new P(`Internal error: ${e}`);var Ir=class extends P{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},mt=class extends P{constructor(t="Embedded wallet error",o){super(t,o,"unknown_embedded_wallet_error")}},Oi=class extends P{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Ni="/api/v1/sessions",Di="/api/v1/sessions/logout",Kc="/api/v1/sessions/fork",Ui="/api/v1/sessions/fork/recover",Yc="/api/v1/siwe/init",Jc="/api/v1/siwe/authenticate",Zc="/api/v1/siwe/link",Qc="/api/v1/siwe/unlink",Xc="/api/v1/farcaster/init",ed="/api/v1/farcaster/authenticate",td="/api/v1/farcaster/link",od="/api/v1/farcaster/status",rd="/api/v1/farcaster/unlink",nd="/api/v1/passwordless/init",id="/api/v1/passwordless/authenticate",ad="/api/v1/passwordless/link",sd="/api/v1/passwordless/unlink",ld="/api/v1/passwordless/update",cd="/api/v1/passwordless_sms/init",dd="/api/v1/passwordless_sms/link",pd="/api/v1/passwordless_sms/unlink",ud="/api/v1/passwordless_sms/authenticate",md="/api/v1/oauth/init",fd="/api/v1/oauth/authenticate",hd="/api/v1/oauth/link",yd="/api/v1/oauth/unlink";var gd="/api/v1/mfa/passwordless_sms/init",vd="/api/v1/mfa/passwordless_sms/enroll";var wd="/api/v1/users/me/accept_terms",Cd="/api/v1/analytics_events",bd="/api/v1/plugins/moonpay_on_ramp/sign",Ed="/api/v1/custom_jwt_account/authenticate";var Mr=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");try{let t=await this.api.post(Ed,{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 ae(t)}}async link(){throw new Error("Unimplemented")}};var Mo=class{constructor(t,o){this.meta={email:t,captchaToken:o}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(id,{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 ae(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(ad,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ae(t)}}async sendCodeEmail(t,o){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.email=t),o&&(this.meta.captchaToken=o),!this.meta.email)throw new P("Email must be set when initialzing authentication.");try{return await this.api.post(nd,{email:this.meta.email,token:this.meta.captchaToken})}catch(r){throw ae(r)}}},Fi=class extends Mo{constructor(o,r,n){super(r,n);this.meta={email:r,captchaToken:n,oldAddress:o}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new P("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(ld,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(o){throw ae(o)}}};import{isMobile as My}from"react-device-detect";var Xe=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 On=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Xe(this._startChannelOnce.bind(this)),this.pollForReady=new Xe(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.channelToken)throw new P("Auth flow must be initialized first");try{let t=await this.api.post(ed,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new P("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw ae(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{return await this.api.post(td,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ae(t)}}async _startChannelOnce(){if(!this.api)throw new P("Auth flow has no API instance");let t=await this.api.post(Xc,{token:this.captchaToken});My&&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 P("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.channelToken)throw new P("Auth flow must be initialized first");let t=await this.api.get(od,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as Nd}from"jose";var Pd="1.59.2";var Bi="4df5e2316331463a9130964bd6078dfa",Td="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",xd="34357d3c125c2bcf2ce2bc3309d98715",Hi="https://auth.privy.io",Sd=2e4,et=1400,_d=2500,js=Pd;var ar="privy:token",Ks="privy-token",Gi="privy:refresh_token",Ys="privy-refresh-token",Vi="privy-session",Nn="privy:session_transfer_token",Ly="privy:wallet",Dn="privy:caid",sr="privy:state_code",Wr="privy:code_verifier",Un="privy:headless_oauth",zi=e=>`${Ly}:${e}`,Js="privy:connectors",Zs="privy:connections";var lr=12e4,wo=1,Qs="0x1",Lr=3e4,Ad="https://api.moonpay.com/v1",kd="https://api.moonpay.com/v1",Rd="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Id="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",Md="0x420000000000000000000000000000000000000F",Wd=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function Ld(e){let t=new TextEncoder().encode(e),o=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(o)}function Od(e){return crypto.getRandomValues(new Uint8Array(e))}var $i=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)}},Xs=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)}},el=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 tl(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function Oy(){return typeof window<"u"&&window.localStorage?new Xs:new $i}function Ny(){return typeof window<"u"&&window.sessionStorage?new el:new $i}var Ve=Ny(),se=Oy();function qi(){return!!Ve.get(Un)}var Dy="S256",Uy="S256",Xt=class{constructor(t){let o=typeof t.headless=="boolean"?t.headless:qi();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 P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");let t=Ve.get(Wr);if(!t)throw new P("Authentication error.");try{let o=await this.api.post(fd,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Ve.del(Wr),this.meta.headless&&Ve.del(Un),{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(o){let r=ae(o);throw r.privyErrorCode?new P(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.message==="User denied confirmation during OAuth flow"?new P("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new P("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");let t=Ve.get(Wr);if(!t)throw new P("Authentication error.");try{let o=await this.api.post(hd,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Ve.del(Wr),o}catch(o){throw ae(o)}}createCodeVerifier(){return Nd.encode(Od(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,o=Dy){if(o==Uy){let r=await Ld(t);return Nd.encode(r)}else return t}async getAuthorizationUrl(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.provider)throw new P("Provider must be set when initializing OAuth authentication.");let t=this.createCodeVerifier();Ve.put(Wr,t);let o=this.createStateCode();Ve.put(sr,o);let r=await this.deriveCodeChallengeFromCodeVerifier(t);this.meta.headless&&Ve.put(Un,!0);try{return await this.api.post(md,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:o})}catch(n){throw ae(n)}}};function ol(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Dd(e,t){let o={detail:"",retryable:!1},r=ol(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 Bn(){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:qi()}}function Hn(){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"),Ve.del(sr),window.history.pushState({},"",e)}var cr=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
+ var js=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var Jc=(e,t,r)=>(js(e,t,"read from private field"),r?r.call(e):t.get(e)),Wi=(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)},Ks=(e,t,r,o)=>(js(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var Zc=(e,t,r)=>(js(e,t,"access private method"),r);import{getAddress as Gs}from"@ethersproject/address";import{Web3Provider as $c}from"@ethersproject/providers";import{createStore as p4}from"mipd";import{useCallback as u4,useEffect as Ir,useMemo as m4,useRef as Wn,useState as _e}from"react";import{FetchError as My}from"ofetch";var He=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}]`:""}`}},er=class extends He{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},T=class extends He{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Li=class extends T{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var Y=class extends He{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},ie=e=>{if(e instanceof He)return e;if(!(e instanceof My))return Qe(e);if(!e.response)return new er("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new er(t||"ApiError",e.response.status,r||o,e,n)},Qe=e=>e instanceof He?e:e instanceof Error?new T(e.message,e):new T(`Internal error: ${e}`);var Io=class extends T{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ht=class extends T{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},Oi=class extends T{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Ni="/api/v1/sessions",Di="/api/v1/sessions/logout",Qc="/api/v1/sessions/fork",Ui="/api/v1/sessions/fork/recover",Xc="/api/v1/siwe/init",ed="/api/v1/siwe/authenticate",td="/api/v1/siwe/link",rd="/api/v1/siwe/unlink",od="/api/v1/farcaster/init",nd="/api/v1/farcaster/authenticate",id="/api/v1/farcaster/link",ad="/api/v1/farcaster/status",sd="/api/v1/farcaster/unlink",ld="/api/v1/passwordless/init",cd="/api/v1/passwordless/authenticate",dd="/api/v1/passwordless/link",pd="/api/v1/passwordless/unlink",ud="/api/v1/passwordless/update",md="/api/v1/passwordless_sms/init",fd="/api/v1/passwordless_sms/link",hd="/api/v1/passwordless_sms/unlink",yd="/api/v1/passwordless_sms/authenticate",gd="/api/v1/oauth/init",vd="/api/v1/oauth/authenticate",wd="/api/v1/oauth/link",Cd="/api/v1/oauth/unlink";var bd="/api/v1/mfa/passwordless_sms/init",Ed="/api/v1/mfa/passwordless_sms/enroll";var Pd="/api/v1/users/me/accept_terms",Td="/api/v1/analytics_events",xd="/api/v1/plugins/moonpay_on_ramp/sign",Sd="/api/v1/custom_jwt_account/authenticate";var Mo=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(Sd,{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 ie(t)}}async link(){throw new Error("Unimplemented")}};var Or=class{constructor(t,r){this.meta={email:t,captchaToken:r}}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(cd,{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 ie(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(dd,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ie(t)}}async sendCodeEmail(t,r){if(!this.api)throw new T("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new T("Email must be set when initialzing authentication.");try{return await this.api.post(ld,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ie(o)}}},Fi=class extends Or{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}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(ud,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ie(r)}}};import{isMobile as Wy}from"react-device-detect";var Xe=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 On=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Xe(this._startChannelOnce.bind(this)),this.pollForReady=new Xe(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(nd,{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 ie(t)}}async link(){if(!this.api)throw new T("Auth flow has no API instance");try{return await this.api.post(id,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ie(t)}}async _startChannelOnce(){if(!this.api)throw new T("Auth flow has no API instance");let t=await this.api.post(od,{token:this.captchaToken});Wy&&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(ad,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as Fd}from"jose";var _d="1.59.3-beta-20240308154132";var Ys="4df5e2316331463a9130964bd6078dfa",Js="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",Ad="34357d3c125c2bcf2ce2bc3309d98715",Bi="https://auth.privy.io",kd=2e4,et=1400,Rd=2500,Zs=_d;var lo="privy:token",Qs="privy-token",Hi="privy:refresh_token",Xs="privy-refresh-token",Gi="privy-session",Nn="privy:session_transfer_token",Oy="privy:wallet",Dn="privy:caid",co="privy:state_code",Wo="privy:code_verifier",Un="privy:headless_oauth",Vi=e=>`${Oy}:${e}`,el="privy:connectors",tl="privy:connections";var po=12e4,br=1,rl="0x1",Lo=3e4,Id="https://api.moonpay.com/v1",Md="https://api.moonpay.com/v1",Wd="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Ld="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",Od="0x420000000000000000000000000000000000000F",Nd=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function Dd(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Ud(e){return crypto.getRandomValues(new Uint8Array(e))}var zi=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)}},ol=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)}},nl=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 il(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function Ny(){return typeof window<"u"&&window.localStorage?new ol:new zi}function Dy(){return typeof window<"u"&&window.sessionStorage?new nl:new zi}var Ge=Dy(),ae=Ny();function $i(){return!!Ge.get(Un)}var Uy="S256",Fy="S256",tr=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:$i();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 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=Ge.get(Wo);if(!t)throw new T("Authentication error.");try{let r=await this.api.post(vd,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Ge.del(Wo),this.meta.headless&&Ge.del(Un),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(r){let o=ie(r);throw o.privyErrorCode?new T(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.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=Ge.get(Wo);if(!t)throw new T("Authentication error.");try{let r=await this.api.post(wd,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Ge.del(Wo),r}catch(r){throw ie(r)}}createCodeVerifier(){return Fd.encode(Ud(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,r=Uy){if(r==Fy){let o=await Dd(t);return Fd.encode(o)}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();Ge.put(Wo,t);let r=this.createStateCode();Ge.put(co,r);let o=await this.deriveCodeChallengeFromCodeVerifier(t);this.meta.headless&&Ge.put(Un,!0);try{return await this.api.post(gd,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw ie(n)}}};function al(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Bd(e,t){let r={detail:"",retryable:!1},o=al(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 Bn(){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:$i()}}function Hn(){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"),Ge.del(co),window.history.pushState({},"",e)}var uo=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 Xe(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 P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Jc,{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 ae(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign();return await this.api.post(Zc,{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ae(t)}}async sign(){if(!this.api)throw new P("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new P("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.api)throw new P("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(Yc,{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new P("Auth flow has no API instance");let t=this.wallet.address,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 dr=class{constructor(t,o){this.meta={phoneNumber:t,captchaToken:o}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(ud,{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 ae(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(dd,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ae(t)}}async sendSmsCode(t,o){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),o&&(this.meta.captchaToken=o),!this.meta.phoneNumber)throw new P("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(cd,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(r){throw ae(r)}}};import{v4 as kg}from"uuid";function tt(e){return new Date(e*1e3)}function Fy(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:tt(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:tt(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:tt(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:tt(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:tt(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:tt(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:tt(o.verified_at)};t.push(u);break;case"github_oauth":let m={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:tt(o.verified_at)};t.push(m);break;case"tiktok_oauth":let h={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:tt(o.verified_at)};t.push(h);break;case"linkedin_oauth":let g={subject:o.subject,name:o.name,email:o.email,type:o.type,verifiedAt:tt(o.verified_at)};t.push(g);break;case"apple_oauth":let w={subject:o.subject,email:o.email,type:o.type,verifiedAt:tt(o.verified_at)};t.push(w);break;case"custom_auth":t.push({type:o.type,customUserId:o.custom_user_id,verifiedAt:tt(o.verified_at)});break;case"farcaster":let b={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:tt(o.verified_at)};t.push(b);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function bt(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var fe=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,By=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Et=(e,t)=>t==="all-users"&&!fe(e)||t==="users-without-wallets"&&!By(e)?.length;function ft(e){if(!e)return null;let t=Fy(e.linked_accounts),o=bt(t,"wallet"),r=bt(t,"email"),n=bt(t,"phone"),i=bt(t,"google_oauth"),a=bt(t,"twitter_oauth"),l=bt(t,"discord_oauth"),s=bt(t,"github_oauth"),c=bt(t,"spotify_oauth"),u=bt(t,"tiktok_oauth"),m=bt(t,"linkedin_oauth"),h=bt(t,"apple_oauth"),g=bt(t,"farcaster"),w=e.mfa_methods.map(({type:T,verified_at:C})=>({type:T,verifiedAt:tt(C)}));return{id:e.id,createdAt:tt(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:m&&{subject:m.subject,name:m.name,email:m.email},apple:h&&{subject:h.subject,email:h.email},farcaster:g&&{fid:g.fid,ownerAddress:g.ownerAddress,displayName:g.displayName,username:g.username,bio:g.bio,pfp:g.pfp,url:g.url},mfaMethods:w.map(T=>T.type),hasAcceptedTerms:e.has_accepted_terms??!1}}import{getAddress as Fp}from"@ethersproject/address";import xg from"eventemitter3";function Ud(){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 ji=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 rl=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||ji(e)!=="MetaMask")return!1;if(e.providers){for(let o of e.providers)if(!rl(o))return!1}return!0},Wo=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Fd=()=>{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 Bd=(e,t)=>{let o=[],r=[];for(let[n,i]of e.entries())n<t?o.push(i):r.push(i);return[o,r]},Ki=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,}))$/),Hd=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Lo=(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}`},nl=e=>new Promise(t=>setTimeout(t,e));function Gd(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 Vd=(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 nl(o)}a||i(new Error("Exceeded max attempts before resolving function"))})},Yi=(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 zd=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),pr=e=>typeof e=="string"?e:"0x"+e.toString(16);async function $d(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 Ud()){let u=ji(c);if(!l.some(m=>m.info.name===u)){if(rl(c,!0)&&!s.find(m=>m.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(m=>m.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(m=>m.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function Or(e){return`eip155:${String(Number(e))}`}var Ft=(e,t,o)=>{let r=Number(e),n=t.find(a=>a.id===r);if(!n)throw new J(`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]+"/"+Bi:n.rpcUrls.blast?.http[0]?i=n.rpcUrls.blast.http[0]+"/"+Td:i=n.rpcUrls.default?.http[0],!i)throw new J(`No RPC url found for ${e}`);return i},qd=(e,t)=>{let o=Number(e),r=t.find(n=>n.id===o);if(!r)throw new J(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url},Ji=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}}};import Jy from"@coinbase/wallet-sdk";import{jsx as jd,jsxs as Hy}from"react/jsx-runtime";var Zi=({style:e,...t})=>Hy("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:[jd("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),jd("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as to}from"@ethersproject/address";import{Web3Provider as ep}from"@ethersproject/providers";import{default as Ky}from"eventemitter3";import{StaticJsonRpcProvider as Yd}from"@ethersproject/providers";import jy from"eventemitter3";var Gy=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Kd=e=>Gy.includes(e);import{ErrorCode as Vy}from"@ethersproject/logger";var Nr=class extends J{constructor(){super("Wallet timeout");this.type="wallet_error"}},Dr=class extends J{constructor(){super("User rejected connection");this.type="wallet_error"}},Bt=e=>{if(e instanceof J)return e;if(e?.code&&e?.reason){let t=new we(e);return e.code===Vy.ACTION_REJECTED&&(t.details=ze.E4001_USER_REJECTED_REQUEST),t}return e?.code?new we(e):new J("Unknown connector error",e)},Pt=class extends Ge{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},we=class extends Pt{constructor(o){let r=o;super(r.message,r.code,r.data);let n=Object.values(ze).find(i=>i.eipCode===r.code);this.details=n||ze.UNKNOWN_ERROR,r.code===-32002&&(r.message?.includes("already pending for origin")?r.message?.includes("wallet_requestPermissions")?this.details=ze.E32002_CONNECTION_ALREADY_PENDING:this.details=ze.E32002_REQUEST_ALREADY_PENDING:r.message?.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=ze.E32002_WALLET_LOCKED))}},zy={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}},$y={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}},qy={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}},ze={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...qy,...$y},Co={...zy,...ze};var he=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 Nr,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||lr,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 J(`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 Bt(o)})}},Oo=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Qi=class extends jy{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 Yd(Ft(a,this.chains,n)),this.rpcTimeoutDuration=Ur(n,"privy")}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Oo(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Re()||!this.address)throw new Oo("Disconnected",4900);return(await Qd(r)).hash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Oo(`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 Oo(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new Yd(Ft(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 Jd(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 Zd(Ji(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:pr(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 pr(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(Kd(o.method)){let r=await Re();if(await Xd(),!r||!this.address)throw new Oo("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 Oo("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await Re();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}}},eo=class extends he{constructor(o){super(o,o.rpcTimeoutDuration)}},No=class extends he{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 Yy=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},dt=class extends Ky{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=Or(o),this.walletClientType==="privy"&&se.put(zi(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=Ur(i,o),this.connected=!1,this.initialized=!1}buildConnectedWallet(o,r,n){let i=async()=>!!this.wallets.find(a=>to(a.address)===to(o));return{address:to(o),chainId:r,meta:n,switchChain:async a=>{if(!i)throw new J("Wallet is not currently connected.");let l=this.wallets.find(h=>to(h.address)===to(o))?.chainId;if(!l)throw new J("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===Or(s))return;let u=this.chains.find(h=>h.id===c);if(!u)throw new J(`Unsupported chainId: ${a}`);let m=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await m()}catch(h){if(Yy(h,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??""]}]}),m();throw this.walletClientType==="rainbow"&&h.message?.includes("wallet_switchEthereumChain")?new J(`Rainbow does not support the chainId ${r}`):h}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new J("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new J("Wallet is not currently connected.");return new ep(new eo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new J("Wallet is not currently connected.");return new No(this.proxyProvider)},sign:async a=>{if(!await i())throw new J("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=to(n),a=[],l;if(this.walletClientType==="privy"){let c=se.get(zi(i));this.chains.find(u=>u.id===Number(c))||(se.del(zi(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 ${Qs}`,c),l=Qs}let s=Or(l);if(!a.find(c=>to(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(to(n),s,c))}Xi(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=>to(n)===to(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 ep(new eo(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 Zy=e=>{let t=`https://mainnet.infura.io/v3/${Bi}`,o=1;return e.makeWeb3Provider(t,o)},ea,ta=class extends dt{constructor(o,r,n){super("coinbase_wallet",o,r,n);this.connectorType="coinbase_wallet";this.proxyProvider=new he(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),ea||(ea=new Jy({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(Zy(ea))}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(){ea.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:Zi,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 J("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([o[0]])}catch(o){throw Bt(o)}}};import{jsx as tp}from"react/jsx-runtime";var oa=({...e})=>tp("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:tp("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 ra=class extends dt{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:[pr(o?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:oa,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as op}from"react/jsx-runtime";var Fr=({style:e,...t})=>op("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:op("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as ht,jsxs as Qy}from"react/jsx-runtime";var Br=({style:e,...t})=>Qy("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:[ht("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),ht("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),ht("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"}),ht("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"}),ht("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"}),ht("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"}),ht("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"}),ht("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"}),ht("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"}),ht("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"}),ht("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"}),ht("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"}),ht("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as rp,jsxs as Xy}from"react/jsx-runtime";var oo=({style:e,...t})=>Xy("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:[rp("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),rp("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 Gr=class extends dt{constructor(o,r,n,i,a){super(a||"unknown",o,r,n);this.connectorType="injected";this.proxyProvider=new he(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 J("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw Bt(o)}}},Hr,Vr=class extends dt{constructor(o,r,n,i,a){super(a??"unknown",o,r,n);this.connectorType="injected";Wi(this,Hr,void 0);this.proxyProvider=new he(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?qs(this,Hr,{name:"MetaMask",icon:Br,id:"io.metamask"}):a==="phantom"&&qs(this,Hr,{name:"Phantom",icon:oo,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 qc(this,Hr)??{name:"Browser Extension",icon:Fr,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 J("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw Bt(o)}}};Hr=new WeakMap;import{getAddress as e6}from"@ethersproject/address";import{Web3Provider as o6}from"@ethersproject/providers";import{isMobile as eg}from"react-device-detect";var na=class extends Gr{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{eg||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 J("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Bt(t)}}};var ia=class extends dt{constructor(o,r){super(o,[],r,{});this.connectorType="null";this.proxyProvider=new he(void 0,lr);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 aa=class extends ia{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:oo,id:"phantom"}}};import{EthereumProvider as bg,OPTIONAL_EVENTS as Eg,OPTIONAL_METHODS as Pg}from"@walletconnect/ethereum-provider";import{isMobile as Tg}from"react-device-detect";import{createContext as ug,useContext as mg,useEffect as ll,useRef as fg,useState as hg}from"react";import{jsx as tg}from"react/jsx-runtime";function sa({src:e,...t}){return tg("img",{src:e,...t,style:{display:"none"}})}import{useContext as Tp,useEffect as Pp,useMemo as lg,useState as cg}from"react";import{createContext as dg}from"react";var Tt={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:xd,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var np=({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 og=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),ip=e=>og.has(e),ap=(e,t,o)=>o.indexOf(e)===t,sp=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(ip).filter(ap):e?e.filter(ip).filter(ap):Tt.appearance.walletList;var la={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 ca={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 da={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 lp={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 cp={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 pa={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 ua={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 ma={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 dp={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 pp={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 up={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 mp={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 fp={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 hp={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 yp={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 gp={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 fa={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 ha={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 ya={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 ga={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 Gn={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 Vn={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 vp={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 wp={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 va={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 wa={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 Ca={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 zn=[la,ca,da,fp,wp,fa,ha,ya,ga,Gn,Vn,dp,pp,up,mp,pa,ua,ma,yp,gp,lp,cp,va,Ca,wa,hp,vp],EP=new Set(zn.map(e=>e.id));import ur from"tinycolor2";var Cp="#FFFFFF",rg="#000000",ng=Cp,ig="#1E1E1D";function ag(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 Do(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return ur({...e.toHsl(),l:o})}function bp({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",warnHex:r="#FFB74D",errorHex:n="#EC6351",whiteHex:i=Cp,blackHex:a=rg}){let l;switch(e){case"light":l=ng;break;case"dark":l=ig;break;default:l=e;break}let s=ur(l),c=ur(t),u=ur(o),m=ur(r),h=ur(n),g=ag(s.getLuminance()),w=Do(s,g==="light"?-.04:.11),b=Do(s,g==="light"?-.88:.87),T=Do(s,g==="light"?-.77:.75),C=Do(s,g==="light"?-.43:.45).desaturate(g==="light"?60:20),_=Do(s,g==="light"?-.08:.25).desaturate(g==="light"?60:20),M=Do(c,.15),R=Do(c,-.06),x=ur(c.getLuminance()>.5?a:i),F=Do(u,-.16);return{colorScheme:g,background:s.toHslString(),background2:w.toHslString(),foreground:b.toHslString(),foreground2:T.toHslString(),foreground3:C.toHslString(),foreground4:_.toHslString(),accent:c.toHslString(),accentLight:M.toHslString(),accentDark:R.toHslString(),foregroundAccent:x.toHslString(),success:u.toHslString(),successDark:F.toHslString(),error:h.toHslString(),warn:m.toHslString()}}function il(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,m,h,g,w,b,T,C;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"),m=i?.includes("discord"),g=i?.includes("spotify"),h=i?.includes("tiktok"),b=i?.includes("github"),w=i?.includes("linkedin"),T=i?.includes("apple"),C=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,s=e.walletAuth,c=e.googleOAuth,u=e.twitterOAuth,m=e.discordOAuth,b=e.githubOAuth,g=e.spotifyOAuth,h=e.tiktokOAuth,w=e.linkedinOAuth,T=e.appleOAuth,C=e.farcasterAuth);let _=[a,l].filter(Boolean),M=[c,u,m,b,g,h,w,T,C].filter(Boolean),R=[s].filter(Boolean);if(_.length+M.length+R.length===0)throw new Error("You must enable at least one login method");let x=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;x&&R.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),x=!1):!x&&M.length+_.length===0&&(r("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),x=!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 F=sp({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),U=np({input:t?.loginMethodsAndOrder}),z=t?.intl?.defaultCountry??"US",{chains:k,defaultChain:K}=sg({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),N=!!t?.defaultChain||!!t?.supportedChains,q=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,$,ee=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?q?$=t?.embeddedWallets?.noPromptOnSignature??!0:$=t?.embeddedWallets?.noPromptOnSignature??ee:$=ee,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&$!==!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:bp({backgroundTheme:t?.appearance?.theme??Tt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Tt.appearance.accentColor}),loginGroupPriority:x?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:F},loginMethods:{wallet:s,email:a,sms:l,google:c,twitter:u,discord:m,github:b,spotify:g,tiktok:h,linkedin:w,apple:T,farcaster:C},loginMethodsAndOrder:U,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Tt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Tt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Tt.rpcConfig.rpcTimeouts},chains:k,defaultChain:K,intl:{defaultCountry:z},shouldEnforceDefaultChainOnConnect:N,captchaEnabled:e.captchaEnabled??Tt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...q?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:$},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:q?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Tt.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??Tt._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Tt._render.inParentNodeId}}}function Ep(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 sg({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:zn.find(u=>u.id===s.id)??s)}else n=zn.concat(e??[]);let i=t?n[0]:fa,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}}import{jsx as pg}from"react/jsx-runtime";var xp={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:""},al=il(xp,void 0,!1),sl=dg({appConfig:al,isServerConfigLoaded:!1}),Sp=({children:e,legacyCreateEmbeddedWalletFlag:t,client:o,clientConfig:r})=>{let[n,i]=cg(null),a=lg(()=>il(n??xp,r,!!n),[n,r]);return Pp(()=>{let l=Ep(r,t);o.createAnalyticsEvent("sdk_initialize",l)},[r,t]),Pp(()=>{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)}})()},[]),pg(sl.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},ba=()=>{let{appConfig:e}=Tp(sl);return e},Ea=()=>{let{isServerConfigLoaded:e}=Tp(sl);return e};var E=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{jsx as gg,jsxs as vg}from"react/jsx-runtime";var _p=ug({ready:!1,app:al,currentScreen:null,lastScreen:null,navigate:E,navigateBack:E,resetNavigation:E,setModalData:E,onUserCloseViaDialogOrKeybindRef:void 0}),yg=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Ap=e=>{let t=ba(),o=e.authenticated,[r,n]=hg(e.initialScreen);ll(()=>{!o&&!yg.includes(e.initialScreen)&&e.setInitialScreen(null)},[o]);let i=fg(null);ll(()=>{e.open||(i.current=null)},[e.open]),ll(()=>{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 vg(_p.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&gg(sa,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},S=()=>mg(_p);import{jsx as zr,jsxs as wg}from"react/jsx-runtime";var $n=({style:e,...t})=>{let{app:o}=S();return wg("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:[zr("rect",{width:"28",height:"28",rx:"3",fill:o?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),zr("g",{clipPath:"url(#clip0_1765_9946)",children:zr("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"})}),zr("defs",{children:zr("clipPath",{id:"clip0_1765_9946",children:zr("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var Pa=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries($r))if(t.includes(r.hostname))return{walletClientType:o,entry:r}};var $r={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 Cg(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var kp=e=>e in $r,Rp=e=>{let t=$r[e].mobile;if("native"in t)return t.native};function Ip(e,t){let o=Cg(t);if(o.deepLink)return Np(o.deepLink,e);if(o.universalLink)return Dp(o.universalLink,e);throw new P(`Unsupported wallet ${t.id}`)}var Mp="WALLETCONNECT_DEEPLINK_CHOICE";function Wp(){try{localStorage.removeItem(Mp)}catch{}}function Lp({href:e,name:t}){try{localStorage.setItem(Mp,JSON.stringify({href:e,name:t}))}catch{}}function Op(e){return e.startsWith("http://")||e.startsWith("https://")}function Np(e,t){if(Op(e))return Dp(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 Dp(e,t){if(!Op(e))return Np(e,t);let o=e;o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function Up(e,t){window.open(e,t,"noreferrer noopener")}var ro=class extends dt{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 he(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=$r[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=Pa(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:Br,id:"io.metamask"}:{name:zd(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||$n,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=$r[o],this.walletClientType=o,this.redirectUri=void 0,Wp(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((o,r)=>{let n=()=>{r(new Dr)};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 J("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=Pa(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Ur(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(Bt(a));return}r(new J("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=Ft(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 bg.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:Eg,optionalMethods:Pg,rpcMap:o,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),Tg&&this.walletEntry){let{redirect:l,href:s}=Ip(a,this.walletEntry);Lp({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,Up(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=Pa(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 cl=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===Fp(t)).length:!1},Ur=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||lr:lr,qn=class extends xg{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 he: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;se.get(Js)&&(se.getKeys().forEach(r=>{r.startsWith("walletconnect")&&se.del(r)}),se.del(Js));let o=$d(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"),!Wo()&&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 Qi(o,r,this.rpcConfig,this.chains,n.id),l=new ra(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 ro&&i.resetConnection(r),i;let l=(()=>{if(o==="injected"){if(r==="metamask"&&n?.eip6963InjectedProvider)return new na(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(r==="metamask"&&n?.legacyInjectedProvider)return new Vr(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(r==="phantom"&&n?.legacyInjectedProvider)return new Vr(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&r==="unknown_browser_extension")return new Vr(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Gr(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,r)}else return o==="coinbase_wallet"?new ta(this.chains,this.defaultChain,this.rpcConfig):o==="phantom"?new aa(this.defaultChain):new ro(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=se.get(Zs);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}));se.put(Zs,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=Fp(o),this.emit("walletsUpdated")}};function Xi(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}import{ofetch as Sg}from"ofetch";var _g=[Ni,Ui,Di],Ta=class{constructor(t,o,r){this.appId=t,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=js,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=Sg.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=!_g.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 Li}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw ae(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw ae(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw ae(r)}}};import mr from"js-cookie";function Bp(e){return e instanceof Mo?"email":e instanceof dr?"sms":e instanceof cr?"siwe":e instanceof Mr?"custom_auth":e instanceof Xt?e.meta.provider:null}import*as Hp from"jose";var no=class{static parse(t){try{return new no(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Hp.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 Ag=30,xa=class{constructor(){this.authenticateOnce=new Xe(async t=>this._authenticate(t)),this.linkOnce=new Xe(async t=>this._link(t)),this.refreshOnce=new Xe(this._refresh.bind(this)),this.destroyOnce=new Xe(this._destroy.bind(this)),this.forkSessionOnce=new Xe(this._forkSession.bind(this))}get token(){try{let t=se.get(ar);return typeof t=="string"?new no(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=se.get(Gi);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=se.get(Nn);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=mr.get(Vi);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=no.parse(this.token);return t!==null&&!t.isExpired(Ag)}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=Bp(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:ft(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),Qe(o)}}async _link(t){try{let o=await t.link();return ft(o)}catch(o){throw console.warn("Error linking account"),Qe(o)}}async _refresh(){if(!this.api)throw new P("Session has no API instance");if(!this.client)throw new P("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,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(Ni,a,{headers:i}),r&&this.clearForkedToken()}else if(r)n=await this.api.post(Ui,{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(),ft(n.user)}catch(n){if(n instanceof Qt&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Qe(n)}}async _destroy(){try{await this.api?.post(Di,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new P("Session has no API instance");let t=this.refreshToken;try{let o=await this.api.post(Kc,{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw Qe(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let o=se.get(ar);if(se.put(ar,t),o!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let r=no.parse(t)?.expiration;mr.set(Ks,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}}else se.del(ar),mr.remove(Ks)}storeRefreshToken(t){typeof t=="string"?(se.put(Gi,t),this.client?.useServerCookies||(mr.set(Vi,"t",{sameSite:"Strict",secure:!0,expires:30}),mr.set(Ys,t,{sameSite:"Strict",secure:!0,expires:30}))):(se.del(Gi),mr.remove(Ys),mr.remove(Vi))}clearForkedToken(){se.del(Nn)}};var dl,Sa,Gp,jn=class{constructor(t){Wi(this,Sa);this.apiUrl=t.apiUrl||Hi,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||Sd,this.appId=t.appId,this.clientAnalyticsId=jc(this,Sa,Gp).call(this),dl||(dl=new xa),this.session=dl,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,o,r,n,i,a,l){this.connectors||(this.connectors=new qn(t,o,r,n,i,a,l))}generateApi(){let t=new Ta(this.appId,this,{baseURL:this.apiUrl,timeout:this.timeout});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new P("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new P("No auth flow in progress.");return this.session.link(this.authFlow)}async logout(){await this.session.destroy(),this.authFlow=void 0}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}startMfaFlow(t){t.api=this.api,this.mfaFlow=t}async unlinkEmail(t){try{let o=await this.api.post(sd,{address:t});return ft(o)}catch(o){throw Qe(o)}}async acceptTerms(){try{let t=await this.api.post(wd,{});return ft(t)}catch(t){throw Qe(t)}}async unlinkPhone(t){try{let o=await this.api.post(pd,{phoneNumber:t});return ft(o)}catch(o){throw Qe(o)}}async unlinkWallet(t){try{let o=await this.api.post(Qc,{address:t});return ft(o)}catch(o){throw Qe(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post(yd,{provider:t,subject:o});return ft(r)}catch(r){throw Qe(r)}}async unlinkFarcaster(t){try{let o=await this.api.post(rd,{fid:t});return ft(o)}catch(o){throw Qe(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(Cd,{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(bd,t)}catch(o){throw Qe(o)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?no.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 Qe(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()}};Sa=new WeakSet,Gp=function(){if(typeof window>"u")return null;try{let o=se.get(Dn);if(typeof o=="string"&&o.length>0)return o}catch{}let t=kg();try{return se.put(Dn,t),t}catch{return t}};import{Turnstile as Og}from"@marsidev/react-turnstile";import{useEffect as Ng,useMemo as Dg}from"react";import{useMemo as Rg,useRef as Ig,useContext as Mg,useState as pl,createContext as Wg}from"react";import{jsx as Lg}from"react/jsx-runtime";var Vp=Wg({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}),Ht=class extends Ge{constructor(o,r,n){super(o||"Captcha failed");this.type="Captcha";r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},zp=({children:e,id:t,captchaSiteKey:o,captchaEnabled:r})=>{let n=Ig(null),[i,a]=pl(),[l,s]=pl(),[c,u]=pl(!1),m=Rg(()=>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 Lg(Vp.Provider,{value:{...m,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 Gd(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Ht("Captcha failed",null,"captcha_timeout")}}},children:e})},ce=()=>Mg(Vp);import{jsx as $p}from"react/jsx-runtime";var ul=e=>{let{enabled:t,siteKey:o,appId:r,setError:n,setToken:i,setExecuting:a,ref:l}=ce(),[,s]=Dg(()=>o?.split("t:")||[],[o]);if(Ng(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return $p("div",{className:"hidden h-0 w-0",children:$p(Og,{...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")}}})})};import{useCallback as Zb,useEffect as fy,useRef as Qb,useState as Xb}from"react";import e4 from"react-dom";import{createContext as Ug,useContext as Fg}from"react";var ml=Ug({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,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}),I=()=>Fg(ml);import{createContext as Bg,useContext as Hg}from"react";var ne=Bg({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}),H=()=>Hg(ne);import{useEffect as Gg,useState as Vg}from"react";var qp=e=>{let[t,o]=Vg("auto");return Gg(()=>{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};import{createContext as zg,useContext as $g,useEffect as qg}from"react";var jp={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:[]}},fl=zg(void 0),Kp=()=>$g(fl);function ge(e,t){if(!t)return;let r=Kp().current[e];return qg(()=>{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 O(e,t,o,...r){for(let n of e.current[t][o])n(...r)}function Yp(){let e=Kp();return(t,o,...r)=>O(e,t,o,...r)}function hl(e){ge("configureMfa",e)}import nu from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import s1 from"@heroicons/react/24/solid/DocumentCheckIcon";import l1 from"styled-components";import hr,{css as wl}from"styled-components";import gl from"styled-components";import{Fragment as Kg,jsx as yl,jsxs as Yg}from"react/jsx-runtime";var Uo=({success:e,fail:t})=>Yg(Kg,{children:[yl(xt,{className:e?"success":t?"fail":""}),yl(vl,{className:e?"success":t?"fail":""})]}),xt=gl.span`
12
+ - https://privy.io`;this.getNonceOnce=new Xe(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 T("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign(),o=await this.api.post(ed,{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 ie(t)}}async link(){if(!this.api)throw new T("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign();return await this.api.post(td,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ie(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(Xc,{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,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 mo=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}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 ie(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(fd,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ie(t)}}async sendSmsCode(t,r){if(!this.api)throw new T("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new T("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(md,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ie(o)}}};import{v4 as Rg}from"uuid";function tt(e){return new Date(e*1e3)}function By(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:tt(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:tt(r.verified_at)};t.push(i);break;case"phone":let a={number:r.phoneNumber,type:r.type,verifiedAt:tt(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:tt(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:tt(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:tt(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:tt(r.verified_at)};t.push(u);break;case"github_oauth":let m={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:tt(r.verified_at)};t.push(m);break;case"tiktok_oauth":let h={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:tt(r.verified_at)};t.push(h);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,type:r.type,verifiedAt:tt(r.verified_at)};t.push(g);break;case"apple_oauth":let w={subject:r.subject,email:r.email,type:r.type,verifiedAt:tt(r.verified_at)};t.push(w);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:tt(r.verified_at)});break;case"farcaster":let C={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:tt(r.verified_at)};t.push(C);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function Pt(e,t){return e.sort((r,o)=>o.verifiedAt.getTime()-r.verifiedAt.getTime()),e.find(r=>r.type===t)}var ue=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,Hy=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Tt=(e,t)=>t==="all-users"&&!ue(e)||t==="users-without-wallets"&&!Hy(e)?.length;function yt(e){if(!e)return null;let t=By(e.linked_accounts),r=Pt(t,"wallet"),o=Pt(t,"email"),n=Pt(t,"phone"),i=Pt(t,"google_oauth"),a=Pt(t,"twitter_oauth"),l=Pt(t,"discord_oauth"),s=Pt(t,"github_oauth"),c=Pt(t,"spotify_oauth"),u=Pt(t,"tiktok_oauth"),m=Pt(t,"linkedin_oauth"),h=Pt(t,"apple_oauth"),g=Pt(t,"farcaster"),w=e.mfa_methods.map(({type:x,verified_at:E})=>({type:x,verifiedAt:tt(E)}));return{id:e.id,createdAt:tt(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:m&&{subject:m.subject,name:m.name,email:m.email},apple:h&&{subject:h.subject,email:h.email},farcaster:g&&{fid:g.fid,ownerAddress:g.ownerAddress,displayName:g.displayName,username:g.username,bio:g.bio,pfp:g.pfp,url:g.url},mfaMethods:w.map(x=>x.type),hasAcceptedTerms:e.has_accepted_terms??!1}}import{getAddress as Hp}from"@ethersproject/address";import Sg from"eventemitter3";import{StaticJsonRpcProvider as Oo}from"@ethersproject/providers";function Hd(){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 qi=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 sl=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||qi(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!sl(r))return!1}return!0},Nr=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Gd=()=>{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 Vd=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},ji=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,}))$/),zd=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Dr=(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}`},ll=e=>new Promise(t=>setTimeout(t,e));function $d(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 qd=(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 ll(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},Ki=(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 jd=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),fo=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Kd(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 Hd()){let u=qi(c);if(!l.some(m=>m.info.name===u)){if(sl(c,!0)&&!s.find(m=>m.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(m=>m.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(m=>m.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function No(e){return`eip155:${String(Number(e))}`}var Yi=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new Y(`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]+"/"+Ys:i.rpcUrls.blast?.http[0]?a=i.rpcUrls.blast.http[0]+"/"+Js:a=i.rpcUrls.default?.http[0];if(!a)throw new Y(`No RPC url found for ${e}`);return a},Yd=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new Y(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Er=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new Y(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new Oo(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new Oo(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new Oo({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.infura?.http[0]?a=new Oo(i.rpcUrls.infura.http[0]+"/"+Ys):i.rpcUrls.blast?.http[0]?a=new Oo(i.rpcUrls.blast.http[0]+"/"+Js):a=new Oo(i.rpcUrls.default?.http[0]),!a)throw new Y(`No RPC url found for ${e}`);return a},Ji=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}}};import Zy from"@coinbase/wallet-sdk";import{jsx as Jd,jsxs as Gy}from"react/jsx-runtime";var Zi=({style:e,...t})=>Gy("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:[Jd("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Jd("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as or}from"@ethersproject/address";import{Web3Provider as rp}from"@ethersproject/providers";import{default as Yy}from"eventemitter3";import Ky from"eventemitter3";var Vy=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Zd=e=>Vy.includes(e);import{ErrorCode as zy}from"@ethersproject/logger";var Do=class extends Y{constructor(){super("Wallet timeout");this.type="wallet_error"}},Uo=class extends Y{constructor(){super("User rejected connection");this.type="wallet_error"}},Bt=e=>{if(e instanceof Y)return e;if(e?.code&&e?.reason){let t=new ge(e);return e.code===zy.ACTION_REJECTED&&(t.details=Ve.E4001_USER_REJECTED_REQUEST),t}return e?.code?new ge(e):new Y("Unknown connector error",e)},xt=class extends He{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},ge=class extends xt{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Ve).find(i=>i.eipCode===o.code);this.details=n||Ve.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Ve.E32002_CONNECTION_ALREADY_PENDING:this.details=Ve.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Ve.E32002_WALLET_LOCKED))}},$y={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}},qy={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}},jy={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}},Ve={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...jy,...qy},Pr={...$y,...Ve};var me=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 Do,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||po,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 Y(`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 Bt(r)})}},Ur=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Qi=class extends Ky{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=Er(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Fo(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new Ur(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Re()||!this.address)throw new Ur("Disconnected",4900);return(await ep(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new Ur(`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 Ur(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Er(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0];return await Qd(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 Xd(Ji(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:fo(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 fo(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(Zd(r.method)){let o=await Re();if(await tp(),!o||!this.address)throw new Ur("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 Ur("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Re();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},rr=class extends me{constructor(r){super(r,r.rpcTimeoutDuration)}},Fr=class extends me{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 Jy=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},dt=class extends Yy{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=No(r),this.walletClientType==="privy"&&ae.put(Vi(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=Fo(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n){let i=async()=>!!this.wallets.find(a=>or(a.address)===or(r));return{address:or(r),chainId:o,meta:n,switchChain:async a=>{if(!i)throw new Y("Wallet is not currently connected.");let l=this.wallets.find(h=>or(h.address)===or(r))?.chainId;if(!l)throw new Y("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===No(s))return;let u=this.chains.find(h=>h.id===c);if(!u)throw new Y(`Unsupported chainId: ${a}`);let m=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await m()}catch(h){if(Jy(h,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??""]}]}),m();throw this.walletClientType==="rainbow"&&h.message?.includes("wallet_switchEthereumChain")?new Y(`Rainbow does not support the chainId ${o}`):h}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new Y("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new Y("Wallet is not currently connected.");return new rp(new rr(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new Y("Wallet is not currently connected.");return new Fr(this.proxyProvider)},sign:async a=>{if(!await i())throw new Y("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=or(n),a=[],l;if(this.walletClientType==="privy"){let c=ae.get(Vi(i));this.chains.find(u=>u.id===Number(c))||(ae.del(Vi(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 ${rl}`,c),l=rl}let s=No(l);if(!a.find(c=>or(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(or(n),s,c))}Xi(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=>or(n)===or(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 rp(new rr(this.proxyProvider)).getSigner().signMessage(r)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}};var Bo={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 Qy=(e,t)=>{let o=Yi(1,[Bo],{},t);return e.makeWeb3Provider(o,1)},ea,ta=class extends dt{constructor(r,o,n,i){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.proxyProvider=new me(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),ea||(ea=new Zy({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(Qy(ea,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(){ea.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:Zi,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 Y("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Bt(r)}}};import{jsx as op}from"react/jsx-runtime";var ra=({...e})=>op("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:op("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 oa=class extends dt{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:[fo(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:ra,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as np}from"react/jsx-runtime";var Ho=({style:e,...t})=>np("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:np("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as gt,jsxs as Xy}from"react/jsx-runtime";var Go=({style:e,...t})=>Xy("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:[gt("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),gt("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),gt("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"}),gt("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"}),gt("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"}),gt("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"}),gt("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"}),gt("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"}),gt("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"}),gt("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"}),gt("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"}),gt("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"}),gt("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as ip,jsxs as eg}from"react/jsx-runtime";var nr=({style:e,...t})=>eg("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:[ip("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),ip("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 zo=class extends dt{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new me(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 Y("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Bt(r)}}},Vo,$o=class extends dt{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Wi(this,Vo,void 0);this.proxyProvider=new me(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Ks(this,Vo,{name:"MetaMask",icon:Go,id:"io.metamask"}):a==="phantom"&&Ks(this,Vo,{name:"Phantom",icon:nr,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 Jc(this,Vo)??{name:"Browser Extension",icon:Ho,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 Y("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Bt(r)}}};Vo=new WeakMap;import{getAddress as e6}from"@ethersproject/address";import{Web3Provider as r6}from"@ethersproject/providers";import{isMobile as tg}from"react-device-detect";var na=class extends zo{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{tg||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 Y("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Bt(t)}}};var ia=class extends dt{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new me(void 0,po);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 aa=class extends ia{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:nr,id:"phantom"}}};import{EthereumProvider as Eg,OPTIONAL_EVENTS as Pg,OPTIONAL_METHODS as Tg}from"@walletconnect/ethereum-provider";import{isMobile as xg}from"react-device-detect";import{createContext as mg,useContext as fg,useEffect as ul,useRef as hg,useState as yg}from"react";import{jsx as rg}from"react/jsx-runtime";function sa({src:e,...t}){return rg("img",{src:e,...t,style:{display:"none"}})}import{useContext as Sp,useEffect as xp,useMemo as cg,useState as dg}from"react";import{createContext as pg}from"react";var St={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:Ad,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var ap=({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 og=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),sp=e=>og.has(e),lp=(e,t,r)=>r.indexOf(e)===t,cp=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(sp).filter(lp):e?e.filter(sp).filter(lp):St.appearance.walletList;var la={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 ca={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 da={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 dp={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 pp={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 pa={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 ua={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 ma={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 up={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 mp={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 fp={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 hp={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 yp={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 gp={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 vp={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 wp={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 fa={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 ha={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 ya={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 Gn={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 Vn={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 Cp={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 bp={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 ga={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 va={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 wa={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 zn=[la,ca,da,yp,bp,Bo,fa,ha,ya,Gn,Vn,up,mp,fp,hp,pa,ua,ma,vp,wp,dp,pp,ga,wa,va,gp,Cp],bP=new Set(zn.map(e=>e.id));import ho from"tinycolor2";var Ep="#FFFFFF",ng="#000000",ig=Ep,ag="#1E1E1D";function sg(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 Br(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return ho({...e.toHsl(),l:r})}function Pp({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:i=Ep,blackHex:a=ng}){let l;switch(e){case"light":l=ig;break;case"dark":l=ag;break;default:l=e;break}let s=ho(l),c=ho(t),u=ho(r),m=ho(o),h=ho(n),g=sg(s.getLuminance()),w=Br(s,g==="light"?-.04:.11),C=Br(s,g==="light"?-.88:.87),x=Br(s,g==="light"?-.77:.75),E=Br(s,g==="light"?-.43:.45).desaturate(g==="light"?60:20),P=Br(s,g==="light"?-.08:.25).desaturate(g==="light"?60:20),I=Br(c,.15),R=Br(c,-.06),S=ho(c.getLuminance()>.5?a:i),U=Br(u,-.16);return{colorScheme:g,background:s.toHslString(),background2:w.toHslString(),foreground:C.toHslString(),foreground2:x.toHslString(),foreground3:E.toHslString(),foreground4:P.toHslString(),accent:c.toHslString(),accentLight:I.toHslString(),accentDark:R.toHslString(),foregroundAccent:S.toHslString(),success:u.toHslString(),successDark:U.toHslString(),error:h.toHslString(),warn:m.toHslString()}}function cl(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,m,h,g,w,C,x,E;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"),m=i?.includes("discord"),g=i?.includes("spotify"),h=i?.includes("tiktok"),C=i?.includes("github"),w=i?.includes("linkedin"),x=i?.includes("apple"),E=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,s=e.walletAuth,c=e.googleOAuth,u=e.twitterOAuth,m=e.discordOAuth,C=e.githubOAuth,g=e.spotifyOAuth,h=e.tiktokOAuth,w=e.linkedinOAuth,x=e.appleOAuth,E=e.farcasterAuth);let P=[a,l].filter(Boolean),I=[c,u,m,C,g,h,w,x,E].filter(Boolean),R=[s].filter(Boolean);if(P.length+I.length+R.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&&R.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):!S&&I.length+P.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!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 U=cp({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),F=ap({input:t?.loginMethodsAndOrder}),z=t?.intl?.defaultCountry??"US",{chains:k,defaultChain:K}=lg({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),N=!!t?.defaultChain||!!t?.supportedChains,q=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,$,te=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?q?$=t?.embeddedWallets?.noPromptOnSignature??!0:$=t?.embeddedWallets?.noPromptOnSignature??te:$=te,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&$!==!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:Pp({backgroundTheme:t?.appearance?.theme??St.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??St.appearance.accentColor}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:U},loginMethods:{wallet:s,email:a,sms:l,google:c,twitter:u,discord:m,github:C,spotify:g,tiktok:h,linkedin:w,apple:x,farcaster:E},loginMethodsAndOrder:F,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??St.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??St.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??St.rpcConfig.rpcTimeouts},chains:k,defaultChain:K,intl:{defaultCountry:z},shouldEnforceDefaultChainOnConnect:N,captchaEnabled:e.captchaEnabled??St.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...q?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:$},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:q?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??St.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??St._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??St._render.inParentNodeId}}}function Tp(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 lg({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:zn.find(u=>u.id===s.id)??s)}else n=zn.concat(e??[]);let i=t?n[0]:Bo,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}}import{jsx as ug}from"react/jsx-runtime";var _p={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:""},dl=cl(_p,void 0,!1),pl=pg({appConfig:dl,isServerConfigLoaded:!1}),Ap=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=dg(null),a=cg(()=>cl(n??_p,o,!!n),[n,o]);return xp(()=>{let l=Tp(o,t);r.createAnalyticsEvent("sdk_initialize",l)},[o,t]),xp(()=>{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)}})()},[]),ug(pl.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},Ca=()=>{let{appConfig:e}=Sp(pl);return e},ba=()=>{let{isServerConfigLoaded:e}=Sp(pl);return e};var b=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{jsx as vg,jsxs as wg}from"react/jsx-runtime";var kp=mg({ready:!1,app:dl,currentScreen:null,lastScreen:null,navigate:b,navigateBack:b,resetNavigation:b,setModalData:b,onUserCloseViaDialogOrKeybindRef:void 0}),gg=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Rp=e=>{let t=Ca(),r=e.authenticated,[o,n]=yg(e.initialScreen);ul(()=>{!r&&!gg.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=hg(null);ul(()=>{e.open||(i.current=null)},[e.open]),ul(()=>{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 wg(kp.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&vg(sa,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},_=()=>fg(kp);import{jsx as qo,jsxs as Cg}from"react/jsx-runtime";var $n=({style:e,...t})=>{let{app:r}=_();return Cg("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:[qo("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),qo("g",{clipPath:"url(#clip0_1765_9946)",children:qo("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"})}),qo("defs",{children:qo("clipPath",{id:"clip0_1765_9946",children:qo("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var Ea=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(jo))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var jo={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 bg(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var Ip=e=>e in jo,Mp=e=>{let t=jo[e].mobile;if("native"in t)return t.native};function Wp(e,t){let r=bg(t);if(r.deepLink)return Up(r.deepLink,e);if(r.universalLink)return Fp(r.universalLink,e);throw new T(`Unsupported wallet ${t.id}`)}var Lp="WALLETCONNECT_DEEPLINK_CHOICE";function Op(){try{localStorage.removeItem(Lp)}catch{}}function Np({href:e,name:t}){try{localStorage.setItem(Lp,JSON.stringify({href:e,name:t}))}catch{}}function Dp(e){return e.startsWith("http://")||e.startsWith("https://")}function Up(e,t){if(Dp(e))return Fp(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 Fp(e,t){if(!Dp(e))return Up(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Bp(e,t){window.open(e,t,"noreferrer noopener")}var ir=class extends dt{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 me(void 0,this.rpcTimeoutDuration),s&&(this.walletEntry=jo[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=Ea(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:Go,id:"io.metamask"}:{name:jd(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||$n,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=jo[r],this.walletClientType=r,this.redirectUri=void 0,Op(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Uo)};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 Y("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=Ea(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Fo(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(Bt(a));return}o(new Y("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=Yi(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 Eg.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:Pg,optionalMethods:Tg,rpcMap:r,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),xg&&this.walletEntry){let{redirect:l,href:s}=Wp(a,this.walletEntry);Np({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,Bp(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=Ea(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 ml=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&o.address===Hp(t)).length:!1},Fo=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||po:po,qn=class extends Sg{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 me: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;ae.get(el)&&(ae.getKeys().forEach(o=>{o.startsWith("walletconnect")&&ae.del(o)}),ae.del(el));let r=Kd(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"),!Nr()&&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 Qi(r,o,this.rpcConfig,this.chains,i,n.id),s=new oa(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 ir&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new na(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new $o(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new $o(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new $o(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new zo(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new ta(this.chains,this.defaultChain,this.rpcConfig,this.privyAppId):r==="phantom"?new aa(this.defaultChain):new ir(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=ae.get(tl);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}));ae.put(tl,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=Hp(r),this.emit("walletsUpdated")}};function Xi(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}import{ofetch as _g}from"ofetch";var Ag=[Ni,Ui,Di],Pa=class{constructor(t,r,o){this.appId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=Zs,this.client=r,this.defaults=o,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=_g.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=!Ag.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 Li}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw ie(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw ie(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw ie(o)}}};import yo from"js-cookie";function Gp(e){return e instanceof Or?"email":e instanceof mo?"sms":e instanceof uo?"siwe":e instanceof Mo?"custom_auth":e instanceof tr?e.meta.provider:null}import*as Vp from"jose";var ar=class{static parse(t){try{return new ar(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Vp.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 kg=30,Ta=class{constructor(){this.authenticateOnce=new Xe(async t=>this._authenticate(t)),this.linkOnce=new Xe(async t=>this._link(t)),this.refreshOnce=new Xe(this._refresh.bind(this)),this.destroyOnce=new Xe(this._destroy.bind(this)),this.forkSessionOnce=new Xe(this._forkSession.bind(this))}get token(){try{let t=ae.get(lo);return typeof t=="string"?new ar(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=ae.get(Hi);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=ae.get(Nn);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=yo.get(Gi);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=ar.parse(this.token);return t!==null&&!t.isExpired(kg)}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=Gp(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:yt(n),isNewUser:i}}catch(r){throw console.warn("Error authenticating session"),Qe(r)}}async _link(t){try{let r=await t.link();return yt(r)}catch(r){throw console.warn("Error linking account"),Qe(r)}}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,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(Ni,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(Ui,{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(),yt(n.user)}catch(n){if(n instanceof er&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Qe(n)}}async _destroy(){try{await this.api?.post(Di,{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 r=await this.api.post(Qc,{refresh_token:t});return this.storeToken(r.token),this.storeRefreshToken(r.refresh_token),r.new_session_refresh_token}catch(r){throw Qe(r)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let r=ae.get(lo);if(ae.put(lo,t),r!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let o=ar.parse(t)?.expiration;yo.set(Qs,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}}else ae.del(lo),yo.remove(Qs)}storeRefreshToken(t){typeof t=="string"?(ae.put(Hi,t),this.client?.useServerCookies||(yo.set(Gi,"t",{sameSite:"Strict",secure:!0,expires:30}),yo.set(Xs,t,{sameSite:"Strict",secure:!0,expires:30}))):(ae.del(Hi),yo.remove(Xs),yo.remove(Gi))}clearForkedToken(){ae.del(Nn)}};var fl,xa,zp,jn=class{constructor(t){Wi(this,xa);this.apiUrl=t.apiUrl||Bi,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||kd,this.appId=t.appId,this.clientAnalyticsId=Zc(this,xa,zp).call(this),fl||(fl=new Ta),this.session=fl,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,r,o,n,i,a,l){this.connectors||(this.connectors=new qn(this.appId,t,r,o,n,i,a,l))}generateApi(){let t=new Pa(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 r=await this.api.post(pd,{address:t});return yt(r)}catch(r){throw Qe(r)}}async acceptTerms(){try{let t=await this.api.post(Pd,{});return yt(t)}catch(t){throw Qe(t)}}async unlinkPhone(t){try{let r=await this.api.post(hd,{phoneNumber:t});return yt(r)}catch(r){throw Qe(r)}}async unlinkWallet(t){try{let r=await this.api.post(rd,{address:t});return yt(r)}catch(r){throw Qe(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Cd,{provider:t,subject:r});return yt(o)}catch(o){throw Qe(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(sd,{fid:t});return yt(r)}catch(r){throw Qe(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(Td,{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(xd,t)}catch(r){throw Qe(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?ar.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 Qe(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()}};xa=new WeakSet,zp=function(){if(typeof window>"u")return null;try{let r=ae.get(Dn);if(typeof r=="string"&&r.length>0)return r}catch{}let t=Rg();try{return ae.put(Dn,t),t}catch{return t}};import{Turnstile as Ng}from"@marsidev/react-turnstile";import{useEffect as Dg,useMemo as Ug}from"react";import{useMemo as Ig,useRef as Mg,useContext as Wg,useState as hl,createContext as Lg}from"react";import{jsx as Og}from"react/jsx-runtime";var $p=Lg({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:b,setError:b,setExecuting:b,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:b,reset:b,execute:b}),Ht=class extends He{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},qp=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=Mg(null),[i,a]=hl(),[l,s]=hl(),[c,u]=hl(!1),m=Ig(()=>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 Og($p.Provider,{value:{...m,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 $d(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Ht("Captcha failed",null,"captcha_timeout")}}},children:e})},le=()=>Wg($p);import{jsx as jp}from"react/jsx-runtime";var yl=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=le(),[,s]=Ug(()=>r?.split("t:")||[],[r]);if(Dg(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return jp("div",{className:"hidden h-0 w-0",children:jp(Ng,{...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")}}})})};import{useCallback as Jb,useEffect as yy,useRef as Zb,useState as Qb}from"react";import Xb from"react-dom";import{createContext as Fg,useContext as Bg}from"react";var gl=Fg({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:b,initializeWalletProxy:b,getAuthMeta:b,getAuthFlow:b,closePrivyModal:b,openPrivyModal:b,connectWallet:b,initLoginWithWallet:b,loginWithWallet:b,initLoginWithFarcaster:b,loginWithFarcaster:b,loginWithCode:b,initLoginWithEmail:b,initLoginWithSms:b,initUpdateEmail:b,resendEmailCode:b,resendSmsCode:b,initLoginWithHeadlessOAuth:b,loginWithHeadlessOAuth:b,initLoginWithOAuth:b,loginWithOAuth:b,refreshUser:b,walletProxy:null,createAnalyticsEvent:b,acceptTerms:b,getUsdTokenPrice:b,recoverEmbeddedWallet:b,getFiatOnRampConfig:b,updateWallets:b,fundWallet:b,setReadyToTrue:b}),M=()=>Bg(gl);import{createContext as Hg,useContext as Gg}from"react";var oe=Hg({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:b,login:b,connectOrCreateWallet:b,linkEmail:b,linkPhone:b,linkFarcaster:b,linkWallet:b,linkGoogle:b,linkTwitter:b,linkDiscord:b,linkGithub:b,linkSpotify:b,linkTiktok:b,linkLinkedIn:b,linkApple:b,updateEmail:b,logout:b,getAccessToken:b,getEthereumProvider:b,getEthersProvider:b,getWeb3jsProvider:b,unlinkEmail:b,unlinkPhone:b,unlinkWallet:b,unlinkGoogle:b,unlinkTwitter:b,unlinkDiscord:b,unlinkGithub:b,unlinkSpotify:b,unlinkTiktok:b,unlinkLinkedIn:b,unlinkApple:b,unlinkFarcaster:b,setActiveWallet:b,forkSession:b,createWallet:b,signMessage:b,signTypedData:b,enrollInMfa:b,initEnrollmentWithSms:b,initEnrollmentWithTotp:b,promptMfa:b,init:b,submitEnrollmentWithSms:b,submitEnrollmentWithTotp:b,unenroll:b,submit:b,cancel:b,sendTransaction:b,exportWallet:b,setWalletPassword:b,initLoginWithEmail:b,initLoginWithSms:b,loginWithCode:b,fundWallet:b,initLoginWithHeadlessOAuth:b,loginWithHeadlessOAuth:b,isHeadlessOAuthLoading:!1,isModalOpen:!1}),H=()=>Gg(oe);import{useEffect as Vg,useState as zg}from"react";var Kp=e=>{let[t,r]=zg("auto");return Vg(()=>{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};import{createContext as $g,useContext as qg,useEffect as jg}from"react";var Yp={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:[]}},vl=$g(void 0),Jp=()=>qg(vl);function he(e,t){if(!t)return;let o=Jp().current[e];return jg(()=>{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 O(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function Zp(){let e=Jp();return(t,r,...o)=>O(e,t,r,...o)}function wl(e){he("configureMfa",e)}import au from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import l1 from"@heroicons/react/24/solid/DocumentCheckIcon";import c1 from"styled-components";import vo,{css as Pl}from"styled-components";import bl from"styled-components";import{Fragment as Yg,jsx as Cl,jsxs as Jg}from"react/jsx-runtime";var Hr=({success:e,fail:t})=>Jg(Yg,{children:[Cl(_t,{className:e?"success":t?"fail":""}),Cl(El,{className:e?"success":t?"fail":""})]}),_t=bl.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
- `,vl=gl(xt)`
45
+ `,El=bl(_t)`
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
- `,fr=e=>yl(jg,{color:e.color||"var(--privy-color-foreground-3)"}),jg=gl(xt)`
51
+ `,go=e=>Cl(Kg,{color:e.color||"var(--privy-color-foreground-3)"}),Kg=bl(_t)`
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
- `;import{jsx as St,jsxs as Ra}from"react/jsx-runtime";var _a=hr.button`
60
+ `;import{jsx as At,jsxs as ka}from"react/jsx-runtime";var Sa=vo.button`
61
61
  display: flex;
62
62
  flex-direction: row;
63
63
  align-items: center;
@@ -85,13 +85,13 @@ Resources:
85
85
  color: var(--privy-color-foreground-3);
86
86
  cursor: not-allowed;
87
87
  }
88
- `,D=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>St(Jp,{disabled:t||o,...n,children:t?Ra("span",{children:[St(fr,{}),r?St("span",{children:r}):null]}):e}),WT=hr(D)`
89
- ${e=>e.hideAnimations&&wl`
88
+ `,D=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>At(Qp,{disabled:t||r,...n,children:t?ka("span",{children:[At(go,{}),o?At("span",{children:o}):null]}):e}),MT=vo(D)`
89
+ ${e=>e.hideAnimations&&Pl`
90
90
  && {
91
91
  transition: none;
92
92
  }
93
93
  `}
94
- `,Aa=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>St(Jp,{as:"a",disabled:t||o,...n,children:t?Ra("span",{children:[St(fr,{}),r?St("span",{children:r}):null]}):e}),Jp=hr(_a)`
94
+ `,_a=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>At(Qp,{as:"a",disabled:t||r,...n,children:t?ka("span",{children:[At(go,{}),o?At("span",{children:o}):null]}):e}),Qp=vo(Sa)`
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?wl`
120
+ ${e=>e.disabled?Pl`
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
- `,Gt=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>St(Jg,{disabled:t||o,...n,children:t?Ra("span",{children:[St(fr,{}),r?St("span",{children:r}):null]}):e}),Jg=hr(_a)`
139
+ `,Gt=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>At(Zg,{disabled:t||r,...n,children:t?ka("span",{children:[At(go,{}),o?At("span",{children:o}):null]}):e}),Zg=vo(Sa)`
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
- `,ka=hr.button`
168
+ `,Aa=vo.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&&wl`
181
+ ${e=>e.invisible&&Pl`
182
182
  pointer-events: none;
183
183
  `}
184
184
 
@@ -196,10 +196,10 @@ Resources:
196
196
  cursor: not-allowed;
197
197
  }
198
198
  }
199
- `,LT=hr.div`
199
+ `,WT=vo.div`
200
200
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
201
201
  height: 44px;
202
- `,qr=({children:e,onClick:t,disabled:o,isSubmitting:r,...n})=>Ra(Zg,{isSubmitting:r,onClick:t,disabled:o,...n,children:[St("span",{children:e}),St("span",{children:St(fr,{})})]}),Zg=hr.button`
202
+ `,Ko=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>ka(Qg,{isSubmitting:o,onClick:t,disabled:r,...n,children:[At("span",{children:e}),At("span",{children:At(go,{})})]}),Qg=vo.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
- `;import Zp from"styled-components";import{Fragment as Qg,jsx as Fo,jsxs as Qp}from"react/jsx-runtime";var Cl=Zp.div`
244
+ `;import Xp from"styled-components";import{Fragment as Xg,jsx as Gr,jsxs as eu}from"react/jsx-runtime";var Tl=Xp.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 jr(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:o,requireUsersAcceptTerms:r}}=e.app;if(r&&!e.alwaysShowImplicitConsent)return Fo(Cl,{});if(!o&&!t)return Fo(Cl,{});let n=!!(t&&o);return Qp(Cl,{children:["By logging in I agree to the"," ",o&&Fo("a",{href:o,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&Fo("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var V=({protectedByPrivy:e})=>Fo(te,{children:e?Qp(Qg,{children:[Fo(oa,{className:"hide-on-mobile"}),Fo("span",{className:"hide-on-mobile",children:Fo("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),te=Zp.div`
253
+ `;function Yo(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return Gr(Tl,{});if(!r&&!t)return Gr(Tl,{});let n=!!(t&&r);return eu(Tl,{children:["By logging in I agree to the"," ",r&&Gr("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&Gr("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var V=({protectedByPrivy:e})=>Gr(ee,{children:e?eu(Xg,{children:[Gr(ra,{className:"hide-on-mobile"}),Gr("span",{className:"hide-on-mobile",children:Gr("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),ee=Xp.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
- `;import Xg from"@heroicons/react/24/outline/ArrowLeftIcon";import e1 from"@heroicons/react/24/outline/XMarkIcon";import bl from"styled-components";import{jsx as _t,jsxs as i1}from"react/jsx-runtime";var Xp=()=>_t("div",{}),t1=({backFn:e})=>_t("div",{children:_t(eu,{onClick:e,children:_t(Xg,{height:"16px",width:"16px",strokeWidth:2})})}),o1=e=>_t("div",{children:_t(eu,{"aria-label":"close modal",onClick:e.onClose,children:_t(e1,{height:"16px",width:"16px",strokeWidth:2})})});var A=({backFn:e,onClose:t,title:o,closeable:r=!0})=>{let{closePrivyModal:n}=I(),{app:i}=S();return i1(r1,{children:[e?_t(t1,{backFn:e}):_t(Xp,{}),o&&_t(n1,{id:"privy-dialog-title",children:o}),i?.render.inDialog&&r?_t(o1,{onClose:t||(()=>n())}):_t(Xp,{})]})},eu=bl.button`
280
+ `;import e1 from"@heroicons/react/24/outline/ArrowLeftIcon";import t1 from"@heroicons/react/24/outline/XMarkIcon";import xl from"styled-components";import{jsx as kt,jsxs as a1}from"react/jsx-runtime";var tu=()=>kt("div",{}),r1=({backFn:e})=>kt("div",{children:kt(ru,{onClick:e,children:kt(e1,{height:"16px",width:"16px",strokeWidth:2})})}),o1=e=>kt("div",{children:kt(ru,{"aria-label":"close modal",onClick:e.onClose,children:kt(t1,{height:"16px",width:"16px",strokeWidth:2})})});var A=({backFn:e,onClose:t,title:r,closeable:o=!0})=>{let{closePrivyModal:n}=M(),{app:i}=_();return a1(n1,{children:[e?kt(r1,{backFn:e}):kt(tu,{}),r&&kt(i1,{id:"privy-dialog-title",children:r}),i?.render.inDialog&&o?kt(o1,{onClose:t||(()=>n())}):kt(tu,{})]})},ru=xl.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
- `,r1=bl.div`
299
+ `,n1=xl.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
- `,n1=bl.div`
321
+ `,i1=xl.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
- `;import Kr,{css as a1}from"styled-components";var Ia=Kr.div`
328
+ `;import Jo,{css as s1}from"styled-components";var Ra=Jo.div`
329
329
  text-align: left;
330
330
  flex-grow: 1;
331
- `,Ma=Kr.div`
331
+ `,Ia=Jo.div`
332
332
  display: flex;
333
333
  flex-direction: column;
334
334
  justify-content: flex-end;
335
335
  flex-grow: 1;
336
- `,At=Kr.div`
336
+ `,Rt=Jo.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
- `,tu=a1`
351
+ `,ou=s1`
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
- `,Ce=Kr.button`
390
- ${tu}
391
- `,El=Kr.a`
392
- ${tu}
393
- `,bo=Kr.div`
389
+ `,ve=Jo.button`
390
+ ${ou}
391
+ `,Sl=Jo.a`
392
+ ${ou}
393
+ `,Tr=Jo.div`
394
394
  width: 100%;
395
395
  ${e=>e.if?"display: none;":""}
396
- `;import Ie from"styled-components";var $e=Ie.div`
396
+ `;import Ie from"styled-components";var ze=Ie.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
- `,be=Ie.div`
404
+ `,we=Ie.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
- `,ye=Ie.div`
410
+ `,fe=Ie.div`
411
411
  font-size: 0.875rem;
412
412
 
413
413
  text-align: center;
414
- `,Bo=Ie.div`
414
+ `,Vr=Ie.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
- `,ou=Ie.div`
424
+ `,nu=Ie.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
- `,Pl=Ie.div`
432
+ `,_l=Ie.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
- `,Tl=Ie.div`
444
+ `,Al=Ie.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
- `,Ho=Ie.div`
451
+ `,zr=Ie.div`
452
452
  display: flex;
453
453
  flex-direction: column;
454
454
  gap: 10px;
455
455
  padding-top: 20px;
456
- `,Wa=Ie.div`
456
+ `,Ma=Ie.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
- `,La=Ie.div`
464
+ `,Wa=Ie.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
- `,xl=Ie.button`
472
+ `,kl=Ie.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
- `,Oa=Ie.div`
491
+ `,La=Ie.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
- `,Yr=Ie.div`
501
+ `,Zo=Ie.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
- `,Na=Ie.div`
515
+ `,Oa=Ie.div`
516
516
  width: 100%;
517
517
  display: flex;
518
518
  justify-content: space-between;
519
- `,ru=Ie.p`
519
+ `,iu=Ie.p`
520
520
  text-align: left;
521
521
  width: 100%;
522
522
  color: var(--privy-color-foreground-3) !important;
523
- `,Sl=Ie.button`
523
+ `,Rl=Ie.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
- `,ot=Ie.div`
553
+ `,rt=Ie.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
- `;import{Fragment as p1,jsx as io,jsxs as Kn}from"react/jsx-runtime";var iu=()=>{let{user:e,logout:t}=H(),{app:o,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:i}=S(),{acceptTerms:a,closePrivyModal:l}=I(),s=u=>{u?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};r.current=s;let c=async u=>{u.preventDefault(),await a(),e&&Et(e,o?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:m=>console.error(m),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return io(c1,{termsAndConditionsUrl:o?.legal.termsAndConditionsUrl,privacyPolicyUrl:o?.legal.privacyPolicyUrl,onAccept:c,onDecline:s})},c1=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:o,onDecline:r})=>Kn(p1,{children:[io(A,{closeable:!1}),io(s1,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),io(be,{style:{marginTop:24},children:"One last step"}),io(ye,{children:"By signing up, you agree to our terms and privacy policy."}),Kn(At,{style:{marginTop:24},children:[e&&Kn(El,{target:"_blank",href:e,children:["View Terms ",io(nu,{style:{marginLeft:"auto"}})]}),t&&Kn(El,{target:"_blank",href:t,children:["View Privacy Policy ",io(nu,{style:{marginLeft:"auto"}})]})]}),Kn(d1,{style:{marginTop:24},children:[io(Gt,{onClick:r,children:"No thanks"}),io(D,{onClick:o,children:"Accept"})]}),io(V,{protectedByPrivy:!0})]}),d1=l1.div`
568
+ `;import{Fragment as u1,jsx as sr,jsxs as Kn}from"react/jsx-runtime";var su=()=>{let{user:e,logout:t}=H(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=_(),{acceptTerms:a,closePrivyModal:l}=M(),s=u=>{u?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=s;let c=async u=>{u.preventDefault(),await a(),e&&Tt(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:m=>console.error(m),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return sr(d1,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:c,onDecline:s})},d1=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>Kn(u1,{children:[sr(A,{closeable:!1}),sr(l1,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),sr(we,{style:{marginTop:24},children:"One last step"}),sr(fe,{children:"By signing up, you agree to our terms and privacy policy."}),Kn(Rt,{style:{marginTop:24},children:[e&&Kn(Sl,{target:"_blank",href:e,children:["View Terms ",sr(au,{style:{marginLeft:"auto"}})]}),t&&Kn(Sl,{target:"_blank",href:t,children:["View Privacy Policy ",sr(au,{style:{marginLeft:"auto"}})]})]}),Kn(p1,{style:{marginTop:24},children:[sr(Gt,{onClick:o,children:"No thanks"}),sr(D,{onClick:r,children:"Accept"})]}),sr(V,{protectedByPrivy:!0})]}),p1=c1.div`
569
569
  display: flex;
570
570
  gap: 10px;
571
- `;import Al from"styled-components";import u1 from"styled-components";var Da=u1.span`
571
+ `;import Ml from"styled-components";import m1 from"styled-components";var Na=m1.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
- `;import{jsx as au}from"react/jsx-runtime";var Ua=({style:e,...t})=>au("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:au("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"})});import{Fragment as _l,jsx as ao,jsxs as Fa}from"react/jsx-runtime";var su=()=>{let{navigate:e,app:t}=S(),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 Fa(_l,{children:[ao(A,{}),Fa(m1,{children:[ao(h1,{children:Fa("div",{children:[ao(Da,{}),ao(Ua,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),Fa(f1,{children:[typeof o=="string"?ao("h3",{children:o}):ao(_l,{children:o}),typeof r=="string"?ao("p",{children:r}):ao(_l,{children:r})]}),t?.allowlistConfig.errorCtaLink?ao(D,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):ao(D,{onClick:()=>{e("LANDING")},children:n})]})]})},m1=Al.div`
586
+ `;import{jsx as lu}from"react/jsx-runtime";var Da=({style:e,...t})=>lu("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:lu("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"})});import{Fragment as Il,jsx as lr,jsxs as Ua}from"react/jsx-runtime";var cu=()=>{let{navigate:e,app:t}=_(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return Ua(Il,{children:[lr(A,{}),Ua(f1,{children:[lr(y1,{children:Ua("div",{children:[lr(Na,{}),lr(Da,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),Ua(h1,{children:[typeof r=="string"?lr("h3",{children:r}):lr(Il,{children:r}),typeof o=="string"?lr("p",{children:o}):lr(Il,{children:o})]}),t?.allowlistConfig.errorCtaLink?lr(D,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):lr(D,{onClick:()=>{e("LANDING")},children:n})]})]})},f1=Ml.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
- `,f1=Al.div`
594
+ `,h1=Ml.div`
595
595
  display: flex;
596
596
  flex-direction: column;
597
597
  gap: 8px;
598
- `,h1=Al.div`
598
+ `,y1=Ml.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
- `;import v1 from"@heroicons/react/24/outline/EnvelopeIcon";import w1 from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as fu,useState as Ha}from"react";import{isMobile as C1}from"react-device-detect";import Zn from"styled-components";import yt from"styled-components";var kt=yt.div`
621
+ `;import w1 from"@heroicons/react/24/outline/EnvelopeIcon";import C1 from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as yu,useState as Ba}from"react";import{isMobile as b1}from"react-device-detect";import Zn from"styled-components";import vt from"styled-components";var It=vt.div`
622
622
  display: flex;
623
623
  flex-direction: column;
624
624
  align-items: flex-start;
@@ -626,36 +626,36 @@ Resources:
626
626
  margin-top: auto;
627
627
  gap: 16px;
628
628
  flex-grow: 100;
629
- `,Rt=yt.div`
629
+ `,Mt=vt.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
- `,lu=yt.div`
636
+ `,du=vt.div`
637
637
  display: flex;
638
638
  flex-direction: column;
639
639
  align-items: center;
640
640
  width: 100%;
641
- `,Ba=yt(Rt)`
641
+ `,Fa=vt(Mt)`
642
642
  padding: 20px 0;
643
- `,Vt=yt(Rt)`
643
+ `,Vt=vt(Mt)`
644
644
  gap: 16px;
645
- `,kl=yt.div`
645
+ `,Wl=vt.div`
646
646
  display: flex;
647
647
  flex-direction: column;
648
648
  width: 100%;
649
- `,It=yt.div`
649
+ `,Wt=vt.div`
650
650
  display: flex;
651
651
  flex-direction: column;
652
652
  gap: 8px;
653
- `,x8=yt.div`
653
+ `,T8=vt.div`
654
654
  display: flex;
655
655
  flex-direction: column;
656
656
  justify-content: space-between;
657
657
  height: 100%;
658
- `,cu=yt.div`
658
+ `,pu=vt.div`
659
659
  display: flex;
660
660
  flex-direction: column;
661
661
  justify-content: flex-start;
@@ -678,13 +678,13 @@ Resources:
678
678
  color: var(--privy-color-foreground-3);
679
679
  font-size: 14px;
680
680
  }
681
- `,Z=yt.div`
681
+ `,Z=vt.div`
682
682
  height: 16px;
683
- `,Q=yt.div`
683
+ `,Q=vt.div`
684
684
  height: 12px;
685
- `,du=yt.div`
685
+ `,uu=vt.div`
686
686
  position: relative;
687
- `,pu=yt.div`
687
+ `,mu=vt.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
- `;import Rl from"styled-components";import{Fragment as g1,jsx as Yn,jsxs as mu}from"react/jsx-runtime";var Jn=({title:e,description:t,children:o,...r})=>Yn(uu,{...r,children:mu(g1,{children:[Yn("h3",{children:e}),typeof t=="string"?Yn("p",{children:t}):t,o]})}),so=Rl(Jn)`
695
+ `;import Ll from"styled-components";import{Fragment as v1,jsx as Yn,jsxs as hu}from"react/jsx-runtime";var Jn=({title:e,description:t,children:r,...o})=>Yn(fu,{...o,children:hu(v1,{children:[Yn("h3",{children:e}),typeof t=="string"?Yn("p",{children:t}):t,r]})}),cr=Ll(Jn)`
696
696
  margin-bottom: 24px;
697
- `,Ee=({title:e,description:t,icon:o,children:r,...n})=>mu(y1,{...n,children:[o||null,Yn("h3",{children:e}),typeof t=="string"?Yn("p",{children:t}):t,r]}),uu=Rl.div`
697
+ `,Ce=({title:e,description:t,icon:r,children:o,...n})=>hu(g1,{...n,children:[r||null,Yn("h3",{children:e}),typeof t=="string"?Yn("p",{children:t}):t,o]}),fu=Ll.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
- `,y1=Rl(uu)`
717
+ `,g1=Ll(fu)`
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
- `;import{Fragment as Il,jsx as qe,jsxs as Go}from"react/jsx-runtime";var Ml=6,hu=new Array(Ml).fill(""),b1=1400;var gu=()=>{let{app:e,navigate:t,navigateBack:o,setModalData:r,onUserCloseViaDialogOrKeybindRef:n}=S(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:u}=I(),{authenticated:m,user:h}=H(),[g,w]=Ha(hu),[b,T]=Ha(!1),[C,_]=Ha(null),[M,R]=Ha(null);n.current=()=>null;let x=s()?.email?0:1,F=e?.render.inDialog?et:0,U=e?.render.inDialog?F-500:0;fu(()=>{if(m&&b&&h){if(e?.legal.requireUsersAcceptTerms&&!h.hasAcceptedTerms){let $=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},U);return()=>clearTimeout($)}if(Et(h,e?.embeddedWallets?.createOnLogin)){let $=setTimeout(()=>{r({createWallet:{onSuccess:()=>{},onFailure:ee=>console.error(ee),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},U);return()=>clearTimeout($)}else{u();let $=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),F);return()=>clearTimeout($)}}},[m,b,h]),fu(()=>{if(C&&M===0){let q=setTimeout(()=>{w(hu),_(null),document.querySelector("input[name=code-0]")?.focus()},b1);return()=>clearTimeout(q)}},[C]);let z=q=>{q.preventDefault();let $=q.currentTarget.value.replace(" ","");if($==="")return;if(isNaN(Number($))){_("Code should be numeric"),R(1);return}_(null),R(null);let ee=Number(q.currentTarget.name?.charAt(5)),ie=[...$||[""]].slice(0,Ml-ee),j=[...g.slice(0,ee),...ie,...g.slice(ee+ie.length)];w(j);let Ue=ie.length,st=Math.min(Math.max(ee+Ue,0),Ml-1);isNaN(Number(q.currentTarget.value))||document.querySelector(`input[name=code-${st}]`)?.focus(),j.every(ut=>ut&&!isNaN(+ut))&&(document.querySelector(`input[name=code-${st}]`)?.blur(),c(j.join("")).then(()=>T(!0)).catch(Fe=>{Fe?.status===422?_("Invalid or expired verification code"):Fe instanceof Qt&&Fe.privyErrorCode==="cannot_link_more_of_type"?_(Fe.message):_("Issue verifying code"),R(0)}))},k=q=>{M===1&&(_(null),R(null));let $=[...g.slice(0,q),"",...g.slice(q+1)];w($),q>0&&document.querySelector(`input[name=code-${q-1}]`)?.focus()},K=x==0?qe(v1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):qe(w1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),N=x==0?Go("p",{children:["Please check ",qe(yu,{children:s()?.email})," for an email from privy.io and enter your code below."]}):Go("p",{children:["Please check ",qe(yu,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return Go(Il,{children:[qe(A,{backFn:()=>o()},"header"),Go(E1,{children:[qe(Ee,{title:"Enter confirmation code",description:N,icon:K}),Go(lu,{children:[Go(P1,{children:[qe(T1,{fail:!!C,success:b,children:qe("span",{children:C||(b?"Success!":"")})}),qe("div",{children:g.map((q,$)=>qe("input",{name:`code-${$}`,type:"text",value:g[$],onChange:z,onKeyUp:ee=>{ee.key==="Backspace"&&k($)},inputMode:"numeric",autoFocus:$===0,pattern:"[0-9]",className:`${b?"success":""} ${C?"fail":""}`,autoComplete:C1?"one-time-code":"off"},$))})]}),qe(x1,{children:x==0?Go(Il,{children:[qe("span",{children:"Didn't get an email?"}),qe("button",{onClick:a,children:"Resend code"})]}):Go(Il,{children:[qe("span",{children:"Didn't get a message?"}),qe("button",{onClick:l,children:"Resend code"})]})})]})]}),qe(V,{protectedByPrivy:!0})]})},E1=Zn.div`
725
+ `;import{Fragment as Ol,jsx as $e,jsxs as $r}from"react/jsx-runtime";var Nl=6,gu=new Array(Nl).fill(""),E1=1400;var wu=()=>{let{app:e,navigate:t,navigateBack:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=_(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:u}=M(),{authenticated:m,user:h}=H(),[g,w]=Ba(gu),[C,x]=Ba(!1),[E,P]=Ba(null),[I,R]=Ba(null);n.current=()=>null;let S=s()?.email?0:1,U=e?.render.inDialog?et:0,F=e?.render.inDialog?U-500:0;yu(()=>{if(m&&C&&h){if(e?.legal.requireUsersAcceptTerms&&!h.hasAcceptedTerms){let $=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},F);return()=>clearTimeout($)}if(Tt(h,e?.embeddedWallets?.createOnLogin)){let $=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:te=>console.error(te),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},F);return()=>clearTimeout($)}else{u();let $=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),U);return()=>clearTimeout($)}}},[m,C,h]),yu(()=>{if(E&&I===0){let q=setTimeout(()=>{w(gu),P(null),document.querySelector("input[name=code-0]")?.focus()},E1);return()=>clearTimeout(q)}},[E]);let z=q=>{q.preventDefault();let $=q.currentTarget.value.replace(" ","");if($==="")return;if(isNaN(Number($))){P("Code should be numeric"),R(1);return}P(null),R(null);let te=Number(q.currentTarget.name?.charAt(5)),se=[...$||[""]].slice(0,Nl-te),j=[...g.slice(0,te),...se,...g.slice(te+se.length)];w(j);let Ue=se.length,Ye=Math.min(Math.max(te+Ue,0),Nl-1);isNaN(Number(q.currentTarget.value))||document.querySelector(`input[name=code-${Ye}]`)?.focus(),j.every(ut=>ut&&!isNaN(+ut))&&(document.querySelector(`input[name=code-${Ye}]`)?.blur(),c(j.join("")).then(()=>x(!0)).catch(Fe=>{Fe?.status===422?P("Invalid or expired verification code"):Fe instanceof er&&Fe.privyErrorCode==="cannot_link_more_of_type"?P(Fe.message):P("Issue verifying code"),R(0)}))},k=q=>{I===1&&(P(null),R(null));let $=[...g.slice(0,q),"",...g.slice(q+1)];w($),q>0&&document.querySelector(`input[name=code-${q-1}]`)?.focus()},K=S==0?$e(w1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):$e(C1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),N=S==0?$r("p",{children:["Please check ",$e(vu,{children:s()?.email})," for an email from privy.io and enter your code below."]}):$r("p",{children:["Please check ",$e(vu,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return $r(Ol,{children:[$e(A,{backFn:()=>r()},"header"),$r(P1,{children:[$e(Ce,{title:"Enter confirmation code",description:N,icon:K}),$r(du,{children:[$r(T1,{children:[$e(x1,{fail:!!E,success:C,children:$e("span",{children:E||(C?"Success!":"")})}),$e("div",{children:g.map((q,$)=>$e("input",{name:`code-${$}`,type:"text",value:g[$],onChange:z,onKeyUp:te=>{te.key==="Backspace"&&k($)},inputMode:"numeric",autoFocus:$===0,pattern:"[0-9]",className:`${C?"success":""} ${E?"fail":""}`,autoComplete:b1?"one-time-code":"off"},$))})]}),$e(S1,{children:S==0?$r(Ol,{children:[$e("span",{children:"Didn't get an email?"}),$e("button",{onClick:a,children:"Resend code"})]}):$r(Ol,{children:[$e("span",{children:"Didn't get a message?"}),$e("button",{onClick:l,children:"Resend code"})]})})]})]}),$e(V,{protectedByPrivy:!0})]})},P1=Zn.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
- `,P1=Zn.div`
733
+ `,T1=Zn.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
- `,T1=Zn.div`
789
+ `,x1=Zn.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
- `,x1=Zn.div`
797
+ `,S1=Zn.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
- `,yu=Zn.span`
811
+ `,vu=Zn.span`
812
812
  font-weight: 500;
813
813
  word-break: break-all;
814
- `;import R1 from"@heroicons/react/24/solid/CheckCircleIcon";import I1 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Wl,useRef as M1,useState as Zr}from"react";import W1 from"styled-components";import S1 from"styled-components";import{Fragment as k1,jsx as Jr,jsxs as A1}from"react/jsx-runtime";var vu=({icon:e})=>{let t=e;return Jr(k1,{children:Jr(_1,{children:A1("div",{children:[Jr(Uo,{}),typeof t=="string"?Jr("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?Jr(t,{style:{width:"38px",height:"38px"}}):Jr("span",{})]})})})},_1=S1.div`
814
+ `;import I1 from"@heroicons/react/24/solid/CheckCircleIcon";import M1 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Dl,useRef as W1,useState as Xo}from"react";import L1 from"styled-components";import _1 from"styled-components";import{Fragment as R1,jsx as Qo,jsxs as k1}from"react/jsx-runtime";var Cu=({icon:e})=>{let t=e;return Qo(R1,{children:Qo(A1,{children:k1("div",{children:[Qo(Hr,{}),typeof t=="string"?Qo("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?Qo(t,{style:{width:"38px",height:"38px"}}):Qo("span",{})]})})})},A1=_1.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
- `;import{Fragment as O1,jsx as zt,jsxs as Ll}from"react/jsx-runtime";var Cu=500,wu=Cu*2,bu=()=>{let{lastScreen:e,currentScreen:t,data:o,navigateBack:r,navigate:n,setModalData:i}=S(),{status:a,token:l,waitForResult:s,reset:c,execute:u}=ce(),m=M1([]),h=q=>{m.current=[q,...m.current]},[g,w]=Zr(!0);Wl(()=>{let q=setTimeout(w,wu,!1);return h(q),()=>{m.current.forEach($=>clearTimeout($)),m.current=[]}},[]);let[b,T]=Zr(""),[C,_]=Zr("Checking that you are a human..."),[M,R]=Zr(zt(D,{onClick:()=>{},disabled:!0,children:"Continue"})),[x,F]=Zr(!1),[U,z]=Zr(3),k=o?.captchaModalData,K=async q=>{try{await k?.callback(q),k?.onSuccessNavigateTo&&n(k?.onSuccessNavigateTo,!1)}catch($){if($ instanceof Ht)return;{let ee={error:$,previousScreen:e||"LANDING"};i({errorModalData:ee}),n(k?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};Wl(()=>{if(a==="success"){let q=setTimeout(async()=>{let $=await s();!$||k?.userIntentRequired||K($)},wu);h(q)}else if(a==="ready"){let q=setTimeout(()=>{a==="ready"&&u()},Cu);h(q)}},[a]),Wl(()=>{if(!g)switch(a){case"success":T("Success!"),_("CAPTCHA passed successfully."),R(zt(D,{onClick:()=>{F(!0),K(l)},disabled:!k?.userIntentRequired,loading:x,children:k?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":T(""),_("Checking that you are a human..."),R(zt(D,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":T("Something went wrong"),U<=0?(_("If you use an adblocker or VPN, try disabling and re-attempting."),R(null)):(_("You did not pass CAPTCHA. Please try again."),R(zt(D,{onClick:N,children:"Retry"})));break;case"ready":default:break}},[a,g,x]);let N=async()=>{if(U<=0)return;z($=>$-1),c(),u();let q=await s();!q||k?.userIntentRequired||K(q)};return Ll(O1,{children:[zt(A,{backFn:!e||t===e?void 0:r}),Ll(L1,{children:[a==="success"?zt(R1,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?zt(I1,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):zt(vu,{}),Ll(It,{children:[b?zt("h3",{children:b}):null,zt("p",{children:C})]}),M]}),zt(te,{})]})},L1=W1.div`
837
+ `;import{Fragment as N1,jsx as zt,jsxs as Ul}from"react/jsx-runtime";var Eu=500,bu=Eu*2,Pu=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=_(),{status:a,token:l,waitForResult:s,reset:c,execute:u}=le(),m=W1([]),h=q=>{m.current=[q,...m.current]},[g,w]=Xo(!0);Dl(()=>{let q=setTimeout(w,bu,!1);return h(q),()=>{m.current.forEach($=>clearTimeout($)),m.current=[]}},[]);let[C,x]=Xo(""),[E,P]=Xo("Checking that you are a human..."),[I,R]=Xo(zt(D,{onClick:()=>{},disabled:!0,children:"Continue"})),[S,U]=Xo(!1),[F,z]=Xo(3),k=r?.captchaModalData,K=async q=>{try{await k?.callback(q),k?.onSuccessNavigateTo&&n(k?.onSuccessNavigateTo,!1)}catch($){if($ instanceof Ht)return;{let te={error:$,previousScreen:e||"LANDING"};i({errorModalData:te}),n(k?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};Dl(()=>{if(a==="success"){let q=setTimeout(async()=>{let $=await s();!$||k?.userIntentRequired||K($)},bu);h(q)}else if(a==="ready"){let q=setTimeout(()=>{a==="ready"&&u()},Eu);h(q)}},[a]),Dl(()=>{if(!g)switch(a){case"success":x("Success!"),P("CAPTCHA passed successfully."),R(zt(D,{onClick:()=>{U(!0),K(l)},disabled:!k?.userIntentRequired,loading:S,children:k?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":x(""),P("Checking that you are a human..."),R(zt(D,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":x("Something went wrong"),F<=0?(P("If you use an adblocker or VPN, try disabling and re-attempting."),R(null)):(P("You did not pass CAPTCHA. Please try again."),R(zt(D,{onClick:N,children:"Retry"})));break;case"ready":default:break}},[a,g,S]);let N=async()=>{if(F<=0)return;z($=>$-1),c(),u();let q=await s();!q||k?.userIntentRequired||K(q)};return Ul(N1,{children:[zt(A,{backFn:!e||t===e?void 0:o}),Ul(O1,{children:[a==="success"?zt(I1,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?zt(M1,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):zt(Cu,{}),Ul(Wt,{children:[C?zt("h3",{children:C}):null,zt("p",{children:E})]}),I]}),zt(ee,{})]})},O1=L1.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
- `;import N1 from"@heroicons/react/24/outline/WalletIcon";import{isMobile as D1}from"react-device-detect";import U1 from"styled-components";import{jsx as $t,jsxs as Eu}from"react/jsx-runtime";var Pu=({...e})=>Eu("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[$t("defs",{children:Eu("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:[$t("stop",{offset:"0",stopColor:"#f1562b"}),$t("stop",{offset:"0.3",stopColor:"#f1542b"}),$t("stop",{offset:"0.41",stopColor:"#f04d2a"}),$t("stop",{offset:"0.49",stopColor:"#ef4229"}),$t("stop",{offset:"0.5",stopColor:"#ef4029"}),$t("stop",{offset:"0.56",stopColor:"#e83e28"}),$t("stop",{offset:"0.67",stopColor:"#e13c26"}),$t("stop",{offset:"1",stopColor:"#df3c26"})]})}),$t("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"}),$t("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as qt,jsxs as Qn}from"react/jsx-runtime";var Tu=({style:e,...t})=>Qn("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:[qt("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"}),qt("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:qt("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"})}),Qn("g",{mask:"url(#mask0_16909_31415)",children:[qt("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"}),qt("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"}),qt("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"}}),qt("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"}})]}),Qn("defs",{children:[Qn("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[qt("stop",{"stop-color":"#002D72"}),qt("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),Qn("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[qt("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),qt("stop",{offset:"1","stop-color":"#002D72"})]})]})]});import{jsx as Y,jsxs as gt}from"react/jsx-runtime";var xu=({style:e,...t})=>gt("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:[Y("g",{clipPath:"url(#clip0_5_32)",children:gt("g",{clipPath:"url(#clip1_5_32)",children:[Y("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:Y("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"})}),Y("g",{mask:"url(#mask0_5_32)",children:Y("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),Y("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)"}),Y("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),Y("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),Y("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),Y("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),Y("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),Y("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)"}),Y("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),Y("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),gt("defs",{children:[gt("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[Y("stop",{stopColor:"#174299"}),Y("stop",{offset:"1",stopColor:"#001E59"})]}),gt("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[Y("stop",{offset:"0.770277",stopColor:"#FF4000"}),Y("stop",{offset:"1",stopColor:"#8754C9"})]}),gt("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[Y("stop",{stopColor:"#FF4000"}),Y("stop",{offset:"1",stopColor:"#8754C9"})]}),gt("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[Y("stop",{stopColor:"#8754C9"}),Y("stop",{offset:"1",stopColor:"#FF4000"})]}),gt("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[Y("stop",{offset:"0.723929",stopColor:"#FFF700"}),Y("stop",{offset:"1",stopColor:"#FF9901"})]}),gt("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[Y("stop",{stopColor:"#FFF700"}),Y("stop",{offset:"1",stopColor:"#FF9901"})]}),gt("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[Y("stop",{stopColor:"#FFF700"}),Y("stop",{offset:"1",stopColor:"#FF9901"})]}),gt("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[Y("stop",{offset:"0.59513",stopColor:"#00AAFF"}),Y("stop",{offset:"1",stopColor:"#01DA40"})]}),gt("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[Y("stop",{stopColor:"#00AAFF"}),Y("stop",{offset:"1",stopColor:"#01DA40"})]}),gt("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:[Y("stop",{stopColor:"#00AAFF"}),Y("stop",{offset:"1",stopColor:"#01DA40"})]}),Y("clipPath",{id:"clip0_5_32",children:Y("rect",{width:"120",height:"120",fill:"white"})}),Y("clipPath",{id:"clip1_5_32",children:Y("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as lo,jsxs as Su}from"react/jsx-runtime";var _u=({style:e,...t})=>Su("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:[lo("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),Su("g",{filter:"url(#filter0_d_12393_20043)",children:[lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as Xn,jsxs as Au}from"react/jsx-runtime";var ku=({style:e,...t})=>Au("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:[Au("g",{clipPath:"url(#clip0_1704_1423)",children:[Xn("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"}),Xn("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"})]}),Xn("defs",{children:Xn("clipPath",{id:"clip0_1704_1423",children:Xn("rect",{width:"176",height:"176",fill:"white"})})})]});import{jsx as Qr,jsxs as V1}from"react/jsx-runtime";var co={coinbase_wallet:{logo:Zi,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Br,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:oo,displayName:"Phantom"},rainbow:{logo:xu,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:$n,displayName:"WalletConnect"},zerion:{logo:ku,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Pu,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Tu,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:_u,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="}},yr=({provider:e,displayName:t,logo:o,connectOnly:r,connector:n})=>{let{navigate:i}=S(),{connectWallet:a}=I(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{Wo()?(a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(D1?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},V1(G1,{onClick:s,children:[Qr(H1,{icon:B1(e,n.connectorType)??o,name:n.walletClientType}),Qr("span",{children:F1(e,n.connectorType)||t||n.walletClientType}),Qr("span",{id:"connect-text",children:"Connect"})]})},F1=(e,t)=>{if(co[e]?.displayName)return co[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},B1=(e,t)=>{if(co[e]?.logo)return co[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return $n},H1=({icon:e,name:t})=>typeof e=="string"?Qr("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?Qr(N1,{}):e?Qr(e,{}):null,G1=U1(Ce)`
844
+ `;import D1 from"@heroicons/react/24/outline/WalletIcon";import{isMobile as U1}from"react-device-detect";import F1 from"styled-components";import{jsx as $t,jsxs as Tu}from"react/jsx-runtime";var xu=({...e})=>Tu("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[$t("defs",{children:Tu("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:[$t("stop",{offset:"0",stopColor:"#f1562b"}),$t("stop",{offset:"0.3",stopColor:"#f1542b"}),$t("stop",{offset:"0.41",stopColor:"#f04d2a"}),$t("stop",{offset:"0.49",stopColor:"#ef4229"}),$t("stop",{offset:"0.5",stopColor:"#ef4029"}),$t("stop",{offset:"0.56",stopColor:"#e83e28"}),$t("stop",{offset:"0.67",stopColor:"#e13c26"}),$t("stop",{offset:"1",stopColor:"#df3c26"})]})}),$t("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"}),$t("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as qt,jsxs as Qn}from"react/jsx-runtime";var Su=({style:e,...t})=>Qn("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:[qt("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"}),qt("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:qt("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"})}),Qn("g",{mask:"url(#mask0_16909_31415)",children:[qt("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"}),qt("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"}),qt("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"}}),qt("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"}})]}),Qn("defs",{children:[Qn("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[qt("stop",{"stop-color":"#002D72"}),qt("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),Qn("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[qt("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),qt("stop",{offset:"1","stop-color":"#002D72"})]})]})]});import{jsx as J,jsxs as wt}from"react/jsx-runtime";var _u=({style:e,...t})=>wt("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:[J("g",{clipPath:"url(#clip0_5_32)",children:wt("g",{clipPath:"url(#clip1_5_32)",children:[J("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:J("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"})}),J("g",{mask:"url(#mask0_5_32)",children:J("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),J("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)"}),J("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),J("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),J("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),J("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),J("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),J("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)"}),J("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),J("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),wt("defs",{children:[wt("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[J("stop",{stopColor:"#174299"}),J("stop",{offset:"1",stopColor:"#001E59"})]}),wt("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[J("stop",{offset:"0.770277",stopColor:"#FF4000"}),J("stop",{offset:"1",stopColor:"#8754C9"})]}),wt("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[J("stop",{stopColor:"#FF4000"}),J("stop",{offset:"1",stopColor:"#8754C9"})]}),wt("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[J("stop",{stopColor:"#8754C9"}),J("stop",{offset:"1",stopColor:"#FF4000"})]}),wt("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[J("stop",{offset:"0.723929",stopColor:"#FFF700"}),J("stop",{offset:"1",stopColor:"#FF9901"})]}),wt("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[J("stop",{stopColor:"#FFF700"}),J("stop",{offset:"1",stopColor:"#FF9901"})]}),wt("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[J("stop",{stopColor:"#FFF700"}),J("stop",{offset:"1",stopColor:"#FF9901"})]}),wt("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[J("stop",{offset:"0.59513",stopColor:"#00AAFF"}),J("stop",{offset:"1",stopColor:"#01DA40"})]}),wt("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[J("stop",{stopColor:"#00AAFF"}),J("stop",{offset:"1",stopColor:"#01DA40"})]}),wt("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:[J("stop",{stopColor:"#00AAFF"}),J("stop",{offset:"1",stopColor:"#01DA40"})]}),J("clipPath",{id:"clip0_5_32",children:J("rect",{width:"120",height:"120",fill:"white"})}),J("clipPath",{id:"clip1_5_32",children:J("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as dr,jsxs as Au}from"react/jsx-runtime";var ku=({style:e,...t})=>Au("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:[dr("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),Au("g",{filter:"url(#filter0_d_12393_20043)",children:[dr("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"}),dr("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"}),dr("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"}),dr("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"}),dr("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"}),dr("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"}),dr("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"}),dr("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"}),dr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as Xn,jsxs as Ru}from"react/jsx-runtime";var Iu=({style:e,...t})=>Ru("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:[Ru("g",{clipPath:"url(#clip0_1704_1423)",children:[Xn("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"}),Xn("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"})]}),Xn("defs",{children:Xn("clipPath",{id:"clip0_1704_1423",children:Xn("rect",{width:"176",height:"176",fill:"white"})})})]});import{jsx as en,jsxs as z1}from"react/jsx-runtime";var pr={coinbase_wallet:{logo:Zi,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Go,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:nr,displayName:"Phantom"},rainbow:{logo:_u,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:$n,displayName:"WalletConnect"},zerion:{logo:Iu,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:xu,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Su,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:ku,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="}},wo=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=_(),{connectWallet:a}=M(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{Nr()?(a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(U1?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},z1(V1,{onClick:s,children:[en(G1,{icon:H1(e,n.connectorType)??r,name:n.walletClientType}),en("span",{children:B1(e,n.connectorType)||t||n.walletClientType}),en("span",{id:"connect-text",children:"Connect"})]})},B1=(e,t)=>{if(pr[e]?.displayName)return pr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},H1=(e,t)=>{if(pr[e]?.logo)return pr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return $n},G1=({icon:e,name:t})=>typeof e=="string"?en("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?en(D1,{}):e?en(e,{}):null,V1=F1(ve)`
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
- `;import{Fragment as K1,jsx as Xr,jsxs as Y1}from"react/jsx-runtime";var z1=["coinbase_wallet"],$1=["metamask","okx_wallet","rainbow","uniswap","zerion"],q1=["cryptocom"],j1=["phantom"],en=({connectOnly:e})=>{let{connectors:t}=I(),{app:o}=S(),r=ei(o.appearance.walletList,t,e,o.appearance.walletList);return Y1(K1,{children:[...r]})},ei=(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:m})=>m==="uniswap_wallet_extension"?!r.includes("uniswap"):u==="injected"&&!r.includes(m));for(let u of c){let{walletClientType:m,walletBranding:h}=u;(m==="unknown"?i:n).push(Xr(yr,{connectOnly:o,provider:m,logo:h.icon,displayName:h.name,connector:u},`${s}-${m}`))}}else if(j1.includes(s)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===s||u.connectorType===s);c&&n.push(Xr(yr,{connectOnly:o,provider:s,connector:c},s))}else if($1.includes(s)){let c=t.find(u=>s==="uniswap"?u.walletClientType==="uniswap_wallet_extension":u.connectorType==="injected"&&u.walletClientType===s)??l;c&&n.push(Xr(yr,{connectOnly:o,provider:s,connector:c},s))}else if(z1.includes(s)){let c=t.find(({connectorType:u})=>u===s);c&&n.push(Xr(yr,{connectOnly:o,provider:s,connector:c},s))}else q1.includes(s)?l&&a.push(Xr(yr,{connectOnly:o,provider:s,connector:l},s)):s==="wallet_connect"&&l&&a.push(Xr(yr,{connectOnly:o,provider:s,connector:l},s));return[...i,...n,...a]};import{Fragment as J1,jsx as ti,jsxs as Z1}from"react/jsx-runtime";var Ru=()=>{let{app:e}=S(),t=`Connect a wallet to ${e?.name}`;return Z1(J1,{children:[ti(A,{},"header"),ti(so,{title:"Connect your wallet",description:t}),ti(At,{children:ti(en,{connectOnly:!0})}),ti(V,{protectedByPrivy:!0})]})};import ov from"styled-components";import ev from"styled-components";import Q1 from"react";import{jsx as X1}from"react/jsx-runtime";var Iu=()=>{let{app:e}=S(),t=e?.appearance?.logo,o=`${e?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?X1("img",{src:t,alt:o,style:r}):t.type==="svg"||t.type==="img"?Q1.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};import{jsx as Mu}from"react/jsx-runtime";var tn=e=>{let{app:t}=S();return t?.appearance.logo?Mu(tv,{...e,children:Mu(Iu,{})}):null},tv=ev.div`
866
+ `;import{Fragment as Y1,jsx as tn,jsxs as J1}from"react/jsx-runtime";var $1=["coinbase_wallet"],q1=["metamask","okx_wallet","rainbow","uniswap","zerion"],j1=["cryptocom"],K1=["phantom"],rn=({connectOnly:e})=>{let{connectors:t}=M(),{app:r}=_(),o=ei(r.appearance.walletList,t,e,r.appearance.walletList);return J1(Y1,{children:[...o]})},ei=(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:m})=>m==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="injected"&&!o.includes(m));for(let u of c){let{walletClientType:m,walletBranding:h}=u;(m==="unknown"?i:n).push(tn(wo,{connectOnly:r,provider:m,logo:h.icon,displayName:h.name,connector:u},`${s}-${m}`))}}else if(K1.includes(s)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===s||u.connectorType===s);c&&n.push(tn(wo,{connectOnly:r,provider:s,connector:c},s))}else if(q1.includes(s)){let c=t.find(u=>s==="uniswap"?u.walletClientType==="uniswap_wallet_extension":u.connectorType==="injected"&&u.walletClientType===s)??l;c&&n.push(tn(wo,{connectOnly:r,provider:s,connector:c},s))}else if($1.includes(s)){let c=t.find(({connectorType:u})=>u===s);c&&n.push(tn(wo,{connectOnly:r,provider:s,connector:c},s))}else j1.includes(s)?l&&a.push(tn(wo,{connectOnly:r,provider:s,connector:l},s)):s==="wallet_connect"&&l&&a.push(tn(wo,{connectOnly:r,provider:s,connector:l},s));return[...i,...n,...a]};import{Fragment as Z1,jsx as ti,jsxs as Q1}from"react/jsx-runtime";var Mu=()=>{let{app:e}=_(),t=`Connect a wallet to ${e?.name}`;return Q1(Z1,{children:[ti(A,{},"header"),ti(cr,{title:"Connect your wallet",description:t}),ti(Rt,{children:ti(rn,{connectOnly:!0})}),ti(V,{protectedByPrivy:!0})]})};import ov from"styled-components";import tv from"styled-components";import X1 from"react";import{jsx as ev}from"react/jsx-runtime";var Wu=()=>{let{app:e}=_(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?ev("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?X1.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};import{jsx as Lu}from"react/jsx-runtime";var on=e=>{let{app:t}=_();return t?.appearance.logo?Lu(rv,{...e,children:Lu(Wu,{})}):null},rv=tv.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
- `;import{Fragment as nv,jsx as on,jsxs as iv}from"react/jsx-runtime";var Wu=()=>{let{app:e}=S();return iv(nv,{children:[on(A,{},"header"),on(rv,{}),on(At,{children:on(en,{connectOnly:!0})}),e&&on(jr,{app:e,alwaysShowImplicitConsent:!0}),on(V,{protectedByPrivy:!0})]})},rv=ov(tn)`
873
+ `;import{Fragment as iv,jsx as nn,jsxs as av}from"react/jsx-runtime";var Ou=()=>{let{app:e}=_();return av(iv,{children:[nn(A,{},"header"),nn(nv,{}),nn(Rt,{children:nn(rn,{connectOnly:!0})}),e&&nn(Yo,{app:e,alwaysShowImplicitConsent:!0}),nn(V,{protectedByPrivy:!0})]})},nv=ov(on)`
874
874
  margin-bottom: 16px;
875
- `;import{useEffect as Uu,useState as Fu}from"react";import{isMobile as mv}from"react-device-detect";import fv from"styled-components";import{useEffect as Ol,useState as gr}from"react";import{isMobile as oi}from"react-device-detect";import{useInterval as cv}from"react-use";import Ou from"styled-components";import{useState as av,useEffect as sv,useCallback as lv}from"react";function Lu(){let[e,t]=av(!1),o=lv(()=>{document.hidden&&t(!0)},[]);return sv(()=>(document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)),[o]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as Du,jsx as Me,jsxs as ri}from"react/jsx-runtime";var Nl=2,Dl=e=>e?.privyErrorCode==="linked_to_another_user"?Co.ERROR_USER_EXISTS:e instanceof we&&!e.details.default?e.details:e instanceof Nr?Co.ERROR_TIMED_OUT:e instanceof Dr?Co.ERROR_USER_REJECTED_CONNECTION:Co.ERROR_WALLET_CONNECTION,Nu=()=>{let[e,t]=gr(!1),[o,r]=gr(!1),[n,i]=gr(void 0),{authenticated:a}=H(),{app:l,navigate:s,navigateBack:c,lastScreen:u,currentScreen:m,setModalData:h}=S(),{getAuthFlow:g,walletConnectionStatus:w,closePrivyModal:b,initLoginWithWallet:T,loginWithWallet:C,updateWallets:_}=I(),{walletConnectors:M}=H(),[R,x]=gr(0),{user:F}=H(),[U]=gr(F?.linkedAccounts.length||0),[z,k]=gr(""),[K,N]=gr(!1),{hasTabbedAway:q}=Lu(),{enabled:$,token:ee}=ce(),ie=oi&&w?.connector?.connectorType==="wallet_connect_v2"||oi&&w?.connector?.connectorType==="coinbase_wallet"||oi&&w?.connector?.connectorType==="injected"&&w?.connector?.walletClientType==="phantom",j=w?.status==="connected",Ue=w?.status==="switching_to_supported_chain";Ol(()=>{let B=g();if(j&&!B&&($&&!ee&&!a?(h({captchaModalData:{callback:Zt=>T(w.connectedWallet,Zt).then(()=>{N(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN",!1)):T(w.connectedWallet,ee).then(()=>{N(!0)})),B&&ie&&j&&!B.preparedMessage){B.buildSiweMessage();return}!B||ie||!j||o||(async()=>{r(!0),i(void 0);try{w?.connector?.connectorType==="wallet_connect_v2"&&w?.connector?.walletClientType==="metamask"&&await nl(2500),await ut()}catch(Zt){console.warn("Auto-prompted signature failed",Zt)}finally{r(!1)}})()},[R,j,K]),Ol(()=>{if(F&&e){let B=l?.render.inDialog?et:0,Zt=l?.render.inDialog?B-500:0;if(l?.legal.requireUsersAcceptTerms&&!F.hasAcceptedTerms){let me=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},Zt);return()=>clearTimeout(me)}if(Et(F,l?.embeddedWallets?.createOnLogin)){let me=setTimeout(()=>{h({createWallet:{onSuccess:()=>{},onFailure:Wn=>console.error(Wn),callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Zt);return()=>clearTimeout(me)}_();let ue=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),et);return()=>clearTimeout(ue)}},[F,e]);let st=B=>{if(B?.privyErrorCode==="allowlist_rejected"){s("ALLOWLIST_REJECTION_SCREEN");return}i(Dl(B))};async function ut(){try{if(await C(),!l?.render.inDialog)return b({shouldCallAuthOnSuccess:!0,isSuccess:!0});t(!0)}catch(B){st(B)}finally{r(!1)}}Ol(()=>{w?.connectError&&st(w?.connectError)},[w]),cv(()=>{let B=Fe==="wallet_connect_v2"&&w?.connector instanceof ro?w.connector.redirectUri:void 0;B&&k(B)},w?.connector instanceof ro&&!z?500:null);let Fe=w?.connector?.connectorType||"injected",re=w?.connector?.walletClientType||"unknown",ko=co[re]?.displayName||w?.connector?.walletBranding.name||"Browser Extension",Ot=co[re]?.logo||w?.connector?.walletBranding.icon||(B=>Me(Fr,{...B})),rr=ko==="Browser Extension"?ko.toLowerCase():ko,Be;e?Be=`Successfully connected with ${rr}`:n?Be=n.message:Ue?Be="Switching networks":j?Be=o&&ie?"Signing":"Sign to verify":Be=`Waiting for ${rr}`;let Se="Don\u2019t see your wallet? Check your other browser windows.";if(e){let B=F?.linkedAccounts.length||0;U===B?Se="Wallet was already linked.":Se="You\u2019re good to go!"}else R>=Nl&&n?Se="Unable to connect wallet":n?Se=n.detail:Ue?Se="Switch your wallet to the requested network.":j&&ie?Se="Sign the message in your wallet to verify it belongs to you.":re==="metamask"&&oi?Se="Click continue to open and connect MetaMask.":re==="metamask"?Se="For the best experience, connect only one wallet at a time.":Fe==="wallet_connect"?Se="Open your mobile wallet app to continue":Fe==="coinbase_wallet"&&(Fd()||(cl(F)?Se="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":Se="Open the Coinbase app on your phone to continue."));let W=M?.walletConnectors?.find(B=>B.walletClientType==="coinbase_wallet"),le=re==="coinbase_wallet"&&(cl(F)||n===Co.ERROR_USER_EXISTS);return ri(Du,{children:[Me(A,{backFn:!u||m===u?void 0:c}),ri(pv,{children:[Me(Ul,{walletLogo:Ot,success:e,fail:!!n}),ri(It,{children:[Me("h3",{children:Be}),Me("p",{children:Se}),!j&&z&&!q?ri("p",{children:["Still here?"," ",Me("a",{href:z,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),le?Me(D,{onClick:()=>W&&W?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Co.ERROR_USER_EXISTS&&m!==u?Me(D,{onClick:c,children:"Use a different wallet"}):j&&!e&&ie?Me(D,{onClick:()=>{r(!0),ut(),dv(re)},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&R<Nl?Me(D,{onClick:()=>{x(R+1),i(void 0),j?(r(!0),ut()):w?.connectRetry()},disabled:!e&&(!n?.retryable||R>=Nl),children:"Retry"}):!e&&!n?Me(D,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),Me(te,{})]})},dv=e=>{if(!oi||!kp(e))return;let t=Rp(e);t&&window.open(t,"_self","noopener,noreferrer")},pv=Ou.div`
875
+ `;import{useEffect as Bu,useState as Hu}from"react";import{isMobile as fv}from"react-device-detect";import hv from"styled-components";import{useEffect as Fl,useState as Co}from"react";import{isMobile as ri}from"react-device-detect";import{useInterval as dv}from"react-use";import Du from"styled-components";import{useState as sv,useEffect as lv,useCallback as cv}from"react";function Nu(){let[e,t]=sv(!1),r=cv(()=>{document.hidden&&t(!0)},[]);return lv(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as Fu,jsx as Me,jsxs as oi}from"react/jsx-runtime";var Bl=2,Hl=e=>e?.privyErrorCode==="linked_to_another_user"?Pr.ERROR_USER_EXISTS:e instanceof ge&&!e.details.default?e.details:e instanceof Do?Pr.ERROR_TIMED_OUT:e instanceof Uo?Pr.ERROR_USER_REJECTED_CONNECTION:Pr.ERROR_WALLET_CONNECTION,Uu=()=>{let[e,t]=Co(!1),[r,o]=Co(!1),[n,i]=Co(void 0),{authenticated:a}=H(),{app:l,navigate:s,navigateBack:c,lastScreen:u,currentScreen:m,setModalData:h}=_(),{getAuthFlow:g,walletConnectionStatus:w,closePrivyModal:C,initLoginWithWallet:x,loginWithWallet:E,updateWallets:P}=M(),{walletConnectors:I}=H(),[R,S]=Co(0),{user:U}=H(),[F]=Co(U?.linkedAccounts.length||0),[z,k]=Co(""),[K,N]=Co(!1),{hasTabbedAway:q}=Nu(),{enabled:$,token:te}=le(),se=ri&&w?.connector?.connectorType==="wallet_connect_v2"||ri&&w?.connector?.connectorType==="coinbase_wallet"||ri&&w?.connector?.connectorType==="injected"&&w?.connector?.walletClientType==="phantom",j=w?.status==="connected",Ue=w?.status==="switching_to_supported_chain";Fl(()=>{let B=g();if(j&&!B&&($&&!te&&!a?(h({captchaModalData:{callback:Qt=>x(w.connectedWallet,Qt).then(()=>{N(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN",!1)):x(w.connectedWallet,te).then(()=>{N(!0)})),B&&se&&j&&!B.preparedMessage){B.buildSiweMessage();return}!B||se||!j||r||(async()=>{o(!0),i(void 0);try{w?.connector?.connectorType==="wallet_connect_v2"&&w?.connector?.walletClientType==="metamask"&&await ll(2500),await ut()}catch(Qt){console.warn("Auto-prompted signature failed",Qt)}finally{o(!1)}})()},[R,j,K]),Fl(()=>{if(U&&e){let B=l?.render.inDialog?et:0,Qt=l?.render.inDialog?B-500:0;if(l?.legal.requireUsersAcceptTerms&&!U.hasAcceptedTerms){let st=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},Qt);return()=>clearTimeout(st)}if(Tt(U,l?.embeddedWallets?.createOnLogin)){let st=setTimeout(()=>{h({createWallet:{onSuccess:()=>{},onFailure:lt=>console.error(lt),callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Qt);return()=>clearTimeout(st)}P();let pe=setTimeout(()=>C({shouldCallAuthOnSuccess:!0,isSuccess:!0}),et);return()=>clearTimeout(pe)}},[U,e]);let Ye=B=>{if(B?.privyErrorCode==="allowlist_rejected"){s("ALLOWLIST_REJECTION_SCREEN");return}i(Hl(B))};async function ut(){try{if(await E(),!l?.render.inDialog)return C({shouldCallAuthOnSuccess:!0,isSuccess:!0});t(!0)}catch(B){Ye(B)}finally{o(!1)}}Fl(()=>{w?.connectError&&Ye(w?.connectError)},[w]),dv(()=>{let B=Fe==="wallet_connect_v2"&&w?.connector instanceof ir?w.connector.redirectUri:void 0;B&&k(B)},w?.connector instanceof ir&&!z?500:null);let Fe=w?.connector?.connectorType||"injected",Ae=w?.connector?.walletClientType||"unknown",Ee=pr[Ae]?.displayName||w?.connector?.walletBranding.name||"Browser Extension",Mr=pr[Ae]?.logo||w?.connector?.walletBranding.icon||(B=>Me(Ho,{...B})),Zt=Ee==="Browser Extension"?Ee.toLowerCase():Ee,mt;e?mt=`Successfully connected with ${Zt}`:n?mt=n.message:Ue?mt="Switching networks":j?mt=r&&se?"Signing":"Sign to verify":mt=`Waiting for ${Zt}`;let Pe="Don\u2019t see your wallet? Check your other browser windows.";if(e){let B=U?.linkedAccounts.length||0;F===B?Pe="Wallet was already linked.":Pe="You\u2019re good to go!"}else R>=Bl&&n?Pe="Unable to connect wallet":n?Pe=n.detail:Ue?Pe="Switch your wallet to the requested network.":j&&se?Pe="Sign the message in your wallet to verify it belongs to you.":Ae==="metamask"&&ri?Pe="Click continue to open and connect MetaMask.":Ae==="metamask"?Pe="For the best experience, connect only one wallet at a time.":Fe==="wallet_connect"?Pe="Open your mobile wallet app to continue":Fe==="coinbase_wallet"&&(Gd()||(ml(U)?Pe="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":Pe="Open the Coinbase app on your phone to continue."));let W=I?.walletConnectors?.find(B=>B.walletClientType==="coinbase_wallet"),ne=Ae==="coinbase_wallet"&&(ml(U)||n===Pr.ERROR_USER_EXISTS);return oi(Fu,{children:[Me(A,{backFn:!u||m===u?void 0:c}),oi(uv,{children:[Me(Gl,{walletLogo:Mr,success:e,fail:!!n}),oi(Wt,{children:[Me("h3",{children:mt}),Me("p",{children:Pe}),!j&&z&&!q?oi("p",{children:["Still here?"," ",Me("a",{href:z,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),ne?Me(D,{onClick:()=>W&&W?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Pr.ERROR_USER_EXISTS&&m!==u?Me(D,{onClick:c,children:"Use a different wallet"}):j&&!e&&se?Me(D,{onClick:()=>{o(!0),ut(),pv(Ae)},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&R<Bl?Me(D,{onClick:()=>{S(R+1),i(void 0),j?(o(!0),ut()):w?.connectRetry()},disabled:!e&&(!n?.retryable||R>=Bl),children:"Retry"}):!e&&!n?Me(D,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),Me(ee,{})]})},pv=e=>{if(!ri||!Ip(e))return;let t=Mp(e);t&&window.open(t,"_self","noopener,noreferrer")},uv=Du.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
- `,uv=Ou.div`
882
+ `,mv=Du.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
- `,Ul=e=>{let t=e.walletLogo;return Me(Du,{children:Me(uv,{children:ri("div",{children:[Me(Uo,{success:e.success,fail:e.fail}),typeof t=="string"?Me("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):Me(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as yv,jsx as Eo,jsxs as Fl}from"react/jsx-runtime";var Ga=2,Bu=()=>{let{navigateBack:e,lastScreen:t,currentScreen:o}=S(),{walletConnectionStatus:r,closePrivyModal:n}=I(),[i,a]=Fu(void 0),[l,s]=Fu(0),c=r?.status==="connected",u=r?.status==="switching_to_supported_chain";Uu(()=>{if(c){let M=setTimeout(n,et);return()=>clearTimeout(M)}},[c]);let m=M=>{a(Dl(M))};Uu(()=>{r?.connectError&&m(r?.connectError)},[r]);let h=r?.connector?.connectorType||"injected",g=r?.connector?.walletClientType||"unknown",w=co[g]?.displayName||r?.connector?.walletBranding.name||"Browser Extension",b=co[g]?.logo||r?.connector?.walletBranding.icon||(M=>Eo(Fr,{...M})),T=w==="Browser Extension"?w.toLowerCase():w,C;c?C=`Successfully connected with ${T}`:i?C=i.message:u?C="Switching networks":C=`Waiting for ${T}`;let _="Don\u2019t see your wallet? Check your other browser windows.";return c?_="You\u2019re good to go!":l>=Ga&&i?_="Unable to connect wallet":i?_=i.detail:u?_="Switch your wallet to the requested network.":g==="metamask"&&mv?_="Click to continue to open and connect MetaMask.":g==="metamask"?_="For the best experience, connect only one wallet at a time.":h==="wallet_connect_v2"?_="Open your mobile wallet app to continue":h==="coinbase_wallet"&&(_="Open the Coinbase app on your phone to continue."),Fl(yv,{children:[Eo(A,{backFn:o===t?void 0:e}),Fl(hv,{children:[Eo(Ul,{walletLogo:b,success:c,fail:!!i}),Fl(It,{children:[Eo("h3",{children:C}),Eo("p",{children:_})]}),i==Co.ERROR_USER_EXISTS?Eo(D,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<Ga?Eo(D,{onClick:()=>{s(l+1),a(void 0),r?.connectRetry()},disabled:!c&&(!i?.retryable||l>=Ga),children:"Retry"}):!c&&i&&l>=Ga?Eo(D,{onClick:e,children:"Use a different wallet"}):null]}),Eo(te,{})]})},hv=fv.div`
905
+ `,Gl=e=>{let t=e.walletLogo;return Me(Fu,{children:Me(mv,{children:oi("div",{children:[Me(Hr,{success:e.success,fail:e.fail}),typeof t=="string"?Me("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):Me(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as gv,jsx as xr,jsxs as Vl}from"react/jsx-runtime";var Ha=2,Gu=()=>{let{navigateBack:e,lastScreen:t,currentScreen:r}=_(),{walletConnectionStatus:o,closePrivyModal:n}=M(),[i,a]=Hu(void 0),[l,s]=Hu(0),c=o?.status==="connected",u=o?.status==="switching_to_supported_chain";Bu(()=>{if(c){let I=setTimeout(n,et);return()=>clearTimeout(I)}},[c]);let m=I=>{a(Hl(I))};Bu(()=>{o?.connectError&&m(o?.connectError)},[o]);let h=o?.connector?.connectorType||"injected",g=o?.connector?.walletClientType||"unknown",w=pr[g]?.displayName||o?.connector?.walletBranding.name||"Browser Extension",C=pr[g]?.logo||o?.connector?.walletBranding.icon||(I=>xr(Ho,{...I})),x=w==="Browser Extension"?w.toLowerCase():w,E;c?E=`Successfully connected with ${x}`:i?E=i.message:u?E="Switching networks":E=`Waiting for ${x}`;let P="Don\u2019t see your wallet? Check your other browser windows.";return c?P="You\u2019re good to go!":l>=Ha&&i?P="Unable to connect wallet":i?P=i.detail:u?P="Switch your wallet to the requested network.":g==="metamask"&&fv?P="Click to continue to open and connect MetaMask.":g==="metamask"?P="For the best experience, connect only one wallet at a time.":h==="wallet_connect_v2"?P="Open your mobile wallet app to continue":h==="coinbase_wallet"&&(P="Open the Coinbase app on your phone to continue."),Vl(gv,{children:[xr(A,{backFn:r===t?void 0:e}),Vl(yv,{children:[xr(Gl,{walletLogo:C,success:c,fail:!!i}),Vl(Wt,{children:[xr("h3",{children:E}),xr("p",{children:P})]}),i==Pr.ERROR_USER_EXISTS?xr(D,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<Ha?xr(D,{onClick:()=>{s(l+1),a(void 0),o?.connectRetry()},disabled:!c&&(!i?.retryable||l>=Ha),children:"Retry"}):!c&&i&&l>=Ha?xr(D,{onClick:e,children:"Use a different wallet"}):null]}),xr(ee,{})]})},yv=hv.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
- `;import Pv from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Tv,useMemo as xv,useState as Sv}from"react";import _v from"styled-components";import Va from"styled-components";import{jsx as Bl,jsxs as bv}from"react/jsx-runtime";var rn=()=>Bl(gv,{children:bv(vv,{children:[Bl(wv,{}),Bl(Cv,{})]})}),gv=Va.div`
912
+ `;import Tv from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as xv,useMemo as Sv,useState as _v}from"react";import Av from"styled-components";import Ga from"styled-components";import{jsx as zl,jsxs as Ev}from"react/jsx-runtime";var an=()=>zl(vv,{children:Ev(wv,{children:[zl(Cv,{}),zl(bv,{})]})}),vv=Ga.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
- `,vv=Va.div`
924
+ `,wv=Ga.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
- `,wv=Va.div`
931
+ `,Cv=Ga.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
- `,Cv=Va.div`
944
+ `,bv=Ga.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 Hu=["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 Te=class extends Error{constructor(o,r){super(r);this.type=o}};function nn(e){let t=e.type;return typeof t=="string"&&Hu.includes(t)}function Ev(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function vr(e){return nn(e)&&e.type==="wallet_not_on_device"}function Gu(e){return nn(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function an(e){return!!(nn(e)&&e.type==="mfa_timeout")}function sn(e){return!!(nn(e)&&e.type==="missing_or_invalid_mfa")}function Hl(e){return!!(nn(e)&&e.type==="mfa_verification_max_attempts_reached")}function Gl(e){return!!(nn(e)&&e.message.includes("code 429"))}function Vl(e){return!!(Ev(e)&&e.message==="MFA canceled")}import{Fragment as zu,jsx as ln,jsxs as zl}from"react/jsx-runtime";var Vu=1,$u=()=>{let{authenticated:e,user:t,getAccessToken:o}=H(),{closePrivyModal:r,createAnalyticsEvent:n,walletProxy:i}=I(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=S(),u=xv(()=>Date.now(),[]),[m,h]=Sv(!1),{onCompleteNavigateTo:g,onFailure:w}=l?.connectWallet,b=C=>{m||(h(!0),w(typeof C=="string"?new Error(C):C))};Tv(()=>{let C=fe(t),_;return!e||!C?b("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let R=await o();if(!R)return b("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:R,address:C.address});let x=(Date.now()-u)/1e3;g==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&x<Vu?_=setTimeout(()=>{a(g)},(Vu-x)*1e3):a(g)}catch(x){if(vr(x)&&C.recoveryMethod==="privy"){let F=await o();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:C.address}),(await i?.recover({address:C.address,accessToken:F}))?.address||b(new Error("Unable to recover wallet")),g?a(g):r({shouldCallAuthOnSuccess:!1}),n("embedded_wallet_recovery_completed",{walletAddress:C.address}),a(g)}catch{b("An error has occurred, please try again.")}}else vr(x)?(s({...l,recoverWallet:{privyWallet:C,onCompleteNavigateTo:g,onFailure:w}}),a("EMBEDDED_WALLET_RECOVERY_SCREEN")):b(x)}})(),()=>clearTimeout(_)):void 0},[e,t,i]);let T=()=>{b("User exited before wallet could be connected"),r({shouldCallAuthOnSuccess:!1})};return c.current=T,zl(zu,{children:[ln(A,{onClose:T}),m?zl(zu,{children:[zl(Vt,{children:[ln(Pv,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),ln(Ee,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),ln(D,{onClick:()=>r({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):ln(rn,{}),ln(Av,{})]})},Av=_v.div`
968
+ `;var Vu=["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 Te=class extends Error{constructor(r,o){super(o);this.type=r}};function sn(e){let t=e.type;return typeof t=="string"&&Vu.includes(t)}function Pv(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function bo(e){return sn(e)&&e.type==="wallet_not_on_device"}function zu(e){return sn(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function ln(e){return!!(sn(e)&&e.type==="mfa_timeout")}function cn(e){return!!(sn(e)&&e.type==="missing_or_invalid_mfa")}function $l(e){return!!(sn(e)&&e.type==="mfa_verification_max_attempts_reached")}function ql(e){return!!(sn(e)&&e.message.includes("code 429"))}function jl(e){return!!(Pv(e)&&e.message==="MFA canceled")}import{Fragment as qu,jsx as dn,jsxs as Kl}from"react/jsx-runtime";var $u=1,ju=()=>{let{authenticated:e,user:t,getAccessToken:r}=H(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=M(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=_(),u=Sv(()=>Date.now(),[]),[m,h]=_v(!1),{onCompleteNavigateTo:g,onFailure:w}=l?.connectWallet,C=E=>{m||(h(!0),w(typeof E=="string"?new Error(E):E))};xv(()=>{let E=ue(t),P;return!e||!E?C("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let R=await r();if(!R)return C("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:R,address:E.address});let S=(Date.now()-u)/1e3;g==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&S<$u?P=setTimeout(()=>{a(g)},($u-S)*1e3):a(g)}catch(S){if(bo(S)&&E.recoveryMethod==="privy"){let U=await r();if(!U)return C("User must be authenticated and have a Privy wallet before it can be recovered");try{n("embedded_wallet_pinless_recovery_started",{walletAddress:E.address}),(await i?.recover({address:E.address,accessToken:U}))?.address||C(new Error("Unable to recover wallet")),g?a(g):o({shouldCallAuthOnSuccess:!1}),n("embedded_wallet_recovery_completed",{walletAddress:E.address}),a(g)}catch{C("An error has occurred, please try again.")}}else bo(S)?(s({...l,recoverWallet:{privyWallet:E,onCompleteNavigateTo:g,onFailure:w}}),a("EMBEDDED_WALLET_RECOVERY_SCREEN")):C(S)}})(),()=>clearTimeout(P)):void 0},[e,t,i]);let x=()=>{C("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=x,Kl(qu,{children:[dn(A,{onClose:x}),m?Kl(qu,{children:[Kl(Vt,{children:[dn(Tv,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),dn(Ce,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),dn(D,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):dn(an,{}),dn(kv,{})]})},kv=Av.div`
969
969
  height: 44px;
970
- `;import kv from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as Rv}from"react";import{Fragment as Iv,jsx as cn,jsxs as qu}from"react/jsx-runtime";var ju=()=>{let{user:e}=H(),{closePrivyModal:t,isNewUserThisSession:o,updateWallets:r}=I(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=S(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,u=()=>{let m=fe(e);m?(r(),l(m)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return Rv(()=>{let m=setTimeout(u,_d);return()=>clearTimeout(m)},[]),a.current=u,qu(Iv,{children:[cn(A,{onClose:u}),cn(Z,{}),qu(Vt,{children:[cn(kv,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),cn(Ee,{title:o?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:o?"You\u2019ve successfully created an account.":"Your account is secured."})]}),cn(Q,{}),cn(V,{protectedByPrivy:!0})]})};import Mv from"@heroicons/react/20/solid/ExclamationTriangleIcon";import Wv from"@heroicons/react/24/outline/ArrowRightOnRectangleIcon";import{useEffect as Ju,useRef as Lv,useState as $l}from"react";import Vo from"styled-components";import{Fragment as Vv,jsx as xe,jsxs as jt}from"react/jsx-runtime";var Zu=()=>{let[e,t]=$l(null),{authenticated:o,user:r,getAccessToken:n}=H(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=I(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=S(),u=fe(r)?.address,{onFailure:m,onSuccess:h,origin:g,appId:w}=s.keyExport,b=C=>{i({shouldCallAuthOnSuccess:!1}),m(typeof C=="string"?new Error(C):C)},T=()=>{i({shouldCallAuthOnSuccess:!1}),h(),a("embedded_wallet_key_export_completed",{walletAddress:u})};return Ju(()=>{let C=fe(r);if(!o||!C)return b("User must be authenticated before exporting their wallet");n().then(t,b)},[o,r]),c.current=T,jt(Vv,{children:[xe(A,{onClose:T}),jt(Dv,{children:[jt(Ee,{icon:xe(Wv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[jt(Hv,{children:[xe(Nv,{style:{marginRight:6}}),Lo(u)]}),xe("p",{children:"You can bring your account with you to another site using an external wallet."})]}),jt(Uv,{children:[jt(Ku,{children:[xe(Yu,{children:"1"}),jt("span",{children:[xe("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."]})]}),jt(Ku,{children:[xe(Yu,{children:"2"}),xe("span",{children:"Copy this key into your other wallet"})]})]}),xe("div",{style:{width:"100%"},children:e&&xe(Ov,{origin:g,appId:w,accessToken:e,clientAnalyticsId:l,address:u,dimensions:{height:"44px"}})}),jt(Gv,{children:[jt("div",{children:[xe(Mv,{viewBox:"0 0 20 18"}),xe("h4",{children:"Warning"})]}),xe("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),xe(V,{protectedByPrivy:!0})]})};function Ov(e){let[t,o]=$l(e.dimensions.width),[r,n]=$l(void 0),i=Lv(null);return Ju(()=>{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")})},[]),xe("div",{ref:i,children:t&&jt(Fv,{children:[xe("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Yi(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...r})}),xe(Bv,{children:"Loading..."})]})})}function Nv(e){return xe("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:xe("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 Dv=Vo.div`
970
+ `;import Rv from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as Iv}from"react";import{Fragment as Mv,jsx as pn,jsxs as Ku}from"react/jsx-runtime";var Yu=()=>{let{user:e}=H(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=M(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=_(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,u=()=>{let m=ue(e);m?(o(),l(m)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return Iv(()=>{let m=setTimeout(u,Rd);return()=>clearTimeout(m)},[]),a.current=u,Ku(Mv,{children:[pn(A,{onClose:u}),pn(Z,{}),Ku(Vt,{children:[pn(Rv,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),pn(Ce,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),pn(Q,{}),pn(V,{protectedByPrivy:!0})]})};import Wv from"@heroicons/react/20/solid/ExclamationTriangleIcon";import Lv from"@heroicons/react/24/outline/ArrowRightOnRectangleIcon";import{useEffect as Qu,useRef as Ov,useState as Yl}from"react";import qr from"styled-components";import{Fragment as zv,jsx as xe,jsxs as jt}from"react/jsx-runtime";var Xu=()=>{let[e,t]=Yl(null),{authenticated:r,user:o,getAccessToken:n}=H(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=M(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),u=ue(o)?.address,{onFailure:m,onSuccess:h,origin:g,appId:w}=s.keyExport,C=E=>{i({shouldCallAuthOnSuccess:!1}),m(typeof E=="string"?new Error(E):E)},x=()=>{i({shouldCallAuthOnSuccess:!1}),h(),a("embedded_wallet_key_export_completed",{walletAddress:u})};return Qu(()=>{let E=ue(o);if(!r||!E)return C("User must be authenticated before exporting their wallet");n().then(t,C)},[r,o]),c.current=x,jt(zv,{children:[xe(A,{onClose:x}),jt(Uv,{children:[jt(Ce,{icon:xe(Lv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[jt(Gv,{children:[xe(Dv,{style:{marginRight:6}}),Dr(u)]}),xe("p",{children:"You can bring your account with you to another site using an external wallet."})]}),jt(Fv,{children:[jt(Ju,{children:[xe(Zu,{children:"1"}),jt("span",{children:[xe("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."]})]}),jt(Ju,{children:[xe(Zu,{children:"2"}),xe("span",{children:"Copy this key into your other wallet"})]})]}),xe("div",{style:{width:"100%"},children:e&&xe(Nv,{origin:g,appId:w,accessToken:e,clientAnalyticsId:l,address:u,dimensions:{height:"44px"}})}),jt(Vv,{children:[jt("div",{children:[xe(Wv,{viewBox:"0 0 20 18"}),xe("h4",{children:"Warning"})]}),xe("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),xe(V,{protectedByPrivy:!0})]})};function Nv(e){let[t,r]=Yl(e.dimensions.width),[o,n]=Yl(void 0),i=Ov(null);return Qu(()=>{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")})},[]),xe("div",{ref:i,children:t&&jt(Bv,{children:[xe("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Ki(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o})}),xe(Hv,{children:"Loading..."})]})})}function Dv(e){return xe("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:xe("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 Uv=qr.div`
971
971
  display: flex;
972
972
  flex-direction: column;
973
973
  text-align: left;
974
- `,Uv=Vo.div`
974
+ `,Fv=qr.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
- `,Ku=Vo.div`
981
+ `,Ju=qr.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
- `,Yu=Vo.div`
990
+ `,Zu=qr.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
- `,Fv=Vo.div`
1004
+ `,Bv=qr.div`
1005
1005
  overflow: visible;
1006
1006
  position: relative;
1007
1007
  height: 44px;
1008
- `,Bv=Vo.div`
1008
+ `,Hv=qr.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
- `,Hv=Vo.div`
1020
+ `,Gv=qr.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
- `,Gv=Vo.div`
1033
+ `,Vv=qr.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
- `;import Nw from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Pm,useRef as Dw,useState as ci}from"react";import Uw from"styled-components";import{useCallback as Em,useEffect as Ow}from"react";import Kv from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as Yv,useState as Kl}from"react";import zv from"@heroicons/react/24/outline/ArrowPathIcon";import $v from"@heroicons/react/24/outline/EyeIcon";import qv from"@heroicons/react/24/outline/EyeSlashIcon";import je,{css as ql}from"styled-components";var jv=ql`
1055
+ `;import Dw from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as xm,useRef as Uw,useState as ci}from"react";import Fw from"styled-components";import{useCallback as Tm,useEffect as Nw}from"react";import Yv from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as Jv,useState as Ql}from"react";import $v from"@heroicons/react/24/outline/ArrowPathIcon";import qv from"@heroicons/react/24/outline/EyeIcon";import jv from"@heroicons/react/24/outline/EyeSlashIcon";import qe,{css as Jl}from"styled-components";var Kv=Jl`
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
- `,za=je.span`
1064
- ${jv}
1063
+ `,Va=qe.span`
1064
+ ${Kv}
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
- `,zo=je.div`
1072
+ `,jr=qe.div`
1073
1073
  display: flex;
1074
1074
  flex-direction: column;
1075
1075
  justify-content: center;
1076
1076
  flex-grow: 1;
1077
- `,$o=je(D)`
1078
- ${e=>e.hideAnimations&&ql`
1077
+ `,Kr=qe(D)`
1078
+ ${e=>e.hideAnimations&&Jl`
1079
1079
  && {
1080
1080
  transition: none;
1081
1081
  }
1082
1082
  `}
1083
- `,Qu=ql`
1083
+ `,em=Jl`
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
- `,dn=je.input`
1099
- ${Qu}
1098
+ `,un=qe.input`
1099
+ ${em}
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
- `,Xu=je.div`
1111
- ${Qu}
1112
- `,qo=je.div`
1110
+ `,tm=qe.div`
1111
+ ${em}
1112
+ `,Yr=qe.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
- `,jo=je.div`
1118
+ `,Jr=qe.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
- `,ni=je.div`
1140
+ `,ni=qe.div`
1141
1141
  display: flex;
1142
1142
  flex-direction: column;
1143
1143
  gap: 10px;
1144
1144
  padding-bottom: 1rem;
1145
- `,ii=je.div`
1145
+ `,ii=qe.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
- `,i_=je.div`
1165
+ `,n_=qe.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
- `,jl=je(_a)`
1171
+ `,Zl=qe(Sa)`
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
- `,pn=je.div`
1183
+ `,mn=qe.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
- `,em=je(zv)`
1191
+ `,rm=qe($v)`
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
- `,un=je(qv)`
1200
+ `,fn=qe(jv)`
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
- `,mn=je($v)`
1209
+ `,hn=qe(qv)`
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
- `,tm=je.progress`
1218
+ `,om=qe.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
- `;import{Fragment as Jv,jsx as vt,jsxs as $a}from"react/jsx-runtime";var om=({buttonHideAnimations:e,buttonLoading:t,password:o,onSubmit:r,onBack:n})=>{let[i,a]=Kl(!0),[l,s]=Kl(!1),[c,u]=Kl(""),m=o===c;return Yv(()=>{c&&!l&&s(!0)},[c]),$a(Jv,{children:[vt(A,{title:"Confirm Password",closeable:!1,backFn:n}),vt(Z,{}),$a(zo,{children:[$a(jo,{children:[vt(Kv,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),vt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),vt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),$a(qo,{children:[vt(dn,{value:c,onChange:h=>u(h.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),vt(pn,{style:{right:"0.75rem"},children:i?vt(un,{onClick:()=>a(!1)}):vt(mn,{onClick:()=>a(!0)})})]}),vt(za,{"aria-hidden":!l||m,error:!0,children:"Passwords do not match"})]}),vt($o,{onClick:r,loading:t,disabled:!m,hideAnimations:e,children:"Continue"}),vt(Q,{}),vt(V,{protectedByPrivy:!0})]})};import ew from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as tw}from"react";import ow from"styled-components";import qa from"styled-components";import{jsx as ai,jsxs as Xv}from"react/jsx-runtime";var rm=({className:e,checked:t,color:o="var(--privy-color-accent)",...r})=>ai("label",{children:Xv(Zv,{className:e,children:[ai(im,{checked:t,...r}),ai(Qv,{color:o,checked:t,children:ai(nm,{viewBox:"0 0 24 24",children:ai("polyline",{points:"20 6 9 17 4 12"})})})]})}),Zv=qa.div`
1234
+ `;import{Fragment as Zv,jsx as Ct,jsxs as za}from"react/jsx-runtime";var nm=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=Ql(!0),[l,s]=Ql(!1),[c,u]=Ql(""),m=r===c;return Jv(()=>{c&&!l&&s(!0)},[c]),za(Zv,{children:[Ct(A,{title:"Confirm Password",closeable:!1,backFn:n}),Ct(Z,{}),za(jr,{children:[za(Jr,{children:[Ct(Yv,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),Ct("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),Ct("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),za(Yr,{children:[Ct(un,{value:c,onChange:h=>u(h.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),Ct(mn,{style:{right:"0.75rem"},children:i?Ct(fn,{onClick:()=>a(!1)}):Ct(hn,{onClick:()=>a(!0)})})]}),Ct(Va,{"aria-hidden":!l||m,error:!0,children:"Passwords do not match"})]}),Ct(Kr,{onClick:o,loading:t,disabled:!m,hideAnimations:e,children:"Continue"}),Ct(Q,{}),Ct(V,{protectedByPrivy:!0})]})};import tw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as rw}from"react";import ow from"styled-components";import $a from"styled-components";import{jsx as ai,jsxs as ew}from"react/jsx-runtime";var im=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>ai("label",{children:ew(Qv,{className:e,children:[ai(sm,{checked:t,...o}),ai(Xv,{color:r,checked:t,children:ai(am,{viewBox:"0 0 24 24",children:ai("polyline",{points:"20 6 9 17 4 12"})})})]})}),Qv=$a.div`
1235
1235
  display: inline-block;
1236
1236
  vertical-align: middle;
1237
- `,nm=qa.svg`
1237
+ `,am=$a.svg`
1238
1238
  fill: none;
1239
1239
  stroke: white;
1240
1240
  stroke-width: 3px;
1241
- `,im=qa.input.attrs({type:"checkbox"})`
1241
+ `,sm=$a.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=qa.div`
1252
+ `,Xv=$a.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
- ${im}:focus + & {
1267
+ ${sm}:focus + & {
1268
1268
  box-shadow: 0 0 0 1px ${e=>e.color};
1269
1269
  }
1270
1270
 
1271
- ${nm} {
1271
+ ${am} {
1272
1272
  visibility: ${e=>e.checked?"visible":"hidden"};
1273
1273
  }
1274
- `;import{Fragment as am,jsx as Mt,jsxs as si}from"react/jsx-runtime";var sm=({buttonHideAnimations:e,buttonLoading:t,onSubmit:o,onBack:r,config:n})=>{let[i,a]=tw(!1);return si(am,{children:[Mt(A,{title:"Confirm Password",closeable:!1,backFn:r}),Mt(Z,{}),si(zo,{children:[si(jo,{children:[Mt(ew,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),Mt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),Mt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),Mt(ni,{children:si(ii,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[Mt(rm,{color:"var(--privy-color-error)",checked:i}),Mt(am,{children:"I understand losing my password means losing my account."})]})})]}),si(rw,{children:[n.initiatedBy==="user"&&Mt(Gt,{onClick:n.onCancel,disabled:t,children:"Cancel"}),Mt($o,{onClick:o,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),Mt(Q,{}),Mt(V,{protectedByPrivy:!0})]})},rw=ow.div`
1274
+ `;import{Fragment as lm,jsx as Lt,jsxs as si}from"react/jsx-runtime";var cm=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=rw(!1);return si(lm,{children:[Lt(A,{title:"Confirm Password",closeable:!1,backFn:o}),Lt(Z,{}),si(jr,{children:[si(Jr,{children:[Lt(tw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),Lt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),Lt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),Lt(ni,{children:si(ii,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[Lt(im,{color:"var(--privy-color-error)",checked:i}),Lt(lm,{children:"I understand losing my password means losing my account."})]})})]}),si(nw,{children:[n.initiatedBy==="user"&&Lt(Gt,{onClick:n.onCancel,disabled:t,children:"Cancel"}),Lt(Kr,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),Lt(Q,{}),Lt(V,{protectedByPrivy:!0})]})},nw=ow.div`
1275
1275
  display: flex;
1276
1276
  gap: 10px;
1277
- `;import ww from"@heroicons/react/24/outline/KeyIcon";import fm from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as hm,useMemo as Yl,useEffect as Cw}from"react";import ym from"styled-components";import nw from"fast-password-entropy";import*as lm from"secure-password-utilities";import{DEFAULT_WORDLIST as iw}from"secure-password-utilities/wordlists";var aw=95,sw=8,lw=3,cw=.3,dw=/[a-z]/,pw=/[A-Z]/,uw=/[0-9]/,mw="a-zA-Z0-9",cm="!@#$%^&*()\\-_+.",dm=`${mw}${cm}`,fw=new RegExp(`[${cm}]`),hw=new RegExp(`[${dm}]`),pm=new RegExp(`^[${dm}]{6,}$`),um=(e="")=>{let t=e.split("").filter(o=>!hw.test(o)).map(o=>o.replace(" ","SPACE"));return[...new Set(t)]},ja=()=>lm.generatePassphrase(4,iw);function yw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function gw(e){if(e.length<sw)return 0;let t=0;dw.test(e)&&(t+=1),pw.test(e)&&(t+=1),uw.test(e)&&(t+=1),fw.test(e)&&(t+=1);let o=t/lw;return Math.max(0,Math.min(1,o))}function vw(e=""){let t=gw(e),o=nw(e)/aw;return(t*cw+o)/2}function mm(e=""){let t=vw(e);return{value:t,label:yw(t)}}import{Fragment as Pw,jsx as We,jsxs as Po}from"react/jsx-runtime";var gm=({buttonHideAnimations:e,buttonLoading:t,password:o="",config:r,onSubmit:n,onClose:i,onPasswordChange:a,onPasswordGenerate:l})=>{let[s,c]=hm(!1),[u,m]=hm(!1);Cw(()=>{o&&!u&&m(!0)},[o]);let h=Yl(()=>u?(o?.length||0)<6?"Password must be at least 6 characters":pm.test(o||"")?null:`Invalid characters used ( ${um(o).join(" ")} )`:null,[o,u]),g=Yl(()=>h?{value:0,label:"Weak"}:mm(o),[o,h]),w=Yl(()=>!!(!o?.length||h),[h,o]);return Po(Pw,{children:[We(A,{onClose:i,title:"Secure your account",closeable:r.initiatedBy==="user"}),We(Z,{}),Po(zo,{children:[Po(jo,{children:[We(ww,{height:48,width:48,stroke:"var(--privy-color-accent)"}),We("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),We("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),Po(qo,{children:[We(dn,{value:o,onChange:b=>a(b.target.value),placeholder:"enter or generate a strong password",type:s?"password":"text",style:{paddingRight:"3.8rem"}}),Po(pn,{style:{width:"3.5rem"},children:[s?We(un,{onClick:()=>c(!1)}):We(mn,{onClick:()=>c(!0)}),We(em,{onClick:l})]})]}),We(tm,{value:g.value===0?.01:g.value,label:g.label}),We(za,{error:!!h,children:h||`Password Strength: ${u?g.label:"--"}`}),Po(Ew,{children:[We(bw,{children:Po(ni,{children:[Po(ii,{children:[We(fm,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),Po(ii,{children:[We(fm,{width:24,height:24,fill:"var(--privy-color-accent)"}),"You will only be asked to enter it when signing on to a new device."]})]})}),We($o,{onClick:n,loading:t,disabled:w,hideAnimations:e,children:"Continue"})]})]}),We(Q,{}),We(V,{protectedByPrivy:!0})]})},bw=ym(ni)`
1277
+ `;import Cw from"@heroicons/react/24/outline/KeyIcon";import ym from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as gm,useMemo as Xl,useEffect as bw}from"react";import vm from"styled-components";import iw from"fast-password-entropy";import*as dm from"secure-password-utilities";import{DEFAULT_WORDLIST as aw}from"secure-password-utilities/wordlists";var sw=95,lw=8,cw=3,dw=.3,pw=/[a-z]/,uw=/[A-Z]/,mw=/[0-9]/,fw="a-zA-Z0-9",pm="!@#$%^&*()\\-_+.",um=`${fw}${pm}`,hw=new RegExp(`[${pm}]`),yw=new RegExp(`[${um}]`),mm=new RegExp(`^[${um}]{6,}$`),fm=(e="")=>{let t=e.split("").filter(r=>!yw.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},qa=()=>dm.generatePassphrase(4,aw);function gw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function vw(e){if(e.length<lw)return 0;let t=0;pw.test(e)&&(t+=1),uw.test(e)&&(t+=1),mw.test(e)&&(t+=1),hw.test(e)&&(t+=1);let r=t/cw;return Math.max(0,Math.min(1,r))}function ww(e=""){let t=vw(e),r=iw(e)/sw;return(t*dw+r)/2}function hm(e=""){let t=ww(e);return{value:t,label:gw(t)}}import{Fragment as Tw,jsx as We,jsxs as Sr}from"react/jsx-runtime";var wm=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,onSubmit:n,onClose:i,onPasswordChange:a,onPasswordGenerate:l})=>{let[s,c]=gm(!1),[u,m]=gm(!1);bw(()=>{r&&!u&&m(!0)},[r]);let h=Xl(()=>u?(r?.length||0)<6?"Password must be at least 6 characters":mm.test(r||"")?null:`Invalid characters used ( ${fm(r).join(" ")} )`:null,[r,u]),g=Xl(()=>h?{value:0,label:"Weak"}:hm(r),[r,h]),w=Xl(()=>!!(!r?.length||h),[h,r]);return Sr(Tw,{children:[We(A,{onClose:i,title:"Secure your account",closeable:o.initiatedBy==="user"}),We(Z,{}),Sr(jr,{children:[Sr(Jr,{children:[We(Cw,{height:48,width:48,stroke:"var(--privy-color-accent)"}),We("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),We("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),Sr(Yr,{children:[We(un,{value:r,onChange:C=>a(C.target.value),placeholder:"enter or generate a strong password",type:s?"password":"text",style:{paddingRight:"3.8rem"}}),Sr(mn,{style:{width:"3.5rem"},children:[s?We(fn,{onClick:()=>c(!1)}):We(hn,{onClick:()=>c(!0)}),We(rm,{onClick:l})]})]}),We(om,{value:g.value===0?.01:g.value,label:g.label}),We(Va,{error:!!h,children:h||`Password Strength: ${u?g.label:"--"}`}),Sr(Pw,{children:[We(Ew,{children:Sr(ni,{children:[Sr(ii,{children:[We(ym,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),Sr(ii,{children:[We(ym,{width:24,height:24,fill:"var(--privy-color-accent)"}),"You will only be asked to enter it when signing on to a new device."]})]})}),We(Kr,{onClick:n,loading:t,disabled:w,hideAnimations:e,children:"Continue"})]})]}),We(Q,{}),We(V,{protectedByPrivy:!0})]})},Ew=vm(ni)`
1278
1278
  flex: 1;
1279
1279
  padding-top: 1rem;
1280
- `,Ew=ym.div`
1280
+ `,Pw=vm.div`
1281
1281
  display: flex;
1282
1282
  flex-direction: column;
1283
1283
  height: 100%;
1284
- `;import Tw from"@heroicons/react/24/outline/ArrowDownTrayIcon";import xw from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import Sw from"@heroicons/react/24/outline/DocumentDuplicateIcon";import _w from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as Aw,useCallback as vm}from"react";import{Fragment as Jl,jsx as pt,jsxs as wr}from"react/jsx-runtime";var wm=({buttonHideAnimations:e,buttonLoading:t,appName:o,password:r,onSubmit:n,onBack:i})=>{let[a,l]=Aw(!1),s=vm(()=>{l(!0),r&&navigator.clipboard.writeText(r)},[r]),c=vm(()=>{let u=document.createElement("a"),m=o.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),h=new Blob([kw(o,r)],{type:"text/plain"}),g=URL.createObjectURL(h);u.href=g,u.target="_blank",u.download=`${m}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(g)},5e3)},[r]);return wr(Jl,{children:[pt(A,{backFn:i,title:"Save Password",closeable:!1}),pt(Z,{}),wr(zo,{children:[wr(jo,{children:[pt(_w,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),pt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),pt("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."})]}),pt(qo,{centered:!0,children:pt(Xu,{children:r})}),wr("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[pt(jl,{onClick:s,children:a?wr(Jl,{children:[pt(xw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):wr(Jl,{children:[pt(Sw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),wr(jl,{onClick:c,children:[pt(Tw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),pt($o,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),pt(Q,{}),pt(V,{protectedByPrivy:!0})]})},kw=(e,t)=>`Your wallet recovery password for ${e} is
1284
+ `;import xw from"@heroicons/react/24/outline/ArrowDownTrayIcon";import Sw from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import _w from"@heroicons/react/24/outline/DocumentDuplicateIcon";import Aw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as kw,useCallback as Cm}from"react";import{Fragment as ec,jsx as pt,jsxs as Eo}from"react/jsx-runtime";var bm=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=kw(!1),s=Cm(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=Cm(()=>{let u=document.createElement("a"),m=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),h=new Blob([Rw(r,o)],{type:"text/plain"}),g=URL.createObjectURL(h);u.href=g,u.target="_blank",u.download=`${m}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(g)},5e3)},[o]);return Eo(ec,{children:[pt(A,{backFn:i,title:"Save Password",closeable:!1}),pt(Z,{}),Eo(jr,{children:[Eo(Jr,{children:[pt(Aw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),pt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),pt("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."})]}),pt(Yr,{centered:!0,children:pt(tm,{children:o})}),Eo("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[pt(Zl,{onClick:s,children:a?Eo(ec,{children:[pt(Sw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):Eo(ec,{children:[pt(_w,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),Eo(Zl,{onClick:c,children:[pt(xw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),pt(Kr,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),pt(Q,{}),pt(V,{protectedByPrivy:!0})]})},Rw=(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.`;import Rw from"@heroicons/react/24/solid/CheckCircleIcon";import Iw from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as Mw,jsx as To,jsxs as Zl}from"react/jsx-runtime";var Cm=({error:e,onClose:t})=>Zl(Mw,{children:[To(A,{closeable:!1}),To(Z,{}),e?Zl(Vt,{children:[To(Iw,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),To(Ee,{title:"Something went wrong",description:e})]}):Zl(Vt,{children:[To(Rw,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),To(Ee,{title:"Success"})]}),To(D,{onClick:t,children:"Close"}),To(Q,{}),To(V,{protectedByPrivy:!0})]});import{useReducer as Ww}from"react";var Lw=(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}},bm=()=>{let[e,t]=Ww(Lw,"creating");return{send:t,state:e}};import{jsx as li}from"react/jsx-runtime";var Ka=({onSubmit:e,...t})=>{let{send:o,state:r}=bm(),n=Em(async()=>{r==="finalizing"&&await e(),o("next")},[r,o,e]);Ow(()=>{let a;return r==="done"&&t.config.initiatedBy==="automatic"&&(a=setTimeout(()=>t.onClose?.(),et)),()=>{a&&clearTimeout(a)}},[r,t.config.initiatedBy,t.onClose]);let i=Em(()=>{o("back")},[o]);return r==="creating"?li(gm,{...t,onSubmit:n}):r==="saving"?li(wm,{...t,onSubmit:n,onBack:i}):r==="confirming"?li(om,{...t,onSubmit:n,onBack:i}):r==="finalizing"?li(sm,{...t,onSubmit:n,onBack:i}):r==="done"?li(Cm,{...t,onSubmit:n}):null};import{Fragment as Bw,jsx as Cr,jsxs as Tm}from"react/jsx-runtime";var xm=()=>{let{app:e,navigate:t,data:o,onUserCloseViaDialogOrKeybindRef:r}=S(),[n,i]=ci(""),[a,l]=ci(!1),[s,c]=ci(),[u,m]=ci(null),[h,g]=ci(null),w=Dw(!1),{authenticated:b,getAccessToken:T}=H(),{refreshUser:C,closePrivyModal:_,createAnalyticsEvent:M,isNewUserThisSession:R,initializeWalletProxy:x}=I(),{onSuccess:F,onFailure:U,callAuthOnSuccessOnClose:z}=o.createWallet,k=e?.embeddedWallets.requireUserPasswordOnCreate===!0,K=!!(!n||w.current)&&!k,N=new Xe(async()=>$());Pm(()=>{u||x(3e4).then(ie=>m(ie))},[u]),Pm(()=>{if(!b){t("LANDING"),U(new Error("User must be authenticated before creating a Privy wallet"));return}!k&&!a&&!w.current&&(l(!0),N.execute().finally(()=>l(!1)))},[k,b]);let q=()=>{k&&h&&h?.recoveryMethod!=="user-passcode"?U(new mt("User created a wallet but failed to set a password for it")):h?F(h):U(new mt("User wallet creation failed")),_({shouldCallAuthOnSuccess:z})};r.current=()=>null;let $=async function(){let ie=await T();if(ie)try{M("embedded_wallet_creation_started");let j=await x(Lr);if(!j)throw new Error("walletProxy does not exist.");let Ue=1e4,st=new Promise((ko,Ot)=>{setTimeout(()=>{Ot(new Error("walletProxy.create timed out."))},Ue)});if(!await Promise.race([j.create({accessToken:ie,recoveryPassword:s}),st]))throw new Error("walletProxy.create did not send a response.");let Fe=await C();if(!Fe)throw new Error("Failed to refresh user.");let re=fe(Fe);if(!re)throw new Error("Updated user is missing embedded wallet.");g(re),M("embedded_wallet_creation_completed",{walletAddress:re.address}),i(""),w.current=!0,k?t("EMBEDDED_WALLET_CREATED_SCREEN"):R?t("EMBEDDED_WALLET_CREATED_SCREEN"):re&&(F(re),_({shouldCallAuthOnSuccess:z}))}catch(j){if(w.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."})},ee=async()=>{if(!k)return _({shouldCallAuthOnSuccess:z});l(!0);let ie=250;return N.execute().then(()=>new Promise(j=>setTimeout(j,ie))).finally(()=>l(!1))};return!k&&n?Tm(Bw,{children:[Cr(A,{closeable:!1}),Tm(Vt,{children:[Cr(Nw,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Cr(Ee,{title:"Something went wrong",description:n})]}),Cr(D,{onClick:q,children:"Close"}),Cr(Fw,{})]}):K?Cr(rn,{}):Cr(Ka,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:K||!u,buttonLoading:a,buttonHideAnimations:!h&&a,error:n,password:s||"",onClose:q,onPasswordChange:c,onPasswordGenerate:()=>c(ja()),onSubmit:ee})},Fw=Uw.div`
1288
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import Iw from"@heroicons/react/24/solid/CheckCircleIcon";import Mw from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as Ww,jsx as _r,jsxs as tc}from"react/jsx-runtime";var Em=({error:e,onClose:t})=>tc(Ww,{children:[_r(A,{closeable:!1}),_r(Z,{}),e?tc(Vt,{children:[_r(Mw,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),_r(Ce,{title:"Something went wrong",description:e})]}):tc(Vt,{children:[_r(Iw,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),_r(Ce,{title:"Success"})]}),_r(D,{onClick:t,children:"Close"}),_r(Q,{}),_r(V,{protectedByPrivy:!0})]});import{useReducer as Lw}from"react";var Ow=(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}},Pm=()=>{let[e,t]=Lw(Ow,"creating");return{send:t,state:e}};import{jsx as li}from"react/jsx-runtime";var ja=({onSubmit:e,...t})=>{let{send:r,state:o}=Pm(),n=Tm(async()=>{o==="finalizing"&&await e(),r("next")},[o,r,e]);Nw(()=>{let a;return o==="done"&&t.config.initiatedBy==="automatic"&&(a=setTimeout(()=>t.onClose?.(),et)),()=>{a&&clearTimeout(a)}},[o,t.config.initiatedBy,t.onClose]);let i=Tm(()=>{r("back")},[r]);return o==="creating"?li(wm,{...t,onSubmit:n}):o==="saving"?li(bm,{...t,onSubmit:n,onBack:i}):o==="confirming"?li(nm,{...t,onSubmit:n,onBack:i}):o==="finalizing"?li(cm,{...t,onSubmit:n,onBack:i}):o==="done"?li(Em,{...t,onSubmit:n}):null};import{Fragment as Hw,jsx as Po,jsxs as Sm}from"react/jsx-runtime";var _m=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=_(),[n,i]=ci(""),[a,l]=ci(!1),[s,c]=ci(),[u,m]=ci(null),[h,g]=ci(null),w=Uw(!1),{authenticated:C,getAccessToken:x}=H(),{refreshUser:E,closePrivyModal:P,createAnalyticsEvent:I,isNewUserThisSession:R,initializeWalletProxy:S}=M(),{onSuccess:U,onFailure:F,callAuthOnSuccessOnClose:z}=r.createWallet,k=e?.embeddedWallets.requireUserPasswordOnCreate===!0,K=!!(!n||w.current)&&!k,N=new Xe(async()=>$());xm(()=>{u||S(3e4).then(se=>m(se))},[u]),xm(()=>{if(!C){t("LANDING"),F(new Error("User must be authenticated before creating a Privy wallet"));return}!k&&!a&&!w.current&&(l(!0),N.execute().finally(()=>l(!1)))},[k,C]);let q=()=>{k&&h&&h?.recoveryMethod!=="user-passcode"?F(new ht("User created a wallet but failed to set a password for it")):h?U(h):F(new ht("User wallet creation failed")),P({shouldCallAuthOnSuccess:z})};o.current=()=>null;let $=async function(){let se=await x();if(se)try{I("embedded_wallet_creation_started");let j=await S(Lo);if(!j)throw new Error("walletProxy does not exist.");let Ue=1e4,Ye=new Promise((Ee,Mr)=>{setTimeout(()=>{Mr(new Error("walletProxy.create timed out."))},Ue)});if(!await Promise.race([j.create({accessToken:se,recoveryPassword:s}),Ye]))throw new Error("walletProxy.create did not send a response.");let Fe=await E();if(!Fe)throw new Error("Failed to refresh user.");let Ae=ue(Fe);if(!Ae)throw new Error("Updated user is missing embedded wallet.");g(Ae),I("embedded_wallet_creation_completed",{walletAddress:Ae.address}),i(""),w.current=!0,k?t("EMBEDDED_WALLET_CREATED_SCREEN"):R?t("EMBEDDED_WALLET_CREATED_SCREEN"):Ae&&(U(Ae),P({shouldCallAuthOnSuccess:z}))}catch(j){if(w.current)return;I("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."),I("embedded_wallet_creation_failed",{error:"Missing access token for user."})},te=async()=>{if(!k)return P({shouldCallAuthOnSuccess:z});l(!0);let se=250;return N.execute().then(()=>new Promise(j=>setTimeout(j,se))).finally(()=>l(!1))};return!k&&n?Sm(Hw,{children:[Po(A,{closeable:!1}),Sm(Vt,{children:[Po(Dw,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Po(Ce,{title:"Something went wrong",description:n})]}),Po(D,{onClick:q,children:"Close"}),Po(Bw,{})]}):K?Po(an,{}):Po(ja,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:K||!u,buttonLoading:a,buttonHideAnimations:!h&&a,error:n,password:s||"",onClose:q,onPasswordChange:c,onPasswordGenerate:()=>c(qa()),onSubmit:te})},Bw=Fw.div`
1289
1289
  height: 44px;
1290
- `;import{useEffect as Hw,useState as Ya}from"react";import{jsx as Gw}from"react/jsx-runtime";var Sm=()=>{let[e,t]=Ya(null),[o,r]=Ya(!1),[n,i]=Ya(null),[a,l]=Ya(""),{authenticated:s,getAccessToken:c,user:u}=H(),{walletProxy:m,refreshUser:h,closePrivyModal:g,createAnalyticsEvent:w}=I(),{app:b,navigate:T,data:C,onUserCloseViaDialogOrKeybindRef:_}=S(),{onSuccess:M,onFailure:R}=C.createWallet,x=fe(u),F=e?.recoveryMethod==="user-passcode";Hw(()=>{s||(T("LANDING"),R(new Oi("User must be authenticated before setting a password on a Privy wallet")))},[s]);let U=()=>{if(n){R(n),g({shouldCallAuthOnSuccess:!1});return}if(!F){R(new mt("Exited before password was added to wallet")),g({shouldCallAuthOnSuccess:!1});return}M(e),g({shouldCallAuthOnSuccess:!1})};_.current=U;let z=async()=>{let K=await c();if(K&&x?.address&&a&&m)try{if(w("embedded_wallet_set_password_started",{walletAddress:x.address}),!(await m.setRecoveryPassword({accessToken:K,address:x.address,recoveryPassword:a})).address){i(new mt("Error setting password on privy wallet")),w("embedded_wallet_set_password_failed",{walletAddress:x.address,reason:"error setting password"});return}let q=await h(),$=fe(q);if(!$){i(new mt("Error setting password on privy wallet")),w("embedded_wallet_set_password_failed",{walletAddress:x.address,reason:"wallet disconnected"});return}t($),w("embedded_wallet_set_password_completed",{walletAddress:x.address})}catch(N){console.warn(N),i(N instanceof Error?N:new Error("Error setting password on privy wallet")),w("embedded_wallet_set_password_failed",{walletAddress:x.address,reason:N})}},k=async()=>{F?(M(e),g({shouldCallAuthOnSuccess:!1})):(r(!0),i(null),await z(),r(!1))};return Gw(Ka,{appName:b?.name||"privy",config:{initiatedBy:"user",onCancel:U},error:n?"An error has occurred, please try again.":void 0,buttonLoading:o,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(ja()),onPasswordChange:l,onSubmit:k,onClose:U})};import Vw from"@heroicons/react/24/outline/UserCircleIcon";import zw from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as $w,jsx as xo,jsxs as Ja}from"react/jsx-runtime";var _m=()=>{let{user:e}=H(),{closePrivyModal:t,createAnalyticsEvent:o}=I(),{data:r,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=S(),{onSuccess:l,onFailure:s}=r.setWalletPassword,c=()=>{s(new mt("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,Ja($w,{children:[xo(A,{onClose:c}),xo(Z,{}),Ja(Vt,{children:[Ja(du,{children:[xo(Vw,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),xo(pu,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:xo(zw,{width:"12px",height:"12px",fill:"white"})})]}),Ja(Ee,{title:"Secure Your Account",children:["Please set a password to secure your account.",xo("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."})]})]}),xo(D,{onClick:()=>{let m=fe(e);o("embedded_wallet_set_password_started",{walletAddress:m?.address}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),xo(Q,{}),xo(V,{protectedByPrivy:!0})]})};import qw from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as jw,useState as Za}from"react";import Qa,{css as Kw}from"styled-components";import{Fragment as Xw,jsx as rt,jsxs as br}from"react/jsx-runtime";var Am=()=>{let[e,t]=Za(!0),{authenticated:o,getAccessToken:r}=H(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=I(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=S(),[u,m]=Za(void 0),[h,g]=Za(""),[w,b]=Za(!1),{privyWallet:T,onCompleteNavigateTo:C,onSuccess:_,onFailure:M}=s.recoverWallet,R=(U="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),M(typeof U=="string"?new mt(U):U)};c.current=R,jw(()=>{if(!o||!T)return R("User must be authenticated and have a Privy wallet before it can be recovered")},[o]);let x=U=>{U&&m(U)};return br(Xw,{children:[rt(A,{onClose:R}),rt(Z,{}),br(Jw,{children:[br(Yw,{children:[rt(qw,{height:48,width:48,stroke:"var(--privy-color-accent)"}),rt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),rt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),br("div",{children:[br(qo,{children:[rt(dn,{type:e?"password":"text",onChange:U=>x(U.target.value),disabled:w,style:{paddingRight:"2.3rem"}}),rt(pn,{style:{right:"0.75rem"},children:e?rt(un,{onClick:()=>t(!1)}):rt(mn,{onClick:()=>t(!0)})})]}),!!h&&rt(Zw,{children:h})]}),br("div",{children:[br(cu,{children:[rt("h4",{children:"Why is this necessary?"}),rt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),rt(Qw,{loading:w||!n,disabled:!u,onClick:async()=>{b(!0);let U=await r();if(U&&T&&u!==null)try{a("embedded_wallet_recovery_started",{walletAddress:T.address}),await n?.recover({address:T.address,accessToken:U,recoveryPin:u}),g(""),C?l(C):i({shouldCallAuthOnSuccess:!1}),_?.(T),a("embedded_wallet_recovery_completed",{walletAddress:T.address})}catch(z){Gu(z)?g("Invalid recovery password, please try again."):g("An error has occurred, please try again.")}finally{b(!1)}else return R("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!T&&w,children:"Recover your account"})]})]}),rt(Q,{}),rt(V,{protectedByPrivy:!0})]})},Yw=Qa.div`
1290
+ `;import{useEffect as Gw,useState as Ka}from"react";import{jsx as Vw}from"react/jsx-runtime";var Am=()=>{let[e,t]=Ka(null),[r,o]=Ka(!1),[n,i]=Ka(null),[a,l]=Ka(""),{authenticated:s,getAccessToken:c,user:u}=H(),{walletProxy:m,refreshUser:h,closePrivyModal:g,createAnalyticsEvent:w}=M(),{app:C,navigate:x,data:E,onUserCloseViaDialogOrKeybindRef:P}=_(),{onSuccess:I,onFailure:R}=E.createWallet,S=ue(u),U=e?.recoveryMethod==="user-passcode";Gw(()=>{s||(x("LANDING"),R(new Oi("User must be authenticated before setting a password on a Privy wallet")))},[s]);let F=()=>{if(n){R(n),g({shouldCallAuthOnSuccess:!1});return}if(!U){R(new ht("Exited before password was added to wallet")),g({shouldCallAuthOnSuccess:!1});return}I(e),g({shouldCallAuthOnSuccess:!1})};P.current=F;let z=async()=>{let K=await c();if(K&&S?.address&&a&&m)try{if(w("embedded_wallet_set_password_started",{walletAddress:S.address}),!(await m.setRecoveryPassword({accessToken:K,address:S.address,recoveryPassword:a})).address){i(new ht("Error setting password on privy wallet")),w("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"error setting password"});return}let q=await h(),$=ue(q);if(!$){i(new ht("Error setting password on privy wallet")),w("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"wallet disconnected"});return}t($),w("embedded_wallet_set_password_completed",{walletAddress:S.address})}catch(N){console.warn(N),i(N instanceof Error?N:new Error("Error setting password on privy wallet")),w("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:N})}},k=async()=>{U?(I(e),g({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await z(),o(!1))};return Vw(ja,{appName:C?.name||"privy",config:{initiatedBy:"user",onCancel:F},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(qa()),onPasswordChange:l,onSubmit:k,onClose:F})};import zw from"@heroicons/react/24/outline/UserCircleIcon";import $w from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as qw,jsx as Ar,jsxs as Ya}from"react/jsx-runtime";var km=()=>{let{user:e}=H(),{closePrivyModal:t,createAnalyticsEvent:r}=M(),{data:o,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef: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,Ya(qw,{children:[Ar(A,{onClose:c}),Ar(Z,{}),Ya(Vt,{children:[Ya(uu,{children:[Ar(zw,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),Ar(mu,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:Ar($w,{width:"12px",height:"12px",fill:"white"})})]}),Ya(Ce,{title:"Secure Your Account",children:["Please set a password to secure your account.",Ar("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."})]})]}),Ar(D,{onClick:()=>{let m=ue(e);r("embedded_wallet_set_password_started",{walletAddress:m?.address}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),Ar(Q,{}),Ar(V,{protectedByPrivy:!0})]})};import jw from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as Kw,useState as Ja}from"react";import Za,{css as Yw}from"styled-components";import{Fragment as e0,jsx as ot,jsxs as To}from"react/jsx-runtime";var Rm=()=>{let[e,t]=Ja(!0),{authenticated:r,getAccessToken:o}=H(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),[u,m]=Ja(void 0),[h,g]=Ja(""),[w,C]=Ja(!1),{privyWallet:x,onCompleteNavigateTo:E,onSuccess:P,onFailure:I}=s.recoverWallet,R=(F="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),I(typeof F=="string"?new ht(F):F)};c.current=R,Kw(()=>{if(!r||!x)return R("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let S=F=>{F&&m(F)};return To(e0,{children:[ot(A,{onClose:R}),ot(Z,{}),To(Zw,{children:[To(Jw,{children:[ot(jw,{height:48,width:48,stroke:"var(--privy-color-accent)"}),ot("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),ot("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),To("div",{children:[To(Yr,{children:[ot(un,{type:e?"password":"text",onChange:F=>S(F.target.value),disabled:w,style:{paddingRight:"2.3rem"}}),ot(mn,{style:{right:"0.75rem"},children:e?ot(fn,{onClick:()=>t(!1)}):ot(hn,{onClick:()=>t(!0)})})]}),!!h&&ot(Qw,{children:h})]}),To("div",{children:[To(pu,{children:[ot("h4",{children:"Why is this necessary?"}),ot("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),ot(Xw,{loading:w||!n,disabled:!u,onClick:async()=>{C(!0);let F=await o();if(F&&x&&u!==null)try{a("embedded_wallet_recovery_started",{walletAddress:x.address}),await n?.recover({address:x.address,accessToken:F,recoveryPin:u}),g(""),E?l(E):i({shouldCallAuthOnSuccess:!1}),P?.(x),a("embedded_wallet_recovery_completed",{walletAddress:x.address})}catch(z){zu(z)?g("Invalid recovery password, please try again."):g("An error has occurred, please try again.")}finally{C(!1)}else return R("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!x&&w,children:"Recover your account"})]})]}),ot(Q,{}),ot(V,{protectedByPrivy:!0})]})},Jw=Za.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
- `,Jw=Qa.div`
1312
+ `,Zw=Za.div`
1313
1313
  display: flex;
1314
1314
  flex-direction: column;
1315
1315
  justify-content: space-between;
1316
- `,Zw=Qa.div`
1316
+ `,Qw=Za.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
- `,Qw=Qa(D)`
1324
- ${e=>e.hideAnimations&&Kw`
1323
+ `,Xw=Za(D)`
1324
+ ${e=>e.hideAnimations&&Yw`
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
- `;import e2 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import t2 from"@heroicons/react/24/outline/PhoneIcon";import Ql from"styled-components";import{Fragment as a2,jsx as Kt,jsxs as Xa}from"react/jsx-runtime";var o2=e=>{let t=Kt(e2,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof P)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof Te&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:Kt(t2,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof Ge)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:Kt(Ua,{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:Kt("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:Kt("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 Qt&&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}}},km=()=>{let{navigate:e,navigateBack:t,data:o,lastScreen:r,currentScreen:n}=S(),{reset:i}=ce(),a=o?.errorModalData,l=o2(a?.error||new Error),s=c=>{if(c instanceof Ge)switch(c.privyErrorCode){case"invalid_captcha":return()=>i()}return()=>{}};return Xa(a2,{children:[Kt(A,{backFn:!r||n===r?void 0:t}),Xa(r2,{children:[Kt(i2,{children:Xa("div",{children:[Kt(Da,{color:"var(--privy-color-error)"}),l.icon]})}),Xa(n2,{children:[Kt("h3",{children:l.title}),Kt("p",{children:l.detail})]}),Kt(D,{color:"var(--privy-color-error)",onClick:()=>{s(a?.error||new Error)(),e(r||"LANDING",!1)},children:l.ctaText})]})]})},r2=Ql.div`
1331
+ `;import t0 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import r0 from"@heroicons/react/24/outline/PhoneIcon";import rc from"styled-components";import{Fragment as s0,jsx as Kt,jsxs as Qa}from"react/jsx-runtime";var o0=e=>{let t=Kt(t0,{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 Te&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:Kt(r0,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof He)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:Kt(Da,{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:Kt("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:Kt("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 er&&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}}},Im=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=_(),{reset:i}=le(),a=r?.errorModalData,l=o0(a?.error||new Error),s=c=>{if(c instanceof He)switch(c.privyErrorCode){case"invalid_captcha":return()=>i()}return()=>{}};return Qa(s0,{children:[Kt(A,{backFn:!o||n===o?void 0:t}),Qa(n0,{children:[Kt(a0,{children:Qa("div",{children:[Kt(Na,{color:"var(--privy-color-error)"}),l.icon]})}),Qa(i0,{children:[Kt("h3",{children:l.title}),Kt("p",{children:l.detail})]}),Kt(D,{color:"var(--privy-color-error)",onClick:()=>{s(a?.error||new Error)(),e(o||"LANDING",!1)},children:l.ctaText})]})]})},n0=rc.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
- `,n2=Ql.div`
1339
+ `,i0=rc.div`
1340
1340
  display: flex;
1341
1341
  flex-direction: column;
1342
1342
  gap: 8px;
1343
- `,i2=Ql.div`
1343
+ `,a0=rc.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
- `;import{useEffect as Um,useRef as S2,useState as tc}from"react";import{isMobile as Fm}from"react-device-detect";import Vm from"styled-components";import{useState as s2}from"react";import l2 from"styled-components";import{jsx as Rm}from"react/jsx-runtime";var es=({style:e,color:t,...o})=>Rm("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:Rm("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as Xl}from"react/jsx-runtime";var Im=({color:e,...t})=>Xl("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:Xl("g",{children:Xl("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"})})});import{jsx as Mm,jsxs as d2}from"react/jsx-runtime";var fn=e=>{let[t,o]=s2(!1);return d2(c2,{color:e.color,onClick:()=>{o(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>o(!1),1500)},justCopied:t,children:[t?Mm(es,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):Mm(Im,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},c2=l2.button`
1366
+ `;import{useEffect as Bm,useRef as _0,useState as ic}from"react";import{isMobile as Hm}from"react-device-detect";import $m from"styled-components";import{useState as l0}from"react";import c0 from"styled-components";import{jsx as Mm}from"react/jsx-runtime";var Xa=({style:e,color:t,...r})=>Mm("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:Mm("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as oc}from"react/jsx-runtime";var Wm=({color:e,...t})=>oc("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:oc("g",{children:oc("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"})})});import{jsx as Lm,jsxs as p0}from"react/jsx-runtime";var yn=e=>{let[t,r]=l0(!1);return p0(d0,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?Lm(Xa,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):Lm(Wm,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},d0=c0.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
- `;import{useState as p2}from"react";import u2 from"styled-components";import{jsx as f2}from"react/jsx-runtime";var Wm=e=>{let[t,o]=p2(!1);return f2(m2,{color:e.color,onClick:()=>{o(!0),window.open(e.url,"_blank"),setTimeout(()=>o(!1),1500)},justOpened:t,children:e.text})},m2=u2.button`
1404
+ `;import{useState as u0}from"react";import m0 from"styled-components";import{jsx as h0}from"react/jsx-runtime";var Om=e=>{let[t,r]=u0(!1);return h0(f0,{color:e.color,onClick:()=>{r(!0),window.open(e.url,"_blank"),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},f0=m0.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
- `;import h2 from"qrcode";import y2 from"react";import g2 from"styled-components";import{jsx as Lm}from"react/jsx-runtime";var Om=()=>Lm("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:Lm("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as di,jsx as nt,jsxs as Dm}from"react/jsx-runtime";var wt=7,ec=(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},v2=e=>{let t=h2.create(e,{errorCorrectionLevel:"high"}).modules,o=Hd(Array.from(t.data),t.size);return o=ec(o,0,0,wt,wt),o=ec(o,o.length-wt,0,wt,wt),o=ec(o,0,o.length-wt,wt,wt),o},w2=({x:e,y:t,cellSize:o,bgColor:r,fgColor:n})=>nt(di,{children:[0,1,2].map(i=>nt("circle",{r:o*(wt-i*2)/2,cx:e+o*wt/2,cy:t+o*wt/2,fill:i%2!==0?r:n},`finder-${e}-${t}-${i}`))}),C2=({cellSize:e,matrixSize:t,bgColor:o,fgColor:r})=>{let n=[[0,0],[(t-wt)*e,0],[0,(t-wt)*e]];return nt(di,{children:n.map(([i,a])=>nt(w2,{x:i,y:a,cellSize:e,bgColor:o,fgColor:r},`finder-${i}-${a}`))})},b2=({matrix:e,cellSize:t,color:o})=>nt(di,{children:e.map((r,n)=>r.map((i,a)=>i?nt("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:o},`circle-${n}-${a}`):nt(y2.Fragment,{},`circle-${n}-${a}`)))}),Nm=(e,t)=>e-e%t,E2=({outputSize:e,cellSize:t,element:o,size:r,padding:n,bgColor:i})=>{if(!o)return nt(di,{});let a=r||40,l=n||4,s=o,c=e/2-a/2-l;return Dm(di,{children:[nt("rect",{x:Nm(c,t),y:Nm(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),nt(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},P2=e=>{let t=e.outputSize,o=v2(e.url),r=t/o.length;return Dm("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[nt(b2,{matrix:o,cellSize:r,color:e.fgColor}),nt(C2,{cellSize:r,matrixSize:o.length,fgColor:e.fgColor,bgColor:e.bgColor}),nt(E2,{outputSize:e.outputSize,cellSize:r,element:e.logo?.element,bgColor:e.bgColor})]})},T2=g2.div`
1442
+ `;import y0 from"qrcode";import g0 from"react";import v0 from"styled-components";import{jsx as Nm}from"react/jsx-runtime";var Dm=()=>Nm("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:Nm("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as di,jsx as nt,jsxs as Fm}from"react/jsx-runtime";var bt=7,nc=(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},w0=e=>{let t=y0.create(e,{errorCorrectionLevel:"high"}).modules,r=zd(Array.from(t.data),t.size);return r=nc(r,0,0,bt,bt),r=nc(r,r.length-bt,0,bt,bt),r=nc(r,0,r.length-bt,bt,bt),r},C0=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>nt(di,{children:[0,1,2].map(i=>nt("circle",{r:r*(bt-i*2)/2,cx:e+r*bt/2,cy:t+r*bt/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),b0=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-bt)*e,0],[0,(t-bt)*e]];return nt(di,{children:n.map(([i,a])=>nt(C0,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},E0=({matrix:e,cellSize:t,color:r})=>nt(di,{children:e.map((o,n)=>o.map((i,a)=>i?nt("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:r},`circle-${n}-${a}`):nt(g0.Fragment,{},`circle-${n}-${a}`)))}),Um=(e,t)=>e-e%t,P0=({outputSize:e,cellSize:t,element:r,size:o,padding:n,bgColor:i})=>{if(!r)return nt(di,{});let a=o||40,l=n||4,s=r,c=e/2-a/2-l;return Fm(di,{children:[nt("rect",{x:Um(c,t),y:Um(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),nt(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},T0=e=>{let t=e.outputSize,r=w0(e.url),o=t/r.length;return Fm("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[nt(E0,{matrix:r,cellSize:o,color:e.fgColor}),nt(b0,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),nt(P0,{outputSize:e.outputSize,cellSize:o,element:e.logo?.element,bgColor:e.bgColor})]})},x0=v0.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
- `,ts=e=>{let t=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",r=e.size||160;return nt(T2,{size:r,bgColor:t,fgColor:o,children:nt(P2,{url:e.url,logo:{element:e.squareLogoElement??Om},outputSize:r,bgColor:t,fgColor:o})})};import{jsx as os,jsxs as x2}from"react/jsx-runtime";var pi=({style:e,...t})=>x2("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:[os("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),os("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"}),os("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"}),os("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});import{Fragment as Gm,jsx as Pe,jsxs as Er}from"react/jsx-runtime";var Bm="#8a63d2",zm=1e3,_2=zm*2,A2=zm*120,$m=()=>{let{ready:e,authenticated:t,user:o}=H(),{lastScreen:r,navigate:n,navigateBack:i,setModalData:a,app:l}=S(),{getAuthFlow:s,loginWithFarcaster:c,closePrivyModal:u}=I(),[m,h]=tc(void 0),[g,w]=tc(!1),[b,T]=tc(!1),C=S2([]),_=l?.render.inDialog?et:0,M=s(),R=M?.meta.connectUri;return Um(()=>{let x=Date.now(),F=setInterval(async()=>{let U=await M.pollForReady.execute(),z=Date.now()-x;if(U){clearInterval(F),w(!0);try{await c(),T(!0)}catch(k){let K={retryable:!1,message:"Authentication failed"};if(k?.privyErrorCode==="allowlist_rejected"){n("ALLOWLIST_REJECTION_SCREEN");return}else k?.privyErrorCode==="linked_to_another_user"?K.detail="This account has already been linked to another user.":k?.privyErrorCode==="invalid_credentials"?(K.retryable=!0,K.detail="Something went wrong. Try again."):k?.privyErrorCode==="too_many_requests"&&(K.detail="Too many requests. Please wait before trying again.");h(K)}}else z>A2&&(clearInterval(F),h({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},_2);return()=>{clearInterval(F),C.current.forEach(U=>clearTimeout(U))}},[]),Um(()=>{if(e&&t&&b&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let F=setTimeout(()=>{n("AFFIRMATIVE_CONSENT_SCREEN")},_);return()=>clearTimeout(F)}b&&(Et(o,l?.embeddedWallets.createOnLogin)?C.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:F=>console.error(F),callAuthOnSuccessOnClose:!0}}),n("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},_)):C.current.push(setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),_)))}},[b,e,t,o]),Fm||g?Er(Gm,{children:[Pe(A,{backFn:r?i:void 0,onClose:u},"header"),Pe(Z,{}),Er(Hm,{children:[Pe(k2,{children:Er("div",{children:[Pe(Uo,{success:b,fail:!!m}),Pe(pi,{style:{width:"38px",height:"38px"}})]})}),Er(It,{children:[Pe(be,{children:m?m.message:"Signing in with Farcaster"}),Pe(ye,{children:m?m.detail:"This should only take a moment"}),Pe(Rt,{children:R&&Fm&&Pe(Wm,{text:"Take me to Warpcast",url:R,color:Bm})})]})]}),Pe(te,{})]}):Er(Gm,{children:[Pe(A,{backFn:r?i:void 0,onClose:u},"header"),Pe(Z,{}),Pe(Hm,{children:Er("div",{children:[Pe(be,{children:"Sign in with Farcaster"}),Pe(ye,{children:"Scan with your phone's camera to continue."}),Pe(Ba,{children:R?Pe(ts,{url:R,size:275,squareLogoElement:pi}):Pe(xt,{})}),Er(Rt,{children:[Pe(ye,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),R&&Pe(fn,{text:R,itemName:"link",color:Bm})]})]})}),Pe(te,{})]})},Hm=Vm.div`
1457
+ `,es=e=>{let t=e.bgColor||"#FFFFFF",r=e.fgColor||"#000000",o=e.size||160;return nt(x0,{size:o,bgColor:t,fgColor:r,children:nt(T0,{url:e.url,logo:{element:e.squareLogoElement??Dm},outputSize:o,bgColor:t,fgColor:r})})};import{jsx as ts,jsxs as S0}from"react/jsx-runtime";var pi=({style:e,...t})=>S0("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:[ts("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),ts("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"}),ts("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"}),ts("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});import{Fragment as zm,jsx as be,jsxs as xo}from"react/jsx-runtime";var Gm="#8a63d2",qm=1e3,A0=qm*2,k0=qm*120,jm=()=>{let{ready:e,authenticated:t,user:r}=H(),{lastScreen:o,navigate:n,navigateBack:i,setModalData:a,app:l}=_(),{getAuthFlow:s,loginWithFarcaster:c,closePrivyModal:u}=M(),[m,h]=ic(void 0),[g,w]=ic(!1),[C,x]=ic(!1),E=_0([]),P=l?.render.inDialog?et:0,I=s(),R=I?.meta.connectUri;return Bm(()=>{let S=Date.now(),U=setInterval(async()=>{let F=await I.pollForReady.execute(),z=Date.now()-S;if(F){clearInterval(U),w(!0);try{await c(),x(!0)}catch(k){let K={retryable:!1,message:"Authentication failed"};if(k?.privyErrorCode==="allowlist_rejected"){n("ALLOWLIST_REJECTION_SCREEN");return}else k?.privyErrorCode==="linked_to_another_user"?K.detail="This account has already been linked to another user.":k?.privyErrorCode==="invalid_credentials"?(K.retryable=!0,K.detail="Something went wrong. Try again."):k?.privyErrorCode==="too_many_requests"&&(K.detail="Too many requests. Please wait before trying again.");h(K)}}else z>k0&&(clearInterval(U),h({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},A0);return()=>{clearInterval(U),E.current.forEach(F=>clearTimeout(F))}},[]),Bm(()=>{if(e&&t&&C&&r){if(l?.legal.requireUsersAcceptTerms&&!r.hasAcceptedTerms){let U=setTimeout(()=>{n("AFFIRMATIVE_CONSENT_SCREEN")},P);return()=>clearTimeout(U)}C&&(Tt(r,l?.embeddedWallets.createOnLogin)?E.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:U=>console.error(U),callAuthOnSuccessOnClose:!0}}),n("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},P)):E.current.push(setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),P)))}},[C,e,t,r]),Hm||g?xo(zm,{children:[be(A,{backFn:o?i:void 0,onClose:u},"header"),be(Z,{}),xo(Vm,{children:[be(R0,{children:xo("div",{children:[be(Hr,{success:C,fail:!!m}),be(pi,{style:{width:"38px",height:"38px"}})]})}),xo(Wt,{children:[be(we,{children:m?m.message:"Signing in with Farcaster"}),be(fe,{children:m?m.detail:"This should only take a moment"}),be(Mt,{children:R&&Hm&&be(Om,{text:"Take me to Warpcast",url:R,color:Gm})})]})]}),be(ee,{})]}):xo(zm,{children:[be(A,{backFn:o?i:void 0,onClose:u},"header"),be(Z,{}),be(Vm,{children:xo("div",{children:[be(we,{children:"Sign in with Farcaster"}),be(fe,{children:"Scan with your phone's camera to continue."}),be(Fa,{children:R?be(es,{url:R,size:275,squareLogoElement:pi}):be(_t,{})}),xo(Mt,{children:[be(fe,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),R&&be(yn,{text:R,itemName:"link",color:Gm})]})]})}),be(ee,{})]})},Vm=$m.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
- `,k2=Vm.div`
1465
+ `,R0=$m.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
- `;import I2 from"@heroicons/react/24/outline/ClockIcon";import M2 from"@heroicons/react/24/outline/EyeSlashIcon";import W2 from"@heroicons/react/24/outline/LinkIcon";import po from"styled-components";import{jsx as oc,jsxs as R2}from"react/jsx-runtime";var rs=({size:e=61,...t})=>oc("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:R2("g",{id:"moonpay_symbol_wht 2",children:[oc("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),oc("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});import{Fragment as qm,jsx as it,jsxs as Pr}from"react/jsx-runtime";var rc=({title:e,desc:t,icon:o})=>Pr(F2,{children:[it(H2,{children:o}),Pr(B2,{children:[it(D2,{children:e}),it(U2,{children:t})]})]}),jm=({app:e,signedUrl:t,onContinue:o})=>Pr(qm,{children:[Pr(O2,{children:[it(rs,{size:"3.75rem"}),Pr(N2,{children:[e?.name," uses ",it("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),Pr(G2,{children:[it(rc,{icon:it(W2,{width:"1rem"}),title:"Purchase assets to fund your account",desc:Pr(qm,{children:["Connect a payment method (",it("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),it(rc,{icon:it(I2,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),it(rc,{icon:it(M2,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),it(V2,{className:"mobile-only"})]}),it(L2,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),it(Aa,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:o,children:"Continue to Moonpay"})]}),L2=po.span`
1488
+ `;import M0 from"@heroicons/react/24/outline/ClockIcon";import W0 from"@heroicons/react/24/outline/EyeSlashIcon";import L0 from"@heroicons/react/24/outline/LinkIcon";import ur from"styled-components";import{jsx as ac,jsxs as I0}from"react/jsx-runtime";var rs=({size:e=61,...t})=>ac("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:I0("g",{id:"moonpay_symbol_wht 2",children:[ac("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),ac("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});import{Fragment as Km,jsx as it,jsxs as So}from"react/jsx-runtime";var sc=({title:e,desc:t,icon:r})=>So(B0,{children:[it(G0,{children:r}),So(H0,{children:[it(U0,{children:e}),it(F0,{children:t})]})]}),Ym=({app:e,signedUrl:t,onContinue:r})=>So(Km,{children:[So(N0,{children:[it(rs,{size:"3.75rem"}),So(D0,{children:[e?.name," uses ",it("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),So(V0,{children:[it(sc,{icon:it(L0,{width:"1rem"}),title:"Purchase assets to fund your account",desc:So(Km,{children:["Connect a payment method (",it("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),it(sc,{icon:it(M0,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),it(sc,{icon:it(W0,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),it(z0,{className:"mobile-only"})]}),it(O0,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),it(_a,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),O0=ur.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
- `,O2=po.div`
1497
+ `,N0=ur.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
- `,N2=po.span`
1503
+ `,D0=ur.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
- `,D2=po.span`
1512
+ `,U0=ur.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
- `,U2=po.span`
1518
+ `,F0=ur.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
- `,F2=po.div`
1523
+ `,B0=ur.div`
1524
1524
  display: flex;
1525
1525
  align-items: flex-start;
1526
1526
  gap: 0.5rem;
1527
1527
  align-self: stretch;
1528
- `,B2=po.div`
1528
+ `,H0=ur.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
- `,H2=po.div`
1535
+ `,G0=ur.div`
1536
1536
  padding-top: 2px;
1537
- `,G2=po.div`
1537
+ `,V0=ur.div`
1538
1538
  display: flex;
1539
1539
  flex-direction: column;
1540
1540
  gap: 1.25rem;
1541
1541
  margin: 0 0.5rem;
1542
- `,V2=po.div`
1542
+ `,z0=ur.div`
1543
1543
  margin: 30px 0;
1544
- `;import{ofetch as z2}from"ofetch";import{useEffect as $2,useRef as q2,useState as j2}from"react";var ns="moonpay",Km="sdk_fiat_on_ramp_completed_with_status";async function Ym(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 K2(e,t){let o=t?kd:Ad,r=t?Id:Rd;return z2(`${o}/transactions/ext/${e}`,{query:{apiKey:r}})}function Jm(e,t=!1){let[o,r]=j2(null),{createAnalyticsEvent:n}=I(),i=q2(0);return $2(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await K2(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;r(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n(Km,{status:s,provider:ns,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(Km,{status:"serviceFailure",provider:ns}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),o}import{Fragment as Y2,jsx as nc,jsxs as J2}from"react/jsx-runtime";var Zm=()=>{let{app:e,data:t,navigate:o}=S(),{createAnalyticsEvent:r}=I(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:J2(Y2,{children:[nc(A,{title:"Fund account"},"header"),nc(jm,{app:e,signedUrl:n,onContinue:()=>{r("sdk_fiat_on_ramp_started",{provider:ns}),o("FIAT_ON_RAMP_STATUS_SCREEN")}}),nc(V,{protectedByPrivy:!0})]})};import Z2 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import Q2 from"@heroicons/react/24/solid/CheckCircleIcon";import X2 from"@heroicons/react/24/solid/XCircleIcon";import{useMemo as e0}from"react";import Qm from"styled-components";import{Fragment as ic,jsx as at,jsxs as Tr}from"react/jsx-runtime";var Xm=()=>{let{app:e,data:t}=S(),{closePrivyModal:o}=I(),{externalTransactionId:r}=t?.fiatOnRampStatus,n=Jm(r||null,e.fiatOnRamp.useSandbox);return Tr(ic,{children:[at(A,{title:"Fund account"},"header"),at(o0,{status:n,onClickCta:o}),at(V,{protectedByPrivy:!0})]})},t0=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:Tr(ic,{children:[Tr("p",{children:["It looks like there was an issue with your payment. Please contact"," ",at("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),at("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:""}}},o0=({status:e,onClickCta:t})=>{let{title:o,body:r,cta:n}=e0(()=>t0(e),[e]);return Tr(ic,{children:[Tr(s0,{children:[at(i0,{status:e}),Tr(It,{children:[at("h3",{children:o}),at(a0,{children:r})]})]}),n&&at(D,{onClick:t,children:n})]})},r0=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)",n0=e=>{switch(e){case"serviceFailure":case"failed":return X2;case"completed":return Q2;case"waitingAuthorization":return()=>at(Z2,{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}},i0=({status:e})=>{if(!e||e==="pending"){let r="var(--privy-color-foreground-4)";return Tr("div",{style:{position:"relative"},children:[at(xt,{color:r,style:{position:"absolute"}}),at(vl,{color:r}),at(rs,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=n0(e),o=r0(e);return at("div",{style:{borderColor:o,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&at(t,{width:"4rem",height:"4rem",color:o})})},a0=Qm.p`
1544
+ `;import{ofetch as $0}from"ofetch";import{useEffect as q0,useRef as j0,useState as K0}from"react";var os="moonpay",Jm="sdk_fiat_on_ramp_completed_with_status";async function Zm(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 Y0(e,t){let r=t?Md:Id,o=t?Ld:Wd;return $0(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function Qm(e,t=!1){let[r,o]=K0(null),{createAnalyticsEvent:n}=M(),i=j0(0);return q0(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await Y0(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;o(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n(Jm,{status:s,provider:os,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(Jm,{status:"serviceFailure",provider:os}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),r}import{Fragment as J0,jsx as lc,jsxs as Z0}from"react/jsx-runtime";var Xm=()=>{let{app:e,data:t,navigate:r}=_(),{createAnalyticsEvent:o}=M(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:Z0(J0,{children:[lc(A,{title:"Fund account"},"header"),lc(Ym,{app:e,signedUrl:n,onContinue:()=>{o("sdk_fiat_on_ramp_started",{provider:os}),r("FIAT_ON_RAMP_STATUS_SCREEN")}}),lc(V,{protectedByPrivy:!0})]})};import Q0 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import X0 from"@heroicons/react/24/solid/CheckCircleIcon";import e2 from"@heroicons/react/24/solid/XCircleIcon";import{useMemo as t2}from"react";import ef from"styled-components";import{Fragment as cc,jsx as at,jsxs as _o}from"react/jsx-runtime";var tf=()=>{let{app:e,data:t}=_(),{closePrivyModal:r}=M(),{externalTransactionId:o}=t?.fiatOnRampStatus,n=Qm(o||null,e.fiatOnRamp.useSandbox);return _o(cc,{children:[at(A,{title:"Fund account"},"header"),at(o2,{status:n,onClickCta:r}),at(V,{protectedByPrivy:!0})]})},r2=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:_o(cc,{children:[_o("p",{children:["It looks like there was an issue with your payment. Please contact"," ",at("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),at("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:""}}},o2=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=t2(()=>r2(e),[e]);return _o(cc,{children:[_o(l2,{children:[at(a2,{status:e}),_o(Wt,{children:[at("h3",{children:r}),at(s2,{children:o})]})]}),n&&at(D,{onClick:t,children:n})]})},n2=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)",i2=e=>{switch(e){case"serviceFailure":case"failed":return e2;case"completed":return X0;case"waitingAuthorization":return()=>at(Q0,{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}},a2=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return _o("div",{style:{position:"relative"},children:[at(_t,{color:o,style:{position:"absolute"}}),at(El,{color:o}),at(rs,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=i2(e),r=n2(e);return at("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&at(t,{width:"4rem",height:"4rem",color:r})})},s2=ef.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
- `,s0=Qm.div`
1551
+ `,l2=ef.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
- `;import l0 from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import c0 from"styled-components";import{Fragment as p0,jsx as Ko,jsxs as u0}from"react/jsx-runtime";var ef=()=>{let{closePrivyModal:e}=I();return u0(p0,{children:[Ko(A,{},"header"),Ko(d0,{children:Ko(l0,{style:{width:32,height:32}})}),Ko(so,{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"}}),Ko(kt,{children:Ko(D,{onClick:()=>e(),children:"Close"})}),Ko(Q,{}),Ko(V,{protectedByPrivy:!0})]})},d0=c0.div`
1559
+ `;import c2 from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import d2 from"styled-components";import{Fragment as u2,jsx as Zr,jsxs as m2}from"react/jsx-runtime";var rf=()=>{let{closePrivyModal:e}=M();return m2(u2,{children:[Zr(A,{},"header"),Zr(p2,{children:Zr(c2,{style:{width:32,height:32}})}),Zr(cr,{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"}}),Zr(It,{children:Zr(D,{onClick:()=>e(),children:"Close"})}),Zr(Q,{}),Zr(V,{protectedByPrivy:!0})]})},p2=d2.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
- `;import*as nf from"react-device-detect";import y0 from"styled-components";import ac from"styled-components";import{jsx as tf}from"react/jsx-runtime";var of=({style:e,...t})=>tf("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:tf("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)"})});import{jsx as f0,jsxs as h0}from"react/jsx-runtime";var rf=ac.div`
1569
+ `;import*as sf from"react-device-detect";import g2 from"styled-components";import dc from"styled-components";import{jsx as of}from"react/jsx-runtime";var nf=({style:e,...t})=>of("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:of("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)"})});import{jsx as h2,jsxs as y2}from"react/jsx-runtime";var af=dc.div`
1570
1570
  display: flex;
1571
1571
  flex-direction: column;
1572
1572
  justify-content: flex-start;
1573
1573
  gap: 4px;
1574
- `,sc=ac.div`
1574
+ `,pc=dc.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
- `,is=({children:e})=>h0(m0,{children:[f0(of,{style:{width:"16px",height:"16px"}}),e]}),m0=ac.div`
1580
+ `,ns=({children:e})=>y2(f2,{children:[h2(nf,{style:{width:"16px",height:"16px"}}),e]}),f2=dc.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
- `;import{Fragment as w0,jsx as Le,jsxs as ui}from"react/jsx-runtime";var g0=()=>ui(v0,{children:[Le(Jn,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),Le(Rt,{children:Le(oo,{style:{width:"152px",height:"152px"}})}),ui(rf,{children:[Le(is,{children:ui("div",{children:[Le("span",{children:"Install the "}),Le("a",{href:nf.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"})]})}),Le(sc,{}),Le(is,{children:"Set up your first wallet"}),Le(sc,{}),Le(is,{children:"Store your recovery phrase in a safe place!"})]}),Le(ka,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),af=()=>{let{navigateBack:e}=S();return ui(w0,{children:[Le(A,{backFn:e},"header"),Le(Z,{}),Le(g0,{}),Le(Q,{}),ui(te,{children:[Le("span",{children:"Still not sure? "}),Le("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},v0=y0(Rt)`
1598
+ `;import{Fragment as C2,jsx as Le,jsxs as ui}from"react/jsx-runtime";var v2=()=>ui(w2,{children:[Le(Jn,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),Le(Mt,{children:Le(nr,{style:{width:"152px",height:"152px"}})}),ui(af,{children:[Le(ns,{children:ui("div",{children:[Le("span",{children:"Install the "}),Le("a",{href:sf.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"})]})}),Le(pc,{}),Le(ns,{children:"Set up your first wallet"}),Le(pc,{}),Le(ns,{children:"Store your recovery phrase in a safe place!"})]}),Le(Aa,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),lf=()=>{let{navigateBack:e}=_();return ui(C2,{children:[Le(A,{backFn:e},"header"),Le(Z,{}),Le(v2,{}),Le(Q,{}),ui(ee,{children:[Le("span",{children:"Still not sure? "}),Le("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},w2=g2(Mt)`
1599
1599
  gap: 30px;
1600
1600
 
1601
1601
  > :first-child > svg {
1602
1602
  margin-top: 20px;
1603
1603
  }
1604
- `;import eC from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as tC,useState as Pf}from"react";import{isMobile as oC}from"react-device-detect";import rC from"styled-components";import x0 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as S0}from"react";import C0 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as b0,useState as sf}from"react";import cf from"styled-components";import{Fragment as T0,jsx as mi,jsxs as lf}from"react/jsx-runtime";var as=b0((e,t)=>{let[o,r]=sf(""),[n,i]=sf(!1),{authenticated:a}=H(),{initLoginWithEmail:l}=I(),{navigate:s,setModalData:c,currentScreen:u}=S(),{enabled:m,token:h}=ce(),g=Ki(o),w=n,b=n||!g,T=_=>{i(!0),l(o,_).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(M=>{c({errorModalData:{error:M,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},C=()=>{m&&!h&&!a?(c({captchaModalData:{callback:_=>l(o,_),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):T(h)};return lf(T0,{children:[mi(E0,{children:lf(P0,{stacked:e.stacked,children:[mi(C0,{}),mi("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:_=>r(_.target.value),onKeyUp:_=>{_.key==="Enter"&&C()},value:o,autoComplete:"email"}),e.stacked?null:mi(qr,{isSubmitting:w,onClick:C,disabled:b,children:"Submit"})]})}),e.stacked?mi(D,{loadingText:null,loading:w,disabled:b,onClick:C,children:"Submit"}):null]})}),E0=cf.div`
1604
+ `;import tC from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as rC,useState as xf}from"react";import{isMobile as oC}from"react-device-detect";import nC from"styled-components";import S2 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as _2}from"react";import b2 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as E2,useState as cf}from"react";import pf from"styled-components";import{Fragment as x2,jsx as mi,jsxs as df}from"react/jsx-runtime";var is=E2((e,t)=>{let[r,o]=cf(""),[n,i]=cf(!1),{authenticated:a}=H(),{initLoginWithEmail:l}=M(),{navigate:s,setModalData:c,currentScreen:u}=_(),{enabled:m,token:h}=le(),g=ji(r),w=n,C=n||!g,x=P=>{i(!0),l(r,P).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(I=>{c({errorModalData:{error:I,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},E=()=>{m&&!h&&!a?(c({captchaModalData:{callback:P=>l(r,P),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):x(h)};return df(x2,{children:[mi(P2,{children:df(T2,{stacked:e.stacked,children:[mi(b2,{}),mi("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:P=>o(P.target.value),onKeyUp:P=>{P.key==="Enter"&&E()},value:r,autoComplete:"email"}),e.stacked?null:mi(Ko,{isSubmitting:w,onClick:E,disabled:C,children:"Submit"})]})}),e.stacked?mi(D,{loadingText:null,loading:w,disabled:C,onClick:E,children:"Submit"}):null]})}),P2=pf.div`
1605
1605
  width: 100%;
1606
- `,P0=cf.label`
1606
+ `,T2=pf.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
- `;import{Fragment as _0,jsx as ss,jsxs as df}from"react/jsx-runtime";var ls=({isEditable:e,setIsEditable:t})=>{let o=S0(null);return df(_0,{children:[ss(bo,{if:!e,children:ss(as,{ref:o})}),ss(bo,{if:e,children:df(Ce,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[ss(x0,{})," Continue with Email"]})})]})};import{useState as A0}from"react";import{jsx as lc,jsxs as k0}from"react/jsx-runtime";var cs=()=>{let[e,t]=A0(!1),{currentScreen:o,navigate:r,setModalData:n}=S(),{enabled:i,token:a}=ce(),{initLoginWithFarcaster:l}=I();return k0(Ce,{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:[lc(pi,{})," Farcaster",e&&lc("span",{children:lc(fr,{})})]})};import G0 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as V0}from"react";import{forwardRef as U0,useState as cc}from"react";import yf from"styled-components";import R0 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as I0,AsYouType as M0,getCountries as W0,getCountryCallingCode as ds,getExampleNumber as L0}from"libphonenumber-js/min";import{jsx as D0,jsxs as N0}from"react/jsx-runtime";var fi=(e,t)=>I0(String(e),t),ps=(e,t)=>`+${ds(t)} ${e}`,pf=e=>`*${e.replaceAll("-","").slice(-4)}`,uf=e=>new M0(e),O0=W0().map(e=>({code:e,callCode:ds(e)})),mf=e=>{let t=L0(e,R0)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},ff=({value:e,onChange:t})=>D0("select",{value:e,onChange:t,children:O0.map(o=>N0("option",{value:o.code,children:[o.code," +",o.callCode]},o.code))});import{Fragment as H0,jsx as hi,jsxs as hf}from"react/jsx-runtime";var hn=U0((e,t)=>{let{app:o}=S(),[r,n]=cc(""),[i,a]=cc(o?.intl.defaultCountry??"US"),l=fi(r,i),s=uf(i),c=mf(i),u=ds(i),m=!l,[h,g]=cc(!1),w=u.length,b=_=>{let M=_.target.value;a(M),n(""),e.onChange&&e.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:ps(r,M),countryCode:M,isValid:fi(r,i)})},T=_=>{try{let M=_.replace(/\D/g,""),R=r.replace(/\D/g,""),x=M===R?_:s.input(_);n(x),e.onChange&&e.onChange({rawPhoneNumber:x,qualifiedPhoneNumber:ps(_,i),countryCode:i,isValid:fi(_,i)})}catch(M){console.error("Error processing phone number:",M)}},C=()=>{g(!0);let _=ps(r,i);e.onSubmit({rawPhoneNumber:r,qualifiedPhoneNumber:_,countryCode:i,isValid:fi(r,i)}).finally(()=>g(!1))};return hf(H0,{children:[hi(F0,{children:hf(B0,{callingCodeLength:w,stacked:e.stacked,children:[hi(ff,{value:i,onChange:b}),hi("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:_=>{T(_.target.value)},onKeyUp:_=>{_.key==="Enter"&&C()},value:r,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?hi(qr,{isSubmitting:h,onClick:C,disabled:m,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?hi(D,{loading:h,loadingText:null,onClick:C,disabled:m,children:"Submit"}):null]})}),F0=yf.div`
1669
+ `;import{Fragment as A2,jsx as as,jsxs as uf}from"react/jsx-runtime";var ss=({isEditable:e,setIsEditable:t})=>{let r=_2(null);return uf(A2,{children:[as(Tr,{if:!e,children:as(is,{ref:r})}),as(Tr,{if:e,children:uf(ve,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[as(S2,{})," Continue with Email"]})})]})};import{useState as k2}from"react";import{jsx as uc,jsxs as R2}from"react/jsx-runtime";var ls=()=>{let[e,t]=k2(!1),{currentScreen:r,navigate:o,setModalData:n}=_(),{enabled:i,token:a}=le(),{initLoginWithFarcaster:l}=M();return R2(ve,{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:[uc(pi,{})," Farcaster",e&&uc("span",{children:uc(go,{})})]})};import V2 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as z2}from"react";import{forwardRef as F2,useState as mc}from"react";import vf from"styled-components";import I2 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as M2,AsYouType as W2,getCountries as L2,getCountryCallingCode as cs,getExampleNumber as O2}from"libphonenumber-js/min";import{jsx as U2,jsxs as D2}from"react/jsx-runtime";var fi=(e,t)=>M2(String(e),t),ds=(e,t)=>`+${cs(t)} ${e}`,mf=e=>`*${e.replaceAll("-","").slice(-4)}`,ff=e=>new W2(e),N2=L2().map(e=>({code:e,callCode:cs(e)})),hf=e=>{let t=O2(e,I2)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},yf=({value:e,onChange:t})=>U2("select",{value:e,onChange:t,children:N2.map(r=>D2("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});import{Fragment as G2,jsx as hi,jsxs as gf}from"react/jsx-runtime";var gn=F2((e,t)=>{let{app:r}=_(),[o,n]=mc(""),[i,a]=mc(r?.intl.defaultCountry??"US"),l=fi(o,i),s=ff(i),c=hf(i),u=cs(i),m=!l,[h,g]=mc(!1),w=u.length,C=P=>{let I=P.target.value;a(I),n(""),e.onChange&&e.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:ds(o,I),countryCode:I,isValid:fi(o,i)})},x=P=>{try{let I=P.replace(/\D/g,""),R=o.replace(/\D/g,""),S=I===R?P:s.input(P);n(S),e.onChange&&e.onChange({rawPhoneNumber:S,qualifiedPhoneNumber:ds(P,i),countryCode:i,isValid:fi(P,i)})}catch(I){console.error("Error processing phone number:",I)}},E=()=>{g(!0);let P=ds(o,i);e.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:P,countryCode:i,isValid:fi(o,i)}).finally(()=>g(!1))};return gf(G2,{children:[hi(B2,{children:gf(H2,{callingCodeLength:w,stacked:e.stacked,children:[hi(yf,{value:i,onChange:C}),hi("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:P=>{x(P.target.value)},onKeyUp:P=>{P.key==="Enter"&&E()},value:o,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?hi(Ko,{isSubmitting:h,onClick:E,disabled:m,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?hi(D,{loading:h,loadingText:null,onClick:E,disabled:m,children:"Submit"}):null]})}),B2=vf.div`
1670
1670
  width: 100%;
1671
- `,B0=yf.label`
1671
+ `,H2=vf.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
- `;import{Fragment as z0,jsx as us,jsxs as gf}from"react/jsx-runtime";var ms=({isEditable:e,setIsEditable:t})=>{let o=V0(null),{authenticated:r}=H(),{navigate:n,setModalData:i,currentScreen:a}=S(),{initLoginWithSms:l}=I(),{enabled:s,token:c}=ce();async function u({qualifiedPhoneNumber:m}){if(s&&!c&&!r)i({captchaModalData:{callback:h=>l(m,h),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(m,c),n("AWAITING_PASSWORDLESS_CODE")}catch(h){i({errorModalData:{error:h,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return gf(z0,{children:[us(bo,{if:!e,children:us(hn,{ref:o,onSubmit:u})}),us(bo,{if:e,children:gf(Ce,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[us(G0,{})," Continue with SMS"]})})]})};import{jsx as vf,jsxs as $0}from"react/jsx-runtime";var fs=({style:e,...t})=>$0("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:[vf("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"}),vf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as yi,jsxs as q0}from"react/jsx-runtime";var hs=({style:e,...t})=>q0("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:[yi("g",{clipPath:"url(#clip0)",children:yi("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"})}),yi("defs",{children:yi("clipPath",{id:"clip0",children:yi("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as wf}from"react/jsx-runtime";var ys=({style:e,...t})=>wf("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:wf("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"})});import{jsx as gs,jsxs as j0}from"react/jsx-runtime";var vs=({style:e,...t})=>j0("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:[gs("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"}),gs("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"}),gs("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"}),gs("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as ws}from"react/jsx-runtime";function Cs({style:e,...t}){return ws("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:ws("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:ws("g",{transform:"scale(5.12,5.12)",children:ws("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Cf,jsxs as K0}from"react/jsx-runtime";function bs(e){return K0("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Cf("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),Cf("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as dc,jsxs as Y0}from"react/jsx-runtime";function Es(e){return Y0("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:[dc("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"}),dc("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"}),dc("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as bf}from"react/jsx-runtime";var Ps=({style:e,...t})=>bf("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:bf("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"})});import{jsx as Yo,jsxs as Z0}from"react/jsx-runtime";var J0={apple:{logo:Yo(fs,{}),displayName:"Apple"},discord:{logo:Yo(hs,{}),displayName:"Discord"},github:{logo:Yo(ys,{}),displayName:"GitHub"},google:{logo:Yo(vs,{}),displayName:"Google"},linkedin:{logo:Yo(Cs,{}),displayName:"LinkedIn"},spotify:{logo:Yo(bs,{}),displayName:"Spotify"},twitter:{logo:Yo(Ps,{}),displayName:"Twitter"},tiktok:{logo:Yo(Es,{}),displayName:"TikTok"}},Oe=({provider:e})=>{let{enabled:t,token:o}=ce(),{navigate:r,setModalData:n}=S(),{initLoginWithOAuth:i}=I(),{displayName:a,logo:l}=J0[e];return Z0(Ce,{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]})};import Q0 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as Ef,jsxs as X0}from"react/jsx-runtime";var Ts=({onClick:e,text:t,icon:o})=>X0(Ce,{onClick:e,children:[o,Ef(Ia,{children:t}),Ef(Q0,{})]});import{Fragment as pc,jsx as Ne,jsxs as Ss}from"react/jsx-runtime";var _s=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=I(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=S(),i=r.loginMethodsAndOrder?.primary??[],a=r.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=Pf("default"),[u,m]=Pf("email");tC(()=>{let x=l.indexOf("sms"),F=l.indexOf("email");x>-1&&x<F&&m("sms")},[i,a]);let h=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=h;let g=x=>x==="email"?Ne(ls,{isEditable:u==="email",setIsEditable:()=>{m("email")}},x):x==="sms"?Ne(ms,{isEditable:u==="sms",setIsEditable:()=>{m("sms")}},x):x==="apple"?Ne(Oe,{provider:"apple"},x):x==="discord"?Ne(Oe,{provider:"discord"},x):x==="farcaster"?Ne(cs,{},x):x==="github"?Ne(Oe,{provider:"github"},x):x==="google"?Ne(Oe,{provider:"google"},x):x==="linkedin"?Ne(Oe,{provider:"linkedin"},x):x==="tiktok"?Ne(Oe,{provider:"tiktok"},x):x==="twitter"&&(!oC||r?.loginConfig.twitterOAuthOnMobileEnabled)?Ne(Oe,{provider:"twitter"},x):ei([x],o,e,l),w=i.map(g).flat(),b=a.map(g).flat(),T=[...w,...b],C=nC({primary:w.length,overflow:b.length}),[_,M]=Bd(T,C);return Ss(pc,{children:[Ne(A,{title:"Log in or sign up",onClose:h,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&Ne(iC,{}),Ne(Ma,{style:{overflow:"hidden",padding:2},children:Ss(At,{children:[s==="default"&&Ss(pc,{children:[..._,M.length>0&&Ne(Ts,{text:"More options",icon:Ne(eC,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&Ss(pc,{children:[...M]})]})}),r&&Ne(jr,{app:r}),Ne(V,{protectedByPrivy:!0})]})},xs=5,nC=({primary:e,overflow:t})=>e<xs?e:e===xs&&t===0?xs:xs-1,iC=rC(tn)`
1762
+ `;import{Fragment as $2,jsx as ps,jsxs as wf}from"react/jsx-runtime";var us=({isEditable:e,setIsEditable:t})=>{let r=z2(null),{authenticated:o}=H(),{navigate:n,setModalData:i,currentScreen:a}=_(),{initLoginWithSms:l}=M(),{enabled:s,token:c}=le();async function u({qualifiedPhoneNumber:m}){if(s&&!c&&!o)i({captchaModalData:{callback:h=>l(m,h),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(m,c),n("AWAITING_PASSWORDLESS_CODE")}catch(h){i({errorModalData:{error:h,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return wf($2,{children:[ps(Tr,{if:!e,children:ps(gn,{ref:r,onSubmit:u})}),ps(Tr,{if:e,children:wf(ve,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[ps(V2,{})," Continue with SMS"]})})]})};import{jsx as Cf,jsxs as q2}from"react/jsx-runtime";var ms=({style:e,...t})=>q2("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:[Cf("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"}),Cf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as yi,jsxs as j2}from"react/jsx-runtime";var fs=({style:e,...t})=>j2("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:[yi("g",{clipPath:"url(#clip0)",children:yi("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"})}),yi("defs",{children:yi("clipPath",{id:"clip0",children:yi("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as bf}from"react/jsx-runtime";var hs=({style:e,...t})=>bf("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:bf("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"})});import{jsx as ys,jsxs as K2}from"react/jsx-runtime";var gs=({style:e,...t})=>K2("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:[ys("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"}),ys("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"}),ys("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"}),ys("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as vs}from"react/jsx-runtime";function ws({style:e,...t}){return vs("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:vs("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:vs("g",{transform:"scale(5.12,5.12)",children:vs("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Ef,jsxs as Y2}from"react/jsx-runtime";function Cs(e){return Y2("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Ef("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"}),Ef("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as fc,jsxs as J2}from"react/jsx-runtime";function bs(e){return J2("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:[fc("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"}),fc("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"}),fc("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as Pf}from"react/jsx-runtime";var Es=({style:e,...t})=>Pf("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:Pf("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"})});import{jsx as Qr,jsxs as Q2}from"react/jsx-runtime";var Z2={apple:{logo:Qr(ms,{}),displayName:"Apple"},discord:{logo:Qr(fs,{}),displayName:"Discord"},github:{logo:Qr(hs,{}),displayName:"GitHub"},google:{logo:Qr(gs,{}),displayName:"Google"},linkedin:{logo:Qr(ws,{}),displayName:"LinkedIn"},spotify:{logo:Qr(Cs,{}),displayName:"Spotify"},twitter:{logo:Qr(Es,{}),displayName:"Twitter"},tiktok:{logo:Qr(bs,{}),displayName:"TikTok"}},Oe=({provider:e})=>{let{enabled:t,token:r}=le(),{navigate:o,setModalData:n}=_(),{initLoginWithOAuth:i}=M(),{displayName:a,logo:l}=Z2[e];return Q2(ve,{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]})};import X2 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as Tf,jsxs as eC}from"react/jsx-runtime";var Ps=({onClick:e,text:t,icon:r})=>eC(ve,{onClick:e,children:[r,Tf(Ra,{children:t}),Tf(X2,{})]});import{Fragment as hc,jsx as Ne,jsxs as xs}from"react/jsx-runtime";var Ss=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=_(),i=o.loginMethodsAndOrder?.primary??[],a=o.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=xf("default"),[u,m]=xf("email");rC(()=>{let S=l.indexOf("sms"),U=l.indexOf("email");S>-1&&S<U&&m("sms")},[i,a]);let h=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=h;let g=S=>S==="email"?Ne(ss,{isEditable:u==="email",setIsEditable:()=>{m("email")}},S):S==="sms"?Ne(us,{isEditable:u==="sms",setIsEditable:()=>{m("sms")}},S):S==="apple"?Ne(Oe,{provider:"apple"},S):S==="discord"?Ne(Oe,{provider:"discord"},S):S==="farcaster"?Ne(ls,{},S):S==="github"?Ne(Oe,{provider:"github"},S):S==="google"?Ne(Oe,{provider:"google"},S):S==="linkedin"?Ne(Oe,{provider:"linkedin"},S):S==="tiktok"?Ne(Oe,{provider:"tiktok"},S):S==="twitter"&&(!oC||o?.loginConfig.twitterOAuthOnMobileEnabled)?Ne(Oe,{provider:"twitter"},S):ei([S],r,e,l),w=i.map(g).flat(),C=a.map(g).flat(),x=[...w,...C],E=iC({primary:w.length,overflow:C.length}),[P,I]=Vd(x,E);return xs(hc,{children:[Ne(A,{title:"Log in or sign up",onClose:h,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&Ne(aC,{}),Ne(Ia,{style:{overflow:"hidden",padding:2},children:xs(Rt,{children:[s==="default"&&xs(hc,{children:[...P,I.length>0&&Ne(Ps,{text:"More options",icon:Ne(tC,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&xs(hc,{children:[...I]})]})}),o&&Ne(Yo,{app:o}),Ne(V,{protectedByPrivy:!0})]})},Ts=5,iC=({primary:e,overflow:t})=>e<Ts?e:e===Ts&&t===0?Ts:Ts-1,aC=nC(on)`
1763
1763
  margin-bottom: 16px;
1764
- `;import cC from"@heroicons/react/24/outline/EnvelopeIcon";import dC from"@heroicons/react/24/outline/PhoneIcon";import pC from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as uC,useState as _f}from"react";import{isMobile as mC}from"react-device-detect";import fC from"styled-components";import{jsx as gi,jsxs as Tf}from"react/jsx-runtime";var xf=({...e})=>Tf("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[Tf("g",{clipPath:"url(#clip0_2856_1743)",children:[gi("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"}),gi("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"})]}),gi("defs",{children:gi("clipPath",{id:"clip0_2856_1743",children:gi("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import aC from"@heroicons/react/24/outline/ChevronRightIcon";import sC from"@heroicons/react/24/outline/WalletIcon";import{jsx as uc,jsxs as lC}from"react/jsx-runtime";var Sf=({onClick:e,text:t})=>lC(Ce,{onClick:e,children:[uc(sC,{}),uc(Ia,{children:t}),uc(aC,{})]});import{Fragment as vi,jsx as ve,jsxs as yn}from"react/jsx-runtime";var As=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=I(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=S(),{email:i,sms:a,google:l,twitter:s,discord:c,github:u,spotify:m,tiktok:h,linkedin:g,apple:w,wallet:b,farcaster:T}=r?.loginMethods??{},C=r?.appearance.loginGroupPriority||"web2-first",_=r?.appearance.hideDirectWeb2Inputs,[M,R]=_f("default"),[x,F]=_f(i?"email":"sms");uC(()=>{F(i?"email":"sms")},[i]);let U=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{R("default")},150)};n.current=U;let z=[i&&ve(ls,{isEditable:x==="email",setIsEditable:()=>{F("email")}}),a&&ve(ms,{isEditable:x==="sms",setIsEditable:()=>{F("sms")}})].filter(Boolean),k=[l&&ve(Oe,{provider:"google"}),s&&(!mC||r?.loginConfig.twitterOAuthOnMobileEnabled)&&ve(Oe,{provider:"twitter"}),c&&ve(Oe,{provider:"discord"}),u&&ve(Oe,{provider:"github"}),m&&ve(Oe,{provider:"spotify"}),h&&ve(Oe,{provider:"tiktok"}),g&&ve(Oe,{provider:"linkedin"}),w&&ve(Oe,{provider:"apple"}),T&&ve(cs,{})].filter(Boolean),K=ei(r.appearance.walletList,o,e,r.appearance.walletList),N=M==="default"?void 0:()=>{R("default")},q=yC({priority:C,email:i,sms:a,social:k}),$=gC({priority:C,email:i,sms:a,social:k}),ee=vC({priority:C,email:i,sms:a,social:k}),ie=ve(Sf,{text:ee,onClick:()=>R("web3-overflow")}),j=ve(Ts,{text:q,icon:$,onClick:()=>R("web2-overflow")}),Ue=_?0:1;return yn(vi,{children:[ve(A,{title:"Log in or sign up",onClose:U,backFn:N}),M==="default"&&ve(hC,{}),ve(Ma,{style:{overflow:"hidden",padding:2},children:yn(At,{children:[M==="default"&&C==="web2-first"&&yn(vi,{children:[...z,...k.length+z.length>4?k.slice(0,3-z.length):k,z.length+k.length>4&&j,b&&ie]}),M==="default"&&C==="web3-first"&&yn(vi,{children:[b&&yn(vi,{children:[...K.length>4?K.slice(0,3):K,K.length>4&&ie]}),z.length+k.length>Ue&&j,z.length+k.length===Ue&&z.length?z[0]:null,z.length+k.length===Ue&&k.length?k[0]:null]}),M==="web2-overflow"&&yn(vi,{children:[...C==="web3-first"?z:[],...k]}),...M==="web3-overflow"?K:[]]})}),r&&ve(jr,{app:r}),ve(V,{protectedByPrivy:!0})]})},hC=fC(tn)`
1764
+ `;import dC from"@heroicons/react/24/outline/EnvelopeIcon";import pC from"@heroicons/react/24/outline/PhoneIcon";import uC from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as mC,useState as kf}from"react";import{isMobile as fC}from"react-device-detect";import hC from"styled-components";import{jsx as gi,jsxs as Sf}from"react/jsx-runtime";var _f=({...e})=>Sf("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[Sf("g",{clipPath:"url(#clip0_2856_1743)",children:[gi("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"}),gi("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"})]}),gi("defs",{children:gi("clipPath",{id:"clip0_2856_1743",children:gi("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import sC from"@heroicons/react/24/outline/ChevronRightIcon";import lC from"@heroicons/react/24/outline/WalletIcon";import{jsx as yc,jsxs as cC}from"react/jsx-runtime";var Af=({onClick:e,text:t})=>cC(ve,{onClick:e,children:[yc(lC,{}),yc(Ra,{children:t}),yc(sC,{})]});import{Fragment as vi,jsx as ye,jsxs as vn}from"react/jsx-runtime";var _s=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=_(),{email:i,sms:a,google:l,twitter:s,discord:c,github:u,spotify:m,tiktok:h,linkedin:g,apple:w,wallet:C,farcaster:x}=o?.loginMethods??{},E=o?.appearance.loginGroupPriority||"web2-first",P=o?.appearance.hideDirectWeb2Inputs,[I,R]=kf("default"),[S,U]=kf(i?"email":"sms");mC(()=>{U(i?"email":"sms")},[i]);let F=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{R("default")},150)};n.current=F;let z=[i&&ye(ss,{isEditable:S==="email",setIsEditable:()=>{U("email")}}),a&&ye(us,{isEditable:S==="sms",setIsEditable:()=>{U("sms")}})].filter(Boolean),k=[l&&ye(Oe,{provider:"google"}),s&&(!fC||o?.loginConfig.twitterOAuthOnMobileEnabled)&&ye(Oe,{provider:"twitter"}),c&&ye(Oe,{provider:"discord"}),u&&ye(Oe,{provider:"github"}),m&&ye(Oe,{provider:"spotify"}),h&&ye(Oe,{provider:"tiktok"}),g&&ye(Oe,{provider:"linkedin"}),w&&ye(Oe,{provider:"apple"}),x&&ye(ls,{})].filter(Boolean),K=ei(o.appearance.walletList,r,e,o.appearance.walletList),N=I==="default"?void 0:()=>{R("default")},q=gC({priority:E,email:i,sms:a,social:k}),$=vC({priority:E,email:i,sms:a,social:k}),te=wC({priority:E,email:i,sms:a,social:k}),se=ye(Af,{text:te,onClick:()=>R("web3-overflow")}),j=ye(Ps,{text:q,icon:$,onClick:()=>R("web2-overflow")}),Ue=P?0:1;return vn(vi,{children:[ye(A,{title:"Log in or sign up",onClose:F,backFn:N}),I==="default"&&ye(yC,{}),ye(Ia,{style:{overflow:"hidden",padding:2},children:vn(Rt,{children:[I==="default"&&E==="web2-first"&&vn(vi,{children:[...z,...k.length+z.length>4?k.slice(0,3-z.length):k,z.length+k.length>4&&j,C&&se]}),I==="default"&&E==="web3-first"&&vn(vi,{children:[C&&vn(vi,{children:[...K.length>4?K.slice(0,3):K,K.length>4&&se]}),z.length+k.length>Ue&&j,z.length+k.length===Ue&&z.length?z[0]:null,z.length+k.length===Ue&&k.length?k[0]:null]}),I==="web2-overflow"&&vn(vi,{children:[...E==="web3-first"?z:[],...k]}),...I==="web3-overflow"?K:[]]})}),o&&ye(Yo,{app:o}),ye(V,{protectedByPrivy:!0})]})},yC=hC(on)`
1765
1765
  margin-bottom: 16px;
1766
- `,yC=({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",gC=({priority:e,email:t,sms:o,social:r})=>e==="web2-first"||r.length>0?ve(pC,{}):t&&o?ve(xf,{}):t?ve(cC,{}):o?ve(dC,{}):null,vC=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";import{jsx as Af}from"react/jsx-runtime";var kf=()=>{let{app:e}=S();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?Af(_s,{connectOnly:!0}):Af(As,{connectOnly:!0})};import{jsx as Rf}from"react/jsx-runtime";var If=()=>{let{app:e}=S();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?Rf(_s,{connectOnly:!1}):Rf(As,{connectOnly:!1})};import wC from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as CC,jsx as Jo,jsxs as bC}from"react/jsx-runtime";var Mf=()=>{let{app:e}=S();return bC(CC,{children:[Jo(A,{},"header"),Jo(Z,{}),Jo(Ee,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:Jo(wC,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Jo(kt,{children:Jo(as,{stacked:!0})}),Jo(Q,{}),Jo(V,{protectedByPrivy:!0})]})};import EC from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as PC,jsx as Zo,jsxs as TC}from"react/jsx-runtime";var Wf=()=>{let{app:e,currentScreen:t,data:o,navigate:r,setModalData:n}=S(),{initLoginWithSms:i}=I();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 TC(PC,{children:[Zo(A,{},"header"),Zo(Z,{}),Zo(Ee,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:Zo(EC,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),Zo(kt,{children:Zo(hn,{stacked:!0,onSubmit:a})}),Zo(Q,{}),Zo(V,{protectedByPrivy:!0})]})};import{Fragment as xC,jsx as wi,jsxs as SC}from"react/jsx-runtime";var Lf=()=>{let{linkingHint:e}=I(),{app:t}=S(),o=e?`Select the wallet with ${Lo(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return SC(xC,{children:[wi(A,{},"header"),wi(so,{title:`${e?"Reconnect":"Connect"} your wallet`,description:o}),wi(At,{children:wi(en,{connectOnly:!1})}),wi(V,{protectedByPrivy:!0})]})};import{jsx as Of,jsxs as _C}from"react/jsx-runtime";var Nf=({style:e,...t})=>_C("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:[Of("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),Of("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});import{Fragment as AC,jsx as Qo,jsxs as Df}from"react/jsx-runtime";var Uf=()=>{let{closePrivyModal:e}=I(),{navigate:t}=S();return Df(AC,{children:[Qo(A,{},"header"),Qo(Z,{}),Qo(Nf,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),Qo(so,{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"}}),Df(kt,{children:[Qo(D,{onClick:()=>t("LANDING"),children:"Try again"}),Qo(Gt,{onClick:()=>e(),children:"Cancel"})]}),Qo(Q,{}),Qo(V,{protectedByPrivy:!0})]})};import jf from"@heroicons/react/20/solid/CheckIcon";import YC from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import JC from"@heroicons/react/24/outline/FingerPrintIcon";import ZC from"@heroicons/react/24/outline/PhoneIcon";import Kf from"@heroicons/react/24/outline/TrashIcon";import QC from"@heroicons/react/24/solid/CheckBadgeIcon";import Yf from"@heroicons/react/24/solid/CheckCircleIcon";import Jf from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import XC from"@heroicons/react/24/solid/IdentificationIcon";import vc from"@heroicons/react/24/solid/PhoneIcon";import gc from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as Zf,useState as So}from"react";import{useState as hc}from"react";import{isMobile as LC}from"react-device-detect";import Vf from"styled-components";import{Dialog as Ff,Transition as mc}from"@headlessui/react";import fc from"react";import vn from"styled-components";import{jsx as gn,jsxs as WC}from"react/jsx-runtime";var Bf=({children:e,open:t,onClick:o,...r})=>gn(mc,{show:t,as:fc.Fragment,children:WC(Ff,{onClose:o,...r,as:RC,children:[gn(mc.Child,{as:fc.Fragment,enterFrom:"entering",leaveTo:"leaving",children:gn(kC,{"aria-hidden":"true"})}),gn(IC,{children:gn(mc.Child,{as:fc.Fragment,enterFrom:"entering",leaveTo:"leaving",children:gn(Ff.Panel,{as:MC,children:e})})})]})}),wn=vn.div`
1766
+ `,gC=({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",vC=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?ye(uC,{}):t&&r?ye(_f,{}):t?ye(dC,{}):r?ye(pC,{}):null,wC=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";import{jsx as Rf}from"react/jsx-runtime";var If=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?Rf(Ss,{connectOnly:!0}):Rf(_s,{connectOnly:!0})};import{jsx as Mf}from"react/jsx-runtime";var Wf=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?Mf(Ss,{connectOnly:!1}):Mf(_s,{connectOnly:!1})};import CC from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as bC,jsx as Xr,jsxs as EC}from"react/jsx-runtime";var Lf=()=>{let{app:e}=_();return EC(bC,{children:[Xr(A,{},"header"),Xr(Z,{}),Xr(Ce,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:Xr(CC,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Xr(It,{children:Xr(is,{stacked:!0})}),Xr(Q,{}),Xr(V,{protectedByPrivy:!0})]})};import PC from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as TC,jsx as eo,jsxs as xC}from"react/jsx-runtime";var Of=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=_(),{initLoginWithSms:i}=M();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 xC(TC,{children:[eo(A,{},"header"),eo(Z,{}),eo(Ce,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:eo(PC,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),eo(It,{children:eo(gn,{stacked:!0,onSubmit:a})}),eo(Q,{}),eo(V,{protectedByPrivy:!0})]})};import{Fragment as SC,jsx as wi,jsxs as _C}from"react/jsx-runtime";var Nf=()=>{let{linkingHint:e}=M(),{app:t}=_(),r=e?`Select the wallet with ${Dr(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return _C(SC,{children:[wi(A,{},"header"),wi(cr,{title:`${e?"Reconnect":"Connect"} your wallet`,description:r}),wi(Rt,{children:wi(rn,{connectOnly:!1})}),wi(V,{protectedByPrivy:!0})]})};import{jsx as Df,jsxs as AC}from"react/jsx-runtime";var Uf=({style:e,...t})=>AC("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:[Df("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),Df("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});import{Fragment as kC,jsx as to,jsxs as Ff}from"react/jsx-runtime";var Bf=()=>{let{closePrivyModal:e}=M(),{navigate:t}=_();return Ff(kC,{children:[to(A,{},"header"),to(Z,{}),to(Uf,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),to(cr,{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"}}),Ff(It,{children:[to(D,{onClick:()=>t("LANDING"),children:"Try again"}),to(Gt,{onClick:()=>e(),children:"Cancel"})]}),to(Q,{}),to(V,{protectedByPrivy:!0})]})};import Yf from"@heroicons/react/20/solid/CheckIcon";import JC from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import ZC from"@heroicons/react/24/outline/FingerPrintIcon";import QC from"@heroicons/react/24/outline/PhoneIcon";import Jf from"@heroicons/react/24/outline/TrashIcon";import XC from"@heroicons/react/24/solid/CheckBadgeIcon";import Zf from"@heroicons/react/24/solid/CheckCircleIcon";import Qf from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import e3 from"@heroicons/react/24/solid/IdentificationIcon";import Ec from"@heroicons/react/24/solid/PhoneIcon";import bc from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as Xf,useState as kr}from"react";import{useState as wc}from"react";import{isMobile as OC}from"react-device-detect";import $f from"styled-components";import{Dialog as Hf,Transition as gc}from"@headlessui/react";import vc from"react";import Cn from"styled-components";import{jsx as wn,jsxs as LC}from"react/jsx-runtime";var Gf=({children:e,open:t,onClick:r,...o})=>wn(gc,{show:t,as:vc.Fragment,children:LC(Hf,{onClose:r,...o,as:IC,children:[wn(gc.Child,{as:vc.Fragment,enterFrom:"entering",leaveTo:"leaving",children:wn(RC,{"aria-hidden":"true"})}),wn(MC,{children:wn(gc.Child,{as:vc.Fragment,enterFrom:"entering",leaveTo:"leaving",children:wn(Hf.Panel,{as:WC,children:e})})})]})}),bn=Cn.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
- `,kC=vn.div`
1789
+ `,RC=Cn.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
- `,RC=vn.div`
1802
+ `,IC=Cn.div`
1803
1803
  position: relative;
1804
1804
  z-index: 999999;
1805
- `,IC=vn.div`
1805
+ `,MC=Cn.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
- `,MC=vn.div`
1813
+ `,WC=Cn.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
- `,Hf=vn.div`
1860
+ `,Vf=Cn.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
- `;import{Fragment as HC,jsx as Ci,jsxs as BC}from"react/jsx-runtime";var bi=6,OC=new Array(bi).fill("");function NC(e){return e.replace(/\s+/g,"")}function yc(e){return/^[0-9]{1}$/.test(e)}function Gf(e){return e.length===bi&&e.every(yc)}function DC(e,t){return e.reduce((o,r)=>o+Number(t(r)),0)}var Cn=({onChange:e,disabled:t,errorReasonOverride:o,success:r})=>{let[n,i]=hc(OC),[a,l]=hc(null),[s,c]=hc(null),u=async w=>{w.preventDefault();let b=NC(w.currentTarget.value);if(b==="")return;let T=DC(n,yc),C=b.split(""),_=!C.every(yc),M=C.length+T>bi;if(_){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 R=Number(w.currentTarget.name?.charAt(4)),x=[...b||[""]].slice(0,bi-R),F=[...n.slice(0,R),...x,...n.slice(R+x.length)];i(F);let U=x.length,z=Math.min(Math.max(R+U,0),bi-1);if(document.querySelector(`input[name=pin-${z}]`)?.focus(),Gf(F))try{await e(F.join("")),document.querySelector(`input[name=pin-${z}]`)?.blur()}catch(K){c(1),l(K.message)}else try{await e(null)}catch(K){c(1),l(K.message)}},m=w=>{s===1&&(l(null),c(null));let b=[...n.slice(0,w),"",...n.slice(w+1)];i(b),w>0&&document.querySelector(`input[name=pin-${w-1}]`)?.focus(),Gf(b)?e(b.join("")):e(null)},g=r?"success":!!(o||a)?"fail":"";return Ci(HC,{children:BC(UC,{children:[Ci("div",{children:n.map((w,b)=>Ci("input",{name:`pin-${b}`,type:"text",value:n[b],onChange:u,onKeyUp:T=>{T.key==="Backspace"&&m(b)},inputMode:"numeric",autoFocus:b===0,pattern:"[0-9]",className:g,autoComplete:LC?"one-time-code":"off",disabled:t},b))}),Ci("div",{children:Ci(FC,{fail:!!o||!!a,children:o||a})})]})})},UC=Vf.div`
1866
+ `;import{Fragment as GC,jsx as Ci,jsxs as HC}from"react/jsx-runtime";var bi=6,NC=new Array(bi).fill("");function DC(e){return e.replace(/\s+/g,"")}function Cc(e){return/^[0-9]{1}$/.test(e)}function zf(e){return e.length===bi&&e.every(Cc)}function UC(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var En=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=wc(NC),[a,l]=wc(null),[s,c]=wc(null),u=async w=>{w.preventDefault();let C=DC(w.currentTarget.value);if(C==="")return;let x=UC(n,Cc),E=C.split(""),P=!E.every(Cc),I=E.length+x>bi;if(P){l("Passcode can only be numbers"),c(1);return}if(I){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let R=Number(w.currentTarget.name?.charAt(4)),S=[...C||[""]].slice(0,bi-R),U=[...n.slice(0,R),...S,...n.slice(R+S.length)];i(U);let F=S.length,z=Math.min(Math.max(R+F,0),bi-1);if(document.querySelector(`input[name=pin-${z}]`)?.focus(),zf(U))try{await e(U.join("")),document.querySelector(`input[name=pin-${z}]`)?.blur()}catch(K){c(1),l(K.message)}else try{await e(null)}catch(K){c(1),l(K.message)}},m=w=>{s===1&&(l(null),c(null));let C=[...n.slice(0,w),"",...n.slice(w+1)];i(C),w>0&&document.querySelector(`input[name=pin-${w-1}]`)?.focus(),zf(C)?e(C.join("")):e(null)},g=o?"success":!!(r||a)?"fail":"";return Ci(GC,{children:HC(FC,{children:[Ci("div",{children:n.map((w,C)=>Ci("input",{name:`pin-${C}`,type:"text",value:n[C],onChange:u,onKeyUp:x=>{x.key==="Backspace"&&m(C)},inputMode:"numeric",autoFocus:C===0,pattern:"[0-9]",className:g,autoComplete:OC?"one-time-code":"off",disabled:t},C))}),Ci("div",{children:Ci(BC,{fail:!!r||!!a,children:r||a})})]})})},FC=$f.div`
1867
1867
  display: flex;
1868
1868
  flex-direction: column;
1869
1869
  width: 100%;
1870
1870
  gap: 8px;
1871
1871
 
1872
- ${wn}[data-height='medium'] & {
1872
+ ${bn}[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
- `,FC=Vf.div`
1937
+ `,BC=$f.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
- `;import{useContext as GC}from"react";function bn(){let{promptMfa:e,init:t,submit:o,cancel:r}=GC(ne);return{promptMfa:e,init:t,submit:o,cancel:r}}import{useContext as VC}from"react";function Ei(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:r,unenroll:n,enrollInMfa:i}=VC(ne);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:r,unenrollWithSms:()=>n("sms"),unenrollWithTotp:()=>n("totp"),showMfaEnrollmentModal:()=>i(!0),closeMfaEnrollmentModal:()=>i(!1)}}import zC from"styled-components";import{jsx as zf,jsxs as qC}from"react/jsx-runtime";var $f=e=>qC($C,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[zf("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),zf("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"})]}),$C=zC.svg`
1945
+ `;import{useContext as VC}from"react";function Pn(){let{promptMfa:e,init:t,submit:r,cancel:o}=VC(oe);return{promptMfa:e,init:t,submit:r,cancel:o}}import{useContext as zC}from"react";function Ei(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:o,unenroll:n,enrollInMfa:i}=zC(oe);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:o,unenrollWithSms:()=>n("sms"),unenrollWithTotp:()=>n("totp"),showMfaEnrollmentModal:()=>i(!0),closeMfaEnrollmentModal:()=>i(!1)}}import $C from"styled-components";import{jsx as qf,jsxs as jC}from"react/jsx-runtime";var jf=e=>jC(qC,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[qf("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),qf("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"})]}),qC=$C.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
- `;import jC from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as KC}from"react/jsx-runtime";var qf=({size:e,authUrl:t})=>KC(ts,{url:t,squareLogoElement:jC,size:e,fgColor:"#1F1F1F"});import{Fragment as Wt,jsx as v,jsxs as X}from"react/jsx-runtime";var Qf=()=>{let{user:e,enrollInMfa:t}=H(),[o,r]=So(null),{unenrollWithSms:n,unenrollWithTotp:i}=Ei(),{app:a,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=S(),{closePrivyModal:u}=I(),{promptMfa:m}=bn(),[h,g]=So(s?.mfaEnrollmentFlow?.seenIntro||!1),[w,b]=So(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),T=()=>{u({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{r(null),b(null)},500)};c.current=T;let C=e?.mfaMethods.includes("sms"),_=!!e?.phone,M=e?.mfaMethods.includes("totp"),R=C||M;Zf(()=>{R&&g(!0)},[R]);function x(){r(null),b(null)}function F(){g(!1)}async function U(N){await m(),b(N)}if(!l||!e||!a)return X(Wt,{children:[v(A,{onClose:T},"header"),v($e,{children:v($f,{})}),v(Bo,{children:v(xt,{})}),v(te,{})]});async function z(){r(null);try{await n()}catch{r(null)}}async function k(){r(null);try{await i()}catch{r(null)}}if(o==="sms")return X(Wt,{children:[v(A,{backFn:x,onClose:T},"header"),v($e,{children:v(ot,{children:v(vc,{})})}),v(be,{children:"Remove SMS verification?"}),X(ye,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),v(Ho,{children:v(D,{warn:!0,onClick:z,children:"Remove SMS for MFA"})}),v(te,{})]});if(o==="totp")return X(Wt,{children:[v(A,{backFn:x,onClose:T},"header"),v($e,{children:v(ot,{children:v(Jf,{})})}),v(be,{children:"Remove Authenticator App verification?"}),X(ye,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),v(Ho,{children:v(D,{warn:!0,onClick:k,children:"Remove Authenticator App for MFA"})}),v(te,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!R)return X(Wt,{children:[v(A,{onClose:T},"header"),v($e,{children:v(ot,{children:v(gc,{})})}),v(be,{children:"Add more security"}),X(ye,{children:[a?.name," does not have any verification methods enabled."]}),v(Ho,{children:v(D,{onClick:T,children:"Close"})}),v(te,{})]});let K=!R&&!h;if(K)return X(Wt,{children:[v(A,{onClose:T},"header"),v($e,{children:v(ot,{children:v(gc,{})})}),v(be,{children:"Transaction Protection"}),v(ye,{children:"Set up transaction protection to add an extra layer of security to your account"}),X(ou,{children:[X(Tl,{children:[v(Pl,{children:v(QC,{})}),"Enable 2-Step verification for your ",a?.name," wallet."]}),X(Tl,{children:[v(Pl,{children:v(XC,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),X(Ho,{children:[v(D,{onClick:()=>g(!0),children:"Continue"}),v(Gt,{onClick:T,children:"Not now"})]}),v(te,{})]});switch(w){case"sms":return v(e3,{onComplete:T,onReset:x,onClose:T});case"totp":return v(t3,{onComplete:T,onClose:T,onReset:x});default:return X(Wt,{children:[v(A,{backFn:K?F:void 0,onClose:T},"header"),v($e,{children:v(ot,{children:v(gc,{})})}),v(be,{children:"Choose a verification method"}),R?v(ye,{children:"To add or delete verification methods, verification is required."}):v(ye,{children:"How would you like to verify your identity? You can change this later."}),X(Wa,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||M)&&X(La,{children:[v(Ce,{disabled:M,onClick:()=>U("totp"),children:X(Na,{children:[X(Oa,{children:[v(YC,{}),"Authenticator App"]}),M?X(Yr,{children:[v(jf,{}),"Added"]}):v(Yr,{children:"Recommended"})]})}),M&&v(xl,{id:"remove",onClick:()=>r("totp"),children:v(Kf,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||C)&&X(La,{children:[v(Ce,{disabled:C||_,onClick:()=>U("sms"),children:X(Na,{children:[X(Oa,{children:[v(ZC,{}),"SMS"]}),C&&X(Yr,{children:[v(jf,{}),"Added"]}),_&&v(Yr,{children:"Disabled"})]})}),C&&v(xl,{id:"remove",onClick:()=>r("sms"),children:v(Kf,{})})]},"sms"),v(La,{children:v(Ce,{disabled:!0,children:X(Na,{children:[X(Oa,{children:[v(JC,{}),"Passkey"]}),v(Yr,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),v(te,{})]})}},e3=({onComplete:e,onReset:t,onClose:o})=>{let[r,n]=So(""),[i,a]=So(!1),[l,s]=So("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:u}=Ei(),{app:m,data:h,currentScreen:g,navigate:w,setModalData:b}=S();function T(){h?.mfaEnrollmentFlow?.onSuccess(),e()}async function C({qualifiedPhoneNumber:R}){try{await c({phoneNumber:R}),n(R),s("verify")}catch(x){b({mfaEnrollmentFlow:h?.mfaEnrollmentFlow?{...h?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:x,previousScreen:g||"MFA_ENROLLMENT_FLOW_SCREEN"}}),w("ERROR_SCREEN")}}async function _(R){try{if(!R)return;await u({phoneNumber:r,mfaCode:R}),a(!0)}catch(x){throw Gl(x)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):sn(x)?new Error("The code you entered is not valid"):an(x)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Vl(x)?new Error("Verification canceled"):new Error("Unknown error")}}function M(){l==="verify"?s("enroll"):t()}return l==="enroll"?X(Wt,{children:[v(A,{backFn:t,onClose:o},"header"),v($e,{children:v(ot,{children:v(vc,{})})}),v(be,{children:"Set up SMS verification"}),v(ye,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),X(Bo,{children:[v(hn,{onSubmit:C}),X(ru,{children:["By providing your mobile number, you agree to receive text messages from ",m?.name,". Some carrier charges may apply"]})]}),v(te,{})]}):i?X(Wt,{children:[v(A,{onClose:T},"header"),v($e,{children:v(ot,{status:"success",children:v(Yf,{})})}),v(be,{children:"SMS verification added"}),v(ye,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),v(Ho,{children:v(D,{onClick:T,children:"Done"})}),v(te,{})]}):X(Wt,{children:[v(A,{backFn:M,onClose:o},"header"),v($e,{children:v(ot,{children:v(vc,{})})}),v(be,{children:"Enter enrollment code"}),X(Bo,{children:[v(Cn,{onChange:_}),X(ye,{children:["To continue, enter the 6-digit code sent to ",v("strong",{children:pf(r)})]})]}),v(te,{})]})},t3=({onComplete:e,onClose:t,onReset:o})=>{let[r,n]=So("enroll"),[i,a]=So(null),[l,s]=So(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:u}=Ei(),{data:m}=S();Zf(()=>{a(null),c().then(T=>{a(T)}).catch(()=>{a(null),o()})},[]);function h(){m?.mfaEnrollmentFlow?.onSuccess(),e()}function g(){n("verify")}async function w(T){try{if(!T)return;await u({mfaCode:T}),s(!0)}catch(C){throw Gl(C)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):sn(C)?new Error("The code you entered is not valid"):an(C)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Vl(C)?new Error("Verification canceled"):new Error("Unknown error")}}function b(){r==="verify"?n("enroll"):o()}return r==="enroll"?X(Wt,{children:[v(A,{backFn:o,onClose:t},"header"),v(be,{children:"Scan QR code"}),v(ye,{children:"Open your authenticator app and scan the QR code to continue."}),v(Ba,{children:i?.authUrl?v(qf,{authUrl:i.authUrl,size:200}):v(xt,{})}),X(Ho,{children:[v(Rt,{children:i?.secret&&v(fn,{itemName:"secret",text:i.secret})}),v(D,{onClick:g,children:"Continue"})]}),v(te,{})]}):l?X(Wt,{children:[v(A,{onClose:h},"header"),v($e,{children:v(ot,{status:"success",children:v(Yf,{})})}),v(be,{children:"Authenticator app verification added"}),v(ye,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),v(Ho,{children:v(D,{onClick:h,children:"Done"})}),v(te,{})]}):X(Wt,{children:[v(A,{backFn:b,onClose:t},"header"),v($e,{children:v(ot,{children:v(Jf,{})})}),v(be,{children:"Enter enrollment code"}),v(Bo,{children:v(Cn,{onChange:w})}),X(ye,{children:["To continue, enter the 6-digit code generated from your ",v("strong",{children:"authenticator app"})]}),v(te,{})]})};import X3 from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import eb from"@heroicons/react/24/outline/PhoneIcon";import tb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import ob from"@heroicons/react/24/solid/PhoneIcon";import rb from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as nb,useState as Oc}from"react";import{StaticJsonRpcProvider as K3}from"@ethersproject/providers";import{useMemo as Y3,useEffect as J3,useState as Uh}from"react";import Z3 from"styled-components";import Ch from"styled-components";import eh from"styled-components";import{jsx as Xf,jsxs as n3}from"react/jsx-runtime";var ks=({label:e,children:t,valueStyles:o})=>n3(o3,{children:[Xf("div",{children:e}),Xf(r3,{style:{...o},children:t})]}),o3=eh.div`
1956
+ `;import KC from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as YC}from"react/jsx-runtime";var Kf=({size:e,authUrl:t})=>YC(es,{url:t,squareLogoElement:KC,size:e,fgColor:"#1F1F1F"});import{Fragment as Ot,jsx as v,jsxs as X}from"react/jsx-runtime";var eh=()=>{let{user:e,enrollInMfa:t}=H(),[r,o]=kr(null),{unenrollWithSms:n,unenrollWithTotp:i}=Ei(),{app:a,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),{closePrivyModal:u}=M(),{promptMfa:m}=Pn(),[h,g]=kr(s?.mfaEnrollmentFlow?.seenIntro||!1),[w,C]=kr(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),x=()=>{u({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),C(null)},500)};c.current=x;let E=e?.mfaMethods.includes("sms"),P=!!e?.phone,I=e?.mfaMethods.includes("totp"),R=E||I;Xf(()=>{R&&g(!0)},[R]);function S(){o(null),C(null)}function U(){g(!1)}async function F(N){await m(),C(N)}if(!l||!e||!a)return X(Ot,{children:[v(A,{onClose:x},"header"),v(ze,{children:v(jf,{})}),v(Vr,{children:v(_t,{})}),v(ee,{})]});async function z(){o(null);try{await n()}catch{o(null)}}async function k(){o(null);try{await i()}catch{o(null)}}if(r==="sms")return X(Ot,{children:[v(A,{backFn:S,onClose:x},"header"),v(ze,{children:v(rt,{children:v(Ec,{})})}),v(we,{children:"Remove SMS verification?"}),X(fe,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),v(zr,{children:v(D,{warn:!0,onClick:z,children:"Remove SMS for MFA"})}),v(ee,{})]});if(r==="totp")return X(Ot,{children:[v(A,{backFn:S,onClose:x},"header"),v(ze,{children:v(rt,{children:v(Qf,{})})}),v(we,{children:"Remove Authenticator App verification?"}),X(fe,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),v(zr,{children:v(D,{warn:!0,onClick:k,children:"Remove Authenticator App for MFA"})}),v(ee,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!R)return X(Ot,{children:[v(A,{onClose:x},"header"),v(ze,{children:v(rt,{children:v(bc,{})})}),v(we,{children:"Add more security"}),X(fe,{children:[a?.name," does not have any verification methods enabled."]}),v(zr,{children:v(D,{onClick:x,children:"Close"})}),v(ee,{})]});let K=!R&&!h;if(K)return X(Ot,{children:[v(A,{onClose:x},"header"),v(ze,{children:v(rt,{children:v(bc,{})})}),v(we,{children:"Transaction Protection"}),v(fe,{children:"Set up transaction protection to add an extra layer of security to your account"}),X(nu,{children:[X(Al,{children:[v(_l,{children:v(XC,{})}),"Enable 2-Step verification for your ",a?.name," wallet."]}),X(Al,{children:[v(_l,{children:v(e3,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),X(zr,{children:[v(D,{onClick:()=>g(!0),children:"Continue"}),v(Gt,{onClick:x,children:"Not now"})]}),v(ee,{})]});switch(w){case"sms":return v(t3,{onComplete:x,onReset:S,onClose:x});case"totp":return v(r3,{onComplete:x,onClose:x,onReset:S});default:return X(Ot,{children:[v(A,{backFn:K?U:void 0,onClose:x},"header"),v(ze,{children:v(rt,{children:v(bc,{})})}),v(we,{children:"Choose a verification method"}),R?v(fe,{children:"To add or delete verification methods, verification is required."}):v(fe,{children:"How would you like to verify your identity? You can change this later."}),X(Ma,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||I)&&X(Wa,{children:[v(ve,{disabled:I,onClick:()=>F("totp"),children:X(Oa,{children:[X(La,{children:[v(JC,{}),"Authenticator App"]}),I?X(Zo,{children:[v(Yf,{}),"Added"]}):v(Zo,{children:"Recommended"})]})}),I&&v(kl,{id:"remove",onClick:()=>o("totp"),children:v(Jf,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||E)&&X(Wa,{children:[v(ve,{disabled:E||P,onClick:()=>F("sms"),children:X(Oa,{children:[X(La,{children:[v(QC,{}),"SMS"]}),E&&X(Zo,{children:[v(Yf,{}),"Added"]}),P&&v(Zo,{children:"Disabled"})]})}),E&&v(kl,{id:"remove",onClick:()=>o("sms"),children:v(Jf,{})})]},"sms"),v(Wa,{children:v(ve,{disabled:!0,children:X(Oa,{children:[X(La,{children:[v(ZC,{}),"Passkey"]}),v(Zo,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),v(ee,{})]})}},t3=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=kr(""),[i,a]=kr(!1),[l,s]=kr("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:u}=Ei(),{app:m,data:h,currentScreen:g,navigate:w,setModalData:C}=_();function x(){h?.mfaEnrollmentFlow?.onSuccess(),e()}async function E({qualifiedPhoneNumber:R}){try{await c({phoneNumber:R}),n(R),s("verify")}catch(S){C({mfaEnrollmentFlow:h?.mfaEnrollmentFlow?{...h?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:S,previousScreen:g||"MFA_ENROLLMENT_FLOW_SCREEN"}}),w("ERROR_SCREEN")}}async function P(R){try{if(!R)return;await u({phoneNumber:o,mfaCode:R}),a(!0)}catch(S){throw ql(S)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):cn(S)?new Error("The code you entered is not valid"):ln(S)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):jl(S)?new Error("Verification canceled"):new Error("Unknown error")}}function I(){l==="verify"?s("enroll"):t()}return l==="enroll"?X(Ot,{children:[v(A,{backFn:t,onClose:r},"header"),v(ze,{children:v(rt,{children:v(Ec,{})})}),v(we,{children:"Set up SMS verification"}),v(fe,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),X(Vr,{children:[v(gn,{onSubmit:E}),X(iu,{children:["By providing your mobile number, you agree to receive text messages from ",m?.name,". Some carrier charges may apply"]})]}),v(ee,{})]}):i?X(Ot,{children:[v(A,{onClose:x},"header"),v(ze,{children:v(rt,{status:"success",children:v(Zf,{})})}),v(we,{children:"SMS verification added"}),v(fe,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),v(zr,{children:v(D,{onClick:x,children:"Done"})}),v(ee,{})]}):X(Ot,{children:[v(A,{backFn:I,onClose:r},"header"),v(ze,{children:v(rt,{children:v(Ec,{})})}),v(we,{children:"Enter enrollment code"}),X(Vr,{children:[v(En,{onChange:P}),X(fe,{children:["To continue, enter the 6-digit code sent to ",v("strong",{children:mf(o)})]})]}),v(ee,{})]})},r3=({onComplete:e,onClose:t,onReset:r})=>{let[o,n]=kr("enroll"),[i,a]=kr(null),[l,s]=kr(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:u}=Ei(),{data:m}=_();Xf(()=>{a(null),c().then(x=>{a(x)}).catch(()=>{a(null),r()})},[]);function h(){m?.mfaEnrollmentFlow?.onSuccess(),e()}function g(){n("verify")}async function w(x){try{if(!x)return;await u({mfaCode:x}),s(!0)}catch(E){throw ql(E)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):cn(E)?new Error("The code you entered is not valid"):ln(E)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):jl(E)?new Error("Verification canceled"):new Error("Unknown error")}}function C(){o==="verify"?n("enroll"):r()}return o==="enroll"?X(Ot,{children:[v(A,{backFn:r,onClose:t},"header"),v(we,{children:"Scan QR code"}),v(fe,{children:"Open your authenticator app and scan the QR code to continue."}),v(Fa,{children:i?.authUrl?v(Kf,{authUrl:i.authUrl,size:200}):v(_t,{})}),X(zr,{children:[v(Mt,{children:i?.secret&&v(yn,{itemName:"secret",text:i.secret})}),v(D,{onClick:g,children:"Continue"})]}),v(ee,{})]}):l?X(Ot,{children:[v(A,{onClose:h},"header"),v(ze,{children:v(rt,{status:"success",children:v(Zf,{})})}),v(we,{children:"Authenticator app verification added"}),v(fe,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),v(zr,{children:v(D,{onClick:h,children:"Done"})}),v(ee,{})]}):X(Ot,{children:[v(A,{backFn:C,onClose:t},"header"),v(ze,{children:v(rt,{children:v(Qf,{})})}),v(we,{children:"Enter enrollment code"}),v(Vr,{children:v(En,{onChange:w})}),X(fe,{children:["To continue, enter the 6-digit code generated from your ",v("strong",{children:"authenticator app"})]}),v(ee,{})]})};import X3 from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import eb from"@heroicons/react/24/outline/PhoneIcon";import tb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import rb from"@heroicons/react/24/solid/PhoneIcon";import ob from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as nb,useState as Fc}from"react";import{useMemo as Y3,useEffect as J3,useState as Bh}from"react";import Z3 from"styled-components";import Eh from"styled-components";import rh from"styled-components";import{jsx as th,jsxs as i3}from"react/jsx-runtime";var As=({label:e,children:t,valueStyles:r})=>i3(o3,{children:[th("div",{children:e}),th(n3,{style:{...r},children:t})]}),o3=rh.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
- `,r3=eh.div`
1971
+ `,n3=rh.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
- `;import Is from"styled-components";import{BigNumber as th}from"@ethersproject/bignumber";import{formatEther as oh}from"@ethersproject/units";var Pi=(e,t)=>{let o=(t*parseFloat(oh(e))).toFixed(2);return o!=="0.00"?`$${o}`:"<$0.01"},uo=(e,t,o=6,r=!1)=>{let i=parseFloat(oh(e)).toFixed(o).replace(/0+$/,"").replace(/\.$/,"");return r?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},wc=e=>e.map(Ke).reduce((t,o)=>t.add(o),th.from(0)).toHexString(),rh=(e,t)=>{let{chains:o}=I(),r=`https://etherscan.io/address/${t}`,n=`${qd(e,o)}/address/${t}`;if(!n)return r;try{new URL(n)}catch{return r}return n},Ke=e=>th.from(e);import{Fragment as l3,jsx as Rs,jsxs as nh}from"react/jsx-runtime";var ih=({weiQuantities:e,tokenPrice:t,tokenSymbol:o})=>{let r=wc(e),n=t?Pi(r,t):void 0,i=uo(r,o);return Rs(ah,{children:n||i})},Cc=({weiQuantities:e,tokenPrice:t,tokenSymbol:o})=>{let r=wc(e),n=t?Pi(r,t):void 0,i=uo(r,o);return Rs(ah,{children:n?nh(l3,{children:[Rs(i3,{children:"USD"}),n==="<$0.01"?nh(s3,{children:[Rs(a3,{children:"<"}),"$0.01"]}):n]}):i})},ah=Is.span`
1980
+ `;import Rs from"styled-components";import{BigNumber as oh}from"@ethersproject/bignumber";import{formatEther as nh}from"@ethersproject/units";var Pi=(e,t)=>{let r=(t*parseFloat(nh(e))).toFixed(2);return r!=="0.00"?`$${r}`:"<$0.01"},mr=(e,t,r=6,o=!1)=>{let i=parseFloat(nh(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},Pc=e=>e.map(je).reduce((t,r)=>t.add(r),oh.from(0)).toHexString(),ih=(e,t)=>{let{chains:r}=M(),o=`https://etherscan.io/address/${t}`,n=`${Yd(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n},je=e=>oh.from(e);import{Fragment as c3,jsx as ks,jsxs as ah}from"react/jsx-runtime";var sh=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Pc(e),n=t?Pi(o,t):void 0,i=mr(o,r);return ks(lh,{children:n||i})},Tc=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Pc(e),n=t?Pi(o,t):void 0,i=mr(o,r);return ks(lh,{children:n?ah(c3,{children:[ks(a3,{children:"USD"}),n==="<$0.01"?ah(l3,{children:[ks(s3,{children:"<"}),"$0.01"]}):n]}):i})},lh=Rs.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
- `,i3=Is.span`
1986
+ `,a3=Rs.span`
1987
1987
  font-size: 12px;
1988
1988
  line-height: 12px;
1989
1989
  color: var(--privy-color-foreground-3);
1990
- `,a3=Is.span`
1990
+ `,s3=Rs.span`
1991
1991
  font-size: 10px;
1992
- `,s3=Is.span`
1992
+ `,l3=Rs.span`
1993
1993
  display: flex;
1994
1994
  align-items: center;
1995
- `;import bc from"styled-components";import{jsx as Xo,jsxs as Ms}from"react/jsx-runtime";var sh=({gas:e,tokenPrice:t,tokenSymbol:o})=>Ms(kl,{style:{paddingBottom:"12px"},children:[Ms(ch,{children:[Xo(ph,{children:"Est. Fees"}),Xo("div",{children:Xo(Cc,{weiQuantities:[e],tokenPrice:t,tokenSymbol:o})})]}),t&&Xo(dh,{children:`${uo(e,o)}`})]}),lh=({transactionData:e,gas:t,tokenPrice:o,tokenSymbol:r})=>{let n=Ke(e.value||0).add(Ke(t)).toHexString();return Ms(kl,{children:[Ms(ch,{children:[Xo(ph,{children:"Total (including fees)"}),Xo("div",{children:Xo(Cc,{weiQuantities:[e.value||0,t],tokenPrice:o,tokenSymbol:r})})]}),o&&Xo(dh,{children:uo(n,r)})]})},ch=bc.div`
1995
+ `;import xc from"styled-components";import{jsx as ro,jsxs as Is}from"react/jsx-runtime";var ch=({gas:e,tokenPrice:t,tokenSymbol:r})=>Is(Wl,{style:{paddingBottom:"12px"},children:[Is(ph,{children:[ro(mh,{children:"Est. Fees"}),ro("div",{children:ro(Tc,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&ro(uh,{children:`${mr(e,r)}`})]}),dh=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=je(e.value||0).add(je(t)).toHexString();return Is(Wl,{children:[Is(ph,{children:[ro(mh,{children:"Total (including fees)"}),ro("div",{children:ro(Tc,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&ro(uh,{children:mr(n,o)})]})},ph=xc.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
- `,dh=bc.div`
2001
+ `,uh=xc.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
- `,ph=bc.div`
2010
+ `,mh=xc.div`
2011
2011
  font-size: 14px;
2012
2012
  line-height: 22.4px;
2013
2013
  font-weight: 400;
2014
- `;import c3 from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as xr,useState as d3}from"react";import er from"styled-components";import{createContext as uh,useContext as _N}from"react";var En=uh(void 0);var Ti=uh(void 0);import{Fragment as v3,jsx as Yt,jsxs as mh}from"react/jsx-runtime";var fh=({defaultValue:e,children:t})=>{let[o,r]=d3(e||null),n=i=>{r(o===i?null:i)};return Yt(En.Provider,{value:{activePanel:o,togglePanel:n},children:Yt(p3,{children:t})})},hh=({value:e,children:t})=>{let{activePanel:o,togglePanel:r}=xr(En),n=o===e;return Yt(Ti.Provider,{value:{onToggle:()=>r(e),value:e},children:Yt(h3,{isActive:n,"data-open":n,children:t})})},yh=({children:e})=>{let{activePanel:t}=xr(En),{onToggle:o,value:r}=xr(Ti),n=t===r;return mh(v3,{children:[mh(u3,{onClick:o,"data-open":n,children:[Yt(f3,{children:e}),Yt(g3,{isactive:n,children:Yt(c3,{height:"16px",width:"16px",strokeWidth:"2"})})]}),Yt(m3,{})]})},gh=({children:e})=>{let{activePanel:t}=xr(En),{value:o}=xr(Ti);return Yt(y3,{"data-open":t===o,children:Yt(wh,{children:e})})},vh=({children:e})=>{let{activePanel:t}=xr(En),{value:o}=xr(Ti);return Yt(wh,{children:typeof e=="function"?e({isActive:t===o}):e})},p3=er.div`
2014
+ `;import d3 from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as Ao,useState as p3}from"react";import oo from"styled-components";import{createContext as fh,useContext as SN}from"react";var Tn=fh(void 0);var Ti=fh(void 0);import{Fragment as w3,jsx as Yt,jsxs as hh}from"react/jsx-runtime";var yh=({defaultValue:e,children:t})=>{let[r,o]=p3(e||null),n=i=>{o(r===i?null:i)};return Yt(Tn.Provider,{value:{activePanel:r,togglePanel:n},children:Yt(u3,{children:t})})},gh=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=Ao(Tn),n=r===e;return Yt(Ti.Provider,{value:{onToggle:()=>o(e),value:e},children:Yt(y3,{isActive:n,"data-open":n,children:t})})},vh=({children:e})=>{let{activePanel:t}=Ao(Tn),{onToggle:r,value:o}=Ao(Ti),n=t===o;return hh(w3,{children:[hh(m3,{onClick:r,"data-open":n,children:[Yt(h3,{children:e}),Yt(v3,{isactive:n,children:Yt(d3,{height:"16px",width:"16px",strokeWidth:"2"})})]}),Yt(f3,{})]})},wh=({children:e})=>{let{activePanel:t}=Ao(Tn),{value:r}=Ao(Ti);return Yt(g3,{"data-open":t===r,children:Yt(bh,{children:e})})},Ch=({children:e})=>{let{activePanel:t}=Ao(Tn),{value:r}=Ao(Ti);return Yt(bh,{children:typeof e=="function"?e({isActive:t===r}):e})},u3=oo.div`
2015
2015
  display: flex;
2016
2016
  flex-direction: column;
2017
2017
  width: 100%;
2018
2018
  gap: 8px;
2019
- `,u3=er.div`
2019
+ `,m3=oo.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
- `,m3=er.div`
2026
+ `,f3=oo.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
- `,f3=er.div`
2034
+ `,h3=oo.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
- `,h3=er.div`
2040
+ `,y3=oo.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
- `,y3=er.div`
2052
+ `,g3=oo.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
- `,wh=er.div`
2064
+ `,bh=oo.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
- `,g3=er.div`
2070
+ `,v3=oo.div`
2071
2071
  transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2072
- `;import w3 from"styled-components";import{jsx as b3}from"react/jsx-runtime";var Ec=({walletAddress:e,chainId:t=wo})=>b3(C3,{href:rh(t,e),target:"_blank",children:Lo(e)}),C3=w3.a`
2072
+ `;import C3 from"styled-components";import{jsx as E3}from"react/jsx-runtime";var Sc=({walletAddress:e,chainId:t=br})=>E3(b3,{href:ih(t,e),target:"_blank",children:Dr(e)}),b3=C3.a`
2073
2073
  &:hover {
2074
2074
  text-decoration: underline;
2075
2075
  }
2076
- `;import{jsx as Ct,jsxs as Pc}from"react/jsx-runtime";var Pn=({from:e,to:t,txn:o,transactionInfo:r,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=o?.value||0;return Ct(fh,{children:Pc(hh,{value:"details",children:[Ct(yh,{children:Pc(E3,{children:[Ct("div",{children:r?.title||r?.actionDescription||"Details"}),Ct(P3,{children:Ct(ih,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),Pc(gh,{children:[Ct(ks,{label:"From",children:Ct(Ec,{walletAddress:e,chainId:o.chainId||wo})}),Ct(ks,{label:"To",children:Ct(Ec,{walletAddress:t,chainId:o.chainId||wo})}),r&&r.action&&Ct(ks,{label:"Action",children:r.action}),i&&Ct(sh,{transactionData:o,gas:i,tokenPrice:n,tokenSymbol:a})]}),Ct(vh,{children:({isActive:s})=>Ct(lh,{transactionData:o,displayFee:s,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},E3=Ch.div`
2076
+ `;import{jsx as Et,jsxs as _c}from"react/jsx-runtime";var xn=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0;return Et(yh,{children:_c(gh,{value:"details",children:[Et(vh,{children:_c(P3,{children:[Et("div",{children:o?.title||o?.actionDescription||"Details"}),Et(T3,{children:Et(sh,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),_c(wh,{children:[Et(As,{label:"From",children:Et(Sc,{walletAddress:e,chainId:r.chainId||br})}),Et(As,{label:"To",children:Et(Sc,{walletAddress:t,chainId:r.chainId||br})}),o&&o.action&&Et(As,{label:"Action",children:o.action}),i&&Et(ch,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),Et(Ch,{children:({isActive:s})=>Et(dh,{transactionData:r,displayFee:s,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},P3=Eh.div`
2077
2077
  display: flex;
2078
2078
  flex-direction: row;
2079
2079
  justify-content: space-between;
2080
- `,P3=Ch.div`
2080
+ `,T3=Eh.div`
2081
2081
  flex-shrink: 0;
2082
2082
  padding-left: 8px;
2083
- `;import Si from"styled-components";import{jsx as xi,jsxs as k3}from"react/jsx-runtime";var Tc=({description:e,contractInfo:t})=>k3(T3,{children:[t.imgUrl&&xi(x3,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&xi(S3,{children:xi("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&xi(_3,{children:t.name}),xi(A3,{children:e||t.actionText})]}),T3=Si.div`
2083
+ `;import Si from"styled-components";import{jsx as xi,jsxs as R3}from"react/jsx-runtime";var Ac=({description:e,contractInfo:t})=>R3(x3,{children:[t.imgUrl&&xi(S3,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&xi(_3,{children:xi("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&xi(A3,{children:t.name}),xi(k3,{children:e||t.actionText})]}),x3=Si.div`
2084
2084
  display: flex;
2085
2085
  flex-direction: column;
2086
2086
  align-items: center;
2087
2087
  margin-bottom: 8px;
2088
- `,x3=Si.img`
2088
+ `,S3=Si.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
- `,S3=Si.div`
2095
+ `,_3=Si.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
- `,_3=Si.div`
2108
+ `,A3=Si.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
- `,A3=Si.div`
2116
+ `,k3=Si.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
- `;import R3 from"@heroicons/react/24/outline/WalletIcon";import Sc from"styled-components";import{jsx as bh,jsxs as xc}from"react/jsx-runtime";var Eh=({address:e,txn:t,balance:o,hasFunds:r})=>{let n=!!o,{nativeTokenSymbolForChainId:i}=I(),a=i(t.chainId)||"ETH";return xc(I3,{children:[xc(M3,{children:[bh(R3,{strokeWidth:"2",width:"16px",height:"16px"}),bh("div",{children:Lo(e)})]}),xc(W3,{displayBalanceColor:n,hasFunds:r,children:[o?uo(o,a,6,!0):0," available"]})]})},I3=Sc.div`
2124
+ `;import I3 from"@heroicons/react/24/outline/WalletIcon";import Rc from"styled-components";import{jsx as Ph,jsxs as kc}from"react/jsx-runtime";var Th=({address:e,txn:t,balance:r,hasFunds:o})=>{let n=!!r,{nativeTokenSymbolForChainId:i}=M(),a=i(t.chainId)||"ETH";return kc(M3,{children:[kc(W3,{children:[Ph(I3,{strokeWidth:"2",width:"16px",height:"16px"}),Ph("div",{children:Dr(e)})]}),kc(L3,{displayBalanceColor:n,hasFunds:o,children:[r?mr(r,a,6,!0):0," available"]})]})},M3=Rc.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
- `,M3=Sc.div`
2137
+ `,W3=Rc.div`
2138
2138
  display: flex;
2139
2139
  flex-direction: row;
2140
2140
  align-items: center;
2141
2141
  gap: 8px;
2142
- `,W3=Sc.div`
2142
+ `,L3=Rc.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
- `;import Ws from"styled-components";import{Fragment as Th,jsx as _i,jsxs as xh}from"react/jsx-runtime";var Sh=({description:e,txn:t,tokenSymbol:o,tokenPrice:r})=>{let n=t.value||0,i=r?Pi(n,r):void 0,a=uo(n,o);return xh(L3,{children:[i?xh(Th,{children:[_i(Ph,{children:i}),_i(O3,{children:a})]}):_i(Th,{children:_i(Ph,{children:a})}),_i(N3,{children:e})]})},L3=Ws.div`
2152
+ `;import Ms from"styled-components";import{Fragment as Sh,jsx as _i,jsxs as _h}from"react/jsx-runtime";var Ah=({description:e,txn:t,tokenSymbol:r,tokenPrice:o})=>{let n=t.value||0,i=o?Pi(n,o):void 0,a=mr(n,r);return _h(O3,{children:[i?_h(Sh,{children:[_i(xh,{children:i}),_i(N3,{children:a})]}):_i(Sh,{children:_i(xh,{children:a})}),_i(D3,{children:e})]})},O3=Ms.div`
2153
2153
  display: flex;
2154
2154
  flex-direction: column;
2155
2155
  align-items: center;
2156
2156
  margin-bottom: 20px;
2157
- `,Ph=Ws.h2`
2157
+ `,xh=Ms.h2`
2158
2158
  && {
2159
2159
  font-size: 48px;
2160
2160
  line-height: 48px;
2161
2161
  margin: 8px auto;
2162
2162
  }
2163
- `,O3=Ws.p`
2163
+ `,N3=Ms.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
- `,N3=Ws.div`
2170
+ `,D3=Ms.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
- `;import{VoidSigner as G3}from"@ethersproject/abstract-signer";import{EtherscanProvider as $D}from"@ethersproject/providers";import{BigNumber as Rh}from"@ethersproject/bignumber";import{BigNumber as Tn}from"@ethersproject/bignumber";import{Contract as D3}from"@ethersproject/contracts";import{serialize as U3}from"@ethersproject/transactions";var xn=e=>[pa.id,ua.id,ma.id,ha.id,ya.id,ga.id,va.id,Ca.id,wa.id].includes(e),_h=async(e,t)=>{if(!xn(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=Tn.from(o).mul(Tn.from(126)).div(Tn.from(100)).add(Tn.from(e.maxPriorityFeePerGas));e.maxFeePerGas=Ai(i)}}catch(o){throw new Error(`Failed to set gas price for OP stack transaction: ${o}.`)}return e};async function Ah(e,t){if(!e.chainId||e.chainId&&!xn(e.chainId))return Tn.from(0);let o=Tn.from(0);try{let r=new D3(Md,Wd,t),n=kh(e),i=U3(n);o=await r.getL1Fee(i)}catch{}return o}async function Ih(e,t){try{let r={...e,from:void 0};return(await t.estimateGas(r)).toHexString()}catch{}return(await t.estimateGas(e)).toHexString()}var Mh=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 Sn(e,t){if(!e.gasLimit)throw new we("gasLimit was not successfully set for transaction.");let o=Ke(e.gasLimit),r=Rh.from(0);if(e.type==2)if(e.maxFeePerGas)r=Ke(e.maxFeePerGas);else throw new we("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)r=Ke(e.gasPrice);else throw new we("gasPrice was not successfully set for transaction of type 0 or 1.");let n=o.mul(r),i=Rh.from(0);if(e.chainId&&xn(e.chainId))try{i=await Ah(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}import{BigNumber as _c}from"@ethersproject/bignumber";var Ac=e=>[la.id,ca.id,da.id].includes(e),Wh=async(e,t)=>{if(!Ac(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(_c.from(120)).div(_c.from(100));e.maxFeePerGas=Ai(r),e.maxPriorityFeePerGas=Ai(_c.from(0))}}catch(o){throw new Error(`Failed to set gas price for Arbitrum transaction: ${o}.`)}return e};var kc=e=>[56,97].includes(e),Lh=async(e,t)=>{if(!kc(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};import{parseUnits as Oh}from"@ethersproject/units";import{ofetch as F3}from"ofetch";var Ic=e=>[Gn.id,Vn.id].includes(e),Rc=e=>({maxPriorityFee:Oh(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:Oh(e.maxFee.toFixed(9),"gwei").toHexString()}),B3=e=>({safeLow:Rc(e.safeLow),standard:Rc(e.standard),fast:Rc(e.fast)}),H3=async e=>{let t="";switch(e){case Gn.id:t="https://gasstation.polygon.technology/v2";break;case Vn.id:t="https://gasstation-testnet.polygon.technology/v2";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return B3(await F3(t))};async function Nh(e){if(!Ic(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 H3(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 Ai(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 kh(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=Ke(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=Ke(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=Ke(e.gasPrice)),e.value!==void 0&&(t.value=Ke(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=Ke(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=Ke(e.maxPriorityFeePerGas)),t}async function _n(e,t,o){if(t.chainId=Number(t.chainId),Dh(t),!t.nonce){let r=new G3(e,o);t.nonce=await r.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await Ih(t,o)),t.from||(t.from=e),Ic(t.chainId)?t=await Nh(t):Ac(t.chainId)?t=await Wh(t,o):xn(t.chainId)?t=await _h(t,o):kc(t.chainId)?t=await Lh(t,o):t=await Mh(t,o),t}async function Ls(e,t,o,r,n){r=Object.assign({chainId:wo},r),Dh(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 Os(e,t,o,r){let n=await r.getBalance(e),i=t.value||0,l=!n.sub(Ke(i)).sub(o).isNegative();return{balance:n,hasSufficientFunds:l}}function Dh(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let o of t){let r=e[o];if(!(typeof r>"u")&&!V3(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 V3(e){let t=typeof e=="number",o=typeof e=="bigint",r=typeof e=="string"&&z3(e);return t||o||r}function z3(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Ns(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}}import{useState as Mc,useEffect as $3}from"react";var Ds=e=>{let{showFiatPrices:t,getUsdTokenPrice:o,chains:r}=I(),[n,i]=Mc(!0),[a,l]=Mc(void 0),[s,c]=Mc(void 0);return $3(()=>{let u=e.chainId||wo,m=r.find(g=>g.id===Number(u));if(!m)throw new J(`Unsupported chain: ${u}`);(async()=>{if(!t){i(!1);return}try{i(!0);let g=await o(m);g?c(g):l(new Error(`Unable to fetch token price on chain id ${m.id}`))}catch(g){l(g)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};import{createContext as q3,useContext as j3}from"react";var Wc=q3(null);function ki(){let e=j3(Wc);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}import{jsx as Fh}from"react/jsx-runtime";var Lc=({pendingTransaction:e})=>{let{getAccessToken:t}=H(),{wallets:o}=ki(),{walletProxy:r,rpcConfig:n,chains:i,nativeTokenSymbolForChainId:a}=I(),[l,s]=Uh(null),[c,u]=Uh(e),{tokenPrice:m}=Ds(c),h=a(e.chainId)||"ETH",g=Y3(()=>o.find(w=>w.walletClientType==="privy"),[o]);return J3(()=>{async function w(){if(!await t()||!r||!g)return c;let T=new K3(Ft(c.chainId,i,n)),C=await _n(g.address,c,T),{totalGasEstimate:_}=await Sn(C,T);return s(_.toHexString()),C}w().then(b=>{u(b)})},[r]),g?Fh(Q3,{children:Fh(Pn,{from:g.address,to:c.to,txn:c,gas:l??void 0,tokenPrice:m,tokenSymbol:h})}):null},Q3=Z3.div`
2177
+ `;import{VoidSigner as V3}from"@ethersproject/abstract-signer";import{EtherscanProvider as zD}from"@ethersproject/providers";import{BigNumber as Mh}from"@ethersproject/bignumber";import{BigNumber as Sn}from"@ethersproject/bignumber";import{Contract as U3}from"@ethersproject/contracts";import{serialize as F3}from"@ethersproject/transactions";var _n=e=>[pa.id,ua.id,ma.id,fa.id,ha.id,ya.id,ga.id,wa.id,va.id].includes(e),kh=async(e,t)=>{if(!_n(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=Sn.from(r).mul(Sn.from(126)).div(Sn.from(100)).add(Sn.from(e.maxPriorityFeePerGas));e.maxFeePerGas=Ai(i)}}catch(r){throw new Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return e};async function Rh(e,t){if(!e.chainId||e.chainId&&!_n(e.chainId))return Sn.from(0);let r=Sn.from(0);try{let o=new U3(Od,Nd,t),n=Ih(e),i=F3(n);r=await o.getL1Fee(i)}catch{}return r}async function Wh(e,t){try{let o={...e,from:void 0};return(await t.estimateGas(o)).toHexString()}catch{}return(await t.estimateGas(e)).toHexString()}var Lh=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 An(e,t){if(!e.gasLimit)throw new ge("gasLimit was not successfully set for transaction.");let r=je(e.gasLimit),o=Mh.from(0);if(e.type==2)if(e.maxFeePerGas)o=je(e.maxFeePerGas);else throw new ge("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)o=je(e.gasPrice);else throw new ge("gasPrice was not successfully set for transaction of type 0 or 1.");let n=r.mul(o),i=Mh.from(0);if(e.chainId&&_n(e.chainId))try{i=await Rh(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}import{BigNumber as Ic}from"@ethersproject/bignumber";var Mc=e=>[la.id,ca.id,da.id].includes(e),Oh=async(e,t)=>{if(!Mc(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(Ic.from(120)).div(Ic.from(100));e.maxFeePerGas=Ai(o),e.maxPriorityFeePerGas=Ai(Ic.from(0))}}catch(r){throw new Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return e};var Wc=e=>[56,97].includes(e),Nh=async(e,t)=>{if(!Wc(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};import{parseUnits as Dh}from"@ethersproject/units";import{ofetch as B3}from"ofetch";var Oc=e=>[Gn.id,Vn.id].includes(e),Lc=e=>({maxPriorityFee:Dh(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:Dh(e.maxFee.toFixed(9),"gwei").toHexString()}),H3=e=>({safeLow:Lc(e.safeLow),standard:Lc(e.standard),fast:Lc(e.fast)}),G3=async e=>{let t="";switch(e){case Gn.id:t="https://gasstation.polygon.technology/v2";break;case Vn.id:t="https://gasstation-testnet.polygon.technology/v2";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return H3(await B3(t))};async function Uh(e){if(!Oc(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 G3(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 Ai(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 Ih(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=je(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=je(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=je(e.gasPrice)),e.value!==void 0&&(t.value=je(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=je(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=je(e.maxPriorityFeePerGas)),t}async function kn(e,t,r){if(t.chainId=Number(t.chainId),Fh(t),!t.nonce){let o=new V3(e,r);t.nonce=await o.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await Wh(t,r)),t.from||(t.from=e),Oc(t.chainId)?t=await Uh(t):Mc(t.chainId)?t=await Oh(t,r):_n(t.chainId)?t=await kh(t,r):Wc(t.chainId)?t=await Nh(t,r):t=await Lh(t,r),t}async function Ws(e,t,r,o,n){o=Object.assign({chainId:br},o),Fh(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 Ls(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(je(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function Fh(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!z3(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 z3(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&$3(e);return t||r||o}function $3(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Os(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}}import{useState as Nc,useEffect as q3}from"react";var Ns=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=M(),[n,i]=Nc(!0),[a,l]=Nc(void 0),[s,c]=Nc(void 0);return q3(()=>{let u=e.chainId||br,m=o.find(g=>g.id===Number(u));if(!m)throw new Y(`Unsupported chain: ${u}`);(async()=>{if(!t){i(!1);return}try{i(!0);let g=await r(m);g?c(g):l(new Error(`Unable to fetch token price on chain id ${m.id}`))}catch(g){l(g)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};import{createContext as j3,useContext as K3}from"react";var Dc=j3(null);function ki(){let e=K3(Dc);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}import{jsx as Hh}from"react/jsx-runtime";var Uc=({pendingTransaction:e})=>{let{getAccessToken:t}=H(),{wallets:r}=ki(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=M(),[s,c]=Bh(null),[u,m]=Bh(e),{tokenPrice:h}=Ns(u),g=l(e.chainId)||"ETH",w=Y3(()=>r.find(C=>C.walletClientType==="privy"),[r]);return J3(()=>{async function C(){if(!await t()||!o||!w)return u;let E=Er(u.chainId,i,n,{appId:a}),P=await kn(w.address,u,E),{totalGasEstimate:I}=await An(P,E);return c(I.toHexString()),P}C().then(x=>{m(x)})},[o]),w?Hh(Q3,{children:Hh(xn,{from:w.address,to:u.to,txn:u,gas:s??void 0,tokenPrice:h,tokenSymbol:g})}):null},Q3=Z3.div`
2178
2178
  width: 100%;
2179
2179
  padding: 1rem 0;
2180
- `;import{Fragment as Nc,jsx as oe,jsxs as mo}from"react/jsx-runtime";var Dc=({open:e,onClose:t})=>{let{user:o}=H(),[r,n]=Oc(null),{init:i,cancel:a}=bn();nb(()=>{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?oe(ib,{selectedMethod:r,onClose:s,onBack:o.mfaMethods.length>1?()=>n(null):void 0}):mo(Nc,{children:[oe(A,{onClose:s},"header"),oe($e,{children:oe(ot,{children:oe(rb,{})})}),oe(be,{children:"Verify your identity"}),oe(ye,{children:"Choose a verification method"}),mo(Wa,{children:[o.mfaMethods.includes("totp")&&mo(Ce,{onClick:()=>l("totp"),children:[oe(X3,{}),"Authenticator App"]},"totp"),o.mfaMethods.includes("sms")&&mo(Ce,{onClick:()=>l("sms"),children:[oe(eb,{}),"SMS"]},"sms")]}),oe(te,{})]})},ib=({selectedMethod:e,onClose:t,onBack:o})=>{let{app:r}=S(),{pendingTransaction:n}=I(),[i,a]=Oc(!1),[l,s]=Oc(!1),{submit:c}=bn();async function u(m){try{if(!m)return;await c(e,m),s(!0),a(!1),t()}catch(h){throw Hl(h)?(a(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):sn(h)?(a(!1),new Error("The code you entered is not valid")):an(h)?(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 mo(Nc,{children:[oe(A,{onClose:t},"header"),oe($e,{children:oe(ot,{children:oe(ob,{})})}),oe(be,{children:"Enter verification code"}),mo(Bo,{children:[oe(Cn,{success:l,disabled:i,onChange:u}),mo(ye,{children:["To continue, please enter the 6-digit code sent to your ",oe("strong",{children:"mobile device"})]}),n&&oe(Lc,{pendingTransaction:n})]}),o&&oe(Sl,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),oe(Gt,{onClick:t,children:"Not now"}),oe(te,{})]});case"totp":return mo(Nc,{children:[oe(A,{onClose:t},"header"),oe($e,{children:oe(ot,{children:oe(tb,{})})}),oe(be,{children:"Enter verification code"}),mo(Bo,{children:[oe(Cn,{success:l,disabled:i,onChange:u}),mo(ye,{children:["To continue, please enter the 6-digit code generated from your"," ",oe("strong",{children:"authenticator app"})]}),n&&oe(Lc,{pendingTransaction:n})]}),o&&oe(Sl,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),oe(Gt,{onClick:t,children:"Not now"}),oe(te,{})]});default:return null}};import{useEffect as Bh,useState as Hh}from"react";import Vh from"styled-components";import{Fragment as lb,jsx as fo,jsxs as Us}from"react/jsx-runtime";var Gh={google:{name:"Google",component:vs},discord:{name:"Discord",component:hs},github:{name:"Github",component:ys},linkedin:{name:"LinkedIn",component:Cs},twitter:{name:"Twitter",component:Ps},spotify:{name:"Spotify",component:bs},tiktok:{name:"Tiktok",component:Es},apple:{name:"Apple",component:fs}},zh=()=>{let{ready:e,user:t,authenticated:o}=H(),{app:r,setModalData:n,navigate:i,resetNavigation:a}=S(),{getAuthMeta:l,initLoginWithOAuth:s,loginWithOAuth:c,updateWallets:u,setReadyToTrue:m,closePrivyModal:h}=I(),[g,w]=Hh(!1),[b,T]=Hh(void 0),C=l()?.provider||"google",_=Gh[C].name,M=Gh[C].component,R=r?.render.inDialog?et:0;Bh(()=>{c(C).then(()=>{w(!0)}).catch(U=>{if(U?.privyErrorCode==="allowlist_rejected"){T(void 0),a(),i("ALLOWLIST_REJECTION_SCREEN");return}let{retryable:z,detail:k}=Dd(U,C);T({retryable:z,detail:k,message:"Authentication failed"})}).finally(()=>{Hn(),m()})},[_,C]),Bh(()=>{if(e&&o&&g&&t){if(r?.legal.requireUsersAcceptTerms&&!t.hasAcceptedTerms){let z=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(z)}if(Et(t,r?.embeddedWallets?.createOnLogin)){let z=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:k=>console.error(k),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},R);return()=>clearTimeout(z)}else{let z=setTimeout(()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R);return u(),()=>clearTimeout(z)}}},[e,o,g,t]);let x=g?`Successfully connected with ${_}`:b?b.message:`Verifying connection to ${_}`,F="";return g?F="You\u2019re good to go!":b?F=b.detail:F="Just a few moments more",Us(lb,{children:[fo(A,{}),fo(Z,{}),Us(ab,{children:[fo(sb,{children:Us("div",{children:[fo(Uo,{success:g,fail:!!b}),fo(M,{style:{width:"38px",height:"38px"}})]})}),Us(It,{children:[fo("h3",{children:x}),fo("p",{children:F})]}),b&&b?.retryable?fo(ka,{onClick:()=>{Hn(),s(C),T(void 0)},disabled:!g&&!b?.retryable,children:"Retry"}):null]}),fo(Q,{}),fo(te,{})]})},ab=Vh.div`
2180
+ `;import{Fragment as Bc,jsx as re,jsxs as fr}from"react/jsx-runtime";var Hc=({open:e,onClose:t})=>{let{user:r}=H(),[o,n]=Fc(null),{init:i,cancel:a}=Pn();nb(()=>{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?re(ib,{selectedMethod:o,onClose:s,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):fr(Bc,{children:[re(A,{onClose:s},"header"),re(ze,{children:re(rt,{children:re(ob,{})})}),re(we,{children:"Verify your identity"}),re(fe,{children:"Choose a verification method"}),fr(Ma,{children:[r.mfaMethods.includes("totp")&&fr(ve,{onClick:()=>l("totp"),children:[re(X3,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&fr(ve,{onClick:()=>l("sms"),children:[re(eb,{}),"SMS"]},"sms")]}),re(ee,{})]})},ib=({selectedMethod:e,onClose:t,onBack:r})=>{let{app:o}=_(),{pendingTransaction:n}=M(),[i,a]=Fc(!1),[l,s]=Fc(!1),{submit:c}=Pn();async function u(m){try{if(!m)return;await c(e,m),s(!0),a(!1),t()}catch(h){throw $l(h)?(a(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):cn(h)?(a(!1),new Error("The code you entered is not valid")):ln(h)?(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 fr(Bc,{children:[re(A,{onClose:t},"header"),re(ze,{children:re(rt,{children:re(rb,{})})}),re(we,{children:"Enter verification code"}),fr(Vr,{children:[re(En,{success:l,disabled:i,onChange:u}),fr(fe,{children:["To continue, please enter the 6-digit code sent to your ",re("strong",{children:"mobile device"})]}),n&&re(Uc,{pendingTransaction:n})]}),r&&re(Rl,{theme:o?.appearance.palette.colorScheme,onClick:r,children:"Choose another method"}),re(Gt,{onClick:t,children:"Not now"}),re(ee,{})]});case"totp":return fr(Bc,{children:[re(A,{onClose:t},"header"),re(ze,{children:re(rt,{children:re(tb,{})})}),re(we,{children:"Enter verification code"}),fr(Vr,{children:[re(En,{success:l,disabled:i,onChange:u}),fr(fe,{children:["To continue, please enter the 6-digit code generated from your"," ",re("strong",{children:"authenticator app"})]}),n&&re(Uc,{pendingTransaction:n})]}),r&&re(Rl,{theme:o?.appearance.palette.colorScheme,onClick:r,children:"Choose another method"}),re(Gt,{onClick:t,children:"Not now"}),re(ee,{})]});default:return null}};import{useEffect as Gh,useState as Vh}from"react";import $h from"styled-components";import{Fragment as lb,jsx as hr,jsxs as Ds}from"react/jsx-runtime";var zh={google:{name:"Google",component:gs},discord:{name:"Discord",component:fs},github:{name:"Github",component:hs},linkedin:{name:"LinkedIn",component:ws},twitter:{name:"Twitter",component:Es},spotify:{name:"Spotify",component:Cs},tiktok:{name:"Tiktok",component:bs},apple:{name:"Apple",component:ms}},qh=()=>{let{ready:e,user:t,authenticated:r}=H(),{app:o,setModalData:n,navigate:i,resetNavigation:a}=_(),{getAuthMeta:l,initLoginWithOAuth:s,loginWithOAuth:c,updateWallets:u,setReadyToTrue:m,closePrivyModal:h}=M(),[g,w]=Vh(!1),[C,x]=Vh(void 0),E=l()?.provider||"google",P=zh[E].name,I=zh[E].component,R=o?.render.inDialog?et:0;Gh(()=>{c(E).then(()=>{w(!0)}).catch(F=>{if(F?.privyErrorCode==="allowlist_rejected"){x(void 0),a(),i("ALLOWLIST_REJECTION_SCREEN");return}let{retryable:z,detail:k}=Bd(F,E);x({retryable:z,detail:k,message:"Authentication failed"})}).finally(()=>{Hn(),m()})},[P,E]),Gh(()=>{if(e&&r&&g&&t){if(o?.legal.requireUsersAcceptTerms&&!t.hasAcceptedTerms){let z=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(z)}if(Tt(t,o?.embeddedWallets?.createOnLogin)){let z=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:k=>console.error(k),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},R);return()=>clearTimeout(z)}else{let z=setTimeout(()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R);return u(),()=>clearTimeout(z)}}},[e,r,g,t]);let S=g?`Successfully connected with ${P}`:C?C.message:`Verifying connection to ${P}`,U="";return g?U="You\u2019re good to go!":C?U=C.detail:U="Just a few moments more",Ds(lb,{children:[hr(A,{}),hr(Z,{}),Ds(ab,{children:[hr(sb,{children:Ds("div",{children:[hr(Hr,{success:g,fail:!!C}),hr(I,{style:{width:"38px",height:"38px"}})]})}),Ds(Wt,{children:[hr("h3",{children:S}),hr("p",{children:U})]}),C&&C?.retryable?hr(Aa,{onClick:()=>{Hn(),s(E),x(void 0)},disabled:!g&&!C?.retryable,children:"Retry"}):null]}),hr(Q,{}),hr(ee,{})]})},ab=$h.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
- `,sb=Vh.div`
2188
+ `,sb=$h.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
- `;import{useEffect as db,useState as qh}from"react";import pb from"styled-components";import{isMobile as cb}from"react-device-detect";var $h=(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(!Wo()&&cb)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`};import{Fragment as mb,jsx as _o,jsxs as jh}from"react/jsx-runtime";var Kh=()=>{let{forkSession:e,ready:t,authenticated:o}=H(),[r,n]=qh(""),[i,a]=qh(!1);db(()=>{t&&o&&e().then(n)},[t,o]);let l=$h(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."),jh(mb,{children:[_o(A,{},"header"),_o(Z,{}),_o(so,{title:s.title,description:s.description}),jh(kt,{children:[_o(ub,{children:_o(oo,{style:{width:"72px",height:"72px"}})}),_o(Aa,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?_o("p",{children:s.footnote}):null]}),_o(Q,{}),_o(V,{protectedByPrivy:!0})]})},ub=pb(Rt)`
2211
+ `;import{useEffect as db,useState as Kh}from"react";import pb from"styled-components";import{isMobile as cb}from"react-device-detect";var jh=(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(!Nr()&&cb)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as mb,jsx as Rr,jsxs as Yh}from"react/jsx-runtime";var Jh=()=>{let{forkSession:e,ready:t,authenticated:r}=H(),[o,n]=Kh(""),[i,a]=Kh(!1);db(()=>{t&&r&&e().then(n)},[t,r]);let l=jh(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."),Yh(mb,{children:[Rr(A,{},"header"),Rr(Z,{}),Rr(cr,{title:s.title,description:s.description}),Yh(It,{children:[Rr(ub,{children:Rr(nr,{style:{width:"72px",height:"72px"}})}),Rr(_a,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?Rr("p",{children:s.footnote}):null]}),Rr(Q,{}),Rr(V,{protectedByPrivy:!0})]})},ub=pb(Mt)`
2212
2212
  margin: 16px auto;
2213
- `;import{BigNumber as Zh}from"@ethersproject/bignumber";import{StaticJsonRpcProvider as wb}from"@ethersproject/providers";import{useMemo as Qh,useEffect as Xh,useState as Lt}from"react";import kn from"styled-components";function Yh(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}import{BigNumber as Uc}from"@ethersproject/bignumber";import fb from"styled-components";import{Fragment as gb,jsx as Ri,jsxs as vb}from"react/jsx-runtime";var hb=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let o=Uc.from(e.gasUsed),r=Uc.from(e.effectiveGasPrice),n=o.mul(r);if(t){let i=Uc.from(t);n=n.add(i)}return n.toString()}catch{return}else return},Jh=({txn:e,receipt:t,transactionInfo:o,onClose:r,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a})=>vb(gb,{children:[Ri(A,{onClose:r}),Ri(Jn,{title:"Transaction complete!",description:"You're all set."}),Ri(Pn,{tokenPrice:n,from:t.from,to:t.to,gas:hb(t,a),txn:e,transactionInfo:o,tokenSymbol:i}),Ri(yb,{loading:!1,onClick:r,children:"All Done"}),Ri(te,{})]}),yb=fb(D)`
2213
+ `;import{BigNumber as Xh}from"@ethersproject/bignumber";import{useMemo as ey,useEffect as ty,useState as Nt}from"react";import In from"styled-components";function Zh(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}import{BigNumber as Gc}from"@ethersproject/bignumber";import fb from"styled-components";import{Fragment as gb,jsx as Ri,jsxs as vb}from"react/jsx-runtime";var hb=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Gc.from(e.gasUsed),o=Gc.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Gc.from(t);n=n.add(i)}return n.toString()}catch{return}else return},Qh=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a})=>vb(gb,{children:[Ri(A,{onClose:o}),Ri(Jn,{title:"Transaction complete!",description:"You're all set."}),Ri(xn,{tokenPrice:n,from:t.from,to:t.to,gas:hb(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),Ri(yb,{loading:!1,onClick:o,children:"All Done"}),Ri(ee,{})]}),yb=fb(D)`
2214
2214
  && {
2215
2215
  margin-top: 24px;
2216
2216
  }
2217
2217
  transition: color 350ms ease, background-color 350ms ease;
2218
- `;import{Fragment as Fc,jsx as Ye,jsxs as An}from"react/jsx-runtime";var Cb=({txn:e,txnFamily:t,uiOptions:o,tokenSymbol:r,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(o.transactionInfo?.contractInfo)return Ye(Tc,{contractInfo:o.transactionInfo.contractInfo,description:o.description});if(o.senderInfo)return Ye(Tc,{contractInfo:o.senderInfo,description:o.description||o.senderInfo.actionText})}return Ye(Fc,{children:Ye(Sh,{description:o.description||o.transactionInfo?.description||"",txn:e,tokenSymbol:r,tokenPrice:n})})},ty=()=>{let{authenticated:e,getAccessToken:t}=H(),{wallets:o}=ki(),{walletProxy:r,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s}=I(),{app:c,navigate:u,data:m,onUserCloseViaDialogOrKeybindRef:h,setModalData:g}=S(),{transactionRequest:w,onSuccess:b,onFailure:T,uiOptions:C,fundWalletConfig:_}=m.sendTransaction,[M,R]=Lt(null),[x,F]=Lt(null),[U,z]=Lt(""),[k,K]=Lt(),[N,q]=Lt(!1),$=()=>{z(""),K(void 0)},ee=(lt,He,Ro)=>{z(lt),K(new we(new Pt(He??lt,Ro??ze.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[ie,j]=Lt(!1),[Ue,st]=Lt(!0),[ut,Fe]=Lt(null),[re,ko]=Lt(w),{tokenPrice:Ot,isTokenPriceLoading:rr}=Ds(re),Be=s(w.chainId)||"ETH",[Se,W]=Lt(null),[le,B]=Lt(null),[Zt,ue]=Lt(!0);Xh(()=>{e||(u("LANDING"),T(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let me=Qh(()=>o.find(lt=>lt.walletClientType==="privy"),[o]),Wn=async()=>{if(!me)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:lt,externalTransactionId:He}=await i(me.address,{config:_?.config||{}});g({fiatOnRampPrompt:{signedUrl:lt},fiatOnRampStatus:{externalTransactionId:He}}),u("FIAT_ON_RAMP_PROMPT_SCREEN")},_r=Qh(()=>new wb(Ft(re.chainId,l,a)),[re.chainId,a]);Xh(()=>{async function lt(){let He=re;if(!await t()||!r||!me)return;try{He=await _n(me.address,re,_r),ko(He)}catch(Io){ee("There was an error preparing your transaction. Please try again.",Io.reason)}let nr=Zh.from(0),ir=Zh.from(0);try{({totalGasEstimate:nr,l1ExecutionFeeEstimate:ir}=await Sn(He,_r)),W(nr.toHexString()),B(ir.toHexString())}catch{W(null)}try{let{balance:Io,hasSufficientFunds:Mi}=await Os(me.address,He,nr,_r);Fe(Io.toHexString()),Mi||(st(!1),ee("Wallet has insufficient funds for this transaction."),c?.fiatOnRamp.enabled&&q(!0))}catch(Io){console.warn(`Failed to fetch wallet balance with error: ${Io}`)}ue(!1)}lt()},[r]);let Ar=Yh(re),kr=Ar==="SEND"?`Send ${Be}`:"Review transaction",Ln={modalTitle:C.header||C.modalTitle||kr,buttonText:C.buttonText||"Submit"},_e=()=>{ie||(x?b(x):T(k||new we(new Pt("The user rejected the request",ze.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return h.current=_e,Ot===void 0&&rr||Zt?An(Fc,{children:[C.transactionInfo?.contractInfo?.imgUrl&&Ye(sa,{src:C.transactionInfo?.contractInfo?.imgUrl}),Ye(A,{title:Ln.modalTitle,onClose:_e}),Ye(ey,{children:Ye(rn,{})})]}):M!==null?Ye(Jh,{txn:re,onClose:_e,receipt:M,transactionInfo:C.transactionInfo,tokenPrice:Ot,tokenSymbol:Be,l1GasEstimate:le}):An(Fc,{children:[Ye(A,{title:Ln.modalTitle,onClose:_e}),An(ey,{children:[An(Tb,{children:[Ye(Cb,{txn:re,txnFamily:Ar,uiOptions:C,tokenSymbol:Be,tokenPrice:Ot}),me?Ye(Pn,{from:me.address,to:re.to,txn:re,transactionInfo:C.transactionInfo,gas:Se||void 0,tokenPrice:Ot,tokenSymbol:Be}):null]}),An(xb,{children:[Ye(bb,{children:U}),Ye(Eh,{txn:re,address:me?.address??"",hasFunds:Ue,balance:ut}),An(Eb,{children:[N&&Ye(D,{onClick:Wn,children:"Add Funds"}),Ye(Pb,{disabled:ie||!Ue,loading:!r||ie,loadingText:ie?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{j(!0);let lt=await t();if(lt&&!ie&&me)try{let He=await Ls(lt,me.address,r,re,_r);F(He);let Ro=await He.wait();R(Ns(Ro)),$()}catch(He){let Ro="There was an error processing your transaction. Please contact support.";console.warn({transaction:re,error:He}),ee(Ro,He.reason)}finally{j(!1)}},children:Ln.buttonText})]})]})]})]})},ey=kn.div`
2218
+ `;import{Fragment as Vc,jsx as Ke,jsxs as Rn}from"react/jsx-runtime";var wb=({txn:e,txnFamily:t,uiOptions:r,tokenSymbol:o,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(r.transactionInfo?.contractInfo)return Ke(Ac,{contractInfo:r.transactionInfo.contractInfo,description:r.description});if(r.senderInfo)return Ke(Ac,{contractInfo:r.senderInfo,description:r.description||r.senderInfo.actionText})}return Ke(Vc,{children:Ke(Ah,{description:r.description||r.transactionInfo?.description||"",txn:e,tokenSymbol:o,tokenPrice:n})})},oy=()=>{let{authenticated:e,getAccessToken:t}=H(),{wallets:r}=ki(),{walletProxy:o,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s,appId:c}=M(),{app:u,navigate:m,data:h,onUserCloseViaDialogOrKeybindRef:g,setModalData:w}=_(),{transactionRequest:C,onSuccess:x,onFailure:E,uiOptions:P,fundWalletConfig:I}=h.sendTransaction,[R,S]=Nt(null),[U,F]=Nt(null),[z,k]=Nt(""),[K,N]=Nt(),[q,$]=Nt(!1),te=()=>{k(""),N(void 0)},se=(ft,Be,Xt)=>{k(ft),N(new ge(new xt(Be??ft,Xt??Ve.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[j,Ue]=Nt(!1),[Ye,ut]=Nt(!0),[Fe,Ae]=Nt(null),[Ee,Mr]=Nt(C),{tokenPrice:Zt,isTokenPriceLoading:mt}=Ns(Ee),Pe=s(C.chainId)||"ETH",[W,ne]=Nt(null),[B,Qt]=Nt(null),[pe,st]=Nt(!0);ty(()=>{e||(m("LANDING"),E(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let lt=ey(()=>r.find(ft=>ft.walletClientType==="privy"),[r]),Vs=async()=>{if(!lt)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:ft,externalTransactionId:Be}=await i(lt.address,{config:I?.config||{}});w({fiatOnRampPrompt:{signedUrl:ft},fiatOnRampStatus:{externalTransactionId:Be}}),m("FIAT_ON_RAMP_PROMPT_SCREEN")},Wr=ey(()=>Er(Ee.chainId,l,a,{appId:c}),[Ee.chainId,a]);ty(()=>{async function ft(){let Be=Ee;if(!await t()||!o||!lt)return;try{Be=await kn(lt.address,Ee,Wr),Mr(Be)}catch(wr){se("There was an error preparing your transaction. Please try again.",wr.reason)}let Lr=Xh.from(0),Mi=Xh.from(0);try{({totalGasEstimate:Lr,l1ExecutionFeeEstimate:Mi}=await An(Be,Wr)),ne(Lr.toHexString()),Qt(Mi.toHexString())}catch{ne(null)}try{let{balance:wr,hasSufficientFunds:$s}=await Ls(lt.address,Be,Lr,Wr);Ae(wr.toHexString()),$s||(ut(!1),se("Wallet has insufficient funds for this transaction."),u?.fiatOnRamp.enabled&&$(!0))}catch(wr){console.warn(`Failed to fetch wallet balance with error: ${wr}`)}st(!1)}ft()},[o]);let ao=Zh(Ee),zs=ao==="SEND"?`Send ${Pe}`:"Review transaction",ke={modalTitle:P.header||P.modalTitle||zs,buttonText:P.buttonText||"Submit"},so=()=>{j||(U?x(U):E(K||new ge(new xt("The user rejected the request",Ve.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return g.current=so,Zt===void 0&&mt||pe?Rn(Vc,{children:[P.transactionInfo?.contractInfo?.imgUrl&&Ke(sa,{src:P.transactionInfo?.contractInfo?.imgUrl}),Ke(A,{title:ke.modalTitle,onClose:so}),Ke(ry,{children:Ke(an,{})})]}):R!==null?Ke(Qh,{txn:Ee,onClose:so,receipt:R,transactionInfo:P.transactionInfo,tokenPrice:Zt,tokenSymbol:Pe,l1GasEstimate:B}):Rn(Vc,{children:[Ke(A,{title:ke.modalTitle,onClose:so}),Rn(ry,{children:[Rn(Pb,{children:[Ke(wb,{txn:Ee,txnFamily:ao,uiOptions:P,tokenSymbol:Pe,tokenPrice:Zt}),lt?Ke(xn,{from:lt.address,to:Ee.to,txn:Ee,transactionInfo:P.transactionInfo,gas:W||void 0,tokenPrice:Zt,tokenSymbol:Pe}):null]}),Rn(Tb,{children:[Ke(Cb,{children:z}),Ke(Th,{txn:Ee,address:lt?.address??"",hasFunds:Ye,balance:Fe}),Rn(bb,{children:[q&&Ke(D,{onClick:Vs,children:"Add Funds"}),Ke(Eb,{disabled:j||!Ye,loading:!o||j,loadingText:j?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{Ue(!0);let ft=await t();if(ft&&!j&&lt)try{let Be=await Ws(ft,lt.address,o,Ee,Wr);F(Be);let Xt=await Be.wait();S(Os(Xt)),te()}catch(Be){let Xt="There was an error processing your transaction. Please contact support.";console.warn({transaction:Ee,error:Be}),se(Xt,Be.reason)}finally{Ue(!1)}},children:ke.buttonText})]})]})]})]})},ry=In.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
- `,bb=kn.div`
2224
+ `,Cb=In.div`
2225
2225
  font-size: 13px;
2226
2226
  color: var(--privy-color-error);
2227
2227
  width: 100%;
2228
2228
  margin-top: 16px;
2229
- `,Eb=kn.div`
2229
+ `,bb=In.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
- `,Pb=kn(D)`
2235
+ `,Eb=In(D)`
2236
2236
  transition: color 350ms ease, background-color 350ms ease;
2237
- `,Tb=kn.div`
2237
+ `,Pb=In.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
- `,xb=kn.div`
2243
+ `,Tb=In.div`
2244
2244
  display: flex;
2245
2245
  flex-direction: column;
2246
2246
  gap: 8px;
2247
- `;import{isHexString as Sb}from"@ethersproject/bytes";import{toUtf8String as _b}from"@ethersproject/strings";import{useEffect as oy,useState as Fs}from"react";import tr,{css as Ab}from"styled-components";import{Fragment as iy,jsx as Ae,jsxs as Rn}from"react/jsx-runtime";var kb=e=>{if(!Sb(e))return e;try{return _b(e)}catch{return e}},Rb=e=>JSON.stringify(e,null,2),Ib=({data:e})=>{let t=o=>typeof o=="object"&&o!==null?Ae(Nb,{children:Object.entries(o).map(([r,n])=>Rn("li",{children:[Rn("strong",{children:[r,":"]})," ",t(n)]},r))}):Ae("span",{children:String(o)});return Ae("div",{children:t(e)})},Mb=e=>{let{types:t,primaryType:o,...r}=e.typedData;return Rn(iy,{children:[Ae(ny,{children:Ae(Ib,{data:r})}),Ae(fn,{text:Rb(e.typedData),itemName:"full payload to clipboard"})," "]})},ry=()=>{let{authenticated:e}=H(),{initializeWalletProxy:t,closePrivyModal:o}=I(),{navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=S(),[a,l]=Fs(!0),[s,c]=Fs(""),[u,m]=Fs(),[h,g]=Fs(null),w=h!==null;oy(()=>{e||r("LANDING")},[e]),oy(()=>{t(Lr).then(U=>{l(!1),U||(c("An error has occurred, please try again."),m(new we(new Pt(s,ze.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:b,data:T,confirmAndSign:C,onSuccess:_,onFailure:M,uiOptions:R}=n.signMessage,x={title:R.title||"Sign message",description:R.description||"Signing this message will not cost you any fees.",buttonText:R.buttonText||"Sign and continue"},F=U=>{U?_(U):M(u||new we(new Pt("The user rejected the request.",ze.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1}),g(null),c(""),m(void 0)};return i.current=()=>{F(h)},Rn(iy,{children:[Ae(A,{onClose:()=>F(h)}),Ae(Z,{}),Rn(Wb,{children:[Ae(Lb,{children:x.title}),Ae(Ob,{children:x.description}),b==="personal_sign"&&Ae(ny,{children:kb(T)}),b==="eth_signTypedData_v4"&&Ae(Mb,{typedData:T}),Ae(Db,{fail:!0,children:s}),Ae(Fb,{success:w,loading:a,disabled:w,onClick:async()=>{try{let U=await C();g(U),c(""),setTimeout(()=>{F(U)},et)}catch{c("An error has occurred, please try again."),m(new we(new Pt(s,ze.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:w?Rn(Ub,{children:[Ae(es,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",Ae("span",{children:"Success"})]}):x.buttonText})]}),Ae(Q,{}),Ae(V,{protectedByPrivy:!0})]})},Wb=tr.div`
2247
+ `;import{isHexString as xb}from"@ethersproject/bytes";import{toUtf8String as Sb}from"@ethersproject/strings";import{useEffect as ny,useState as Us}from"react";import no,{css as _b}from"styled-components";import{Fragment as sy,jsx as Se,jsxs as Mn}from"react/jsx-runtime";var Ab=e=>{if(!xb(e))return e;try{return Sb(e)}catch{return e}},kb=e=>JSON.stringify(e,null,2),Rb=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?Se(Ob,{children:Object.entries(r).map(([o,n])=>Mn("li",{children:[Mn("strong",{children:[o,":"]})," ",t(n)]},o))}):Se("span",{children:String(r)});return Se("div",{children:t(e)})},Ib=e=>{let{types:t,primaryType:r,...o}=e.typedData;return Mn(sy,{children:[Se(ay,{children:Se(Rb,{data:o})}),Se(yn,{text:kb(e.typedData),itemName:"full payload to clipboard"})," "]})},iy=()=>{let{authenticated:e}=H(),{initializeWalletProxy:t,closePrivyModal:r}=M(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=_(),[a,l]=Us(!0),[s,c]=Us(""),[u,m]=Us(),[h,g]=Us(null),w=h!==null;ny(()=>{e||o("LANDING")},[e]),ny(()=>{t(Lo).then(F=>{l(!1),F||(c("An error has occurred, please try again."),m(new ge(new xt(s,Ve.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:C,data:x,confirmAndSign:E,onSuccess:P,onFailure:I,uiOptions:R}=n.signMessage,S={title:R.title||"Sign message",description:R.description||"Signing this message will not cost you any fees.",buttonText:R.buttonText||"Sign and continue"},U=F=>{F?P(F):I(u||new ge(new xt("The user rejected the request.",Ve.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),g(null),c(""),m(void 0)};return i.current=()=>{U(h)},Mn(sy,{children:[Se(A,{onClose:()=>U(h)}),Se(Z,{}),Mn(Mb,{children:[Se(Wb,{children:S.title}),Se(Lb,{children:S.description}),C==="personal_sign"&&Se(ay,{children:Ab(x)}),C==="eth_signTypedData_v4"&&Se(Ib,{typedData:x}),Se(Nb,{fail:!0,children:s}),Se(Ub,{success:w,loading:a,disabled:w,onClick:async()=>{try{let F=await E();g(F),c(""),setTimeout(()=>{U(F)},et)}catch{c("An error has occurred, please try again."),m(new ge(new xt(s,Ve.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:w?Mn(Db,{children:[Se(Xa,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",Se("span",{children:"Success"})]}):S.buttonText})]}),Se(Q,{}),Se(V,{protectedByPrivy:!0})]})},Mb=no.div`
2248
2248
  display: flex;
2249
2249
  flex-direction: column;
2250
2250
  align-items: center;
2251
2251
  justify-content: center;
2252
- `,Lb=tr.span`
2252
+ `,Wb=no.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
- `,Ob=tr.span`
2259
+ `,Lb=no.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
- `,ny=tr.div`
2269
+ `,ay=no.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
- `,Nb=tr.ul`
2288
+ `,Ob=no.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
- `,Db=tr.div`
2300
+ `,Nb=no.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
- `,Ub=tr.span`
2310
+ `,Db=no.span`
2311
2311
  display: flex;
2312
2312
  align-items: center;
2313
2313
  gap: 8px;
2314
- `,Fb=tr(D)`
2314
+ `,Ub=no(D)`
2315
2315
  transition: color 350ms ease, background-color 350ms ease;
2316
2316
 
2317
- ${e=>e.success&&Ab`
2317
+ ${e=>e.success&&_b`
2318
2318
  &&&& {
2319
2319
  background-color: var(--privy-color-success);
2320
2320
  color: #ffffff;
2321
2321
  }
2322
2322
  `}
2323
- `;import $b from"@heroicons/react/24/outline/EnvelopeIcon";import Bb from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as Hb,useState as ay}from"react";import ly from"styled-components";import{Fragment as zb,jsx as Ii,jsxs as sy}from"react/jsx-runtime";var cy=Hb((e,t)=>{let[o,r]=ay(""),[n,i]=ay(!1),{authenticated:a,user:l}=H(),{initUpdateEmail:s}=I(),{navigate:c,setModalData:u,currentScreen:m}=S(),{enabled:h,token:g}=ce(),w=Ki(o),b=n,T=n||!w,C=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,o,M),c("AWAITING_PASSWORDLESS_CODE")}catch(R){u({errorModalData:{error:R,previousScreen:m||"LANDING"}})}i(!1)},_=()=>{h&&!g&&!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,o,M)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):C(g)};return sy(zb,{children:[Ii(Gb,{children:sy(Vb,{children:[Ii(Bb,{}),Ii("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:M=>r(M.target.value),onKeyUp:M=>{M.key==="Enter"&&_()},value:o,autoComplete:"email"}),e.stacked?null:Ii(qr,{isSubmitting:b,onClick:_,disabled:T,children:"Submit"})]})}),e.stacked?Ii(D,{loadingText:null,loading:b,disabled:T,onClick:_,children:"Submit"}):null]})}),Gb=ly.div`
2323
+ `;import zb from"@heroicons/react/24/outline/EnvelopeIcon";import Fb from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as Bb,useState as ly}from"react";import dy from"styled-components";import{Fragment as Vb,jsx as Ii,jsxs as cy}from"react/jsx-runtime";var py=Bb((e,t)=>{let[r,o]=ly(""),[n,i]=ly(!1),{authenticated:a,user:l}=H(),{initUpdateEmail:s}=M(),{navigate:c,setModalData:u,currentScreen:m}=_(),{enabled:h,token:g}=le(),w=ji(r),C=n,x=n||!w,E=async I=>{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,I),c("AWAITING_PASSWORDLESS_CODE")}catch(R){u({errorModalData:{error:R,previousScreen:m||"LANDING"}})}i(!1)},P=()=>{h&&!g&&!a?(u({captchaModalData:{callback:I=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,I)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):E(g)};return cy(Vb,{children:[Ii(Hb,{children:cy(Gb,{children:[Ii(Fb,{}),Ii("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:I=>o(I.target.value),onKeyUp:I=>{I.key==="Enter"&&P()},value:r,autoComplete:"email"}),e.stacked?null:Ii(Ko,{isSubmitting:C,onClick:P,disabled:x,children:"Submit"})]})}),e.stacked?Ii(D,{loadingText:null,loading:C,disabled:x,onClick:P,children:"Submit"}):null]})}),Hb=dy.div`
2324
2324
  width: 100%;
2325
- `,Vb=ly.label`
2325
+ `,Gb=dy.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
- `;import{Fragment as qb,jsx as or,jsxs as jb}from"react/jsx-runtime";var dy=()=>jb(qb,{children:[or(A,{},"header"),or(Z,{}),or(Ee,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:or($b,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),or(kt,{children:or(cy,{stacked:!0})}),or(Q,{}),or(V,{protectedByPrivy:!0})]});import Yb,{createGlobalStyle as Jb}from"styled-components";var Kb=`
2383
+ `;import{Fragment as $b,jsx as io,jsxs as qb}from"react/jsx-runtime";var uy=()=>qb($b,{children:[io(A,{},"header"),io(Z,{}),io(Ce,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:io(zb,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),io(It,{children:io(py,{stacked:!0})}),io(Q,{}),io(V,{protectedByPrivy:!0})]});import Kb,{createGlobalStyle as Yb}from"styled-components";var jb=`
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
- `,py=Kb;var uy=Jb`
2613
+ `,my=jb;var fy=Yb`
2614
2614
  :root {
2615
2615
  // Borders
2616
2616
  --privy-border-radius-sm: 6px;
@@ -2642,10 +2642,10 @@ 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
- `,my=Yb.div`
2645
+ `,hy=Kb.div`
2646
2646
  // css normalize only the privy application to avoid conflicts
2647
2647
  // with consuming application
2648
- ${py}
2648
+ ${my}
2649
2649
 
2650
2650
  // Privy styles
2651
2651
  color: var(--privy-color-foreground-2);
@@ -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
- `;import{jsx as De,jsxs as hy}from"react/jsx-runtime";var t4={["LANDING"]:If,["CONNECT_OR_CREATE"]:kf,["AWAITING_PASSWORDLESS_CODE"]:gu,["AWAITING_CONNECTION"]:Nu,["AWAITING_CONNECT_ONLY_CONNECTION"]:Bu,["AWAITING_FARCASTER_CONNECTION"]:$m,["PHANTOM_INTERSTITIAL_SCREEN"]:Kh,["LOGIN_FAILED_SCREEN"]:Uf,["AWAITING_OAUTH_SCREEN"]:zh,["ALLOWLIST_REJECTION_SCREEN"]:su,["INSTALL_PHANTOM_SCREEN"]:af,["LINK_EMAIL_SCREEN"]:Mf,["LINK_PHONE_SCREEN"]:Wf,["LINK_WALLET_SCREEN"]:Lf,["UPDATE_EMAIL_SCREEN"]:dy,["CONNECT_ONLY_LANDING_SCREEN"]:Wu,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Ru,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:xm,["EMBEDDED_WALLET_CREATED_SCREEN"]:ju,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:$u,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:Am,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Zu,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:ry,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:ty,["FIAT_ON_RAMP_PROMPT_SCREEN"]:Zm,["FIAT_ON_RAMP_STATUS_SCREEN"]:Xm,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:_m,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Sm,["MFA_ENROLLMENT_FLOW_SCREEN"]:Qf,["CAPTCHA_SCREEN"]:bu,["ERROR_SCREEN"]:km,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:ef,["AFFIRMATIVE_CONSENT_SCREEN"]:iu},o4=["LANDING","AWAITING_CONNECTION"],r4=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:o,isModalOpen:r}=H(),{headless:n}=I(),{ready:i,currentScreen:a}=S(),{status:l,execute:s,reset:c,enabled:u}=ce(),m=Qb(null),h=qp(m),g=r&&a&&o4.includes(a)&&!n&&l==="ready";if(fy(()=>{g&&s()},[g]),fy(()=>{!r&&u&&c()},[r,u]),(!o||!i)&&a!=="AWAITING_OAUTH_SCREEN")return hy(wn,{children:[De(A,{}),De(Z,{}),De(Hf,{children:De(xt,{})}),De(Q,{}),De(te,{})]});if(!a&&e)return De(wn,{style:{height:h},children:De("div",{ref:m,children:De(Dc,{open:e,onClose:t})})});if(!a)return null;let w=t4[a];return De(wn,{style:{height:h},children:hy("div",{ref:m,children:[De(bo,{if:!!e,children:De(w,{})}),De(bo,{if:!e,children:De(Dc,{open:e,onClose:t})})]})})},n4=()=>{let{closePrivyModal:e}=I(),{onUserCloseViaDialogOrKeybindRef:t}=S();return{gracefulClosePrivyModal:Zb(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},yy=({open:e})=>{let{app:t}=S(),{gracefulClosePrivyModal:o}=n4(),[r,n]=Xb(!1);hl({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=De(my,{children:De(r4,{isMfaVerifying:r,onMfaVerificationComplete:()=>n(!1)})}),a=e||r,l=t?.render.inDialog?De(Bf,{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 e4.createPortal(l,s)}return l};import{useEffect as i4,useRef as gy}from"react";var Bs=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 Sr(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 Te("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((h,g)=>{o.current={resolve:h,reject:g};let w=1e3*60*5;setTimeout(()=>{let b=new Te("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(b),g(b)},w)});return await e(m)}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(m){if(m.type==="missing_or_invalid_mfa")a=!0;else throw r.current?.resolve(void 0),m}if(c===null){let u=new Te("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(u),u}return c}import{jsx as p4}from"react/jsx-runtime";var a4=function(e){return()=>`id-${e++}`}(0);function s4(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function ho(e){return e.error!==void 0}var Jt=new Bs,Bc=new Map,l4=(e,t)=>typeof t=="bigint"?t.toString():t,c4=(e,t)=>`${e}${JSON.stringify(t,l4)}`;function yo(e,t,o,r){let n=o.contentWindow;if(!n)throw new Error("iframe not initialized");let i=c4(e,t);if(e==="privy:wallet:create"){let l=Bc.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=a4();Jt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},r)}).finally(()=>{Bc.delete(i)});return Bc.set(i,a),a}function d4(e){switch(e.event){case"privy:iframe:ready":let t=Jt.dequeue(e.event,e.id);return ho(e)?t.reject(new Te(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=Jt.dequeue(e.event,e.id);return ho(e)?o.reject(new Te(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=Jt.dequeue(e.event,e.id);return ho(e)?r.reject(new Te(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=Jt.dequeue(e.event,e.id);return ho(e)?n.reject(new Te(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=Jt.dequeue(e.event,e.id);return ho(e)?i.reject(new Te(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=Jt.dequeue(e.event,e.id);return ho(e)?a.reject(new Te(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=Jt.dequeue(e.event,e.id);return ho(e)?l.reject(new Te(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=Jt.dequeue(e.event,e.id);return ho(e)?s.reject(new Te(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=Jt.dequeue(e.event,e.id);return ho(e)?s.reject(new Te(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=Jt.dequeue(e.event,e.id);return ho(e)?s.reject(new Te(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function vy(e){let t=gy(null),o=gy(e.mfaMethods),r=Yp();return i4(()=>{o.current=e.mfaMethods},[e.mfaMethods]),p4("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>{let i=t.current;if(!i)return;function a(m){m&&m.origin===e.origin&&s4(m.data)&&d4(m.data)}let l={create(m){return yo("privy:wallet:create",m,i,e.origin)},connect(m){return yo("privy:wallet:connect",m,i,e.origin)},recover(m){return Sr(h=>yo("privy:wallet:recover",{...m,...h},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r,!0)},rpc(m){return Sr(h=>yo("privy:wallet:rpc",{...m,...h},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r)},setRecoveryPassword(m){return Sr(h=>yo("privy:wallet:set-recovery-password",{...m,...h},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r)},verifyMfa(m){return Sr(h=>yo("privy:mfa:verify",{...m,...h},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r,!0)},initEnrollMfa(m){return Sr(h=>yo("privy:mfa:init-enrollment",{...m,...h},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r)},submitEnrollMfa(m){return yo("privy:mfa:submit-enrollment",m,i,e.origin)},unenrollMfa(m){return Sr(h=>yo("privy:mfa:unenroll",{...m,...h},i,e.origin),o.current,e.mfaPromise,e.mfaSubmitPromise,r,!0)}};window.addEventListener("message",a);let s=()=>e.onLoad(l),c=(...m)=>{console.warn("Privy iframe failed to load: ",...m),e.onLoadFailed()},u=new AbortController;return Vd(()=>yo("privy:iframe:ready",{},i,e.origin),{abortSignal:u.signal}).then(s,c),()=>{window.removeEventListener("message",a),u.abort()}},src:Yi(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function Hs(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(r=>t.includes(r))}var Gs=class{constructor(t,o){this.meta={action:t,phoneNumber:o}}async init(){if(!this.meta.action)throw new P("action required");if(!this.api)throw new P("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new P("phone number must be set when initialzing authentication.");try{await this.api.post(gd,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw ae(t)}}async authenticate(){if(!this.meta.action)throw new P("action required");if(!this.api)throw new P("Mfa flow has no API instance");if(!this.meta.smsCode)throw new P("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new P("phone number must be set prior to calling authenticate.");try{let t=await this.api.post(vd,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return ft(t)}catch(t){throw ae(t)}}};import{jsx as go,jsxs as wy}from"react/jsx-runtime";var Mn;function y4(e){return typeof e=="string"&&e.length===25}function Re(){if(!Mn){let e=se.get(ar);return Promise.resolve(e||null)}return Mn.getAccessToken()}var Cy,Jd=(e,t)=>Cy(e,t),by,Zd=(e,t)=>by(e,t),Ey,Qd=(e,t)=>Ey(e,t),Py,Xd=()=>Py(),g4=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;se.put(Nn,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},v4=({config:e,...t})=>{if(!y4(t.appId))throw new P("Cannot initialize the Privy provider with an invalid Privy app ID");Mn||(Mn=new jn({appId:t.appId,apiUrl:t.apiUrl||Hi}));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."),go(Sp,{client:Mn,clientConfig:o,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:go(w4,{...t,config:o,client:Mn})})},w4=e=>{let t=e.client,[o,r]=ke(!1),[n,i]=ke(!1),[a,l]=ke(!1),[s,c]=ke(null),[u,m]=ke([]),h=In(u),[g,w]=ke(!1),[b,T]=ke(null),[C,_]=ke(!1),[M,R]=ke({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:E}),[x,F]=ke(null),[U,z]=ke(null),[k,K]=ke(null),N=ba(),q=Ea(),[$,ee]=ke(!0),[ie,j]=ke({}),[Ue,st]=ke(null),[ut,Fe]=ke(null),[re,ko]=ke(!1),[Ot,rr]=ke(!1),Be=In(null),Se=In(null),W=In(jp);t.onStoreToken=d=>{d&&O(W,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{O(W,"accessToken","onAccessTokenRemoved")};let le=In(null),B=In(null),Zt=f4(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(y=>y.type==="wallet"&&y.walletClientType==="privy")?p&&d?.some(y=>y?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),ue=d=>{T(d),setTimeout(()=>{r(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},me=d=>{N.embeddedWallets.createOnLogin!=="off"&&ee(!0),ue(d)};Ao(()=>{if(!k||!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(k,p,N.defaultChain)}},[k,s]),Ao(()=>{k&&ut?.(k)},[k]),Ao(()=>{(async()=>{if(!N.customAuth?.enabled)return;ee(!0);let{getCustomAccessToken:p,isLoading:f}=N.customAuth;if(!(!n||f))try{let y=await p();if(!y){await Rr.logout();return}if(a)return;t.startAuthFlow(new Mr(y));let{user:L,isNewUser:G}=await t.authenticate();L||await Rr.logout(),c(L||null),w(G||!1),l(!0),rr(!0)}catch(y){console.warn(y),a&&await Rr.logout()}})()},[N.customAuth?.enabled,N.customAuth?.getCustomAccessToken,N.customAuth?.isLoading,n,a]),Ao(()=>{Ot&&k&&s&&Et(s,e.config?.embeddedWallets?.createOnLogin)&&(rr(!1),Mi(s,Lr).catch(console.error))},[Ot&&k&&s]),Ao(()=>{async function d(){let p=Wn();g4();let f=m4();F(f),t.initializeConnectorManager(N.walletConnectCloudProjectId,N.rpcConfig,N.chains,N.defaultChain,f,N.appearance.walletList,N.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{Ln()});let y=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!y),y&&O(W,"login","onComplete",y,!1,!0,null),c(y)),p||de.setReadyToTrue(),p&&(y?B.current="link":B.current="login")}!n&&q&&d()},[t,Ue,n,q]);let Wn=()=>{let d=Bn();return!d.inProgress||d.headless?!1:(t.startAuthFlow(new Xt(d)),me("AWAITING_OAUTH_SCREEN"),!0)},_r=async(d,p,f,y)=>{let L=await t.connectors?.createWalletConnector(d,p)||null;Ar(L,p,f,y)};async function Ar(d,p,f,y){if(!d)return R({status:"disconnected",connectedWallet:null,connectError:new J("Unable to connect to wallet."),connector:null,connectRetry:E}),y?.(null,f);d instanceof ro&&p&&await d.resetConnection(p),R({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Ar(d,p,f,y)});try{let L=await d.connect({showPrompt:!0});if(N.shouldEnforceDefaultChainOnConnect&&!N.chains.find(G=>G.id===Number(L?.chainId))&&!(L?.connectorType==="wallet_connect_v2"&&L?.walletClientType==="metamask")){R(G=>({...G,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:E}));try{await L?.switchChain(N.defaultChain.id),L&&(L.chainId=Or(pr(N.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${N.defaultChain.id}`)}}return R(G=>({...G,status:"connected",connectedWallet:L,connectError:null,connectRetry:E})),L&&!B.current&&O(W,"connectWallet","onSuccess",L),y?.(L,f)}catch(L){return L instanceof Ge?(console.warn(L.cause?L.cause:L.message),B.current||O(W,"connectWallet","onError",L.privyErrorCode||"generic_connect_wallet_error")):(console.warn(L),B.current||O(W,"connectWallet","onError","unknown_connect_wallet_error")),R(G=>({...G,status:"disconnected",connectedWallet:null,connectError:L})),y?.(null,f)}}let kr=async(d,p)=>{if(d===null)return;let f=new cr(d,p);t.startAuthFlow(f)},Ln=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),f=d.get("privy_wallet_client");if(!p||!f)return;if(f==="phantom"&&!Wo()&&me("LOGIN_FAILED_SCREEN"),!t.connectors)throw new P("Connector not initialized");ue("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),_r(p,f,void 0,kr)};Ao(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let _e=()=>{if(!a)throw O(W,"linkAccount","onError","must_be_authenticated"),new P("User must be authenticated before linking an account.")},lt=()=>{_e(),le.current="siwe",B.current="link",ue("LINK_WALLET_SCREEN")},He=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},Ro=async d=>{if(!t.connectors)throw new P("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(R(f=>({...f,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:E})),N.captchaEnabled&&!a){let f={callback:y=>kr(d,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};j({captchaModalData:f}),me("CAPTCHA_SCREEN")}else await kr(d),me("AWAITING_CONNECTION")},nr=async(d,p)=>{if(!N.fiatOnRamp.enabled)throw new P("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:f,externalTransactionId:y}=await Ym(t,d,p?.config??{},N.appearance.palette,N.fiatOnRamp.useSandbox);return{signedUrl:f,externalTransactionId:y}}else throw new P("Unsupported fund provider. Currently supported option is `moonpay`.")},ir=()=>{m(d=>{let p=t.connectors?.wallets.map(f=>({...f,linked:He(f),loginOrLink:async()=>{if(!await f.isConnected())throw new P("Wallet is not connected");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new P("Cannot link or login with embedded wallet");Ro(f)},fund:async y=>{let{signedUrl:L,externalTransactionId:G}=await nr(f.address,y);j({fiatOnRampPrompt:{signedUrl:L},fiatOnRampStatus:{externalTransactionId:G}}),ue("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new P("User is not authenticated.");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new P("Cannot unlink an embedded wallet");let y=await t.unlinkWallet(f.address);c(y)}}))||[];return ko(Zt(p)),Xi(d,p)?d:p})};Ao(()=>{ir()},[s?.linkedAccounts,a,n]),Ao(()=>{if(n){if(!t.connectors)throw new P("Connector not initialized");ir(),t.connectors.on("walletsUpdated",ir)}},[n]);let Io=()=>{ue(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};Ao(()=>{if(!u[0])return;let d=u[0],p=h.current.find(y=>y.address===d.address),f;if(d.walletClientType==="privy"?f=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType==="privy"):f=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType!=="privy"),!p&&f){let y=Object.assign({},s);y.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType},c(y)}h.current=u},[u]);let Mi=async(d,p)=>{if(fe(d))throw O(W,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[y,L]=await Promise.all([de.initializeWalletProxy(p),Re()]);if(!y&&e.config?.customAuth?.enabled)throw O(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!y||!L||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((G,pe)=>{ee(!0),j({createWallet:{onSuccess:ct=>{O(W,"createWallet","onSuccess",ct),G(ct)},onFailure:ct=>{O(W,"createWallet","onError","unknown_embedded_wallet_error"),pe(ct)},callAuthOnSuccessOnClose:!1}}),ue("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await y.create({accessToken:L});let G=await de.refreshUser(),pe=fe(G);if(!pe)throw O(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return O(W,"createWallet","onSuccess",pe),pe}},_y=d=>{if(!N.chains.map(p=>p.id).includes(d))throw new J(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Gc=(d,p,f)=>new Promise(async(y,L)=>{if(!a||!s){O(W,"sendTransaction","onError","must_be_authenticated"),L(new Error("User must be authenticated before signing with a Privy wallet"));return}let G=fe(s);if(!G){O(W,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have a Privy wallet before signing"));return}ee(!0);let pe=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,Je=d.chainId?Number(d.chainId):pe.chainId;_y(Je);let ct=Object.assign({},d,{chainId:Je}),vo=async()=>{let Ze=await Re();if(!Ze||!k){O(W,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await de.recoverEmbeddedWallet()){O(W,"sendTransaction","onError","unknown_connect_wallet_error"),L(new Error("Unable to connect to wallet"));return}let Ut=new u4(Ft(ct.chainId,N.chains,N.rpcConfig)),zs=await _n(G.address,ct,Ut);if(N.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:ky}=await Sn(zs,Ut),{hasSufficientFunds:Ry}=await Os(G.address,zs,ky,Ut);if(!Ry)throw new we(new Pt("Wallet has insufficient funds for this transaction.",ze.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let $c=await Ls(Ze,G.address,k,zs,Ut);O(W,"sendTransaction","onSuccess",$c),y($c)}catch(Dt){O(W,"sendTransaction","onError","transaction_failure"),L(Dt)}};if(N.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),vo();else{let Ze={transactionRequest:ct,onSuccess:Ut=>{O(W,"sendTransaction","onSuccess",Ut),y(Ut)},onFailure:Ut=>{O(W,"sendTransaction","onError","transaction_failure"),L(Ut)},uiOptions:p||{},fundWalletConfig:f},Dt={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:Ut=>{O(W,"sendTransaction","onError","unknown_connect_wallet_error"),L(Ut)}};j({connectWallet:Dt,sendTransaction:Ze}),ue("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Vc(){return new Promise(async(d,p)=>{let f=await Re();if(!f||!k)throw new Error("Must have valid access token to enroll in MFA");try{await k.verifyMfa({accessToken:f}),d()}catch(y){p(y)}})}let Nt=d=>{if(s?.[d])throw O(W,"linkAccount","onError","cannot_link_more_of_type"),new P(`User already has an account of type ${d} linked.`)},Rr={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Io,linkWallet:lt,linkEmail:()=>{_e(),Nt("email"),le.current="email",B.current="link",ue("LINK_EMAIL_SCREEN")},linkPhone:()=>{_e(),Nt("phone"),le.current="sms",B.current="link",ue("LINK_PHONE_SCREEN")},linkGoogle:async()=>{_e(),Nt("google"),B.current="link",await de.initLoginWithOAuth("google")},linkTwitter:async()=>{_e(),Nt("twitter"),B.current="link",await de.initLoginWithOAuth("twitter")},linkDiscord:async()=>{_e(),Nt("discord"),B.current="link",await de.initLoginWithOAuth("discord")},linkGithub:async()=>{_e(),Nt("github"),B.current="link",await de.initLoginWithOAuth("github")},linkSpotify:async()=>{_e(),Nt("spotify"),B.current="link",await de.initLoginWithOAuth("spotify")},linkTiktok:async()=>{_e(),Nt("tiktok"),B.current="link",await de.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{_e(),Nt("linkedin"),B.current="link",await de.initLoginWithOAuth("linkedin")},linkApple:async()=>{_e(),Nt("apple"),B.current="link",await de.initLoginWithOAuth("apple")},linkFarcaster:async()=>{_e(),Nt("farcaster"),await de.initLoginWithFarcaster(),B.current="link",le.current="farcaster",ue("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(_e(),!s?.email)throw new P("User does not have an email linked to their account.");B.current="link",le.current="email",ue("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{st(()=>d)}),st(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}B.current="login",me("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{st(()=>d)}),st(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}me("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),T(null),O(W,"logout","onSuccess"),B.current=null,le.current=null,r(!1),se.del(Dn)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new he;let d=u.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(y=>y.address===d?.address));return!d||!p?new he:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Hc(new eo(new he));let d=u.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(y=>y.address===d?.address));return!d||!p?new Hc(new eo(new he)):new Hc(new eo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new No(new he);let d=u.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(y=>y.address===d?.address));return!d||!p?new No(new he):new No(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(y=>Vs(y.address)===Vs(d)),f=s?.linkedAccounts.find(y=>y.type==="wallet"&&Vs(y.address)===Vs(d));if(!p||!await p.isConnected())z(d),lt();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},s);y.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType},c(y)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw O(W,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Mi(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw O(W,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=fe(s);if(!d||!k)throw O(W,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw O(W,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await Vc()}catch(p){throw O(W,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,f)=>{ee(!0);let y={onSuccess:G=>{O(W,"setWalletPassword","onSuccess",G),p(G)},onFailure:G=>{O(W,"setWalletPassword","onError","user_exited_set_password_flow"),f(G)},callAuthOnSuccessOnClose:!1},L={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:G=>{O(W,"setWalletPassword","onError","unknown_connect_wallet_error"),f(G)}};j({setWalletPassword:y,connectWallet:L}),ue("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(f,y)=>{if(!a||!s){O(W,"signMessage","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=fe(s);if(!L){O(W,"signMessage","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){O(W,"signMessage","onError","invalid_message"),y(new Error("Message must be a non-empty string"));return}ee(!0);let G=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let pe=await Re();if(!k||!pe)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:L.address});let{response:ct}=await k.rpc({accessToken:pe,address:L.address,request:{method:"personal_sign",params:[d,L.address]}}),vo=ct.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:L.address}),vo};if(N.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let pe=await G();O(W,"signMessage","onSuccess",pe),f(pe)}catch(pe){O(W,"signMessage","onError","unable_to_sign"),y(pe??new we("Unable to sign message"))}}else{let ct={method:"personal_sign",data:d,confirmAndSign:G,onSuccess:Ze=>{O(W,"signMessage","onSuccess",Ze),f(Ze)},onFailure:Ze=>{O(W,"signMessage","onError","unable_to_sign"),y(Ze)},uiOptions:p||{}},vo={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Ze=>{O(W,"signMessage","onError","unknown_connect_wallet_error"),y(Ze)}};j({signMessage:ct,connectWallet:vo}),ue("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(f,y)=>{if(!a||!s){O(W,"signTypedData","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=fe(s);if(!L){O(W,"signTypedData","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}ee(!0);let G=Ji(d),pe=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Je=await Re();if(!k||!Je)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:L.address});let{response:vo}=await k.rpc({accessToken:Je,address:L.address,request:{method:"eth_signTypedData_v4",params:[L.address,G]}}),Ze=vo.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:L.address}),Ze};if(N.embeddedWallets.noPromptOnSignature||(N.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Je=await pe();O(W,"signTypedData","onSuccess",Je),f(Je)}catch(Je){O(W,"signTypedData","onError","unable_to_sign"),y(Je??new we("Unable to sign message"))}}else{let vo={method:"eth_signTypedData_v4",data:G,confirmAndSign:pe,onSuccess:Dt=>{O(W,"signTypedData","onSuccess",Dt),f(Dt)},onFailure:Dt=>{O(W,"signTypedData","onError","unable_to_sign"),y(Dt)},uiOptions:p||{}},Ze={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Dt=>{O(W,"signMessage","onError","unknown_connect_wallet_error"),y(Dt)}};j({signMessage:vo,connectWallet:Ze}),ue("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,f)=>{let L=await(await Gc(d,p,f)).wait();return Ns(L)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let f=fe(s);if(!f){p(new Error("Must have a Privy wallet before exporting"));return}ee(!0);let y={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},L=await Re();if(!L||!k){p(new Error("Must have valid access token to enroll in MFA"));return}if(!k){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await k.connect({accessToken:L,address:f.address}),await k.verifyMfa({accessToken:L})}catch(pe){if(vr(pe))await de.recoverEmbeddedWallet();else throw pe}}catch(pe){p(pe);return}let G={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};j({keyExport:G,connectWallet:y}),ue("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Vc,async init(d){let p;switch(d){case"sms":p=new Gs("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":Be.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((f,y)=>{Se.current={resolve:f,reject:y}});break;default:throw Be.current?.reject(new P("Unsupported MFA method")),new P(`Unsupported MFA method: ${d}`)}},cancel(){Be.current?.reject(new P("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Re();if(!p||!k)throw new Error("Must have valid access token to enroll in MFA");await k.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,f)=>{if(!d){de.closePrivyModal(),p();return}N.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),j({mfaEnrollmentFlow:{mfaMethods:N.mfa.methods,onSuccess:p,onFailure:f}}),ue("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Re();if(!d||!k)throw new Error("Must have valid access token to enroll in MFA");let p=await k.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Re();if(!p||!k)throw new Error("Must have valid access token to enroll in MFA");await k.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async submitEnrollmentWithTotp(d){let p=await Re();if(!p||!k)throw new Error("Must have valid access token to enroll in MFA");await k.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async unenroll(d){let p=await Re();if(!p||!k)throw new Error("Must have valid access token to remove MFA");await k.unenrollMfa({method:d,accessToken:p});let f=await t.getAuthenticatedUser();c(f)},isHeadlessOAuthLoading:C,loginWithCode(d){return de.loginWithCode(d)},initLoginWithEmail(d){return de.initLoginWithEmail(d)},initLoginWithSms(d){return de.initLoginWithSms(d)},fundWallet(d,p){return de.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return de.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return de.loginWithHeadlessOAuth(d)},isModalOpen:o};Cy=Rr.signMessage,by=Rr.signTypedData,Ey=async(...d)=>{let p=await Gc(...d);return N.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let zc=!!e.config?.headless,de=(()=>({headless:zc,isNewUserThisSession:g,linkingHint:U,pendingTransaction:null,walletConnectionStatus:M,mipdStore:x,connectors:t.connectors?.walletConnectors??[],rpcConfig:N.rpcConfig,chains:N.chains,showFiatPrices:N.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>N.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(k)return k;let p=new Promise(L=>{Fe(()=>G=>L(G))}),f=new Promise(L=>setTimeout(()=>L(null),d)),y=await Promise.race([p,f]);return Fe(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s;B.current==="login"?d.shouldCallAuthOnSuccess&&p?(O(W,"login","onComplete",s,g,!1,le.current??null),e.onSuccess?.(s,g)):O(W,"login","onError","exited_auth_flow"):B.current==="link"&&le.current&&(d.isSuccess&&p?O(W,"linkAccount","onSuccess",s,le.current):O(W,"linkAccount","onError","exited_link_flow")),z(null),B.current=null,le.current=null,w(!1),r(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:ue,connectWallet:Ar,initLoginWithWallet:async(d,p)=>{le.current="siwe",kr(d,p)},loginWithWallet:async()=>{if(!n)throw new Ir;if(!(t.authFlow instanceof cr))throw new P("Must initialize SIWE flow first.");let d,p;if(a)try{d=await t.link(),le.current="siwe"}catch(f){throw O(W,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:d,isNewUser:p}=await t.authenticate()),le.current="siwe"}catch(f){throw O(W,"login","onError",f.privyErrorCode||"generic_connect_wallet_error"),f}c(d||s||null),w(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new On(d);t.startAuthFlow(p);try{le.current="farcaster",await p.initializeFarcasterConnect()}catch(f){throw B.current==="login"?O(W,"login","onError",f.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",f.privyErrorCode||"unknown_auth_error"),f}},loginWithFarcaster:async()=>{if(!n)throw new Ir;if(!(t.authFlow instanceof On))throw new P("Must initialize Farcaster flow first.");let d,p;if(a)try{d=await t.link(),le.current="farcaster"}catch(f){throw O(W,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:d,isNewUser:p}=await t.authenticate()),le.current="farcaster"}catch(f){throw O(W,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}c(d||null),w(p||!1),l(!0)},async initLoginWithOAuth(d,p){if(le.current=d,tl()){if(d==="google"&&Hs(window.navigator.userAgent)){me("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{me("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let f=new Xt({provider:d});p&&f.addCaptchaToken(p),t.startAuthFlow(f);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&window.location.assign(y.url)},async loginWithOAuth(d){if(!(t.authFlow instanceof Xt))throw new P("Must initialize OAuth flow before calling loginWithOAuth");let p=Ve.get(sr),f=t.authFlow.meta.stateCode;if(p!==f)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:f??""}),new P("Unexpected auth flow. This may be a phishing attempt.");let y,L;if(a)try{y=await t.link(),le.current=d}catch(G){throw O(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}else try{({user:y,isNewUser:L}=await t.authenticate()),le.current=d}catch(G){throw B.current==="login"?O(W,"login","onError",G.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}c(y),w(L||!1),l(!0)},async initLoginWithHeadlessOAuth(d,p){if(tl()){if(d==="google"&&Hs(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let f=new Xt({provider:d,headless:!0});p&&f.addCaptchaToken(p);let y=await t.startAuthFlow(f).getAuthorizationUrl();y?.url&&window.location.assign(y.url)},async loginWithHeadlessOAuth(d){_(!0),t.startAuthFlow(new Xt(d));let p=Ve.get(sr),f=d.stateCode;if(p!==f)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d.provider,storedStateCode:p??"",returnedStateCode:f??""}),_(!1),new P("Unexpected auth flow. This may be a phishing attempt.");let y,L;if(a)try{y=await t.link(),le.current=d.provider}catch(G){throw O(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}else try{({user:y,isNewUser:L}=await t.authenticate()),le.current=d.provider}catch(G){throw B.current==="login"?O(W,"login","onError",G.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}return c(y),w(L||!1),l(!0),_(!1),y??void 0},initLoginWithEmail:async(d,p)=>{let f=new Mo(d,p);t.startAuthFlow(f);try{le.current="email",await f.sendCodeEmail()}catch(y){throw B.current==="login"?O(W,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}},initUpdateEmail:async(d,p,f)=>{let y=new Fi(d,p,f);t.startAuthFlow(y),await y.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let f=new dr(d,p);t.startAuthFlow(f);try{le.current="sms",await f.sendSmsCode()}catch(y){throw B.current==="login"?O(W,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(!n)throw new Ir;if(t.authFlow instanceof Mo)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof dr)t.authFlow.meta.smsCode=d.trim();else throw new P("Must initialize a passwordless code flow first");let p,f;if(a)try{p=await t.link()}catch(y){throw O(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}else try{({user:p,isNewUser:f}=await t.authenticate())}catch(y){throw O(W,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}c(p||s||null),w(f||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:k,createAnalyticsEvent:(d,p,f)=>t.createAnalyticsEvent(d,p,f),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let f=s?.linkedAccounts.find(L=>L.type==="wallet"&&L.walletClientType==="privy"),y=await Re();if(!y||!k||!f){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}ee(!0);try{await k.connect({accessToken:y,address:f.address}),d(!0)}catch(L){vr(L)&&f.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:f.address}),(await k.recover({address:f.address,accessToken:y})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:f.address}),d(!0)):vr(L)?(j({recoverWallet:{privyWallet:f,onFailure:p,onSuccess:()=>d(!0)}}),ue("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(L)}}),getFiatOnRampConfig:nr,setReadyToTrue:()=>{i(!0),Ue?.()},updateWallets:()=>ir(),fundWallet:async(d,p)=>{let{signedUrl:f,externalTransactionId:y}=await nr(d,p);j({fiatOnRampPrompt:{signedUrl:f},fiatOnRampStatus:{externalTransactionId:y}}),ue("FIAT_ON_RAMP_PROMPT_SCREEN")}}))();Py=de.recoverEmbeddedWallet;let Ay=h4(()=>({wallets:u,ready:re}),[u,re]);return go(ne.Provider,{value:Rr,children:go(fl.Provider,{value:W,children:go(Wc.Provider,{value:Ay,children:wy(zp,{...N,children:[e.children,wy(ml.Provider,{value:de,children:[!zc&&N.captchaEnabled&&n&&!a&&go(ul,{delayedExecution:!1}),go(uy,{theme:{...N.appearance.palette||{}}}),go(Ap,{data:ie,setModalData:j,setInitialScreen:T,initialScreen:b,authenticated:a,open:o,children:go(yy,{open:o})}),$&&q?go(vy,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Be,mfaSubmitPromise:Se,onLoad:K,onLoadFailed:()=>null}):null]})]})})})})};import{useContext as C4}from"react";function b4(e){let{login:t}=C4(ne);return ge("login",e),{login:t}}import{useContext as E4}from"react";function P4(e){let{logout:t}=E4(ne);return ge("logout",e),{logout:t}}import{useCallback as Ty,useEffect as T4}from"react";function x4(){let e=ce(),t=Ea(),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:r,isHeadlessOAuthLoading:n,ready:i,user:a}=H(),l=Ty(async c=>{if(e.enabled&&e.status!=="success")throw new Ht(e.error,null,"captcha_failure");return o(c.provider,e.token)},[o,e]),s=Ty(async()=>{let c=Bn();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{Hn()}},[r]);return T4(()=>{let c=Bn();i&&t&&c.inProgress&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}import{useCallback as xy}from"react";var S4=()=>{let e=ce(),{initLoginWithEmail:t,loginWithCode:o}=H(),r=xy(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=xy(async({code:i})=>{if(e.enabled&&e.status==="error")throw new Ht(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};import{useCallback as Sy}from"react";var _4=()=>{let e=ce(),{initLoginWithSms:t,loginWithCode:o}=H(),r=Sy(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return t(i)},[t]),n=Sy(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new Ht(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};import{useContext as A4}from"react";function k4(e){let{linkEmail:t,linkPhone:o,linkWallet:r,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:m,linkFarcaster:h}=A4(ne);return ge("linkAccount",e),{linkEmail:t,linkPhone:o,linkWallet:r,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:m,linkFarcaster:h}}import{useContext as R4}from"react";function I4(e){let{connectWallet:t}=R4(ne);return ge("connectWallet",e),{connectWallet:t}}import{useContext as M4}from"react";function W4(e){let{createWallet:t}=M4(ne);return ge("createWallet",e),{createWallet:t}}var L4=()=>{let{fundWallet:e}=H();return{fundWallet:e}};import{useContext as O4}from"react";function N4(e){let{sendTransaction:t}=O4(ne);return ge("sendTransaction",e),{sendTransaction:t}}import{useContext as D4}from"react";function U4(e){let{setWalletPassword:t}=D4(ne);return ge("setWalletPassword",e),{setWalletPassword:t}}import{useContext as F4}from"react";function B4(e){let{signMessage:t}=F4(ne);return ge("signMessage",e),{signMessage:t}}import{useContext as H4}from"react";function G4(e){let{signTypedData:t}=H4(ne);return ge("signTypedData",e),{signTypedData:t}}import{useContext as V4}from"react";var z4=()=>{let{isModalOpen:e}=V4(ne);return{isOpen:e}};import{useContext as $4}from"react";function q4(e){let{getAccessToken:t}=$4(ne);return ge("accessToken",e),{getAccessToken:t}}function j4(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}export{eo as AsExternalProvider,ul as Captcha,qn as ConnectorManager,jn as PrivyClient,v4 as PrivyProvider,he as PrivyProxyProvider,zn as SUPPORTED_CHAINS,js as VERSION,dt as WalletConnector,j4 as addRpcUrlOverrideToChain,Hl as errorIndicatesMaxMfaRetries,an as errorIndicatesMfaTimeout,sn as errorIndicatesMfaVerificationFailed,Re as getAccessToken,I4 as useConnectWallet,W4 as useCreateWallet,L4 as useFundWallet,k4 as useLinkAccount,b4 as useLogin,S4 as useLoginWithEmail,x4 as useLoginWithOAuth,_4 as useLoginWithSms,P4 as useLogout,bn as useMfa,Ei as useMfaEnrollment,z4 as useModalStatus,H as usePrivy,hl as useRegisterMfaListener,N4 as useSendTransaction,U4 as useSetWalletPassword,B4 as useSignMessage,G4 as useSignTypedData,q4 as useToken,ki as useWallets};
2707
+ `;import{jsx as De,jsxs as gy}from"react/jsx-runtime";var e4={["LANDING"]:Wf,["CONNECT_OR_CREATE"]:If,["AWAITING_PASSWORDLESS_CODE"]:wu,["AWAITING_CONNECTION"]:Uu,["AWAITING_CONNECT_ONLY_CONNECTION"]:Gu,["AWAITING_FARCASTER_CONNECTION"]:jm,["PHANTOM_INTERSTITIAL_SCREEN"]:Jh,["LOGIN_FAILED_SCREEN"]:Bf,["AWAITING_OAUTH_SCREEN"]:qh,["ALLOWLIST_REJECTION_SCREEN"]:cu,["INSTALL_PHANTOM_SCREEN"]:lf,["LINK_EMAIL_SCREEN"]:Lf,["LINK_PHONE_SCREEN"]:Of,["LINK_WALLET_SCREEN"]:Nf,["UPDATE_EMAIL_SCREEN"]:uy,["CONNECT_ONLY_LANDING_SCREEN"]:Ou,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Mu,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:_m,["EMBEDDED_WALLET_CREATED_SCREEN"]:Yu,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:ju,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:Rm,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Xu,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:iy,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:oy,["FIAT_ON_RAMP_PROMPT_SCREEN"]:Xm,["FIAT_ON_RAMP_STATUS_SCREEN"]:tf,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:km,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Am,["MFA_ENROLLMENT_FLOW_SCREEN"]:eh,["CAPTCHA_SCREEN"]:Pu,["ERROR_SCREEN"]:Im,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:rf,["AFFIRMATIVE_CONSENT_SCREEN"]:su},t4=["LANDING","AWAITING_CONNECTION"],r4=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=H(),{headless:n}=M(),{ready:i,currentScreen:a}=_(),{status:l,execute:s,reset:c,enabled:u}=le(),m=Zb(null),h=Kp(m),g=o&&a&&t4.includes(a)&&!n&&l==="ready";if(yy(()=>{g&&s()},[g]),yy(()=>{!o&&u&&c()},[o,u]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN")return gy(bn,{children:[De(A,{}),De(Z,{}),De(Vf,{children:De(_t,{})}),De(Q,{}),De(ee,{})]});if(!a&&e)return De(bn,{style:{height:h},children:De("div",{ref:m,children:De(Hc,{open:e,onClose:t})})});if(!a)return null;let w=e4[a];return De(bn,{style:{height:h},children:gy("div",{ref:m,children:[De(Tr,{if:!!e,children:De(w,{})}),De(Tr,{if:!e,children:De(Hc,{open:e,onClose:t})})]})})},o4=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=_();return{gracefulClosePrivyModal:Jb(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},vy=({open:e})=>{let{app:t}=_(),{gracefulClosePrivyModal:r}=o4(),[o,n]=Qb(!1);wl({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=De(hy,{children:De(r4,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})}),a=e||o,l=t?.render.inDialog?De(Gf,{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 Xb.createPortal(l,s)}return l};import{useEffect as n4,useRef as wy}from"react";var Fs=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 ko(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 Te("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((h,g)=>{r.current={resolve:h,reject:g};let w=1e3*60*5;setTimeout(()=>{let C=new Te("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(C),g(C)},w)});return await e(m)}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(m){if(m.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),m}if(c===null){let u=new Te("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}import{jsx as d4}from"react/jsx-runtime";var i4=function(e){return()=>`id-${e++}`}(0);function a4(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function yr(e){return e.error!==void 0}var Jt=new Fs,zc=new Map,s4=(e,t)=>typeof t=="bigint"?t.toString():t,l4=(e,t)=>`${e}${JSON.stringify(t,s4)}`;function gr(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=l4(e,t);if(e==="privy:wallet:create"){let l=zc.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=i4();Jt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{zc.delete(i)});return zc.set(i,a),a}function c4(e){switch(e.event){case"privy:iframe:ready":let t=Jt.dequeue(e.event,e.id);return yr(e)?t.reject(new Te(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=Jt.dequeue(e.event,e.id);return yr(e)?r.reject(new Te(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:connect":let o=Jt.dequeue(e.event,e.id);return yr(e)?o.reject(new Te(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:recover":let n=Jt.dequeue(e.event,e.id);return yr(e)?n.reject(new Te(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=Jt.dequeue(e.event,e.id);return yr(e)?i.reject(new Te(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=Jt.dequeue(e.event,e.id);return yr(e)?a.reject(new Te(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=Jt.dequeue(e.event,e.id);return yr(e)?l.reject(new Te(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=Jt.dequeue(e.event,e.id);return yr(e)?s.reject(new Te(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=Jt.dequeue(e.event,e.id);return yr(e)?s.reject(new Te(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=Jt.dequeue(e.event,e.id);return yr(e)?s.reject(new Te(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function Cy(e){let t=wy(null),r=wy(e.mfaMethods),o=Zp();return n4(()=>{r.current=e.mfaMethods},[e.mfaMethods]),d4("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>{let i=t.current;if(!i)return;function a(m){m&&m.origin===e.origin&&a4(m.data)&&c4(m.data)}let l={create(m){return gr("privy:wallet:create",m,i,e.origin)},connect(m){return gr("privy:wallet:connect",m,i,e.origin)},recover(m){return ko(h=>gr("privy:wallet:recover",{...m,...h},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(m){return ko(h=>gr("privy:wallet:rpc",{...m,...h},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(m){return ko(h=>gr("privy:wallet:set-recovery-password",{...m,...h},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(m){return ko(h=>gr("privy:mfa:verify",{...m,...h},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(m){return ko(h=>gr("privy:mfa:init-enrollment",{...m,...h},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(m){return gr("privy:mfa:submit-enrollment",m,i,e.origin)},unenrollMfa(m){return ko(h=>gr("privy:mfa:unenroll",{...m,...h},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)}};window.addEventListener("message",a);let s=()=>e.onLoad(l),c=(...m)=>{console.warn("Privy iframe failed to load: ",...m),e.onLoadFailed()},u=new AbortController;return qd(()=>gr("privy:iframe:ready",{},i,e.origin),{abortSignal:u.signal}).then(s,c),()=>{window.removeEventListener("message",a),u.abort()}},src:Ki(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function Bs(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(o=>t.includes(o))}var Hs=class{constructor(t,r){this.meta={action:t,phoneNumber:r}}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(bd,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw ie(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(Ed,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return yt(t)}catch(t){throw ie(t)}}};import{jsx as vr,jsxs as by}from"react/jsx-runtime";var Ln;function f4(e){return typeof e=="string"&&e.length===25}function Re(){if(!Ln){let e=ae.get(lo);return Promise.resolve(e||null)}return Ln.getAccessToken()}var Ey,Qd=(e,t)=>Ey(e,t),Py,Xd=(e,t)=>Py(e,t),Ty,ep=(e,t)=>Ty(e,t),xy,tp=()=>xy(),h4=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;ae.put(Nn,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},y4=({config:e,...t})=>{if(!f4(t.appId))throw new T("Cannot initialize the Privy provider with an invalid Privy app ID");Ln||(Ln=new jn({appId:t.appId,apiUrl:t.apiUrl||Bi}));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."),vr(Ap,{client:Ln,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:vr(g4,{...t,config:r,client:Ln})})},g4=e=>{let t=e.client,[r,o]=_e(!1),[n,i]=_e(!1),[a,l]=_e(!1),[s,c]=_e(null),[u,m]=_e([]),h=Wn(u),[g,w]=_e(!1),[C,x]=_e(null),[E,P]=_e(!1),[I,R]=_e({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:b}),[S,U]=_e(null),[F,z]=_e(null),[k,K]=_e(null),N=Ca(),q=ba(),[$,te]=_e(!0),[se,j]=_e({}),[Ue,Ye]=_e(null),[ut,Fe]=_e(null),[Ae,Ee]=_e(!1),[Mr,Zt]=_e(!1),mt=Wn(null),Pe=Wn(null),W=Wn(Yp);t.onStoreToken=d=>{d&&O(W,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{O(W,"accessToken","onAccessTokenRemoved")};let ne=Wn(null),B=Wn(null),Qt=u4(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(y=>y.type==="wallet"&&y.walletClientType==="privy")?p&&d?.some(y=>y?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),pe=d=>{x(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},st=d=>{N.embeddedWallets.createOnLogin!=="off"&&te(!0),pe(d)};Ir(()=>{if(!k||!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(k,p,N.defaultChain,e.appId)}},[k,s]),Ir(()=>{k&&ut?.(k)},[k]),Ir(()=>{(async()=>{if(!N.customAuth?.enabled)return;te(!0);let{getCustomAccessToken:p,isLoading:f}=N.customAuth;if(!(!n||f))try{let y=await p();if(!y){await Ro.logout();return}if(a)return;t.startAuthFlow(new Mo(y));let{user:L,isNewUser:G}=await t.authenticate();L||await Ro.logout(),c(L||null),w(G||!1),l(!0),Zt(!0)}catch(y){console.warn(y),a&&await Ro.logout()}})()},[N.customAuth?.enabled,N.customAuth?.getCustomAccessToken,N.customAuth?.isLoading,n,a]),Ir(()=>{Mr&&k&&s&&Tt(s,e.config?.embeddedWallets?.createOnLogin)&&(Zt(!1),wr(s,Lo).catch(console.error))},[Mr&&k&&s]),Ir(()=>{async function d(){let p=lt();h4();let f=p4();U(f),t.initializeConnectorManager(N.walletConnectCloudProjectId,N.rpcConfig,N.chains,N.defaultChain,f,N.appearance.walletList,N.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{zs()});let y=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!y),y&&O(W,"login","onComplete",y,!1,!0,null),c(y)),p||ce.setReadyToTrue(),p&&(y?B.current="link":B.current="login")}!n&&q&&d()},[t,Ue,n,q]);let lt=()=>{let d=Bn();return!d.inProgress||d.headless?!1:(t.startAuthFlow(new tr(d)),st("AWAITING_OAUTH_SCREEN"),!0)},Vs=async(d,p,f,y)=>{let L=await t.connectors?.createWalletConnector(d,p)||null;Wr(L,p,f,y)};async function Wr(d,p,f,y){if(!d)return R({status:"disconnected",connectedWallet:null,connectError:new Y("Unable to connect to wallet."),connector:null,connectRetry:b}),y?.(null,f);d instanceof ir&&p&&await d.resetConnection(p),R({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Wr(d,p,f,y)});try{let L=await d.connect({showPrompt:!0});if(N.shouldEnforceDefaultChainOnConnect&&!N.chains.find(G=>G.id===Number(L?.chainId))&&!(L?.connectorType==="wallet_connect_v2"&&L?.walletClientType==="metamask")){R(G=>({...G,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:b}));try{await L?.switchChain(N.defaultChain.id),L&&(L.chainId=No(fo(N.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${N.defaultChain.id}`)}}return R(G=>({...G,status:"connected",connectedWallet:L,connectError:null,connectRetry:b})),L&&!B.current&&O(W,"connectWallet","onSuccess",L),y?.(L,f)}catch(L){return L instanceof He?(console.warn(L.cause?L.cause:L.message),B.current||O(W,"connectWallet","onError",L.privyErrorCode||"generic_connect_wallet_error")):(console.warn(L),B.current||O(W,"connectWallet","onError","unknown_connect_wallet_error")),R(G=>({...G,status:"disconnected",connectedWallet:null,connectError:L})),y?.(null,f)}}let ao=async(d,p)=>{if(d===null)return;let f=new uo(d,p);t.startAuthFlow(f)},zs=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),f=d.get("privy_wallet_client");if(!p||!f)return;if(f==="phantom"&&!Nr()&&st("LOGIN_FAILED_SCREEN"),!t.connectors)throw new T("Connector not initialized");pe("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),Vs(p,f,void 0,ao)};Ir(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let ke=()=>{if(!a)throw O(W,"linkAccount","onError","must_be_authenticated"),new T("User must be authenticated before linking an account.")},so=()=>{ke(),ne.current="siwe",B.current="link",pe("LINK_WALLET_SCREEN")},ft=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},Be=async d=>{if(!t.connectors)throw new T("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(R(f=>({...f,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:b})),N.captchaEnabled&&!a){let f={callback:y=>ao(d,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};j({captchaModalData:f}),st("CAPTCHA_SCREEN")}else await ao(d),st("AWAITING_CONNECTION")},Xt=async(d,p)=>{if(!N.fiatOnRamp.enabled)throw new T("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:f,externalTransactionId:y}=await Zm(t,d,p?.config??{},N.appearance.palette,N.fiatOnRamp.useSandbox);return{signedUrl:f,externalTransactionId:y}}else throw new T("Unsupported fund provider. Currently supported option is `moonpay`.")},Lr=()=>{m(d=>{let p=t.connectors?.wallets.map(f=>({...f,linked:ft(f),loginOrLink:async()=>{if(!await f.isConnected())throw new T("Wallet is not connected");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new T("Cannot link or login with embedded wallet");Be(f)},fund:async y=>{let{signedUrl:L,externalTransactionId:G}=await Xt(f.address,y);j({fiatOnRampPrompt:{signedUrl:L},fiatOnRampStatus:{externalTransactionId:G}}),pe("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new T("User is not authenticated.");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new T("Cannot unlink an embedded wallet");let y=await t.unlinkWallet(f.address);c(y)}}))||[];return Ee(Qt(p)),Xi(d,p)?d:p})};Ir(()=>{Lr()},[s?.linkedAccounts,a,n]),Ir(()=>{if(n){if(!t.connectors)throw new T("Connector not initialized");Lr(),t.connectors.on("walletsUpdated",Lr)}},[n]);let Mi=()=>{pe(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};Ir(()=>{if(!u[0])return;let d=u[0],p=h.current.find(y=>y.address===d.address),f;if(d.walletClientType==="privy"?f=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType==="privy"):f=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType!=="privy"),!p&&f){let y=Object.assign({},s);y.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType},c(y)}h.current=u},[u]);let wr=async(d,p)=>{if(ue(d))throw O(W,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[y,L]=await Promise.all([ce.initializeWalletProxy(p),Re()]);if(!y&&e.config?.customAuth?.enabled)throw O(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!y||!L||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((G,de)=>{te(!0),j({createWallet:{onSuccess:ct=>{O(W,"createWallet","onSuccess",ct),G(ct)},onFailure:ct=>{O(W,"createWallet","onError","unknown_embedded_wallet_error"),de(ct)},callAuthOnSuccessOnClose:!1}}),pe("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await y.create({accessToken:L});let G=await ce.refreshUser(),de=ue(G);if(!de)throw O(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return O(W,"createWallet","onSuccess",de),de}},$s=d=>{if(!N.chains.map(p=>p.id).includes(d))throw new Y(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},qc=(d,p,f)=>new Promise(async(y,L)=>{if(!a||!s){O(W,"sendTransaction","onError","must_be_authenticated"),L(new Error("User must be authenticated before signing with a Privy wallet"));return}let G=ue(s);if(!G){O(W,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have a Privy wallet before signing"));return}te(!0);let de=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,Je=d.chainId?Number(d.chainId):de.chainId;$s(Je);let ct=Object.assign({},d,{chainId:Je}),Cr=async()=>{let Ze=await Re();if(!Ze||!k){O(W,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ce.recoverEmbeddedWallet()){O(W,"sendTransaction","onError","unknown_connect_wallet_error"),L(new Error("Unable to connect to wallet"));return}let Ft=Er(ct.chainId,N.chains,N.rpcConfig,{appId:e.appId}),qs=await kn(G.address,ct,Ft);if(N.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:Ry}=await An(qs,Ft),{hasSufficientFunds:Iy}=await Ls(G.address,qs,Ry,Ft);if(!Iy)throw new ge(new xt("Wallet has insufficient funds for this transaction.",Ve.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Yc=await Ws(Ze,G.address,k,qs,Ft);O(W,"sendTransaction","onSuccess",Yc),y(Yc)}catch(Ut){O(W,"sendTransaction","onError","transaction_failure"),L(Ut)}};if(N.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Cr();else{let Ze={transactionRequest:ct,onSuccess:Ft=>{O(W,"sendTransaction","onSuccess",Ft),y(Ft)},onFailure:Ft=>{O(W,"sendTransaction","onError","transaction_failure"),L(Ft)},uiOptions:p||{},fundWalletConfig:f},Ut={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:Ft=>{O(W,"sendTransaction","onError","unknown_connect_wallet_error"),L(Ft)}};j({connectWallet:Ut,sendTransaction:Ze}),pe("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function jc(){return new Promise(async(d,p)=>{let f=await Re();if(!f||!k)throw new Error("Must have valid access token to enroll in MFA");try{await k.verifyMfa({accessToken:f}),d()}catch(y){p(y)}})}let Dt=d=>{if(s?.[d])throw O(W,"linkAccount","onError","cannot_link_more_of_type"),new T(`User already has an account of type ${d} linked.`)},Ro={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Mi,linkWallet:so,linkEmail:()=>{ke(),Dt("email"),ne.current="email",B.current="link",pe("LINK_EMAIL_SCREEN")},linkPhone:()=>{ke(),Dt("phone"),ne.current="sms",B.current="link",pe("LINK_PHONE_SCREEN")},linkGoogle:async()=>{ke(),Dt("google"),B.current="link",await ce.initLoginWithOAuth("google")},linkTwitter:async()=>{ke(),Dt("twitter"),B.current="link",await ce.initLoginWithOAuth("twitter")},linkDiscord:async()=>{ke(),Dt("discord"),B.current="link",await ce.initLoginWithOAuth("discord")},linkGithub:async()=>{ke(),Dt("github"),B.current="link",await ce.initLoginWithOAuth("github")},linkSpotify:async()=>{ke(),Dt("spotify"),B.current="link",await ce.initLoginWithOAuth("spotify")},linkTiktok:async()=>{ke(),Dt("tiktok"),B.current="link",await ce.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{ke(),Dt("linkedin"),B.current="link",await ce.initLoginWithOAuth("linkedin")},linkApple:async()=>{ke(),Dt("apple"),B.current="link",await ce.initLoginWithOAuth("apple")},linkFarcaster:async()=>{ke(),Dt("farcaster"),await ce.initLoginWithFarcaster(),B.current="link",ne.current="farcaster",pe("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(ke(),!s?.email)throw new T("User does not have an email linked to their account.");B.current="link",ne.current="email",pe("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{Ye(()=>d)}),Ye(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}B.current="login",st("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{Ye(()=>d)}),Ye(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}st("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),x(null),O(W,"logout","onSuccess"),B.current=null,ne.current=null,o(!1),ae.del(Dn)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new me;let d=u.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(y=>y.address===d?.address));return!d||!p?new me:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new $c(new rr(new me));let d=u.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(y=>y.address===d?.address));return!d||!p?new $c(new rr(new me)):new $c(new rr(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Fr(new me);let d=u.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(y=>y.address===d?.address));return!d||!p?new Fr(new me):new Fr(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(y=>Gs(y.address)===Gs(d)),f=s?.linkedAccounts.find(y=>y.type==="wallet"&&Gs(y.address)===Gs(d));if(!p||!await p.isConnected())z(d),so();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},s);y.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType},c(y)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw O(W,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return wr(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw O(W,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=ue(s);if(!d||!k)throw O(W,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw O(W,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await jc()}catch(p){throw O(W,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,f)=>{te(!0);let y={onSuccess:G=>{O(W,"setWalletPassword","onSuccess",G),p(G)},onFailure:G=>{O(W,"setWalletPassword","onError","user_exited_set_password_flow"),f(G)},callAuthOnSuccessOnClose:!1},L={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:G=>{O(W,"setWalletPassword","onError","unknown_connect_wallet_error"),f(G)}};j({setWalletPassword:y,connectWallet:L}),pe("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(f,y)=>{if(!a||!s){O(W,"signMessage","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=ue(s);if(!L){O(W,"signMessage","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){O(W,"signMessage","onError","invalid_message"),y(new Error("Message must be a non-empty string"));return}te(!0);let G=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let de=await Re();if(!k||!de)throw new Error("Unable to connect to wallet");if(!await ce.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:L.address});let{response:ct}=await k.rpc({accessToken:de,address:L.address,request:{method:"personal_sign",params:[d,L.address]}}),Cr=ct.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:L.address}),Cr};if(N.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let de=await G();O(W,"signMessage","onSuccess",de),f(de)}catch(de){O(W,"signMessage","onError","unable_to_sign"),y(de??new ge("Unable to sign message"))}}else{let ct={method:"personal_sign",data:d,confirmAndSign:G,onSuccess:Ze=>{O(W,"signMessage","onSuccess",Ze),f(Ze)},onFailure:Ze=>{O(W,"signMessage","onError","unable_to_sign"),y(Ze)},uiOptions:p||{}},Cr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Ze=>{O(W,"signMessage","onError","unknown_connect_wallet_error"),y(Ze)}};j({signMessage:ct,connectWallet:Cr}),pe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(f,y)=>{if(!a||!s){O(W,"signTypedData","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=ue(s);if(!L){O(W,"signTypedData","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}te(!0);let G=Ji(d),de=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Je=await Re();if(!k||!Je)throw new Error("Unable to connect to wallet");if(!await ce.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:L.address});let{response:Cr}=await k.rpc({accessToken:Je,address:L.address,request:{method:"eth_signTypedData_v4",params:[L.address,G]}}),Ze=Cr.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:L.address}),Ze};if(N.embeddedWallets.noPromptOnSignature||(N.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Je=await de();O(W,"signTypedData","onSuccess",Je),f(Je)}catch(Je){O(W,"signTypedData","onError","unable_to_sign"),y(Je??new ge("Unable to sign message"))}}else{let Cr={method:"eth_signTypedData_v4",data:G,confirmAndSign:de,onSuccess:Ut=>{O(W,"signTypedData","onSuccess",Ut),f(Ut)},onFailure:Ut=>{O(W,"signTypedData","onError","unable_to_sign"),y(Ut)},uiOptions:p||{}},Ze={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Ut=>{O(W,"signMessage","onError","unknown_connect_wallet_error"),y(Ut)}};j({signMessage:Cr,connectWallet:Ze}),pe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,f)=>{let L=await(await qc(d,p,f)).wait();return Os(L)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let f=ue(s);if(!f){p(new Error("Must have a Privy wallet before exporting"));return}te(!0);let y={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},L=await Re();if(!L||!k){p(new Error("Must have valid access token to enroll in MFA"));return}if(!k){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await k.connect({accessToken:L,address:f.address}),await k.verifyMfa({accessToken:L})}catch(de){if(bo(de))await ce.recoverEmbeddedWallet();else throw de}}catch(de){p(de);return}let G={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};j({keyExport:G,connectWallet:y}),pe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:jc,async init(d){let p;switch(d){case"sms":p=new Hs("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":mt.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((f,y)=>{Pe.current={resolve:f,reject:y}});break;default:throw mt.current?.reject(new T("Unsupported MFA method")),new T(`Unsupported MFA method: ${d}`)}},cancel(){mt.current?.reject(new T("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Re();if(!p||!k)throw new Error("Must have valid access token to enroll in MFA");await k.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,f)=>{if(!d){ce.closePrivyModal(),p();return}N.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),j({mfaEnrollmentFlow:{mfaMethods:N.mfa.methods,onSuccess:p,onFailure:f}}),pe("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Re();if(!d||!k)throw new Error("Must have valid access token to enroll in MFA");let p=await k.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Re();if(!p||!k)throw new Error("Must have valid access token to enroll in MFA");await k.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async submitEnrollmentWithTotp(d){let p=await Re();if(!p||!k)throw new Error("Must have valid access token to enroll in MFA");await k.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async unenroll(d){let p=await Re();if(!p||!k)throw new Error("Must have valid access token to remove MFA");await k.unenrollMfa({method:d,accessToken:p});let f=await t.getAuthenticatedUser();c(f)},isHeadlessOAuthLoading:E,loginWithCode(d){return ce.loginWithCode(d)},initLoginWithEmail(d){return ce.initLoginWithEmail(d)},initLoginWithSms(d){return ce.initLoginWithSms(d)},fundWallet(d,p){return ce.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return ce.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return ce.loginWithHeadlessOAuth(d)},isModalOpen:r};Ey=Ro.signMessage,Py=Ro.signTypedData,Ty=async(...d)=>{let p=await qc(...d);return N.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let Kc=!!e.config?.headless,ce=(()=>({headless:Kc,isNewUserThisSession:g,linkingHint:F,pendingTransaction:null,walletConnectionStatus:I,mipdStore:S,connectors:t.connectors?.walletConnectors??[],rpcConfig:N.rpcConfig,chains:N.chains,appId:e.appId,showFiatPrices:N.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>N.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(k)return k;let p=new Promise(L=>{Fe(()=>G=>L(G))}),f=new Promise(L=>setTimeout(()=>L(null),d)),y=await Promise.race([p,f]);return Fe(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s;B.current==="login"?d.shouldCallAuthOnSuccess&&p?(O(W,"login","onComplete",s,g,!1,ne.current??null),e.onSuccess?.(s,g)):O(W,"login","onError","exited_auth_flow"):B.current==="link"&&ne.current&&(d.isSuccess&&p?O(W,"linkAccount","onSuccess",s,ne.current):O(W,"linkAccount","onError","exited_link_flow")),z(null),B.current=null,ne.current=null,w(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:pe,connectWallet:Wr,initLoginWithWallet:async(d,p)=>{ne.current="siwe",ao(d,p)},loginWithWallet:async()=>{if(!n)throw new Io;if(!(t.authFlow instanceof uo))throw new T("Must initialize SIWE flow first.");let d,p;if(a)try{d=await t.link(),ne.current="siwe"}catch(f){throw O(W,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:d,isNewUser:p}=await t.authenticate()),ne.current="siwe"}catch(f){throw O(W,"login","onError",f.privyErrorCode||"generic_connect_wallet_error"),f}c(d||s||null),w(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new On(d);t.startAuthFlow(p);try{ne.current="farcaster",await p.initializeFarcasterConnect()}catch(f){throw B.current==="login"?O(W,"login","onError",f.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",f.privyErrorCode||"unknown_auth_error"),f}},loginWithFarcaster:async()=>{if(!n)throw new Io;if(!(t.authFlow instanceof On))throw new T("Must initialize Farcaster flow first.");let d,p;if(a)try{d=await t.link(),ne.current="farcaster"}catch(f){throw O(W,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:d,isNewUser:p}=await t.authenticate()),ne.current="farcaster"}catch(f){throw O(W,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}c(d||null),w(p||!1),l(!0)},async initLoginWithOAuth(d,p){if(ne.current=d,il()){if(d==="google"&&Bs(window.navigator.userAgent)){st("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{st("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let f=new tr({provider:d});p&&f.addCaptchaToken(p),t.startAuthFlow(f);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&window.location.assign(y.url)},async loginWithOAuth(d){if(!(t.authFlow instanceof tr))throw new T("Must initialize OAuth flow before calling loginWithOAuth");let p=Ge.get(co),f=t.authFlow.meta.stateCode;if(p!==f)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:f??""}),new T("Unexpected auth flow. This may be a phishing attempt.");let y,L;if(a)try{y=await t.link(),ne.current=d}catch(G){throw O(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}else try{({user:y,isNewUser:L}=await t.authenticate()),ne.current=d}catch(G){throw B.current==="login"?O(W,"login","onError",G.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}c(y),w(L||!1),l(!0)},async initLoginWithHeadlessOAuth(d,p){if(il()){if(d==="google"&&Bs(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let f=new tr({provider:d,headless:!0});p&&f.addCaptchaToken(p);let y=await t.startAuthFlow(f).getAuthorizationUrl();y?.url&&window.location.assign(y.url)},async loginWithHeadlessOAuth(d){P(!0),t.startAuthFlow(new tr(d));let p=Ge.get(co),f=d.stateCode;if(p!==f)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d.provider,storedStateCode:p??"",returnedStateCode:f??""}),P(!1),new T("Unexpected auth flow. This may be a phishing attempt.");let y,L;if(a)try{y=await t.link(),ne.current=d.provider}catch(G){throw O(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}else try{({user:y,isNewUser:L}=await t.authenticate()),ne.current=d.provider}catch(G){throw B.current==="login"?O(W,"login","onError",G.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}return c(y),w(L||!1),l(!0),P(!1),y??void 0},initLoginWithEmail:async(d,p)=>{let f=new Or(d,p);t.startAuthFlow(f);try{ne.current="email",await f.sendCodeEmail()}catch(y){throw B.current==="login"?O(W,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}},initUpdateEmail:async(d,p,f)=>{let y=new Fi(d,p,f);t.startAuthFlow(y),await y.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let f=new mo(d,p);t.startAuthFlow(f);try{ne.current="sms",await f.sendSmsCode()}catch(y){throw B.current==="login"?O(W,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(!n)throw new Io;if(t.authFlow instanceof Or)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof mo)t.authFlow.meta.smsCode=d.trim();else throw new T("Must initialize a passwordless code flow first");let p,f;if(a)try{p=await t.link()}catch(y){throw O(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}else try{({user:p,isNewUser:f}=await t.authenticate())}catch(y){throw O(W,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}c(p||s||null),w(f||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:k,createAnalyticsEvent:(d,p,f)=>t.createAnalyticsEvent(d,p,f),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let f=s?.linkedAccounts.find(L=>L.type==="wallet"&&L.walletClientType==="privy"),y=await Re();if(!y||!k||!f){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}te(!0);try{await k.connect({accessToken:y,address:f.address}),d(!0)}catch(L){bo(L)&&f.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:f.address}),(await k.recover({address:f.address,accessToken:y})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:f.address}),d(!0)):bo(L)?(j({recoverWallet:{privyWallet:f,onFailure:p,onSuccess:()=>d(!0)}}),pe("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(L)}}),getFiatOnRampConfig:Xt,setReadyToTrue:()=>{i(!0),Ue?.()},updateWallets:()=>Lr(),fundWallet:async(d,p)=>{let{signedUrl:f,externalTransactionId:y}=await Xt(d,p);j({fiatOnRampPrompt:{signedUrl:f},fiatOnRampStatus:{externalTransactionId:y}}),pe("FIAT_ON_RAMP_PROMPT_SCREEN")}}))();xy=ce.recoverEmbeddedWallet;let ky=m4(()=>({wallets:u,ready:Ae}),[u,Ae]);return vr(oe.Provider,{value:Ro,children:vr(vl.Provider,{value:W,children:vr(Dc.Provider,{value:ky,children:by(qp,{...N,children:[e.children,by(gl.Provider,{value:ce,children:[!Kc&&N.captchaEnabled&&n&&!a&&vr(yl,{delayedExecution:!1}),vr(fy,{theme:{...N.appearance.palette||{}}}),vr(Rp,{data:se,setModalData:j,setInitialScreen:x,initialScreen:C,authenticated:a,open:r,children:vr(vy,{open:r})}),$&&q?vr(Cy,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:mt,mfaSubmitPromise:Pe,onLoad:K,onLoadFailed:()=>null}):null]})]})})})})};import{useContext as v4}from"react";function w4(e){let{login:t}=v4(oe);return he("login",e),{login:t}}import{useContext as C4}from"react";function b4(e){let{logout:t}=C4(oe);return he("logout",e),{logout:t}}import{useCallback as Sy,useEffect as E4}from"react";function P4(){let e=le(),t=ba(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=H(),l=Sy(async c=>{if(e.enabled&&e.status!=="success")throw new Ht(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=Sy(async()=>{let c=Bn();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{Hn()}},[o]);return E4(()=>{let c=Bn();i&&t&&c.inProgress&&c.headless&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}import{useCallback as _y}from"react";var T4=()=>{let e=le(),{initLoginWithEmail:t,loginWithCode:r}=H(),o=_y(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=_y(async({code:i})=>{if(e.enabled&&e.status==="error")throw new Ht(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as Ay}from"react";var x4=()=>{let e=le(),{initLoginWithSms:t,loginWithCode:r}=H(),o=Ay(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return t(i)},[t]),n=Ay(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new Ht(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useContext as S4}from"react";function _4(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:m,linkFarcaster:h}=S4(oe);return he("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:m,linkFarcaster:h}}import{useContext as A4}from"react";function k4(e){let{connectWallet:t}=A4(oe);return he("connectWallet",e),{connectWallet:t}}import{useContext as R4}from"react";function I4(e){let{createWallet:t}=R4(oe);return he("createWallet",e),{createWallet:t}}var M4=()=>{let{fundWallet:e}=H();return{fundWallet:e}};import{useContext as W4}from"react";function L4(e){let{sendTransaction:t}=W4(oe);return he("sendTransaction",e),{sendTransaction:t}}import{useContext as O4}from"react";function N4(e){let{setWalletPassword:t}=O4(oe);return he("setWalletPassword",e),{setWalletPassword:t}}import{useContext as D4}from"react";function U4(e){let{signMessage:t}=D4(oe);return he("signMessage",e),{signMessage:t}}import{useContext as F4}from"react";function B4(e){let{signTypedData:t}=F4(oe);return he("signTypedData",e),{signTypedData:t}}import{useContext as H4}from"react";var G4=()=>{let{isModalOpen:e}=H4(oe);return{isOpen:e}};import{useContext as V4}from"react";function z4(e){let{getAccessToken:t}=V4(oe);return he("accessToken",e),{getAccessToken:t}}function $4(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}export{rr as AsExternalProvider,yl as Captcha,qn as ConnectorManager,jn as PrivyClient,y4 as PrivyProvider,me as PrivyProxyProvider,zn as SUPPORTED_CHAINS,Zs as VERSION,dt as WalletConnector,$4 as addRpcUrlOverrideToChain,$l as errorIndicatesMaxMfaRetries,ln as errorIndicatesMfaTimeout,cn as errorIndicatesMfaVerificationFailed,Re as getAccessToken,k4 as useConnectWallet,I4 as useCreateWallet,M4 as useFundWallet,_4 as useLinkAccount,w4 as useLogin,T4 as useLoginWithEmail,P4 as useLoginWithOAuth,x4 as useLoginWithSms,b4 as useLogout,Pn as useMfa,Ei as useMfaEnrollment,G4 as useModalStatus,H as usePrivy,wl as useRegisterMfaListener,L4 as useSendTransaction,N4 as useSetWalletPassword,U4 as useSignMessage,B4 as useSignTypedData,z4 as useToken,ki as useWallets};