@privy-io/react-auth 1.58.1 → 1.58.2-beta-20240304210939
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 +224 -224
- package/dist/index.js +225 -225
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Zg=Object.create;var ua=Object.defineProperty;var Xg=Object.getOwnPropertyDescriptor;var ev=Object.getOwnPropertyNames;var tv=Object.getPrototypeOf,ov=Object.prototype.hasOwnProperty;var rv=(e,t)=>{for(var o in t)ua(e,o,{get:t[o],enumerable:!0})},md=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ev(t))!ov.call(e,n)&&n!==o&&ua(e,n,{get:()=>t[n],enumerable:!(r=Xg(t,n))||r.enumerable});return e};var f=(e,t,o)=>(o=e!=null?Zg(tv(e)):{},md(t||!e||!e.__esModule?ua(o,"default",{value:e,enumerable:!0}):o,e)),nv=e=>md(ua({},"__esModule",{value:!0}),e);var xl=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)};var fd=(e,t,o)=>(xl(e,t,"read from private field"),o?o.call(e):t.get(e)),ma=(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)},Sl=(e,t,o,r)=>(xl(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o);var hd=(e,t,o)=>(xl(e,t,"access private method"),o);var xb={};rv(xb,{AsExternalProvider:()=>ho,Captcha:()=>ss,ConnectorManager:()=>Ln,PrivyClient:()=>On,PrivyProvider:()=>Pg,PrivyProxyProvider:()=>Se,SUPPORTED_CHAINS:()=>Wn,VERSION:()=>Ea,WalletConnector:()=>vt,addRpcUrlOverrideToChain:()=>Kg,errorIndicatesMaxMfaRetries:()=>ks,errorIndicatesMfaTimeout:()=>Zr,errorIndicatesMfaVerificationFailed:()=>Xr,getAccessToken:()=>Ke,useConnectWallet:()=>Wg,useCreateWallet:()=>Ng,useFundWallet:()=>Lg,useLogin:()=>Sg,useLoginWithEmail:()=>kg,useLoginWithSms:()=>Rg,useLogout:()=>Ag,useMfa:()=>cn,useMfaEnrollment:()=>ui,useModalStatus:()=>$g,usePrivy:()=>G,useRegisterMfaListener:()=>ps,useSendTransaction:()=>Dg,useSetWalletPassword:()=>Fg,useSignMessage:()=>Hg,useSignTypedData:()=>Vg,useToken:()=>jg,useWallets:()=>vi});module.exports=nv(xb);var la=require("@ethersproject/address"),Ei=require("@ethersproject/providers"),wg=require("mipd"),J=require("react");var yd=require("ofetch"),rt=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}]`:""}`}},Io=class extends rt{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},C=class extends rt{constructor(o,r,n){super(o,r,n);this.type="client_error"}},fa=class extends C{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var Z=class extends rt{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},me=e=>{if(e instanceof rt)return e;if(!(e instanceof yd.FetchError))return ft(e);if(!e.response)return new Io("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new Io(t||"ApiError",e.response.status,o||r,e,n)},ft=e=>e instanceof rt?e:e instanceof Error?new C(e.message,e):new C(`Internal error: ${e}`);var vn=class extends C{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Nt=class extends C{constructor(t="Embedded wallet error",o){super(t,o,"unknown_embedded_wallet_error")}},ha=class extends C{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var ya=()=>"/api/v1/sessions",ga=()=>"/api/v1/sessions/logout",gd=()=>"/api/v1/sessions/fork",va=()=>"/api/v1/sessions/fork/recover",vd=()=>"/api/v1/siwe/init",wd=()=>"/api/v1/siwe/authenticate",Cd=()=>"/api/v1/siwe/link",bd=()=>"/api/v1/farcaster/init",Ed=()=>"/api/v1/farcaster/authenticate",Td=()=>"/api/v1/farcaster/link",Pd=()=>"/api/v1/farcaster/status",xd=()=>"/api/v1/passwordless/init",Sd=()=>"/api/v1/passwordless/authenticate",_d=()=>"/api/v1/passwordless/link",Ad=()=>"/api/v1/passwordless/update",kd=()=>"/api/v1/passwordless_sms/init",Rd=()=>"/api/v1/passwordless_sms/authenticate",Id=()=>"/api/v1/passwordless_sms/link",Wd=()=>"/api/v1/oauth/init",Md=()=>"/api/v1/oauth/authenticate",Nd=()=>"/api/v1/oauth/link",Ld=()=>"/api/v1/siwe/unlink",Od=()=>"/api/v1/passwordless/unlink",Dd=()=>"/api/v1/passwordless_sms/unlink",Ud=()=>"/api/v1/oauth/unlink",Fd=()=>"/api/v1/farcaster/unlink",Bd=()=>"/api/v1/analytics_events",Hd=()=>"/api/v1/plugins/moonpay_on_ramp/sign",Gd=()=>"/api/v1/custom_jwt_account/authenticate",Vd=()=>"/api/v1/mfa/passwordless_sms/init";var zd=()=>"/api/v1/mfa/passwordless_sms/enroll";var $d=()=>"/api/v1/users/me/accept_terms";var wn=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");try{let t=Gd(),o=await this.api.post(t,{token:this.meta.token});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw me(t)}}async link(){throw new Error("Unimplemented")}};var Cr=class{constructor(t,o){this.meta={email:t,captchaToken:o}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new C("Email and email code must be set prior to calling authenticate.");try{let t=Sd(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new C("Email and email code must be set prior to calling authenticate.");try{let t=_d();return await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw me(t)}}async sendCodeEmail(t,o){if(!this.api)throw new C("Auth flow has no API instance");if(t&&(this.meta.email=t),o&&(this.meta.captchaToken=o),!this.meta.email)throw new C("Email must be set when initialzing authentication.");try{let r=xd();return await this.api.post(r,{email:this.meta.email,token:this.meta.captchaToken})}catch(r){throw me(r)}}},wa=class extends Cr{constructor(o,r,n){super(r,n);this.meta={email:r,captchaToken:n,oldAddress:o}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new C("Email, email code, and an old email address must be set prior to calling update.");try{let o=Ad();return await this.api.post(o,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(o){throw me(o)}}};var qd=require("react-device-detect");var ht=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 xi=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new ht(this._startChannelOnce.bind(this)),this.pollForReady=new ht(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.channelToken)throw new C("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 C("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new C("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 me(t)}}async _startChannelOnce(){if(!this.api)throw new C("Auth flow has no API instance");let t=await this.api.post(bd(),{token:this.captchaToken});qd.isMobile&&t.connect_uri&&window.open(t.connect_uri,"_blank","noopener noreferrer"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new C("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.channelToken)throw new C("Auth flow must be initialized first");let t=await this.api.get(Pd(),{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var Nl=require("jose");var jd="1.58.1";var Ca="4df5e2316331463a9130964bd6078dfa",Kd="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",Yd="34357d3c125c2bcf2ce2bc3309d98715",ba="https://auth.privy.io",Jd=2e4,yt=1400,Qd=2500,Ea=jd;var zr="privy:token",_l="privy-token",Ta="privy:refresh_token",Al="privy-refresh-token",Pa="privy-session",Si="privy:session_transfer_token",av="privy:wallet",_i="privy:caid",Cn="privy:state_code",bn="privy:code_verifier",xa=e=>`${av}:${e}`,kl="privy:connectors",Rl="privy:connections";var $r=12e4,tr=1,Il="0x1",En=3e4,Zd="https://api.moonpay.com/v1",Xd="https://api.moonpay.com/v1",ep="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",tp="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",op="0x420000000000000000000000000000000000000F",rp=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function np(e){let t=new TextEncoder().encode(e),o=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(o)}function ip(e){return crypto.getRandomValues(new Uint8Array(e))}var Sa=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)}},Wl=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)}},Ml=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 ap(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function sv(){return typeof window<"u"&&window.localStorage?new Wl:new Sa}function lv(){return typeof window<"u"&&window.sessionStorage?new Ml:new Sa}var uo=lv(),de=sv();var cv="S256",dv="S256",br=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=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 C("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new C("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new C("User denied confirmation during OAuth flow");let t=uo.get(bn);if(!t)throw new C("Authentication error.");try{let o=Md(),r=await this.api.post(o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return uo.del(bn),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(o){let r=me(o);throw r.privyErrorCode?new C(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.message==="User denied confirmation during OAuth flow"?new C("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new C("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new C("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new C("User denied confirmation during OAuth flow");let t=uo.get(bn);if(!t)throw new C("Authentication error.");try{let o=Nd(),r=await this.api.post(o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return uo.del(bn),r}catch(o){throw me(o)}}createCodeVerifier(){return Nl.base64url.encode(ip(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,o=cv){if(o==dv){let r=await np(t);return Nl.base64url.encode(r)}else return t}async getAuthorizationUrl(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.provider)throw new C("Provider must be set when initializing OAuth authentication.");let t=this.createCodeVerifier();uo.put(bn,t);let o=this.createStateCode();uo.put(Cn,o);let r=await this.deriveCodeChallengeFromCodeVerifier(t);try{let n=Wd();return await this.api.post(n,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:o})}catch(n){throw me(n)}}};var qr=class{constructor(t,o){this.createSiweMessage=(t,o,r,n,i,a,l)=>`${r} wants you to sign in with your Ethereum account:
|
|
1
|
+
"use strict";var cv=Object.create;var fa=Object.defineProperty;var dv=Object.getOwnPropertyDescriptor;var pv=Object.getOwnPropertyNames;var uv=Object.getPrototypeOf,mv=Object.prototype.hasOwnProperty;var fv=(e,t)=>{for(var o in t)fa(e,o,{get:t[o],enumerable:!0})},Cd=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pv(t))!mv.call(e,n)&&n!==o&&fa(e,n,{get:()=>t[n],enumerable:!(r=dv(t,n))||r.enumerable});return e};var f=(e,t,o)=>(o=e!=null?cv(uv(e)):{},Cd(t||!e||!e.__esModule?fa(o,"default",{value:e,enumerable:!0}):o,e)),hv=e=>Cd(fa({},"__esModule",{value:!0}),e);var kl=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)};var bd=(e,t,o)=>(kl(e,t,"read from private field"),o?o.call(e):t.get(e)),ha=(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)},Rl=(e,t,o,r)=>(kl(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o);var Ed=(e,t,o)=>(kl(e,t,"access private method"),o);var Mb={};fv(Mb,{AsExternalProvider:()=>fo,Captcha:()=>cs,ConnectorManager:()=>Nn,PrivyClient:()=>Ln,PrivyProvider:()=>Ng,PrivyProxyProvider:()=>Se,SUPPORTED_CHAINS:()=>In,VERSION:()=>Pa,WalletConnector:()=>wt,addRpcUrlOverrideToChain:()=>nv,errorIndicatesMaxMfaRetries:()=>Is,errorIndicatesMfaTimeout:()=>Yr,errorIndicatesMfaVerificationFailed:()=>Jr,getAccessToken:()=>Ke,useConnectWallet:()=>Gg,useCreateWallet:()=>zg,useFundWallet:()=>$g,useLogin:()=>Og,useLoginWithEmail:()=>Fg,useLoginWithSms:()=>Bg,useLogout:()=>Ug,useMfa:()=>an,useMfaEnrollment:()=>ui,useModalStatus:()=>tv,usePrivy:()=>G,useRegisterMfaListener:()=>ms,useSendTransaction:()=>jg,useSetWalletPassword:()=>Yg,useSignMessage:()=>Qg,useSignTypedData:()=>Xg,useToken:()=>rv,useWallets:()=>Ci});module.exports=hv(Mb);var pa=require("@ethersproject/address"),Pi=require("@ethersproject/providers"),kg=require("mipd"),J=require("react");var Td=require("ofetch"),nt=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}]`:""}`}},Ro=class extends nt{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},C=class extends nt{constructor(o,r,n){super(o,r,n);this.type="client_error"}},ya=class extends C{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var Z=class extends nt{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},me=e=>{if(e instanceof nt)return e;if(!(e instanceof Td.FetchError))return ht(e);if(!e.response)return new Ro("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new Ro(t||"ApiError",e.response.status,o||r,e,n)},ht=e=>e instanceof nt?e:e instanceof Error?new C(e.message,e):new C(`Internal error: ${e}`);var gn=class extends C{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Nt=class extends C{constructor(t="Embedded wallet error",o){super(t,o,"unknown_embedded_wallet_error")}},ga=class extends C{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var va=()=>"/api/v1/sessions",wa=()=>"/api/v1/sessions/logout",Pd=()=>"/api/v1/sessions/fork",Ca=()=>"/api/v1/sessions/fork/recover",xd=()=>"/api/v1/siwe/init",Sd=()=>"/api/v1/siwe/authenticate",_d=()=>"/api/v1/siwe/link",Ad=()=>"/api/v1/farcaster/init",kd=()=>"/api/v1/farcaster/authenticate",Rd=()=>"/api/v1/farcaster/link",Id=()=>"/api/v1/farcaster/status",Wd=()=>"/api/v1/passwordless/init",Md=()=>"/api/v1/passwordless/authenticate",Nd=()=>"/api/v1/passwordless/link",Ld=()=>"/api/v1/passwordless/update",Od=()=>"/api/v1/passwordless_sms/init",Dd=()=>"/api/v1/passwordless_sms/authenticate",Ud=()=>"/api/v1/passwordless_sms/link",Fd=()=>"/api/v1/oauth/init",Bd=()=>"/api/v1/oauth/authenticate",Hd=()=>"/api/v1/oauth/link",Gd=()=>"/api/v1/siwe/unlink",Vd=()=>"/api/v1/passwordless/unlink",zd=()=>"/api/v1/passwordless_sms/unlink",$d=()=>"/api/v1/oauth/unlink",qd=()=>"/api/v1/farcaster/unlink",jd=()=>"/api/v1/analytics_events",Kd=()=>"/api/v1/plugins/moonpay_on_ramp/sign",Yd=()=>"/api/v1/custom_jwt_account/authenticate",Jd=()=>"/api/v1/mfa/passwordless_sms/init";var Qd=()=>"/api/v1/mfa/passwordless_sms/enroll";var Zd=()=>"/api/v1/users/me/accept_terms";var vn=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");try{let t=Yd(),o=await this.api.post(t,{token:this.meta.token});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw me(t)}}async link(){throw new Error("Unimplemented")}};var gr=class{constructor(t,o){this.meta={email:t,captchaToken:o}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new C("Email and email code must be set prior to calling authenticate.");try{let t=Md(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new C("Email and email code must be set prior to calling authenticate.");try{let t=Nd();return await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw me(t)}}async sendCodeEmail(t,o){if(!this.api)throw new C("Auth flow has no API instance");if(t&&(this.meta.email=t),o&&(this.meta.captchaToken=o),!this.meta.email)throw new C("Email must be set when initialzing authentication.");try{let r=Wd();return await this.api.post(r,{email:this.meta.email,token:this.meta.captchaToken})}catch(r){throw me(r)}}},ba=class extends gr{constructor(o,r,n){super(r,n);this.meta={email:r,captchaToken:n,oldAddress:o}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new C("Email, email code, and an old email address must be set prior to calling update.");try{let o=Ld();return await this.api.post(o,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(o){throw me(o)}}};var Xd=require("react-device-detect");var yt=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 _i=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new yt(this._startChannelOnce.bind(this)),this.pollForReady=new yt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.channelToken)throw new C("Auth flow must be initialized first");try{let t=await this.api.post(kd(),{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new C("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");try{return await this.api.post(Rd(),{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw me(t)}}async _startChannelOnce(){if(!this.api)throw new C("Auth flow has no API instance");let t=await this.api.post(Ad(),{token:this.captchaToken});Xd.isMobile&&t.connect_uri&&window.open(t.connect_uri,"_blank","noopener noreferrer"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new C("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.channelToken)throw new C("Auth flow must be initialized first");let t=await this.api.get(Id(),{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var Ul=require("jose");var ep="1.58.2-beta-20240304210939";var Ea="4df5e2316331463a9130964bd6078dfa",tp="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",op="34357d3c125c2bcf2ce2bc3309d98715",Ta="https://auth.privy.io",rp=2e4,gt=1400,np=2500,Pa=ep;var Gr="privy:token",Il="privy-token",xa="privy:refresh_token",Wl="privy-refresh-token",Sa="privy-session",Ai="privy:session_transfer_token",gv="privy:wallet",ki="privy:caid",wn="privy:state_code",Cn="privy:code_verifier",_a=e=>`${gv}:${e}`,Ml="privy:connectors",Nl="privy:connections";var Vr=12e4,Zo=1,Ll="0x1",bn=3e4,ip="https://api.moonpay.com/v1",ap="https://api.moonpay.com/v1",sp="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",lp="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",cp="0x420000000000000000000000000000000000000F",dp=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function pp(e){let t=new TextEncoder().encode(e),o=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(o)}function up(e){return crypto.getRandomValues(new Uint8Array(e))}var Aa=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)}},Ol=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)}},Dl=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 mp(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function vv(){return typeof window<"u"&&window.localStorage?new Ol:new Aa}function wv(){return typeof window<"u"&&window.sessionStorage?new Dl:new Aa}var po=wv(),ce=vv();var Cv="S256",bv="S256",vr=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=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 C("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new C("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new C("User denied confirmation during OAuth flow");let t=po.get(Cn);if(!t)throw new C("Authentication error.");try{let o=Bd(),r=await this.api.post(o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return po.del(Cn),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(o){let r=me(o);throw r.privyErrorCode?new C(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.message==="User denied confirmation during OAuth flow"?new C("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new C("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new C("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new C("User denied confirmation during OAuth flow");let t=po.get(Cn);if(!t)throw new C("Authentication error.");try{let o=Hd(),r=await this.api.post(o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return po.del(Cn),r}catch(o){throw me(o)}}createCodeVerifier(){return Ul.base64url.encode(up(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,o=Cv){if(o==bv){let r=await pp(t);return Ul.base64url.encode(r)}else return t}async getAuthorizationUrl(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.provider)throw new C("Provider must be set when initializing OAuth authentication.");let t=this.createCodeVerifier();po.put(Cn,t);let o=this.createStateCode();po.put(wn,o);let r=await this.deriveCodeChallengeFromCodeVerifier(t);try{let n=Fd();return await this.api.post(n,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:o})}catch(n){throw me(n)}}};var zr=class{constructor(t,o){this.createSiweMessage=(t,o,r,n,i,a,l)=>`${r} wants you to sign in with your Ethereum account:
|
|
2
2
|
${o}
|
|
3
3
|
|
|
4
4
|
${l}
|
|
@@ -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 ht(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 C("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(wd(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign();return await this.api.post(Cd(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw me(t)}}async sign(){if(!this.api)throw new C("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new C("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 C("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(vd(),{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new C("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 jr=class{constructor(t,o){this.meta={phoneNumber:t,captchaToken:o}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new C("phone number and sms code must be set prior to calling authenticate.");try{let t=Rd(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new C("phone number and sms code must be set prior to calling authenticate.");try{let t=Id();return await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw me(t)}}async sendSmsCode(t,o){if(!this.api)throw new C("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),o&&(this.meta.captchaToken=o),!this.meta.phoneNumber)throw new C("phone nNumber must be set when initialzing authentication.");try{let r=kd();return await this.api.post(r,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(r){throw me(r)}}};var pu=require("uuid");function gt(e){return new Date(e*1e3)}function pv(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:gt(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:gt(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:gt(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:gt(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:gt(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:gt(o.verified_at)};t.push(c);break;case"discord_oauth":let m={subject:o.subject,username:o.username,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(m);break;case"github_oauth":let y={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(y);break;case"tiktok_oauth":let g={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:gt(o.verified_at)};t.push(g);break;case"linkedin_oauth":let v={subject:o.subject,name:o.name,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(v);break;case"apple_oauth":let b={subject:o.subject,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(b);break;case"custom_auth":t.push({type:o.type,customUserId:o.custom_user_id,verifiedAt:gt(o.verified_at)});break;case"farcaster":let T={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:gt(o.verified_at)};t.push(T);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function jt(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var ke=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,uv=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Kt=(e,t)=>t==="all-users"&&!ke(e)||t==="users-without-wallets"&&!uv(e)?.length;function Lt(e){if(!e)return null;let t=pv(e.linked_accounts),o=jt(t,"wallet"),r=jt(t,"email"),n=jt(t,"phone"),i=jt(t,"google_oauth"),a=jt(t,"twitter_oauth"),l=jt(t,"discord_oauth"),s=jt(t,"github_oauth"),c=jt(t,"spotify_oauth"),m=jt(t,"tiktok_oauth"),y=jt(t,"linkedin_oauth"),g=jt(t,"apple_oauth"),v=jt(t,"farcaster"),b=e.mfa_methods.map(({type:x,verified_at:E})=>({type:x,verifiedAt:gt(E)}));return{id:e.id,createdAt:gt(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:m&&{subject:m.subject,username:m.username,name:m.name},linkedin:y&&{subject:y.subject,name:y.name,email:y.email},apple:g&&{subject:g.subject,email:g.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url},mfaMethods:b.map(x=>x.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var $l=require("@ethersproject/address"),su=f(require("eventemitter3"));function sp(){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 _a=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 Ll=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||_a(e)!=="MetaMask")return!1;if(e.providers){for(let o of e.providers)if(!Ll(o))return!1}return!0},Er=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),lp=()=>{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 cp=(e,t)=>{let o=[],r=[];for(let[n,i]of e.entries())n<t?o.push(i):r.push(i);return[o,r]},Aa=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,}))$/),dp=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Tr=(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}`},Ol=e=>new Promise(t=>setTimeout(t,e));function pp(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 up=(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 Ol(o)}a||i(new Error("Exceeded max attempts before resolving function"))})},ka=(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 Dl=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Kr=e=>typeof e=="string"?e:"0x"+e.toString(16);async function mp(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 sp()){let m=_a(c);if(!l.some(y=>y.info.name===m)){if(Ll(c,!0)&&!s.find(y=>y.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(m==="Phantom"&&!s.find(y=>y.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(y=>y.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function Tn(e){return`eip155:${String(Number(e))}`}var mo=(e,t,o)=>{let r=Number(e),n=t.find(a=>a.id===r);if(!n)throw new Z(`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]+"/"+Ca:n.rpcUrls.blast?.http[0]?i=n.rpcUrls.blast.http[0]+"/"+Kd:i=n.rpcUrls.default?.http[0],!i)throw new Z(`No RPC url found for ${e}`);return i},fp=(e,t)=>{let o=Number(e),r=t.find(n=>n.id===o);if(!r)throw new Z(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url},Ra=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},o=Object.entries(e.domain).map(([r,n])=>{if(n!=null&&typeof r=="string"&&r in t)return{name:r,type:t[r]}}).filter(r=>r!==void 0);return{...e,types:{...e.types,EIP712Domain:o}}};var Tp=f(require("@coinbase/wallet-sdk"));var Ai=require("react/jsx-runtime"),ki=({style:e,...t})=>(0,Ai.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Ai.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Ai.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var yo=require("@ethersproject/address"),Fl=require("@ethersproject/providers"),Ep=f(require("eventemitter3"));var Ul=require("@ethersproject/providers"),gp=f(require("eventemitter3"));var mv=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],hp=e=>mv.includes(e);var yp=require("@ethersproject/logger");var Pn=class extends Z{constructor(){super("Wallet timeout");this.type="wallet_error"}},xn=class extends Z{constructor(){super("User rejected connection");this.type="wallet_error"}},fo=e=>{if(e instanceof Z)return e;if(e?.code&&e?.reason){let t=new nt(e);return e.code===yp.ErrorCode.ACTION_REJECTED&&(t.details=St.E4001_USER_REJECTED_REQUEST),t}return e?.code?new nt(e):new Z("Unknown connector error",e)},Mo=class extends rt{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},nt=class extends Mo{constructor(o){let r=o;super(r.message,r.code,r.data);let n=Object.values(St).find(i=>i.eipCode===r.code);this.details=n||St.UNKNOWN_ERROR,r.code===-32002&&(r.message?.includes("already pending for origin")?r.message?.includes("wallet_requestPermissions")?this.details=St.E32002_CONNECTION_ALREADY_PENDING:this.details=St.E32002_REQUEST_ALREADY_PENDING:r.message?.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=St.E32002_WALLET_LOCKED))}},fv={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}},hv={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}},yv={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},St={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...yv,...hv},or={...fv,...St};var Se=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 Pn,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||$r,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 Z(`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 fo(o)})}},Pr=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Ia=class extends gp.default{constructor(o,r,n,i,a=1){super();this.walletProxy=o,this.address=r,this.chainId=a,this.rpcConfig=n,this.chains=i,this.provider=new Ul.StaticJsonRpcProvider(mo(a,this.chains,n)),this.rpcTimeoutDuration=Sn(n,"privy")}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Pr(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Ke()||!this.address)throw new Pr("Disconnected",4900);return(await Cp(r)).hash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Pr(`Invalid params for ${o.method}`,4200);let r;if(typeof o.params[0]=="string")r=o.params[0];else if("chainId"in o.params[0]&&typeof o.params[0].chainId=="string")r=o.params[0].chainId;else throw new Pr(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new Ul.StaticJsonRpcProvider(mo(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 vp(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 wp(Ra(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:Kr(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 Kr(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(hp(o.method)){let r=await Ke();if(await bp(),!r||!this.address)throw new Pr("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new Pr("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await Ke();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}}},ho=class extends Se{constructor(o){super(o,o.rpcTimeoutDuration)}},xr=class extends Se{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 gv=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},vt=class extends Ep.default{constructor(o,r,n,i){super();this.onAccountsChanged=o=>{o.length===0?this.onDisconnect():this.syncAccounts(o)};this.onChainChanged=o=>{this.wallets.forEach(r=>{r.chainId=Tn(o),this.walletClientType==="privy"&&de.put(xa(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=Sn(i,o),this.connected=!1,this.initialized=!1}buildConnectedWallet(o,r,n){let i=async()=>!!this.wallets.find(a=>(0,yo.getAddress)(a.address)===(0,yo.getAddress)(o));return{address:(0,yo.getAddress)(o),chainId:r,meta:n,switchChain:async a=>{if(!i)throw new Z("Wallet is not currently connected.");let l=this.wallets.find(g=>(0,yo.getAddress)(g.address)===(0,yo.getAddress)(o))?.chainId;if(!l)throw new Z("Unable to determine current chainId.");let s,c;if(typeof a=="number"?(s=`0x${a.toString(16)}`,c=a):(s=a,c=Number(a)),l===Tn(s))return;let m=this.chains.find(g=>g.id===c);if(!m)throw new Z(`Unsupported chainId: ${a}`);let y=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await y()}catch(g){if(gv(g,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:m.name,nativeCurrency:m.nativeCurrency,rpcUrls:[m.rpcUrls.default?.http[0]??""],blockExplorerUrls:[m.blockExplorers?.default.url??""]}]}),y();throw this.walletClientType==="rainbow"&&g.message?.includes("wallet_switchEthereumChain")?new Z(`Rainbow does not support the chainId ${r}`):g}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return new Fl.Web3Provider(new ho(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return new xr(this.proxyProvider)},sign:async a=>{if(!await i())throw new Z("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(o){let r=o;try{if(r===void 0){let c=await this.proxyProvider.request({method:"eth_accounts"});Array.isArray(c)&&(r=c)}}catch{console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.")}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return;let n=r[0],i=(0,yo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=de.get(xa(i));this.chains.find(m=>m.id===Number(c))||(de.del(xa(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 ${Il}`,c),l=Il}let s=Tn(l);if(!a.find(c=>(0,yo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,yo.getAddress)(n),s,c))}Wa(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let o=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((r,n)=>n.connectedAt-r.connectedAt).find(r=>o.find(n=>(0,yo.getAddress)(n)===(0,yo.getAddress)(r.address)))||null}async isConnected(){let o=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(o)&&o.length>0}async sign(o){return await this.connect({showPrompt:!1}),new Fl.Web3Provider(new ho(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 vv=e=>{let t=`https://mainnet.infura.io/v3/${Ca}`,o=1;return e.makeWeb3Provider(t,o)},Ma,Na=class extends vt{constructor(o,r,n){super("coinbase_wallet",o,r,n);this.connectorType="coinbase_wallet";this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),Ma||(Ma=new Tp.default({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(vv(Ma)),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){Ma.disconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:ki,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 Z("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([o[0]])}catch(o){throw fo(o)}}};var Bl=require("react/jsx-runtime"),La=({...e})=>(0,Bl.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Bl.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var Oa=class extends vt{constructor(o,r,n,i){super("privy",r,n,i);this.connectorType="embedded";this.proxyProvider=o,this.subscribeListeners(),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Kr(o?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:La,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Hl=require("react/jsx-runtime"),_n=({style:e,...t})=>(0,Hl.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Hl.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var it=require("react/jsx-runtime"),An=({style:e,...t})=>(0,it.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,it.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,it.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,it.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,it.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,it.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,it.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,it.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,it.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,it.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,it.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,it.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,it.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,it.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var Ri=require("react/jsx-runtime"),No=({style:e,...t})=>(0,Ri.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,Ri.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,Ri.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var Rn=class extends vt{constructor(o,r,n,i,a){super(a||"unknown",o,r,n);this.connectorType="injected";this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l),this.syncAccounts().then(()=>{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 Z("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw fo(o)}}},kn,In=class extends vt{constructor(o,r,n,i,a){super(a??"unknown",o,r,n);this.connectorType="injected";ma(this,kn,void 0);this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0}),a==="metamask"?Sl(this,kn,{name:"MetaMask",icon:An,id:"io.metamask"}):a==="phantom"&&Sl(this,kn,{name:"Phantom",icon:No,id:"phantom"})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return fd(this,kn)??{name:"Browser Extension",icon:_n,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 Z("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw fo(o)}}};kn=new WeakMap;var wv=require("@ethersproject/address"),Cv=require("@ethersproject/providers"),Pp=require("react-device-detect");var Da=class extends Rn{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Pp.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new Z("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw fo(t)}}};var Ua=class extends vt{constructor(o,r){super(o,[],r,{});this.connectorType="null";this.proxyProvider=new Se(void 0,$r);this.connectorType=o}get walletBranding(){return{name:"Wallet",id:""}}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 Fa=class extends Ua{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:No,id:"phantom"}}};var Nn=require("@walletconnect/ethereum-provider"),au=require("react-device-detect");var Jt=require("react");var xp=require("react/jsx-runtime");function Ba({src:e,...t}){return(0,xp.jsx)("img",{src:e,...t,style:{display:"none"}})}var Lo=require("react"),Vp=require("react");var Yt={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:Yd,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Sp=({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 `input.primary.length`");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 bv=new Set(["metamask","coinbase_wallet","rainbow","zerion","phantom","wallet_connect","detected_wallets"]),Ev=e=>bv.has(e),Tv=(e,t,o)=>o.indexOf(e)===t,_p=({input:e})=>e?e.filter(Ev).filter(Tv):Yt.appearance.walletList;var Ha={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 Ga={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 Va={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 Ap={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var kp={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var za={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 $a={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 qa={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 Rp={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 Ip={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 Wp={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 Np={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 Lp={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 Op={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 Dp={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 ja={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 Ka={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 Ja={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 Ii={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 Wi={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 Up={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 Fp={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 Qa={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 Za={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 Xa={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var Wn=[Ha,Ga,Va,Np,Fp,ja,Ka,Ya,Ja,Ii,Wi,Rp,Ip,Wp,Mp,za,$a,qa,Op,Dp,Ap,kp,Qa,Xa,Za,Lp,Up],b2=new Set(Wn.map(e=>e.id));var _r=f(require("tinycolor2")),Bp="#FFFFFF",Pv="#000000",xv=Bp,Sv="#1E1E1D";function _v(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 Sr(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,_r.default)({...e.toHsl(),l:o})}function Hp({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",warnHex:r="#FFB74D",errorHex:n="#EC6351",whiteHex:i=Bp,blackHex:a=Pv}){let l;switch(e){case"light":l=xv;break;case"dark":l=Sv;break;default:l=e;break}let s=(0,_r.default)(l),c=(0,_r.default)(t),m=(0,_r.default)(o),y=(0,_r.default)(r),g=(0,_r.default)(n),v=_v(s.getLuminance()),b=Sr(s,v==="light"?-.04:.11),T=Sr(s,v==="light"?-.88:.87),x=Sr(s,v==="light"?-.77:.75),E=Sr(s,v==="light"?-.43:.45).desaturate(v==="light"?60:20),k=Sr(s,v==="light"?-.08:.25).desaturate(v==="light"?60:20),I=Sr(c,.15),W=Sr(c,-.06),S=(0,_r.default)(c.getLuminance()>.5?a:i),O=Sr(m,-.16);return{colorScheme:v,background:s.toHslString(),background2:b.toHslString(),foreground:T.toHslString(),foreground2:x.toHslString(),foreground3:E.toHslString(),foreground4:k.toHslString(),accent:c.toHslString(),accentLight:I.toHslString(),accentDark:W.toHslString(),foregroundAccent:S.toHslString(),success:m.toHslString(),successDark:O.toHslString(),error:g.toHslString(),warn:y.toHslString()}}function Gl(e,t,o){let r=o?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],i=t?.loginMethods?.filter(Q=>n.includes(Q)),a,l,s,c,m,y,g,v,b,T,x,E;t?.loginMethods?(a=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),c=i?.includes("google"),m=i?.includes("twitter"),y=i?.includes("discord"),v=i?.includes("spotify"),g=i?.includes("tiktok"),T=i?.includes("github"),b=i?.includes("linkedin"),x=i?.includes("apple"),E=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,s=e.walletAuth,c=e.googleOAuth,m=e.twitterOAuth,y=e.discordOAuth,T=e.githubOAuth,v=e.spotifyOAuth,g=e.tiktokOAuth,b=e.linkedinOAuth,x=e.appleOAuth,E=e.farcasterAuth);let k=[a,l].filter(Boolean),I=[c,m,y,T,v,g,b,x,E].filter(Boolean),W=[s].filter(Boolean);if(k.length+I.length+W.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&&W.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):!S&&I.length+k.length===0&&(r("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0);let O=_p({isWalletLoginEnabled:s,input:t?.appearance?.walletList});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 D=Sp({input:t?.loginMethodsAndOrder}),B=t?.intl?.defaultCountry??"US",{chains:V,defaultChain:K}=Av({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),U=!!t?.defaultChain||!!t?.supportedChains,j=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,R,le=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?j?R=t?.embeddedWallets?.noPromptOnSignature??!0:R=t?.embeddedWallets?.noPromptOnSignature??le:R=le,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&R!==!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:Hp({backgroundTheme:t?.appearance?.theme??Yt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Yt.appearance.accentColor}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:O},loginMethods:{wallet:s,email:a,sms:l,google:c,twitter:m,discord:y,github:T,spotify:v,tiktok:g,linkedin:b,apple:x,farcaster:E},loginMethodsAndOrder:D,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Yt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Yt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Yt.rpcConfig.rpcTimeouts},chains:V,defaultChain:K,intl:{defaultCountry:B},shouldEnforceDefaultChainOnConnect:U,captchaEnabled:e.captchaEnabled??Yt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...j?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:R},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:j?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Yt.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??Yt._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Yt._render.inParentNodeId}}}function Gp(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 Av({additionalChains:e,supportedChains:t,defaultChainFromConfig:o,hasRpcConfigDefined:r}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&r&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map(s=>s.rpcUrls.privyWalletOverride?s:Wn.find(m=>m.id===s.id)??s)}else n=Wn.concat(e??[]);let i=t?n[0]:ja,a=o??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var jp=require("react/jsx-runtime"),zp={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:""},Vl=Gl(zp,void 0,!1),zl=(0,Vp.createContext)({appConfig:Vl,isServerConfigLoaded:!1}),$p=({children:e,legacyCreateEmbeddedWalletFlag:t,client:o,clientConfig:r})=>{let[n,i]=(0,Lo.useState)(null),a=(0,Lo.useMemo)(()=>Gl(n??zp,r,!!n),[n,r]);return(0,Lo.useEffect)(()=>{let l=Gp(r,t);o.createAnalyticsEvent("sdk_initialize",l)},[r,t]),(0,Lo.useEffect)(()=>{n||(async()=>{try{let s=await o.getServerConfig();s.customApiUrl&&o.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,jp.jsx)(zl.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},es=()=>{let{appConfig:e}=(0,Lo.useContext)(zl);return e},qp=()=>{let{isServerConfigLoaded:e}=(0,Lo.useContext)(zl);return e};var P=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var ts=require("react/jsx-runtime"),Kp=(0,Jt.createContext)({ready:!1,app:Vl,currentScreen:null,lastScreen:null,navigate:P,navigateBack:P,resetNavigation:P,setModalData:P,onUserCloseViaDialogOrKeybindRef:void 0}),kv=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Yp=e=>{let t=es(),o=e.authenticated,[r,n]=(0,Jt.useState)(e.initialScreen);(0,Jt.useEffect)(()=>{!o&&!kv.includes(e.initialScreen)&&e.setInitialScreen(null)},[o]);let i=(0,Jt.useRef)(null);(0,Jt.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,Jt.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,ts.jsxs)(Kp.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,ts.jsx)(Ba,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},_=()=>(0,Jt.useContext)(Kp);var rr=require("react/jsx-runtime"),Mi=({style:e,...t})=>{let{app:o}=_();return(0,rr.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,rr.jsx)("rect",{width:"28",height:"28",rx:"3",fill:o?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,rr.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,rr.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,rr.jsx)("defs",{children:(0,rr.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,rr.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var os=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries(Mn))if(t.includes(r.hostname))return{walletClientType:o,entry:r}};var Mn={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"}},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"}},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"}}};function Rv(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var Jp=e=>e in Mn,Qp=e=>{let t=Mn[e].mobile;if("native"in t)return t.native};function Zp(e,t){let o=Rv(t);if(o.deepLink)return ru(o.deepLink,e);if(o.universalLink)return nu(o.universalLink,e);throw new C(`Unsupported wallet ${t.id}`)}var Xp="WALLETCONNECT_DEEPLINK_CHOICE";function eu(){try{localStorage.removeItem(Xp)}catch{}}function tu({href:e,name:t}){try{localStorage.setItem(Xp,JSON.stringify({href:e,name:t}))}catch{}}function ou(e){return e.startsWith("http://")||e.startsWith("https://")}function ru(e,t){if(ou(e))return nu(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 nu(e,t){if(!ou(e))return ru(e,t);let o=e;o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function iu(e,t){window.open(e,t,"noreferrer noopener")}var Oo=class extends vt{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 Se(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=Mn[l],this.walletClientType=l),this.createProvider().then(s=>{if(this.provider=s,this.proxyProvider.setWalletProvider(s),this.subscribeListeners(),s.session){if(this.walletProvider?.session?.peer.metadata.url){let c=os(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=c?.entry,this.walletClientType=c?.walletClientType||"unknown"}this.connected=!0,this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}else this.emit("initialized"),this.initialized=!0}),import("@walletconnect/modal").then(({WalletConnectModal:s})=>{this.modal=new s({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(c=>{!c.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:An,id:"io.metamask"}:{name:Dl(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Mi,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=Mn[o],this.walletClientType=o,this.redirectUri=void 0,eu(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((o,r)=>{let n=()=>{r(new xn)};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 Z("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=os(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Sn(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(fo(a));return}r(new Z("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=mo(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 Nn.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:Nn.OPTIONAL_EVENTS,optionalMethods:Nn.OPTIONAL_METHODS,rpcMap:o,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),au.isMobile&&this.walletEntry){let{redirect:l,href:s}=Zp(a,this.walletEntry);tu({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,iu(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=os(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 ql=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===(0,$l.getAddress)(t)).length:!1},Sn=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||$r:$r,Ln=class extends su.default{constructor(o,r,n,i,a,l,s){super();this.getEthereumProvider=()=>{let o=this.wallets[0],r=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===o?.address));return!o||!r?new Se: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;de.get(kl)&&(de.getKeys().forEach(r=>{r.startsWith("walletconnect")&&de.del(r)}),de.del(kl));let o=mp(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"),!Er()&&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 Ia(o,r,this.rpcConfig,this.chains,n.id),l=new Oa(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 Oo&&i.resetConnection(r),i;let l=(()=>{if(o==="injected"){if(r==="metamask"&&n?.eip6963InjectedProvider)return new Da(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(r==="metamask"&&n?.legacyInjectedProvider)return new In(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(r==="phantom"&&n?.legacyInjectedProvider)return new In(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&r==="unknown_browser_extension")return new In(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Rn(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,r)}else return o==="coinbase_wallet"?new Na(this.chains,this.defaultChain,this.rpcConfig):o==="phantom"?new Fa(this.defaultChain):new Oo(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))}loadConnectionHistory(){let o=a=>a&&typeof a.address=="string"&&typeof a.connectorType=="string"&&typeof a.walletClientType=="string"&&typeof a.connectedAt=="number",r=de.get(Rl);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}));de.put(Rl,o)}async activeWalletSign(o){let r=this.wallets,n=r.length>0?r[0]:null;return n?n.sign(o):null}setActiveWallet(o){this.activeWallet=(0,$l.getAddress)(o),this.emit("walletsUpdated")}};function Wa(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++){let r=e[o],n=t[o];if(r?.address!==n?.address||r?.chainId!==n?.chainId||r?.connectorType!==n?.connectorType||r?.connectedAt!==n?.connectedAt||r?.walletClientType!==n?.walletClientType||r?.isConnected!==n?.isConnected||r?.linked!==n?.linked)return!1}return!0}var lu=require("ofetch");var Iv=[ya(),va(),ga()],rs=class{constructor(t,o,r){this.appId=t,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Ea,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=lu.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:n,options:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-ca-id",this.clientAnalyticsId||""),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=!Iv.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 fa}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw me(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw me(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw me(r)}}};var Ar=f(require("js-cookie"));function cu(e){return e instanceof Cr?"email":e instanceof jr?"sms":e instanceof qr?"siwe":e instanceof wn?"custom_auth":e instanceof br?e.meta.provider:null}var du=f(require("jose")),Do=class{static parse(t){try{return new Do(t)}catch{return null}}constructor(t){this.value=t,this._decoded=du.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 Wv=30,ns=class{constructor(){this.authenticateOnce=new ht(async t=>this._authenticate(t)),this.linkOnce=new ht(async t=>this._link(t)),this.refreshOnce=new ht(this._refresh.bind(this)),this.destroyOnce=new ht(this._destroy.bind(this)),this.forkSessionOnce=new ht(this._forkSession.bind(this))}get token(){try{let t=de.get(zr);return typeof t=="string"?new Do(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=de.get(Ta);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=de.get(Si);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=Ar.default.get(Pa);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=Do.parse(this.token);return t!==null&&!t.isExpired(Wv)}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=cu(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:Lt(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),ft(o)}}async _link(t){try{let o=await t.link();return Lt(o)}catch(o){throw console.warn("Error linking account"),ft(o)}}async _refresh(){if(!this.api)throw new C("Session has no API instance");if(!this.client)throw new C("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(ya(),a,{headers:i}),r&&this.clearForkedToken()}else if(r)n=await this.api.post(va(),{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(),Lt(n.user)}catch(n){if(n instanceof Io&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw ft(n)}}async _destroy(){try{await this.api?.post(ga(),{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new C("Session has no API instance");let t=this.refreshToken;try{let o=await this.api.post(gd(),{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw ft(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let o=de.get(zr);if(de.put(zr,t),o!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let r=Do.parse(t)?.expiration;Ar.default.set(_l,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}}else de.del(zr),Ar.default.remove(_l)}storeRefreshToken(t){typeof t=="string"?(de.put(Ta,t),this.client?.useServerCookies||(Ar.default.set(Pa,"t",{sameSite:"Strict",secure:!0,expires:30}),Ar.default.set(Al,t,{sameSite:"Strict",secure:!0,expires:30}))):(de.del(Ta),Ar.default.remove(Al),Ar.default.remove(Pa))}clearForkedToken(){de.del(Si)}};var jl,is,uu,On=class{constructor(t){ma(this,is);this.apiUrl=t.apiUrl||ba,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||Jd,this.appId=t.appId,this.clientAnalyticsId=hd(this,is,uu).call(this),jl||(jl=new ns),this.session=jl,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,o,r,n,i,a,l){this.connectors||(this.connectors=new Ln(t,o,r,n,i,a,l))}generateApi(){let t=new rs(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 C("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new C("No auth flow in progress.");return this.session.link(this.authFlow)}async logout(){await this.session.destroy(),this.authFlow=void 0}startAuthFlow(t){t.api=this.api,this.authFlow=t}startMfaFlow(t){t.api=this.api,this.mfaFlow=t}async unlinkEmail(t){try{let o=await this.api.post(Od(),{address:t});return Lt(o)}catch(o){throw ft(o)}}async acceptTerms(){try{let t=await this.api.post($d(),{});return Lt(t)}catch(t){throw ft(t)}}async unlinkPhone(t){try{let o=await this.api.post(Dd(),{phoneNumber:t});return Lt(o)}catch(o){throw ft(o)}}async unlinkWallet(t){try{let o=await this.api.post(Ld(),{address:t});return Lt(o)}catch(o){throw ft(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post(Ud(),{provider:t,subject:o});return Lt(r)}catch(r){throw ft(r)}}async unlinkFarcaster(t){try{let o=await this.api.post(Fd(),{fid:t});return Lt(o)}catch(o){throw ft(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(Bd(),{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(Hd(),t)}catch(o){throw ft(o)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Do.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 ft(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()}};is=new WeakSet,uu=function(){if(typeof window>"u")return null;try{let o=de.get(_i);if(typeof o=="string"&&o.length>0)return o}catch{}let t=(0,pu.v4)();try{return de.put(_i,t),t}catch{return t}};var yu=require("@marsidev/react-turnstile"),as=require("react");var Qt=require("react");var hu=require("react/jsx-runtime"),mu=(0,Qt.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:P,setError:P,setExecuting:P,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:P,reset:P,execute:P}),nr=class extends rt{constructor(o,r,n){super(o||"Captcha failed");this.type="Captcha";r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},fu=({children:e,id:t,captchaSiteKey:o,captchaEnabled:r})=>{let n=(0,Qt.useRef)(null),[i,a]=(0,Qt.useState)(),[l,s]=(0,Qt.useState)(),[c,m]=(0,Qt.useState)(!1),y=(0,Qt.useMemo)(()=>r?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[r,i,l,c]);return(0,hu.jsx)(mu.Provider,{value:{...y,ref:n,enabled:r,siteKey:o,appId:t,setToken:a,setError:s,setExecuting:m,remove(){r&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){r&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){r&&(m(!0),n.current?.execute())},async waitForResult(){if(!r)return"";try{return await pp(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new nr("Captcha failed",null,"captcha_timeout")}}},children:e})},_e=()=>(0,Qt.useContext)(mu);var Kl=require("react/jsx-runtime"),ss=e=>{let{enabled:t,siteKey:o,appId:r,setError:n,setToken:i,setExecuting:a,ref:l}=_e(),[,s]=(0,as.useMemo)(()=>o?.split("t:")||[],[o]);if((0,as.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Kl.jsx)("div",{className:"hidden h-0 w-0",children:(0,Kl.jsx)(yu.Turnstile,{...e,ref:l,siteKey:s,options:{action:r,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var gr=require("react"),hg=f(require("react-dom"));var ls=require("react");var Yl=(0,ls.createContext)({isNewUserThisSession:!1,isLinking:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,nativeTokenSymbolForChainId:P,initializeWalletProxy:P,getAuthMeta:P,getAuthFlow:P,closePrivyModal:P,openPrivyModal:P,connectWallet:P,initLoginWithWallet:P,loginWithWallet:P,initLoginWithFarcaster:P,loginWithFarcaster:P,loginWithCode:P,initLoginWithEmail:P,initLoginWithSms:P,initUpdateEmail:P,resendEmailCode:P,resendSmsCode:P,initLoginWithOAuth:P,loginWithOAuth:P,refreshUser:P,walletProxy:null,createAnalyticsEvent:P,acceptTerms:P,getUsdTokenPrice:P,recoverEmbeddedWallet:P,getFiatOnRampConfig:P,updateWallets:P,fundWallet:P,setReadyToTrue:P}),M=()=>(0,ls.useContext)(Yl);var cs=require("react");var ge=(0,cs.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:P,login:P,connectOrCreateWallet:P,linkEmail:P,linkPhone:P,linkFarcaster:P,linkWallet:P,linkGoogle:P,linkTwitter:P,linkDiscord:P,linkGithub:P,linkSpotify:P,linkTiktok:P,linkLinkedIn:P,linkApple:P,updateEmail:P,logout:P,getAccessToken:P,getEthereumProvider:P,getEthersProvider:P,getWeb3jsProvider:P,unlinkEmail:P,unlinkPhone:P,unlinkWallet:P,unlinkGoogle:P,unlinkTwitter:P,unlinkDiscord:P,unlinkGithub:P,unlinkSpotify:P,unlinkTiktok:P,unlinkLinkedIn:P,unlinkApple:P,unlinkFarcaster:P,setActiveWallet:P,forkSession:P,createWallet:P,signMessage:P,signTypedData:P,enrollInMfa:P,initEnrollmentWithSms:P,initEnrollmentWithTotp:P,promptMfa:P,init:P,submitEnrollmentWithSms:P,submitEnrollmentWithTotp:P,unenroll:P,submit:P,cancel:P,sendTransaction:P,exportWallet:P,setWalletPassword:P,initLoginWithEmail:P,initLoginWithSms:P,loginWithCode:P,fundWallet:P,isModalOpen:!1}),G=()=>(0,cs.useContext)(ge);var ds=require("react"),gu=e=>{let[t,o]=(0,ds.useState)("auto");return(0,ds.useEffect)(()=>{let r=new ResizeObserver(n=>{o(n[0]?.contentRect.height??"auto")});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},[e.current]),t};var Dn=require("react"),vu={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},Jl=(0,Dn.createContext)(void 0),wu=()=>(0,Dn.useContext)(Jl);function Be(e,t){if(!t)return;let r=wu().current[e];return(0,Dn.useEffect)(()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]=r[n]?.filter(a=>a!==i)}},[t])}function H(e,t,o,...r){for(let n of e.current[t][o])n(...r)}function Cu(){let e=wu();return(t,o,...r)=>H(e,t,o,...r)}function ps(e){Be("configureMfa",e)}var ic=f(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),ku=f(require("@heroicons/react/24/solid/DocumentCheckIcon")),Ru=f(require("styled-components"));var Xt=f(require("styled-components"));var us=f(require("styled-components")),kr=require("react/jsx-runtime"),Rr=({success:e,fail:t})=>(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(Zt,{className:e?"success":t?"fail":""}),(0,kr.jsx)(Ql,{className:e?"success":t?"fail":""})]}),Zt=us.default.span`
|
|
12
|
+
- https://privy.io`;this.getNonceOnce=new yt(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 C("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Sd(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign();return await this.api.post(_d(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw me(t)}}async sign(){if(!this.api)throw new C("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new C("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 C("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(xd(),{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new C("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 $r=class{constructor(t,o){this.meta={phoneNumber:t,captchaToken:o}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new C("phone number and sms code must be set prior to calling authenticate.");try{let t=Dd(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new C("phone number and sms code must be set prior to calling authenticate.");try{let t=Ud();return await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw me(t)}}async sendSmsCode(t,o){if(!this.api)throw new C("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),o&&(this.meta.captchaToken=o),!this.meta.phoneNumber)throw new C("phone nNumber must be set when initialzing authentication.");try{let r=Od();return await this.api.post(r,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(r){throw me(r)}}};var vu=require("uuid");function vt(e){return new Date(e*1e3)}function Ev(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:vt(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:vt(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:vt(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:vt(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:vt(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:vt(o.verified_at)};t.push(c);break;case"discord_oauth":let m={subject:o.subject,username:o.username,email:o.email,type:o.type,verifiedAt:vt(o.verified_at)};t.push(m);break;case"github_oauth":let y={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:vt(o.verified_at)};t.push(y);break;case"tiktok_oauth":let g={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:vt(o.verified_at)};t.push(g);break;case"linkedin_oauth":let v={subject:o.subject,name:o.name,email:o.email,type:o.type,verifiedAt:vt(o.verified_at)};t.push(v);break;case"apple_oauth":let b={subject:o.subject,email:o.email,type:o.type,verifiedAt:vt(o.verified_at)};t.push(b);break;case"custom_auth":t.push({type:o.type,customUserId:o.custom_user_id,verifiedAt:vt(o.verified_at)});break;case"farcaster":let T={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:vt(o.verified_at)};t.push(T);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function qt(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var ke=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,Tv=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),jt=(e,t)=>t==="all-users"&&!ke(e)||t==="users-without-wallets"&&!Tv(e)?.length;function Lt(e){if(!e)return null;let t=Ev(e.linked_accounts),o=qt(t,"wallet"),r=qt(t,"email"),n=qt(t,"phone"),i=qt(t,"google_oauth"),a=qt(t,"twitter_oauth"),l=qt(t,"discord_oauth"),s=qt(t,"github_oauth"),c=qt(t,"spotify_oauth"),m=qt(t,"tiktok_oauth"),y=qt(t,"linkedin_oauth"),g=qt(t,"apple_oauth"),v=qt(t,"farcaster"),b=e.mfa_methods.map(({type:x,verified_at:E})=>({type:x,verifiedAt:vt(E)}));return{id:e.id,createdAt:vt(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:m&&{subject:m.subject,username:m.username,name:m.name},linkedin:y&&{subject:y.subject,name:y.name,email:y.email},apple:g&&{subject:g.subject,email:g.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url},mfaMethods:b.map(x=>x.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Yl=require("@ethersproject/address"),fu=f(require("eventemitter3"));function fp(){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 ka=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 Fl=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||ka(e)!=="MetaMask")return!1;if(e.providers){for(let o of e.providers)if(!Fl(o))return!1}return!0},wr=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),hp=()=>{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 yp=(e,t)=>{let o=[],r=[];for(let[n,i]of e.entries())n<t?o.push(i):r.push(i);return[o,r]},Ra=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,}))$/),gp=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Cr=(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}`},Bl=e=>new Promise(t=>setTimeout(t,e));function vp(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 wp=(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 Bl(o)}a||i(new Error("Exceeded max attempts before resolving function"))})},Ia=(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 Hl=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),qr=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Cp(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 fp()){let m=ka(c);if(!l.some(y=>y.info.name===m)){if(Fl(c,!0)&&!s.find(y=>y.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(m==="Phantom"&&!s.find(y=>y.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(y=>y.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function En(e){return`eip155:${String(Number(e))}`}var uo=(e,t,o)=>{let r=Number(e),n=t.find(a=>a.id===r);if(!n)throw new Z(`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]+"/"+Ea:n.rpcUrls.blast?.http[0]?i=n.rpcUrls.blast.http[0]+"/"+tp:i=n.rpcUrls.default?.http[0],!i)throw new Z(`No RPC url found for ${e}`);return i},bp=(e,t)=>{let o=Number(e),r=t.find(n=>n.id===o);if(!r)throw new Z(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url},Wa=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},o=Object.entries(e.domain).map(([r,n])=>{if(n!=null&&typeof r=="string"&&r in t)return{name:r,type:t[r]}}).filter(r=>r!==void 0);return{...e,types:{...e.types,EIP712Domain:o}}};var Rp=f(require("@coinbase/wallet-sdk"));var Ri=require("react/jsx-runtime"),Ii=({style:e,...t})=>(0,Ri.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Ri.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Ri.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var ho=require("@ethersproject/address"),Vl=require("@ethersproject/providers"),kp=f(require("eventemitter3"));var Gl=require("@ethersproject/providers"),Pp=f(require("eventemitter3"));var Pv=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Ep=e=>Pv.includes(e);var Tp=require("@ethersproject/logger");var Tn=class extends Z{constructor(){super("Wallet timeout");this.type="wallet_error"}},Pn=class extends Z{constructor(){super("User rejected connection");this.type="wallet_error"}},mo=e=>{if(e instanceof Z)return e;if(e?.code&&e?.reason){let t=new Me(e);return e.code===Tp.ErrorCode.ACTION_REJECTED&&(t.details=it.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Me(e):new Z("Unknown connector error",e)},Kt=class extends nt{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Me=class extends Kt{constructor(o){let r=o;super(r.message,r.code,r.data);let n=Object.values(it).find(i=>i.eipCode===r.code);this.details=n||it.UNKNOWN_ERROR,r.code===-32002&&(r.message?.includes("already pending for origin")?r.message?.includes("wallet_requestPermissions")?this.details=it.E32002_CONNECTION_ALREADY_PENDING:this.details=it.E32002_REQUEST_ALREADY_PENDING:r.message?.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=it.E32002_WALLET_LOCKED))}},xv={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}},Sv={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}},_v={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}},it={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},..._v,...Sv},Xo={...xv,...it};var Se=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 Tn,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||Vr,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 Z(`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 mo(o)})}},br=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Ma=class extends Pp.default{constructor(o,r,n,i,a=1){super();this.walletProxy=o,this.address=r,this.chainId=a,this.rpcConfig=n,this.chains=i,this.provider=new Gl.StaticJsonRpcProvider(uo(a,this.chains,n)),this.rpcTimeoutDuration=xn(n,"privy")}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new br(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Ke()||!this.address)throw new br("Disconnected",4900);return(await _p(r)).hash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new br(`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 br(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new Gl.StaticJsonRpcProvider(uo(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 xp(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 Sp(Wa(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:qr(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 qr(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(Ep(o.method)){let r=await Ke();if(await Ap(),!r||!this.address)throw new br("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 br("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await Ke();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}}},fo=class extends Se{constructor(o){super(o,o.rpcTimeoutDuration)}},Er=class extends Se{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 Av=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},wt=class extends kp.default{constructor(o,r,n,i){super();this.onAccountsChanged=o=>{o.length===0?this.onDisconnect():this.syncAccounts(o)};this.onChainChanged=o=>{this.wallets.forEach(r=>{r.chainId=En(o),this.walletClientType==="privy"&&ce.put(_a(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=xn(i,o),this.connected=!1,this.initialized=!1}buildConnectedWallet(o,r,n){let i=async()=>!!this.wallets.find(a=>(0,ho.getAddress)(a.address)===(0,ho.getAddress)(o));return{address:(0,ho.getAddress)(o),chainId:r,meta:n,switchChain:async a=>{if(!i)throw new Z("Wallet is not currently connected.");let l=this.wallets.find(g=>(0,ho.getAddress)(g.address)===(0,ho.getAddress)(o))?.chainId;if(!l)throw new Z("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===En(s))return;let m=this.chains.find(g=>g.id===c);if(!m)throw new Z(`Unsupported chainId: ${a}`);let y=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await y()}catch(g){if(Av(g,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:m.name,nativeCurrency:m.nativeCurrency,rpcUrls:[m.rpcUrls.default?.http[0]??""],blockExplorerUrls:[m.blockExplorers?.default.url??""]}]}),y();throw this.walletClientType==="rainbow"&&g.message?.includes("wallet_switchEthereumChain")?new Z(`Rainbow does not support the chainId ${r}`):g}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return new Vl.Web3Provider(new fo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return new Er(this.proxyProvider)},sign:async a=>{if(!await i())throw new Z("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(o){let r=o;try{if(r===void 0){let c=await this.proxyProvider.request({method:"eth_accounts"});Array.isArray(c)&&(r=c)}}catch{console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.")}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return;let n=r[0],i=(0,ho.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=ce.get(_a(i));this.chains.find(m=>m.id===Number(c))||(ce.del(_a(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 ${Ll}`,c),l=Ll}let s=En(l);if(!a.find(c=>(0,ho.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,ho.getAddress)(n),s,c))}Na(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let o=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((r,n)=>n.connectedAt-r.connectedAt).find(r=>o.find(n=>(0,ho.getAddress)(n)===(0,ho.getAddress)(r.address)))||null}async isConnected(){let o=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(o)&&o.length>0}async sign(o){return await this.connect({showPrompt:!1}),new Vl.Web3Provider(new fo(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 kv=e=>{let t=`https://mainnet.infura.io/v3/${Ea}`,o=1;return e.makeWeb3Provider(t,o)},La,Oa=class extends wt{constructor(o,r,n){super("coinbase_wallet",o,r,n);this.connectorType="coinbase_wallet";this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),La||(La=new Rp.default({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(kv(La)),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){La.disconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:Ii,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 Z("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([o[0]])}catch(o){throw mo(o)}}};var zl=require("react/jsx-runtime"),Da=({...e})=>(0,zl.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,zl.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var Ua=class extends wt{constructor(o,r,n,i){super("privy",r,n,i);this.connectorType="embedded";this.proxyProvider=o,this.subscribeListeners(),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[qr(o?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Da,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var $l=require("react/jsx-runtime"),Sn=({style:e,...t})=>(0,$l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,$l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var at=require("react/jsx-runtime"),_n=({style:e,...t})=>(0,at.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,at.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,at.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,at.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,at.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,at.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,at.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,at.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,at.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,at.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,at.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,at.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,at.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,at.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var Wi=require("react/jsx-runtime"),Wo=({style:e,...t})=>(0,Wi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,Wi.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,Wi.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var kn=class extends wt{constructor(o,r,n,i,a){super(a||"unknown",o,r,n);this.connectorType="injected";this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l),this.syncAccounts().then(()=>{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 Z("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw mo(o)}}},An,Rn=class extends wt{constructor(o,r,n,i,a){super(a??"unknown",o,r,n);this.connectorType="injected";ha(this,An,void 0);this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0}),a==="metamask"?Rl(this,An,{name:"MetaMask",icon:_n,id:"io.metamask"}):a==="phantom"&&Rl(this,An,{name:"Phantom",icon:Wo,id:"phantom"})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return bd(this,An)??{name:"Browser Extension",icon:Sn,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 Z("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw mo(o)}}};An=new WeakMap;var Rv=require("@ethersproject/address"),Iv=require("@ethersproject/providers"),Ip=require("react-device-detect");var Fa=class extends kn{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Ip.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new Z("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw mo(t)}}};var Ba=class extends wt{constructor(o,r){super(o,[],r,{});this.connectorType="null";this.proxyProvider=new Se(void 0,Vr);this.connectorType=o}get walletBranding(){return{name:"Wallet",id:""}}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 Ha=class extends Ba{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Wo,id:"phantom"}}};var Mn=require("@walletconnect/ethereum-provider"),mu=require("react-device-detect");var Jt=require("react");var Wp=require("react/jsx-runtime");function Ga({src:e,...t}){return(0,Wp.jsx)("img",{src:e,...t,style:{display:"none"}})}var Mo=require("react"),Jp=require("react");var Yt={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:op,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Mp=({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 `input.primary.length`");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 Wv=new Set(["metamask","coinbase_wallet","rainbow","zerion","phantom","wallet_connect","detected_wallets"]),Mv=e=>Wv.has(e),Nv=(e,t,o)=>o.indexOf(e)===t,Np=({input:e})=>e?e.filter(Mv).filter(Nv):Yt.appearance.walletList;var Va={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var za={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var $a={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 Op={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 qa={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 ja={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 Ka={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 Up={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 Bp={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 Hp={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 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 zp={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 Ya={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 Ja={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 Qa={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 Za={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 Mi={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 Ni={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 $p={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 qp={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 Xa={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 es={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 ts={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 In=[Va,za,$a,Hp,qp,Ya,Ja,Qa,Za,Mi,Ni,Dp,Up,Fp,Bp,qa,ja,Ka,Vp,zp,Lp,Op,Xa,ts,es,Gp,$p],k2=new Set(In.map(e=>e.id));var Pr=f(require("tinycolor2")),jp="#FFFFFF",Lv="#000000",Ov=jp,Dv="#1E1E1D";function Uv(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 Tr(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Pr.default)({...e.toHsl(),l:o})}function Kp({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",warnHex:r="#FFB74D",errorHex:n="#EC6351",whiteHex:i=jp,blackHex:a=Lv}){let l;switch(e){case"light":l=Ov;break;case"dark":l=Dv;break;default:l=e;break}let s=(0,Pr.default)(l),c=(0,Pr.default)(t),m=(0,Pr.default)(o),y=(0,Pr.default)(r),g=(0,Pr.default)(n),v=Uv(s.getLuminance()),b=Tr(s,v==="light"?-.04:.11),T=Tr(s,v==="light"?-.88:.87),x=Tr(s,v==="light"?-.77:.75),E=Tr(s,v==="light"?-.43:.45).desaturate(v==="light"?60:20),A=Tr(s,v==="light"?-.08:.25).desaturate(v==="light"?60:20),I=Tr(c,.15),W=Tr(c,-.06),S=(0,Pr.default)(c.getLuminance()>.5?a:i),O=Tr(m,-.16);return{colorScheme:v,background:s.toHslString(),background2:b.toHslString(),foreground:T.toHslString(),foreground2:x.toHslString(),foreground3:E.toHslString(),foreground4:A.toHslString(),accent:c.toHslString(),accentLight:I.toHslString(),accentDark:W.toHslString(),foregroundAccent:S.toHslString(),success:m.toHslString(),successDark:O.toHslString(),error:g.toHslString(),warn:y.toHslString()}}function ql(e,t,o){let r=o?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],i=t?.loginMethods?.filter(Q=>n.includes(Q)),a,l,s,c,m,y,g,v,b,T,x,E;t?.loginMethods?(a=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),c=i?.includes("google"),m=i?.includes("twitter"),y=i?.includes("discord"),v=i?.includes("spotify"),g=i?.includes("tiktok"),T=i?.includes("github"),b=i?.includes("linkedin"),x=i?.includes("apple"),E=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,s=e.walletAuth,c=e.googleOAuth,m=e.twitterOAuth,y=e.discordOAuth,T=e.githubOAuth,v=e.spotifyOAuth,g=e.tiktokOAuth,b=e.linkedinOAuth,x=e.appleOAuth,E=e.farcasterAuth);let A=[a,l].filter(Boolean),I=[c,m,y,T,v,g,b,x,E].filter(Boolean),W=[s].filter(Boolean);if(A.length+I.length+W.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&&W.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):!S&&I.length+A.length===0&&(r("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0);let O=Np({isWalletLoginEnabled:s,input:t?.appearance?.walletList});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 D=Mp({input:t?.loginMethodsAndOrder}),B=t?.intl?.defaultCountry??"US",{chains:V,defaultChain:Y}=Fv({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),U=!!t?.defaultChain||!!t?.supportedChains,j=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,R,le=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?j?R=t?.embeddedWallets?.noPromptOnSignature??!0:R=t?.embeddedWallets?.noPromptOnSignature??le:R=le,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&R!==!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:Kp({backgroundTheme:t?.appearance?.theme??Yt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Yt.appearance.accentColor}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:O},loginMethods:{wallet:s,email:a,sms:l,google:c,twitter:m,discord:y,github:T,spotify:v,tiktok:g,linkedin:b,apple:x,farcaster:E},loginMethodsAndOrder:D,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Yt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Yt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Yt.rpcConfig.rpcTimeouts},chains:V,defaultChain:Y,intl:{defaultCountry:B},shouldEnforceDefaultChainOnConnect:U,captchaEnabled:e.captchaEnabled??Yt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...j?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:R},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:j?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Yt.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??Yt._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Yt._render.inParentNodeId}}}function Yp(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 Fv({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:In.find(m=>m.id===s.id)??s)}else n=In.concat(e??[]);let i=t?n[0]:Ya,a=o??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var eu=require("react/jsx-runtime"),Qp={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:""},jl=ql(Qp,void 0,!1),Kl=(0,Jp.createContext)({appConfig:jl,isServerConfigLoaded:!1}),Zp=({children:e,legacyCreateEmbeddedWalletFlag:t,client:o,clientConfig:r})=>{let[n,i]=(0,Mo.useState)(null),a=(0,Mo.useMemo)(()=>ql(n??Qp,r,!!n),[n,r]);return(0,Mo.useEffect)(()=>{let l=Yp(r,t);o.createAnalyticsEvent("sdk_initialize",l)},[r,t]),(0,Mo.useEffect)(()=>{n||(async()=>{try{let s=await o.getServerConfig();s.customApiUrl&&o.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,eu.jsx)(Kl.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},os=()=>{let{appConfig:e}=(0,Mo.useContext)(Kl);return e},Xp=()=>{let{isServerConfigLoaded:e}=(0,Mo.useContext)(Kl);return e};var P=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var rs=require("react/jsx-runtime"),tu=(0,Jt.createContext)({ready:!1,app:jl,currentScreen:null,lastScreen:null,navigate:P,navigateBack:P,resetNavigation:P,setModalData:P,onUserCloseViaDialogOrKeybindRef:void 0}),Bv=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],ou=e=>{let t=os(),o=e.authenticated,[r,n]=(0,Jt.useState)(e.initialScreen);(0,Jt.useEffect)(()=>{!o&&!Bv.includes(e.initialScreen)&&e.setInitialScreen(null)},[o]);let i=(0,Jt.useRef)(null);(0,Jt.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,Jt.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,rs.jsxs)(tu.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,rs.jsx)(Ga,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},_=()=>(0,Jt.useContext)(tu);var er=require("react/jsx-runtime"),Li=({style:e,...t})=>{let{app:o}=_();return(0,er.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,er.jsx)("rect",{width:"28",height:"28",rx:"3",fill:o?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,er.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,er.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,er.jsx)("defs",{children:(0,er.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,er.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var ns=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries(Wn))if(t.includes(r.hostname))return{walletClientType:o,entry:r}};var Wn={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"}},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"}},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"}}};function Hv(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var ru=e=>e in Wn,nu=e=>{let t=Wn[e].mobile;if("native"in t)return t.native};function iu(e,t){let o=Hv(t);if(o.deepLink)return du(o.deepLink,e);if(o.universalLink)return pu(o.universalLink,e);throw new C(`Unsupported wallet ${t.id}`)}var au="WALLETCONNECT_DEEPLINK_CHOICE";function su(){try{localStorage.removeItem(au)}catch{}}function lu({href:e,name:t}){try{localStorage.setItem(au,JSON.stringify({href:e,name:t}))}catch{}}function cu(e){return e.startsWith("http://")||e.startsWith("https://")}function du(e,t){if(cu(e))return pu(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 pu(e,t){if(!cu(e))return du(e,t);let o=e;o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function uu(e,t){window.open(e,t,"noreferrer noopener")}var No=class extends wt{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 Se(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=Wn[l],this.walletClientType=l),this.createProvider().then(s=>{if(this.provider=s,this.proxyProvider.setWalletProvider(s),this.subscribeListeners(),s.session){if(this.walletProvider?.session?.peer.metadata.url){let c=ns(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=c?.entry,this.walletClientType=c?.walletClientType||"unknown"}this.connected=!0,this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}else this.emit("initialized"),this.initialized=!0}),import("@walletconnect/modal").then(({WalletConnectModal:s})=>{this.modal=new s({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(c=>{!c.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:_n,id:"io.metamask"}:{name:Hl(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Li,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=Wn[o],this.walletClientType=o,this.redirectUri=void 0,su(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((o,r)=>{let n=()=>{r(new Pn)};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 Z("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=ns(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=xn(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(mo(a));return}r(new Z("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=uo(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 Mn.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:Mn.OPTIONAL_EVENTS,optionalMethods:Mn.OPTIONAL_METHODS,rpcMap:o,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),mu.isMobile&&this.walletEntry){let{redirect:l,href:s}=iu(a,this.walletEntry);lu({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,uu(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=ns(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 Jl=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===(0,Yl.getAddress)(t)).length:!1},xn=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Vr:Vr,Nn=class extends fu.default{constructor(o,r,n,i,a,l,s){super();this.getEthereumProvider=()=>{let o=this.wallets[0],r=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===o?.address));return!o||!r?new Se: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;ce.get(Ml)&&(ce.getKeys().forEach(r=>{r.startsWith("walletconnect")&&ce.del(r)}),ce.del(Ml));let o=Cp(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"),!wr()&&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 Ma(o,r,this.rpcConfig,this.chains,n.id),l=new Ua(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 No&&i.resetConnection(r),i;let l=(()=>{if(o==="injected"){if(r==="metamask"&&n?.eip6963InjectedProvider)return new Fa(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(r==="metamask"&&n?.legacyInjectedProvider)return new Rn(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(r==="phantom"&&n?.legacyInjectedProvider)return new Rn(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&r==="unknown_browser_extension")return new Rn(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new kn(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,r)}else return o==="coinbase_wallet"?new Oa(this.chains,this.defaultChain,this.rpcConfig):o==="phantom"?new Ha(this.defaultChain):new No(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))}loadConnectionHistory(){let o=a=>a&&typeof a.address=="string"&&typeof a.connectorType=="string"&&typeof a.walletClientType=="string"&&typeof a.connectedAt=="number",r=ce.get(Nl);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}));ce.put(Nl,o)}async activeWalletSign(o){let r=this.wallets,n=r.length>0?r[0]:null;return n?n.sign(o):null}setActiveWallet(o){this.activeWallet=(0,Yl.getAddress)(o),this.emit("walletsUpdated")}};function Na(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++){let r=e[o],n=t[o];if(r?.address!==n?.address||r?.chainId!==n?.chainId||r?.connectorType!==n?.connectorType||r?.connectedAt!==n?.connectedAt||r?.walletClientType!==n?.walletClientType||r?.isConnected!==n?.isConnected||r?.linked!==n?.linked)return!1}return!0}var hu=require("ofetch");var Gv=[va(),Ca(),wa()],is=class{constructor(t,o,r){this.appId=t,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Pa,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=hu.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:n,options:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-ca-id",this.clientAnalyticsId||""),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=!Gv.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 ya}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw me(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw me(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw me(r)}}};var xr=f(require("js-cookie"));function yu(e){return e instanceof gr?"email":e instanceof $r?"sms":e instanceof zr?"siwe":e instanceof vn?"custom_auth":e instanceof vr?e.meta.provider:null}var gu=f(require("jose")),Lo=class{static parse(t){try{return new Lo(t)}catch{return null}}constructor(t){this.value=t,this._decoded=gu.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 Vv=30,as=class{constructor(){this.authenticateOnce=new yt(async t=>this._authenticate(t)),this.linkOnce=new yt(async t=>this._link(t)),this.refreshOnce=new yt(this._refresh.bind(this)),this.destroyOnce=new yt(this._destroy.bind(this)),this.forkSessionOnce=new yt(this._forkSession.bind(this))}get token(){try{let t=ce.get(Gr);return typeof t=="string"?new Lo(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=ce.get(xa);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=ce.get(Ai);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=xr.default.get(Sa);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=Lo.parse(this.token);return t!==null&&!t.isExpired(Vv)}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=yu(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:Lt(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),ht(o)}}async _link(t){try{let o=await t.link();return Lt(o)}catch(o){throw console.warn("Error linking account"),ht(o)}}async _refresh(){if(!this.api)throw new C("Session has no API instance");if(!this.client)throw new C("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(va(),a,{headers:i}),r&&this.clearForkedToken()}else if(r)n=await this.api.post(Ca(),{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(),Lt(n.user)}catch(n){if(n instanceof Ro&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw ht(n)}}async _destroy(){try{await this.api?.post(wa(),{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new C("Session has no API instance");let t=this.refreshToken;try{let o=await this.api.post(Pd(),{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw ht(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let o=ce.get(Gr);if(ce.put(Gr,t),o!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let r=Lo.parse(t)?.expiration;xr.default.set(Il,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}}else ce.del(Gr),xr.default.remove(Il)}storeRefreshToken(t){typeof t=="string"?(ce.put(xa,t),this.client?.useServerCookies||(xr.default.set(Sa,"t",{sameSite:"Strict",secure:!0,expires:30}),xr.default.set(Wl,t,{sameSite:"Strict",secure:!0,expires:30}))):(ce.del(xa),xr.default.remove(Wl),xr.default.remove(Sa))}clearForkedToken(){ce.del(Ai)}};var Ql,ss,wu,Ln=class{constructor(t){ha(this,ss);this.apiUrl=t.apiUrl||Ta,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||rp,this.appId=t.appId,this.clientAnalyticsId=Ed(this,ss,wu).call(this),Ql||(Ql=new as),this.session=Ql,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,o,r,n,i,a,l){this.connectors||(this.connectors=new Nn(t,o,r,n,i,a,l))}generateApi(){let t=new is(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 C("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new C("No auth flow in progress.");return this.session.link(this.authFlow)}async logout(){await this.session.destroy(),this.authFlow=void 0}startAuthFlow(t){t.api=this.api,this.authFlow=t}startMfaFlow(t){t.api=this.api,this.mfaFlow=t}async unlinkEmail(t){try{let o=await this.api.post(Vd(),{address:t});return Lt(o)}catch(o){throw ht(o)}}async acceptTerms(){try{let t=await this.api.post(Zd(),{});return Lt(t)}catch(t){throw ht(t)}}async unlinkPhone(t){try{let o=await this.api.post(zd(),{phoneNumber:t});return Lt(o)}catch(o){throw ht(o)}}async unlinkWallet(t){try{let o=await this.api.post(Gd(),{address:t});return Lt(o)}catch(o){throw ht(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post($d(),{provider:t,subject:o});return Lt(r)}catch(r){throw ht(r)}}async unlinkFarcaster(t){try{let o=await this.api.post(qd(),{fid:t});return Lt(o)}catch(o){throw ht(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(jd(),{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(Kd(),t)}catch(o){throw ht(o)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Lo.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 ht(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()}};ss=new WeakSet,wu=function(){if(typeof window>"u")return null;try{let o=ce.get(ki);if(typeof o=="string"&&o.length>0)return o}catch{}let t=(0,vu.v4)();try{return ce.put(ki,t),t}catch{return t}};var Tu=require("@marsidev/react-turnstile"),ls=require("react");var Qt=require("react");var Eu=require("react/jsx-runtime"),Cu=(0,Qt.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:P,setError:P,setExecuting:P,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:P,reset:P,execute:P}),tr=class extends nt{constructor(o,r,n){super(o||"Captcha failed");this.type="Captcha";r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},bu=({children:e,id:t,captchaSiteKey:o,captchaEnabled:r})=>{let n=(0,Qt.useRef)(null),[i,a]=(0,Qt.useState)(),[l,s]=(0,Qt.useState)(),[c,m]=(0,Qt.useState)(!1),y=(0,Qt.useMemo)(()=>r?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[r,i,l,c]);return(0,Eu.jsx)(Cu.Provider,{value:{...y,ref:n,enabled:r,siteKey:o,appId:t,setToken:a,setError:s,setExecuting:m,remove(){r&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){r&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){r&&(m(!0),n.current?.execute())},async waitForResult(){if(!r)return"";try{return await vp(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new tr("Captcha failed",null,"captcha_timeout")}}},children:e})},_e=()=>(0,Qt.useContext)(Cu);var Zl=require("react/jsx-runtime"),cs=e=>{let{enabled:t,siteKey:o,appId:r,setError:n,setToken:i,setExecuting:a,ref:l}=_e(),[,s]=(0,ls.useMemo)(()=>o?.split("t:")||[],[o]);if((0,ls.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Zl.jsx)("div",{className:"hidden h-0 w-0",children:(0,Zl.jsx)(Tu.Turnstile,{...e,ref:l,siteKey:s,options:{action:r,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var mr=require("react"),xg=f(require("react-dom"));var ds=require("react");var Xl=(0,ds.createContext)({isNewUserThisSession:!1,isLinking:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,nativeTokenSymbolForChainId:P,initializeWalletProxy:P,getAuthMeta:P,getAuthFlow:P,closePrivyModal:P,openPrivyModal:P,connectWallet:P,initLoginWithWallet:P,loginWithWallet:P,initLoginWithFarcaster:P,loginWithFarcaster:P,loginWithCode:P,initLoginWithEmail:P,initLoginWithSms:P,initUpdateEmail:P,resendEmailCode:P,resendSmsCode:P,initLoginWithOAuth:P,loginWithOAuth:P,refreshUser:P,walletProxy:null,createAnalyticsEvent:P,acceptTerms:P,getUsdTokenPrice:P,recoverEmbeddedWallet:P,getFiatOnRampConfig:P,updateWallets:P,fundWallet:P,setReadyToTrue:P}),M=()=>(0,ds.useContext)(Xl);var ps=require("react");var ge=(0,ps.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:P,login:P,connectOrCreateWallet:P,linkEmail:P,linkPhone:P,linkFarcaster:P,linkWallet:P,linkGoogle:P,linkTwitter:P,linkDiscord:P,linkGithub:P,linkSpotify:P,linkTiktok:P,linkLinkedIn:P,linkApple:P,updateEmail:P,logout:P,getAccessToken:P,getEthereumProvider:P,getEthersProvider:P,getWeb3jsProvider:P,unlinkEmail:P,unlinkPhone:P,unlinkWallet:P,unlinkGoogle:P,unlinkTwitter:P,unlinkDiscord:P,unlinkGithub:P,unlinkSpotify:P,unlinkTiktok:P,unlinkLinkedIn:P,unlinkApple:P,unlinkFarcaster:P,setActiveWallet:P,forkSession:P,createWallet:P,signMessage:P,signTypedData:P,enrollInMfa:P,initEnrollmentWithSms:P,initEnrollmentWithTotp:P,promptMfa:P,init:P,submitEnrollmentWithSms:P,submitEnrollmentWithTotp:P,unenroll:P,submit:P,cancel:P,sendTransaction:P,exportWallet:P,setWalletPassword:P,initLoginWithEmail:P,initLoginWithSms:P,loginWithCode:P,fundWallet:P,isModalOpen:!1}),G=()=>(0,ps.useContext)(ge);var us=require("react"),Pu=e=>{let[t,o]=(0,us.useState)("auto");return(0,us.useEffect)(()=>{let r=new ResizeObserver(n=>{o(n[0]?.contentRect.height??"auto")});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},[e.current]),t};var On=require("react"),xu={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},ec=(0,On.createContext)(void 0),Su=()=>(0,On.useContext)(ec);function Be(e,t){if(!t)return;let r=Su().current[e];return(0,On.useEffect)(()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]=r[n]?.filter(a=>a!==i)}},[t])}function H(e,t,o,...r){for(let n of e.current[t][o])n(...r)}function _u(){let e=Su();return(t,o,...r)=>H(e,t,o,...r)}function ms(e){Be("configureMfa",e)}var cc=f(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),Ou=f(require("@heroicons/react/24/solid/DocumentCheckIcon")),Du=f(require("styled-components"));var Xt=f(require("styled-components"));var fs=f(require("styled-components")),Sr=require("react/jsx-runtime"),_r=({success:e,fail:t})=>(0,Sr.jsxs)(Sr.Fragment,{children:[(0,Sr.jsx)(Zt,{className:e?"success":t?"fail":""}),(0,Sr.jsx)(tc,{className:e?"success":t?"fail":""})]}),Zt=fs.default.span`
|
|
13
13
|
&& {
|
|
14
14
|
width: 82px;
|
|
15
15
|
height: 82px;
|
|
@@ -42,13 +42,13 @@ Resources:
|
|
|
42
42
|
border-color: var(--privy-color-error);
|
|
43
43
|
border-bottom-color: var(--privy-color-error);
|
|
44
44
|
}
|
|
45
|
-
`,
|
|
45
|
+
`,tc=(0,fs.default)(Zt)`
|
|
46
46
|
&& {
|
|
47
47
|
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
48
48
|
animation: none;
|
|
49
49
|
opacity: 0.5;
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,jr=e=>(0,Sr.jsx)(zv,{color:e.color||"var(--privy-color-foreground-3)"}),zv=(0,fs.default)(Zt)`
|
|
52
52
|
&& {
|
|
53
53
|
height: 0.9rem;
|
|
54
54
|
width: 0.9rem;
|
|
@@ -57,7 +57,7 @@ Resources:
|
|
|
57
57
|
/* Override default Loader to match button transitions */
|
|
58
58
|
transition: border-color 200ms ease;
|
|
59
59
|
}
|
|
60
|
-
`;var Ye=require("react/jsx-runtime"),
|
|
60
|
+
`;var Ye=require("react/jsx-runtime"),hs=Xt.default.button`
|
|
61
61
|
display: flex;
|
|
62
62
|
flex-direction: row;
|
|
63
63
|
align-items: center;
|
|
@@ -85,13 +85,13 @@ Resources:
|
|
|
85
85
|
color: var(--privy-color-foreground-3);
|
|
86
86
|
cursor: not-allowed;
|
|
87
87
|
}
|
|
88
|
-
`,F=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>(0,Ye.jsx)(
|
|
88
|
+
`,F=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>(0,Ye.jsx)(Au,{disabled:t||o,...n,children:t?(0,Ye.jsxs)("span",{children:[(0,Ye.jsx)(jr,{}),r?(0,Ye.jsx)("span",{children:r}):null]}):e}),v3=(0,Xt.default)(F)`
|
|
89
89
|
${e=>e.hideAnimations&&Xt.css`
|
|
90
90
|
&& {
|
|
91
91
|
transition: none;
|
|
92
92
|
}
|
|
93
93
|
`}
|
|
94
|
-
`,
|
|
94
|
+
`,ys=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>(0,Ye.jsx)(Au,{as:"a",disabled:t||o,...n,children:t?(0,Ye.jsxs)("span",{children:[(0,Ye.jsx)(jr,{}),r?(0,Ye.jsx)("span",{children:r}):null]}):e}),Au=(0,Xt.default)(hs)`
|
|
95
95
|
position: relative;
|
|
96
96
|
|
|
97
97
|
&& {
|
|
@@ -136,7 +136,7 @@ Resources:
|
|
|
136
136
|
opacity: 1;
|
|
137
137
|
animation: fadein 200ms ease;
|
|
138
138
|
}
|
|
139
|
-
`,
|
|
139
|
+
`,yo=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>(0,Ye.jsx)($v,{disabled:t||o,...n,children:t?(0,Ye.jsxs)("span",{children:[(0,Ye.jsx)(jr,{}),r?(0,Ye.jsx)("span",{children:r}):null]}):e}),$v=(0,Xt.default)(hs)`
|
|
140
140
|
&& {
|
|
141
141
|
border-width: 1px;
|
|
142
142
|
border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
|
|
@@ -165,7 +165,7 @@ Resources:
|
|
|
165
165
|
opacity: 1;
|
|
166
166
|
animation: fadein 200ms ease;
|
|
167
167
|
}
|
|
168
|
-
`,
|
|
168
|
+
`,gs=Xt.default.button`
|
|
169
169
|
&& {
|
|
170
170
|
padding: 12px 16px;
|
|
171
171
|
font-weight: 500;
|
|
@@ -196,10 +196,10 @@ Resources:
|
|
|
196
196
|
cursor: not-allowed;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
`,
|
|
199
|
+
`,w3=Xt.default.div`
|
|
200
200
|
/* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
|
|
201
201
|
height: 44px;
|
|
202
|
-
`,
|
|
202
|
+
`,Dn=({children:e,onClick:t,disabled:o,isSubmitting:r,...n})=>(0,Ye.jsxs)(qv,{isSubmitting:r,onClick:t,disabled:o,...n,children:[(0,Ye.jsx)("span",{children:e}),(0,Ye.jsx)("span",{children:(0,Ye.jsx)(jr,{})})]}),qv=Xt.default.button`
|
|
203
203
|
&& {
|
|
204
204
|
color: var(--privy-color-accent);
|
|
205
205
|
font-size: 16px;
|
|
@@ -241,7 +241,7 @@ Resources:
|
|
|
241
241
|
cursor: not-allowed;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
`;var
|
|
244
|
+
`;var rc=f(require("styled-components"));var At=require("react/jsx-runtime"),oc=rc.default.div`
|
|
245
245
|
margin-top: 16px;
|
|
246
246
|
font-size: 13px;
|
|
247
247
|
text-align: center;
|
|
@@ -250,7 +250,7 @@ Resources:
|
|
|
250
250
|
&& > a {
|
|
251
251
|
color: var(--privy-color-accent);
|
|
252
252
|
}
|
|
253
|
-
`;function
|
|
253
|
+
`;function Un(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:o,requireUsersAcceptTerms:r}}=e.app;if(r&&!e.alwaysShowImplicitConsent)return(0,At.jsx)(oc,{});if(!o&&!t)return(0,At.jsx)(oc,{});let n=!!(t&&o);return(0,At.jsxs)(oc,{children:["By logging in I agree to the"," ",o&&(0,At.jsx)("a",{href:o,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,At.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var $=({protectedByPrivy:e})=>(0,At.jsx)(re,{children:e?(0,At.jsxs)(At.Fragment,{children:[(0,At.jsx)(Da,{className:"hide-on-mobile"}),(0,At.jsx)("span",{className:"hide-on-mobile",children:(0,At.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),re=rc.default.div`
|
|
254
254
|
display: flex;
|
|
255
255
|
align-items: center;
|
|
256
256
|
justify-content: center;
|
|
@@ -277,7 +277,7 @@ Resources:
|
|
|
277
277
|
@media all and (display-mode: standalone) {
|
|
278
278
|
padding-bottom: 30px;
|
|
279
279
|
}
|
|
280
|
-
`;var
|
|
280
|
+
`;var Ru=f(require("@heroicons/react/24/outline/ArrowLeftIcon")),Iu=f(require("@heroicons/react/24/outline/XMarkIcon")),vs=f(require("styled-components"));var Ct=require("react/jsx-runtime"),ku=()=>(0,Ct.jsx)("div",{}),jv=({backFn:e})=>(0,Ct.jsx)("div",{children:(0,Ct.jsx)(Wu,{onClick:e,children:(0,Ct.jsx)(Ru.default,{height:"16px",width:"16px",strokeWidth:2})})}),Kv=e=>(0,Ct.jsx)("div",{children:(0,Ct.jsx)(Wu,{"aria-label":"close modal",onClick:e.onClose,children:(0,Ct.jsx)(Iu.default,{height:"16px",width:"16px",strokeWidth:2})})});var k=({backFn:e,onClose:t,title:o,closeable:r=!0})=>{let{closePrivyModal:n}=M(),{app:i}=_();return(0,Ct.jsxs)(Yv,{children:[e?(0,Ct.jsx)(jv,{backFn:e}):(0,Ct.jsx)(ku,{}),o&&(0,Ct.jsx)(Jv,{id:"privy-dialog-title",children:o}),i?.render.inDialog&&r?(0,Ct.jsx)(Kv,{onClose:t||(()=>n())}):(0,Ct.jsx)(ku,{})]})},Wu=vs.default.button`
|
|
281
281
|
&& {
|
|
282
282
|
cursor: pointer;
|
|
283
283
|
display: flex;
|
|
@@ -296,7 +296,7 @@ Resources:
|
|
|
296
296
|
opacity: 1;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
`,
|
|
299
|
+
`,Yv=vs.default.div`
|
|
300
300
|
padding: 16px 0;
|
|
301
301
|
display: flex;
|
|
302
302
|
align-items: center;
|
|
@@ -318,22 +318,22 @@ Resources:
|
|
|
318
318
|
display: flex;
|
|
319
319
|
justify-content: flex-end;
|
|
320
320
|
}
|
|
321
|
-
`,
|
|
321
|
+
`,Jv=vs.default.div`
|
|
322
322
|
overflow: hidden;
|
|
323
323
|
white-space: nowrap;
|
|
324
324
|
max-width: 100%;
|
|
325
325
|
text-overflow: ellipsis;
|
|
326
326
|
text-align: center;
|
|
327
327
|
color: var(--privy-color-foreground-2);
|
|
328
|
-
`;var
|
|
328
|
+
`;var or=f(require("styled-components")),ws=or.default.div`
|
|
329
329
|
text-align: left;
|
|
330
330
|
flex-grow: 1;
|
|
331
|
-
`,
|
|
331
|
+
`,Cs=or.default.div`
|
|
332
332
|
display: flex;
|
|
333
333
|
flex-direction: column;
|
|
334
334
|
justify-content: flex-end;
|
|
335
335
|
flex-grow: 1;
|
|
336
|
-
`,eo=
|
|
336
|
+
`,eo=or.default.div`
|
|
337
337
|
display: flex;
|
|
338
338
|
flex-direction: column;
|
|
339
339
|
gap: 12px;
|
|
@@ -348,7 +348,7 @@ Resources:
|
|
|
348
348
|
&::-webkit-scrollbar {
|
|
349
349
|
display: none;
|
|
350
350
|
}
|
|
351
|
-
`,
|
|
351
|
+
`,Mu=or.css`
|
|
352
352
|
&& {
|
|
353
353
|
width: 100%;
|
|
354
354
|
font-size: 16px;
|
|
@@ -386,14 +386,14 @@ Resources:
|
|
|
386
386
|
max-width: 24px;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
`,
|
|
390
|
-
${
|
|
391
|
-
`,
|
|
392
|
-
${
|
|
393
|
-
`,
|
|
389
|
+
`,Ne=or.default.button`
|
|
390
|
+
${Mu}
|
|
391
|
+
`,nc=or.default.a`
|
|
392
|
+
${Mu}
|
|
393
|
+
`,rr=or.default.div`
|
|
394
394
|
width: 100%;
|
|
395
395
|
${e=>e.if?"display: none;":""}
|
|
396
|
-
`;var Je=f(require("styled-components")),
|
|
396
|
+
`;var Je=f(require("styled-components")),st=Je.default.div`
|
|
397
397
|
display: flex;
|
|
398
398
|
flex-direction: column;
|
|
399
399
|
align-items: center;
|
|
@@ -401,7 +401,7 @@ Resources:
|
|
|
401
401
|
@media (max-width: 440px) {
|
|
402
402
|
padding: 10px 10px 20px;
|
|
403
403
|
}
|
|
404
|
-
`,
|
|
404
|
+
`,Le=Je.default.div`
|
|
405
405
|
font-size: 18px;
|
|
406
406
|
line-height: 18px;
|
|
407
407
|
text-align: center;
|
|
@@ -411,7 +411,7 @@ Resources:
|
|
|
411
411
|
font-size: 0.875rem;
|
|
412
412
|
|
|
413
413
|
text-align: center;
|
|
414
|
-
`,
|
|
414
|
+
`,Ar=Je.default.div`
|
|
415
415
|
display: flex;
|
|
416
416
|
flex-direction: column;
|
|
417
417
|
align-items: center;
|
|
@@ -421,7 +421,7 @@ Resources:
|
|
|
421
421
|
@media (max-width: 440px) {
|
|
422
422
|
padding: 10px 10px 20px;
|
|
423
423
|
}
|
|
424
|
-
`,
|
|
424
|
+
`,Nu=Je.default.div`
|
|
425
425
|
display: flex;
|
|
426
426
|
flex-direction: column;
|
|
427
427
|
align-items: stretch;
|
|
@@ -429,7 +429,7 @@ Resources:
|
|
|
429
429
|
padding: 1rem 0rem 0rem;
|
|
430
430
|
flex-grow: 1;
|
|
431
431
|
width: 100%;
|
|
432
|
-
`,
|
|
432
|
+
`,ic=Je.default.div`
|
|
433
433
|
width: 25px;
|
|
434
434
|
display: flex;
|
|
435
435
|
align-items: center;
|
|
@@ -441,19 +441,19 @@ Resources:
|
|
|
441
441
|
width: 25px !important;
|
|
442
442
|
color: var(--privy-color-accent);
|
|
443
443
|
}
|
|
444
|
-
`,
|
|
444
|
+
`,ac=Je.default.div`
|
|
445
445
|
display: flex;
|
|
446
446
|
align-items: center;
|
|
447
447
|
gap: 10px;
|
|
448
448
|
font-size: 0.875rem;
|
|
449
449
|
line-height: 1rem;
|
|
450
450
|
text-align: left;
|
|
451
|
-
`,
|
|
451
|
+
`,kr=Je.default.div`
|
|
452
452
|
display: flex;
|
|
453
453
|
flex-direction: column;
|
|
454
454
|
gap: 10px;
|
|
455
455
|
padding-top: 20px;
|
|
456
|
-
`,
|
|
456
|
+
`,bs=Je.default.div`
|
|
457
457
|
display: flex;
|
|
458
458
|
flex-direction: column;
|
|
459
459
|
align-items: stretch;
|
|
@@ -461,7 +461,7 @@ Resources:
|
|
|
461
461
|
padding: 1rem 0rem 0rem;
|
|
462
462
|
flex-grow: 1;
|
|
463
463
|
width: 100%;
|
|
464
|
-
`,
|
|
464
|
+
`,Es=Je.default.div`
|
|
465
465
|
display: flex;
|
|
466
466
|
gap: 5px;
|
|
467
467
|
width: 100%;
|
|
@@ -469,7 +469,7 @@ Resources:
|
|
|
469
469
|
& > button:not(#remove) {
|
|
470
470
|
width: 100%;
|
|
471
471
|
}
|
|
472
|
-
`,
|
|
472
|
+
`,sc=Je.default.button`
|
|
473
473
|
&& {
|
|
474
474
|
background-color: transparent;
|
|
475
475
|
color: var(--privy-color-foreground-3);
|
|
@@ -488,7 +488,7 @@ Resources:
|
|
|
488
488
|
&&:hover {
|
|
489
489
|
color: var(--privy-color-error);
|
|
490
490
|
}
|
|
491
|
-
`,
|
|
491
|
+
`,Ts=Je.default.div`
|
|
492
492
|
display: flex;
|
|
493
493
|
align-items: center;
|
|
494
494
|
gap: 0.5rem;
|
|
@@ -498,7 +498,7 @@ Resources:
|
|
|
498
498
|
height: 20px !important;
|
|
499
499
|
width: 20px !important;
|
|
500
500
|
}
|
|
501
|
-
`,
|
|
501
|
+
`,Fn=Je.default.div`
|
|
502
502
|
display: flex;
|
|
503
503
|
align-items: center;
|
|
504
504
|
gap: 6px;
|
|
@@ -512,15 +512,15 @@ Resources:
|
|
|
512
512
|
display: flex !important;
|
|
513
513
|
align-items: flex-end;
|
|
514
514
|
}
|
|
515
|
-
`,
|
|
515
|
+
`,Ps=Je.default.div`
|
|
516
516
|
width: 100%;
|
|
517
517
|
display: flex;
|
|
518
518
|
justify-content: space-between;
|
|
519
|
-
`,
|
|
519
|
+
`,Lu=Je.default.p`
|
|
520
520
|
text-align: left;
|
|
521
521
|
width: 100%;
|
|
522
522
|
color: var(--privy-color-foreground-3) !important;
|
|
523
|
-
`,
|
|
523
|
+
`,lc=Je.default.button`
|
|
524
524
|
display: flex;
|
|
525
525
|
flex-direction: row;
|
|
526
526
|
align-items: center;
|
|
@@ -550,7 +550,7 @@ Resources:
|
|
|
550
550
|
&:hover {
|
|
551
551
|
text-decoration: underline;
|
|
552
552
|
}
|
|
553
|
-
`,
|
|
553
|
+
`,bt=Je.default.div`
|
|
554
554
|
display: flex;
|
|
555
555
|
align-items: center;
|
|
556
556
|
justify-content: center;
|
|
@@ -565,10 +565,10 @@ Resources:
|
|
|
565
565
|
width: auto !important;
|
|
566
566
|
color: white;
|
|
567
567
|
}
|
|
568
|
-
`;var Ge=require("react/jsx-runtime"),
|
|
568
|
+
`;var Ge=require("react/jsx-runtime"),Uu=()=>{let{user:e,logout:t}=G(),{app:o,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:i}=_(),{acceptTerms:a,closePrivyModal:l}=M(),s=m=>{m?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};r.current=s;let c=async m=>{m.preventDefault(),await a(),e&&jt(e,o?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:y=>console.error(y),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,Ge.jsx)(Qv,{termsAndConditionsUrl:o?.legal.termsAndConditionsUrl,privacyPolicyUrl:o?.legal.privacyPolicyUrl,onAccept:c,onDecline:s})},Qv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:o,onDecline:r})=>(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(k,{closeable:!1}),(0,Ge.jsx)(Ou.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,Ge.jsx)(Le,{style:{marginTop:24},children:"One last step"}),(0,Ge.jsx)(Re,{children:"By signing up, you agree to our terms and privacy policy."}),(0,Ge.jsxs)(eo,{style:{marginTop:24},children:[e&&(0,Ge.jsxs)(nc,{target:"_blank",href:e,children:["View Terms ",(0,Ge.jsx)(cc.default,{style:{marginLeft:"auto"}})]}),t&&(0,Ge.jsxs)(nc,{target:"_blank",href:t,children:["View Privacy Policy ",(0,Ge.jsx)(cc.default,{style:{marginLeft:"auto"}})]})]}),(0,Ge.jsxs)(Zv,{style:{marginTop:24},children:[(0,Ge.jsx)(yo,{onClick:r,children:"No thanks"}),(0,Ge.jsx)(F,{onClick:o,children:"Accept"})]}),(0,Ge.jsx)($,{protectedByPrivy:!0})]}),Zv=Du.default.div`
|
|
569
569
|
display: flex;
|
|
570
570
|
gap: 10px;
|
|
571
|
-
`;var
|
|
571
|
+
`;var _s=f(require("styled-components"));var Fu=f(require("styled-components")),xs=Fu.default.span`
|
|
572
572
|
&& {
|
|
573
573
|
width: 82px;
|
|
574
574
|
height: 82px;
|
|
@@ -583,7 +583,7 @@ Resources:
|
|
|
583
583
|
transition: border-color 800ms;
|
|
584
584
|
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
585
585
|
}
|
|
586
|
-
`;var
|
|
586
|
+
`;var dc=require("react/jsx-runtime"),Ss=({style:e,...t})=>(0,dc.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,dc.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var He=require("react/jsx-runtime"),Bu=()=>{let{navigate:e,app:t}=_(),o=t?.allowlistConfig.errorTitle||"You don't have access to this app",r=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(k,{}),(0,He.jsxs)(Xv,{children:[(0,He.jsx)(tw,{children:(0,He.jsxs)("div",{children:[(0,He.jsx)(xs,{}),(0,He.jsx)(Ss,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,He.jsxs)(ew,{children:[typeof o=="string"?(0,He.jsx)("h3",{children:o}):(0,He.jsx)(He.Fragment,{children:o}),typeof r=="string"?(0,He.jsx)("p",{children:r}):(0,He.jsx)(He.Fragment,{children:r})]}),t?.allowlistConfig.errorCtaLink?(0,He.jsx)(F,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,He.jsx)(F,{onClick:()=>{e("LANDING")},children:n})]})]})},Xv=_s.default.div`
|
|
587
587
|
display: flex;
|
|
588
588
|
flex-direction: column;
|
|
589
589
|
align-items: center;
|
|
@@ -591,11 +591,11 @@ Resources:
|
|
|
591
591
|
gap: 24px;
|
|
592
592
|
width: 100%;
|
|
593
593
|
padding-bottom: 16px;
|
|
594
|
-
`,
|
|
594
|
+
`,ew=_s.default.div`
|
|
595
595
|
display: flex;
|
|
596
596
|
flex-direction: column;
|
|
597
597
|
gap: 8px;
|
|
598
|
-
`,
|
|
598
|
+
`,tw=_s.default.div`
|
|
599
599
|
display: flex;
|
|
600
600
|
flex-direction: column;
|
|
601
601
|
justify-content: center;
|
|
@@ -618,7 +618,7 @@ Resources:
|
|
|
618
618
|
left: -19px;
|
|
619
619
|
top: -19px;
|
|
620
620
|
}
|
|
621
|
-
`;var
|
|
621
|
+
`;var Ku=f(require("@heroicons/react/24/outline/EnvelopeIcon")),Yu=f(require("@heroicons/react/24/outline/PhoneIcon")),Rr=require("react"),Ju=require("react-device-detect"),Bn=f(require("styled-components"));var kt=f(require("styled-components")),to=kt.default.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
|
-
`,oo=
|
|
629
|
+
`,oo=kt.default.div`
|
|
630
630
|
display: flex;
|
|
631
631
|
flex-direction: column;
|
|
632
632
|
align-items: center;
|
|
633
633
|
justify-content: center;
|
|
634
634
|
flex-grow: 1;
|
|
635
635
|
width: 100%;
|
|
636
|
-
`,
|
|
636
|
+
`,Hu=kt.default.div`
|
|
637
637
|
display: flex;
|
|
638
638
|
flex-direction: column;
|
|
639
639
|
align-items: center;
|
|
640
640
|
width: 100%;
|
|
641
|
-
`,
|
|
641
|
+
`,As=(0,kt.default)(oo)`
|
|
642
642
|
padding: 20px 0;
|
|
643
|
-
`,
|
|
643
|
+
`,go=(0,kt.default)(oo)`
|
|
644
644
|
gap: 16px;
|
|
645
|
-
`,
|
|
645
|
+
`,pc=kt.default.div`
|
|
646
646
|
display: flex;
|
|
647
647
|
flex-direction: column;
|
|
648
648
|
width: 100%;
|
|
649
|
-
`,ro=
|
|
649
|
+
`,ro=kt.default.div`
|
|
650
650
|
display: flex;
|
|
651
651
|
flex-direction: column;
|
|
652
652
|
gap: 8px;
|
|
653
|
-
`,
|
|
653
|
+
`,K3=kt.default.div`
|
|
654
654
|
display: flex;
|
|
655
655
|
flex-direction: column;
|
|
656
656
|
justify-content: space-between;
|
|
657
657
|
height: 100%;
|
|
658
|
-
`,
|
|
658
|
+
`,Gu=kt.default.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
|
-
`,X=
|
|
681
|
+
`,X=kt.default.div`
|
|
682
682
|
height: 16px;
|
|
683
|
-
`,ee=
|
|
683
|
+
`,ee=kt.default.div`
|
|
684
684
|
height: 12px;
|
|
685
|
-
`,
|
|
685
|
+
`,Vu=kt.default.div`
|
|
686
686
|
position: relative;
|
|
687
|
-
`,
|
|
687
|
+
`,zu=kt.default.div`
|
|
688
688
|
background-color: var(--privy-color-accent);
|
|
689
689
|
display: flex;
|
|
690
690
|
justify-content: center;
|
|
@@ -692,9 +692,9 @@ Resources:
|
|
|
692
692
|
border-radius: 50%;
|
|
693
693
|
border-color: white;
|
|
694
694
|
border-width: 2px !important;
|
|
695
|
-
`;var
|
|
695
|
+
`;var ks=f(require("styled-components")),vo=require("react/jsx-runtime"),Oi=({title:e,description:t,children:o,...r})=>(0,vo.jsx)($u,{...r,children:(0,vo.jsxs)(vo.Fragment,{children:[(0,vo.jsx)("h3",{children:e}),typeof t=="string"?(0,vo.jsx)("p",{children:t}):t,o]})}),Oo=(0,ks.default)(Oi)`
|
|
696
696
|
margin-bottom: 24px;
|
|
697
|
-
`,
|
|
697
|
+
`,Oe=({title:e,description:t,icon:o,children:r,...n})=>(0,vo.jsxs)(ow,{...n,children:[o||null,(0,vo.jsx)("h3",{children:e}),typeof t=="string"?(0,vo.jsx)("p",{children:t}):t,r]}),$u=ks.default.div`
|
|
698
698
|
display: flex;
|
|
699
699
|
flex-direction: column;
|
|
700
700
|
justify-content: flex-start;
|
|
@@ -714,7 +714,7 @@ Resources:
|
|
|
714
714
|
color: var(--privy-color-foreground-2);
|
|
715
715
|
font-size: 14px;
|
|
716
716
|
}
|
|
717
|
-
|
|
717
|
+
`,ow=(0,ks.default)($u)`
|
|
718
718
|
align-items: center;
|
|
719
719
|
text-align: center;
|
|
720
720
|
gap: 16px;
|
|
@@ -722,7 +722,7 @@ Resources:
|
|
|
722
722
|
h3 {
|
|
723
723
|
margin-bottom: 24px;
|
|
724
724
|
}
|
|
725
|
-
`;var ae=require("react/jsx-runtime"),
|
|
725
|
+
`;var ae=require("react/jsx-runtime"),uc=6,qu=new Array(uc).fill(""),rw=1400;var Qu=()=>{let{app:e,navigate:t,navigateBack:o,setModalData:r,onUserCloseViaDialogOrKeybindRef:n}=_(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:m}=M(),{authenticated:y,user:g}=G(),[v,b]=(0,Rr.useState)(qu),[T,x]=(0,Rr.useState)(!1),[E,A]=(0,Rr.useState)(null),[I,W]=(0,Rr.useState)(null);n.current=()=>null;let S=s()?.email?0:1,O=e?.render.inDialog?gt:0,D=e?.render.inDialog?O-500:0;(0,Rr.useEffect)(()=>{if(y&&T&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let R=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},D);return()=>clearTimeout(R)}if(jt(g,e?.embeddedWallets?.createOnLogin)){let R=setTimeout(()=>{r({createWallet:{onSuccess:()=>{},onFailure:le=>console.error(le),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},D);return()=>clearTimeout(R)}else{m();let R=setTimeout(i,O);return()=>clearTimeout(R)}}},[y,T,g]),(0,Rr.useEffect)(()=>{if(E&&I===0){let j=setTimeout(()=>{b(qu),A(null),document.querySelector("input[name=code-0]")?.focus()},rw);return()=>clearTimeout(j)}},[E]);let B=j=>{j.preventDefault();let R=j.currentTarget.value.replace(" ","");if(R==="")return;if(isNaN(Number(R))){A("Code should be numeric"),W(1);return}A(null),W(null);let le=Number(j.currentTarget.name?.charAt(5)),pe=[...R||[""]].slice(0,uc-le),Q=[...v.slice(0,le),...pe,...v.slice(le+pe.length)];b(Q);let pt=pe.length,Ie=Math.min(Math.max(le+pt,0),uc-1);isNaN(Number(j.currentTarget.value))||document.querySelector(`input[name=code-${Ie}]`)?.focus(),Q.every(Pt=>Pt&&!isNaN(+Pt))&&(document.querySelector(`input[name=code-${Ie}]`)?.blur(),c(Q.join("")).then(()=>x(!0)).catch(qe=>{qe?.status===422?A("Invalid or expired verification code"):qe instanceof Ro&&qe.privyErrorCode==="cannot_link_more_of_type"?A(qe.message):A("Issue verifying code"),W(0)}))},V=j=>{I===1&&(A(null),W(null));let R=[...v.slice(0,j),"",...v.slice(j+1)];b(R),j>0&&document.querySelector(`input[name=code-${j-1}]`)?.focus()},Y=S==0?(0,ae.jsx)(Ku.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,ae.jsx)(Yu.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),U=S==0?(0,ae.jsxs)("p",{children:["Please check ",(0,ae.jsx)(ju,{children:s()?.email})," for an email from privy.io and enter your code below."]}):(0,ae.jsxs)("p",{children:["Please check ",(0,ae.jsx)(ju,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k,{backFn:()=>o()},"header"),(0,ae.jsxs)(nw,{children:[(0,ae.jsx)(Oe,{title:"Enter confirmation code",description:U,icon:Y}),(0,ae.jsxs)(Hu,{children:[(0,ae.jsxs)(iw,{children:[(0,ae.jsx)(aw,{fail:!!E,success:T,children:(0,ae.jsx)("span",{children:E||(T?"Success!":"")})}),(0,ae.jsx)("div",{children:v.map((j,R)=>(0,ae.jsx)("input",{name:`code-${R}`,type:"text",value:v[R],onChange:B,onKeyUp:le=>{le.key==="Backspace"&&V(R)},inputMode:"numeric",autoFocus:R===0,pattern:"[0-9]",className:`${T?"success":""} ${E?"fail":""}`,autoComplete:Ju.isMobile?"one-time-code":"off"},R))})]}),(0,ae.jsx)(sw,{children:S==0?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("span",{children:"Didn't get an email?"}),(0,ae.jsx)("button",{onClick:a,children:"Resend code"})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("span",{children:"Didn't get a message?"}),(0,ae.jsx)("button",{onClick:l,children:"Resend code"})]})})]})]}),(0,ae.jsx)($,{protectedByPrivy:!0})]})},nw=Bn.default.div`
|
|
726
726
|
display: flex;
|
|
727
727
|
flex-direction: column;
|
|
728
728
|
align-items: flex-start;
|
|
@@ -730,7 +730,7 @@ Resources:
|
|
|
730
730
|
margin: auto;
|
|
731
731
|
gap: 16px;
|
|
732
732
|
flex-grow: 1;
|
|
733
|
-
`,
|
|
733
|
+
`,iw=Bn.default.div`
|
|
734
734
|
display: flex;
|
|
735
735
|
flex-direction: column;
|
|
736
736
|
width: 100%;
|
|
@@ -786,7 +786,7 @@ Resources:
|
|
|
786
786
|
transform: translate(1px, 0px);
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
|
-
`,
|
|
789
|
+
`,aw=Bn.default.div`
|
|
790
790
|
line-height: 20px;
|
|
791
791
|
height: 20px;
|
|
792
792
|
font-size: 13px;
|
|
@@ -794,7 +794,7 @@ Resources:
|
|
|
794
794
|
display: flex;
|
|
795
795
|
justify-content: flex-end;
|
|
796
796
|
width: 100%;
|
|
797
|
-
`,
|
|
797
|
+
`,sw=Bn.default.div`
|
|
798
798
|
font-size: 13px;
|
|
799
799
|
color: var(--privy-color-foreground-3);
|
|
800
800
|
display: flex;
|
|
@@ -808,10 +808,10 @@ Resources:
|
|
|
808
808
|
> button {
|
|
809
809
|
text-decoration: underline;
|
|
810
810
|
}
|
|
811
|
-
`,
|
|
811
|
+
`,ju=Bn.default.span`
|
|
812
812
|
font-weight: 500;
|
|
813
813
|
word-break: break-all;
|
|
814
|
-
`;var
|
|
814
|
+
`;var tm=f(require("@heroicons/react/24/solid/CheckCircleIcon")),om=f(require("@heroicons/react/24/solid/XCircleIcon")),Ot=require("react"),rm=f(require("styled-components"));var Zu=f(require("styled-components"));var wo=require("react/jsx-runtime"),Xu=({icon:e})=>{let t=e;return(0,wo.jsx)(wo.Fragment,{children:(0,wo.jsx)(lw,{children:(0,wo.jsxs)("div",{children:[(0,wo.jsx)(_r,{}),typeof t=="string"?(0,wo.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,wo.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,wo.jsx)("span",{})]})})})},lw=Zu.default.div`
|
|
815
815
|
display: flex;
|
|
816
816
|
flex-direction: column;
|
|
817
817
|
justify-content: center;
|
|
@@ -834,14 +834,14 @@ Resources:
|
|
|
834
834
|
left: -19px;
|
|
835
835
|
top: -19px;
|
|
836
836
|
}
|
|
837
|
-
`;var Qe=require("react/jsx-runtime"),
|
|
837
|
+
`;var Qe=require("react/jsx-runtime"),nm=500,em=nm*2,im=()=>{let{lastScreen:e,currentScreen:t,data:o,navigateBack:r,navigate:n,setModalData:i}=_(),{status:a,token:l,waitForResult:s,reset:c,execute:m}=_e(),y=(0,Ot.useRef)([]),g=j=>{y.current=[j,...y.current]},[v,b]=(0,Ot.useState)(!0);(0,Ot.useEffect)(()=>{let j=setTimeout(b,em,!1);return g(j),()=>{y.current.forEach(R=>clearTimeout(R)),y.current=[]}},[]);let[T,x]=(0,Ot.useState)(""),[E,A]=(0,Ot.useState)("Checking that you are a human..."),[I,W]=(0,Ot.useState)((0,Qe.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"})),[S,O]=(0,Ot.useState)(!1),[D,B]=(0,Ot.useState)(3),V=o?.captchaModalData,Y=async j=>{try{await V?.callback(j),V?.onSuccessNavigateTo&&n(V?.onSuccessNavigateTo,!1)}catch(R){if(R instanceof tr)return;{let le={error:R,previousScreen:e||"LANDING"};i({errorModalData:le}),n(V?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Ot.useEffect)(()=>{if(a==="success"){let j=setTimeout(async()=>{let R=await s();!R||V?.userIntentRequired||Y(R)},em);g(j)}else if(a==="ready"){let j=setTimeout(()=>{a==="ready"&&m()},nm);g(j)}},[a]),(0,Ot.useEffect)(()=>{if(!v)switch(a){case"success":x("Success!"),A("CAPTCHA passed successfully."),W((0,Qe.jsx)(F,{onClick:()=>{O(!0),Y(l)},disabled:!V?.userIntentRequired,loading:S,children:V?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":x(""),A("Checking that you are a human..."),W((0,Qe.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":x("Something went wrong"),D<=0?(A("If you use an adblocker or VPN, try disabling and re-attempting."),W(null)):(A("You did not pass CAPTCHA. Please try again."),W((0,Qe.jsx)(F,{onClick:U,children:"Retry"})));break;case"ready":default:break}},[a,v,S]);let U=async()=>{if(D<=0)return;B(R=>R-1),c(),m();let j=await s();!j||V?.userIntentRequired||Y(j)};return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(k,{backFn:!e||t===e?void 0:r}),(0,Qe.jsxs)(cw,{children:[a==="success"?(0,Qe.jsx)(tm.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Qe.jsx)(om.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Qe.jsx)(Xu,{}),(0,Qe.jsxs)(ro,{children:[T?(0,Qe.jsx)("h3",{children:T}):null,(0,Qe.jsx)("p",{children:E})]}),I]}),(0,Qe.jsx)(re,{})]})},cw=rm.default.div`
|
|
838
838
|
display: flex;
|
|
839
839
|
flex-direction: column;
|
|
840
840
|
align-items: center;
|
|
841
841
|
justify-content: center;
|
|
842
842
|
gap: 24px;
|
|
843
843
|
width: 100%;
|
|
844
|
-
`;var om=f(require("@heroicons/react/24/outline/WalletIcon")),rm=require("react-device-detect"),nm=f(require("styled-components"));var bt=require("react/jsx-runtime"),Xu=({...e})=>(0,bt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,bt.jsx)("defs",{children:(0,bt.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,bt.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,bt.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,bt.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,bt.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,bt.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,bt.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,bt.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,bt.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,bt.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,bt.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var z=require("react/jsx-runtime"),em=({style:e,...t})=>(0,z.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,z.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,z.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,z.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,z.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,z.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,z.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,z.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,z.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,z.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,z.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,z.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,z.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,z.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,z.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,z.jsxs)("defs",{children:[(0,z.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#174299"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,z.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,z.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,z.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FF4000"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,z.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#8754C9"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,z.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,z.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,z.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,z.jsx)("stop",{stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,z.jsx)("stop",{stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.jsx)("clipPath",{id:"clip0_5_32",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,z.jsx)("clipPath",{id:"clip1_5_32",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var sr=require("react/jsx-runtime"),tm=({style:e,...t})=>(0,sr.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,sr.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,sr.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,sr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,sr.jsx)("defs",{children:(0,sr.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,sr.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var lr=require("react/jsx-runtime"),Fo={coinbase_wallet:{logo:ki,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:An,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:No,displayName:"Phantom"},rainbow:{logo:em,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Mi,displayName:"WalletConnect"},zerion:{logo:tm,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Xu,displayName:"Brave Wallet",rdns:"com.brave.wallet"}},Gn=({provider:e,displayName:t,logo:o,connectOnly:r,connector:n})=>{let{navigate:i}=_(),{connectWallet:a}=M(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{Er()?(a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(rm.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,lr.jsxs)(o1,{onClick:s,children:[(0,lr.jsx)(t1,{icon:e1(e,n.connectorType)??o,name:n.walletClientType}),(0,lr.jsx)("span",{style:{textTransform:"capitalize"},children:Xv(e,n.connectorType)||t||n.walletClientType}),(0,lr.jsx)("span",{id:"connect-text",children:"Connect"})]})},Xv=(e,t)=>{if(Fo[e]?.displayName)return Fo[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},e1=(e,t)=>{if(Fo[e]?.logo)return Fo[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Mi},t1=({icon:e,name:t})=>typeof e=="string"?(0,lr.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,lr.jsx)(om.default,{}):e?(0,lr.jsx)(e,{}):null,o1=(0,nm.default)(Me)`
|
|
844
|
+
`;var cm=f(require("@heroicons/react/24/outline/WalletIcon")),dm=require("react-device-detect"),pm=f(require("styled-components"));var Et=require("react/jsx-runtime"),am=({...e})=>(0,Et.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,Et.jsx)("defs",{children:(0,Et.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,Et.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,Et.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,Et.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,Et.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,Et.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,Et.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,Et.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,Et.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var z=require("react/jsx-runtime"),sm=({style:e,...t})=>(0,z.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,z.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,z.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,z.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,z.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,z.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,z.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,z.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,z.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,z.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,z.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,z.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,z.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,z.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,z.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,z.jsxs)("defs",{children:[(0,z.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#174299"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,z.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,z.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,z.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FF4000"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,z.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#8754C9"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,z.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,z.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,z.jsx)("stop",{stopColor:"#FFF700"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,z.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,z.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,z.jsx)("stop",{stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,z.jsx)("stop",{stopColor:"#00AAFF"}),(0,z.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,z.jsx)("clipPath",{id:"clip0_5_32",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,z.jsx)("clipPath",{id:"clip1_5_32",children:(0,z.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var nr=require("react/jsx-runtime"),lm=({style:e,...t})=>(0,nr.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,nr.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,nr.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,nr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,nr.jsx)("defs",{children:(0,nr.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,nr.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var ir=require("react/jsx-runtime"),Do={coinbase_wallet:{logo:Ii,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:_n,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Wo,displayName:"Phantom"},rainbow:{logo:sm,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Li,displayName:"WalletConnect"},zerion:{logo:lm,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:am,displayName:"Brave Wallet",rdns:"com.brave.wallet"}},Hn=({provider:e,displayName:t,logo:o,connectOnly:r,connector:n})=>{let{navigate:i}=_(),{connectWallet:a}=M(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{wr()?(a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(dm.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,ir.jsxs)(mw,{onClick:s,children:[(0,ir.jsx)(uw,{icon:pw(e,n.connectorType)??o,name:n.walletClientType}),(0,ir.jsx)("span",{style:{textTransform:"capitalize"},children:dw(e,n.connectorType)||t||n.walletClientType}),(0,ir.jsx)("span",{id:"connect-text",children:"Connect"})]})},dw=(e,t)=>{if(Do[e]?.displayName)return Do[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},pw=(e,t)=>{if(Do[e]?.logo)return Do[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Li},uw=({icon:e,name:t})=>typeof e=="string"?(0,ir.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,ir.jsx)(cm.default,{}):e?(0,ir.jsx)(e,{}):null,mw=(0,pm.default)(Ne)`
|
|
845
845
|
/* Show "Connect" on hover */
|
|
846
846
|
> #connect-text {
|
|
847
847
|
font-weight: 500;
|
|
@@ -863,23 +863,23 @@ Resources:
|
|
|
863
863
|
display: none;
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
|
-
`;var
|
|
866
|
+
`;var Uo=require("react/jsx-runtime"),fw=["coinbase_wallet"],hw=["metamask","rainbow","zerion"],yw=["phantom"],Gn=({connectOnly:e})=>{let{connectors:t}=M(),{app:o}=_(),r=Di(o.appearance.walletList,t,e,o.appearance.walletList);return(0,Uo.jsxs)(Uo.Fragment,{children:[...r]})},Di=(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:m,walletClientType:y})=>m==="injected"&&!r.includes(y));for(let m of c){let{walletClientType:y,walletBranding:g}=m;(y==="unknown"?i:n).push((0,Uo.jsx)(Hn,{connectOnly:o,provider:y,logo:g.icon,displayName:g.name,connector:m},`${s}-${y}`))}}else if(yw.includes(s)){let c=t.find(m=>m.connectorType==="injected"&&m.walletClientType===s||m.connectorType===s);c&&n.push((0,Uo.jsx)(Hn,{connectOnly:o,provider:s,connector:c},s))}else if(hw.includes(s)){let c=t.find(m=>m.connectorType==="injected"&&m.walletClientType===s)??l;c&&n.push((0,Uo.jsx)(Hn,{connectOnly:o,provider:s,connector:c},s))}else if(fw.includes(s)){let c=t.find(({connectorType:m})=>m===s);c&&n.push((0,Uo.jsx)(Hn,{connectOnly:o,provider:s,connector:c},s))}else s==="wallet_connect"&&l&&a.push((0,Uo.jsx)(Hn,{connectOnly:o,provider:s,connector:l},s));return[...i,...n,...a]};var Fo=require("react/jsx-runtime"),um=()=>{let{app:e}=_(),t=`Connect a wallet to ${e?.name}`;return(0,Fo.jsxs)(Fo.Fragment,{children:[(0,Fo.jsx)(k,{},"header"),(0,Fo.jsx)(Oo,{title:"Connect your wallet",description:t}),(0,Fo.jsx)(eo,{children:(0,Fo.jsx)(Gn,{connectOnly:!0})}),(0,Fo.jsx)($,{protectedByPrivy:!0})]})};var gm=f(require("styled-components"));var ym=f(require("styled-components"));var mm=f(require("react"));var hm=require("react/jsx-runtime"),fm=()=>{let{app:e}=_(),t=e?.appearance?.logo,o=`${e?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,hm.jsx)("img",{src:t,alt:o,style:r}):t.type==="svg"||t.type==="img"?mm.default.cloneElement(t,{alt:o,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var mc=require("react/jsx-runtime"),Vn=e=>{let{app:t}=_();return t?.appearance.logo?(0,mc.jsx)(gw,{...e,children:(0,mc.jsx)(fm,{})}):null},gw=ym.default.div`
|
|
867
867
|
display: flex;
|
|
868
868
|
flex-direction: column;
|
|
869
869
|
align-items: center;
|
|
870
870
|
padding: 24px 0;
|
|
871
871
|
flex-grow: 1;
|
|
872
872
|
justify-content: center;
|
|
873
|
-
`;var
|
|
873
|
+
`;var Co=require("react/jsx-runtime"),vm=()=>{let{app:e}=_();return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(k,{},"header"),(0,Co.jsx)(vw,{}),(0,Co.jsx)(eo,{children:(0,Co.jsx)(Gn,{connectOnly:!0})}),e&&(0,Co.jsx)(Un,{app:e,alwaysShowImplicitConsent:!0}),(0,Co.jsx)($,{protectedByPrivy:!0})]})},vw=(0,gm.default)(Vn)`
|
|
874
874
|
margin-bottom: 16px;
|
|
875
|
-
`;var
|
|
875
|
+
`;var qn=require("react"),Em=require("react-device-detect"),Tm=f(require("styled-components"));var no=require("react"),$n=require("react-device-detect"),Cm=require("react-use"),hc=f(require("styled-components"));var zn=require("react");function wm(){let[e,t]=(0,zn.useState)(!1),o=(0,zn.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,zn.useEffect)(()=>(document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)),[o]),{hasTabbedAway:e,reset:()=>t(!1)}}var ve=require("react/jsx-runtime"),fc=2,yc=e=>e?.privyErrorCode==="linked_to_another_user"?Xo.ERROR_USER_EXISTS:e instanceof Me&&!e.details.default?e.details:e instanceof Tn?Xo.ERROR_TIMED_OUT:e instanceof Pn?Xo.ERROR_USER_REJECTED_CONNECTION:Xo.ERROR_WALLET_CONNECTION,bm=()=>{let[e,t]=(0,no.useState)(!1),[o,r]=(0,no.useState)(!1),[n,i]=(0,no.useState)(void 0),{authenticated:a}=G(),{app:l,navigate:s,navigateBack:c,lastScreen:m,currentScreen:y,setModalData:g}=_(),{getAuthFlow:v,walletConnectionStatus:b,closePrivyModal:T,initLoginWithWallet:x,loginWithWallet:E,updateWallets:A}=M(),{walletConnectors:I}=G(),[W,S]=(0,no.useState)(0),{user:O}=G(),[D]=(0,no.useState)(O?.linkedAccounts.length||0),[B,V]=(0,no.useState)(""),[Y,U]=(0,no.useState)(!1),{hasTabbedAway:j}=wm(),{enabled:R,token:le}=_e(),pe=$n.isMobile&&b?.connector?.connectorType==="wallet_connect_v2"||$n.isMobile&&b?.connector?.connectorType==="coinbase_wallet"||$n.isMobile&&b?.connector?.connectorType==="injected"&&b?.connector?.walletClientType==="phantom",Q=b?.status==="connected",pt=b?.status==="switching_to_supported_chain";(0,no.useEffect)(()=>{let N=v();if(Q&&!N&&(R&&!le&&!a?(g({captchaModalData:{callback:ut=>x(b.connectedWallet,ut).then(()=>{U(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN",!1)):x(b.connectedWallet,le).then(()=>{U(!0)})),N&&pe&&Q&&!N.preparedMessage){N.buildSiweMessage();return}!N||pe||!Q||o||(async()=>{r(!0),i(void 0);try{b?.connector?.connectorType==="wallet_connect_v2"&&b?.connector?.walletClientType==="metamask"&&await Bl(2500),await Pt()}catch(ut){console.warn("Auto-prompted signature failed",ut)}finally{r(!1)}})()},[W,Q,Y]),(0,no.useEffect)(()=>{if(O&&e){let N=l?.render.inDialog?gt:0,ut=l?.render.inDialog?N-500:0;if(l?.legal.requireUsersAcceptTerms&&!O.hasAcceptedTerms){let oe=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},ut);return()=>clearTimeout(oe)}if(jt(O,l?.embeddedWallets?.createOnLogin)){let oe=setTimeout(()=>{g({createWallet:{onSuccess:()=>{},onFailure:$t=>console.error($t),callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},ut);return()=>clearTimeout(oe)}A();let xi=setTimeout(T,gt);return()=>clearTimeout(xi)}},[O,e]);let Ie=N=>{if(N?.privyErrorCode==="allowlist_rejected"){s("ALLOWLIST_REJECTION_SCREEN");return}i(yc(N))};async function Pt(){try{if(await E(),!l?.render.inDialog)return T();t(!0)}catch(N){Ie(N)}finally{r(!1)}}(0,no.useEffect)(()=>{b?.connectError&&Ie(b?.connectError)},[b]),(0,Cm.useInterval)(()=>{let N=qe==="wallet_connect_v2"&&b?.connector instanceof No?b.connector.redirectUri:void 0;N&&V(N)},b?.connector instanceof No&&!B?500:null);let qe=b?.connector?.connectorType||"injected",ue=b?.connector?.walletClientType||"unknown",Jo=Do[ue]?.displayName||b?.connector?.walletBranding.name||"Browser Extension",so=Do[ue]?.logo||b?.connector?.walletBranding.icon||(N=>(0,ve.jsx)(Sn,{...N})),un=Jo==="Browser Extension"?Jo.toLowerCase():Jo,xt;e?xt=`Successfully connected with ${un}`:n?xt=n.message:pt?xt="Switching networks":Q?xt=o&&pe?"Signing":"Sign to verify":xt=`Waiting for ${un}`;let je="Don\u2019t see your wallet? Check your other browser windows.";if(e){let N=O?.linkedAccounts.length||0;D===N?je="Wallet was already linked.":je="You\u2019re good to go!"}else W>=fc&&n?je="Unable to connect wallet":n?je=n.detail:pt?je="Switch your wallet to the requested network.":Q&&pe?je="Sign the message in your wallet to verify it belongs to you.":ue==="metamask"&&$n.isMobile?je="Click continue to open and connect MetaMask.":ue==="metamask"?je="For the best experience, connect only one wallet at a time.":qe==="wallet_connect"?je="Open your mobile wallet app to continue":qe==="coinbase_wallet"&&(hp()||(Jl(O)?je="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":je="Open the Coinbase app on your phone to continue."));let ko=I?.walletConnectors?.find(N=>N.walletClientType==="coinbase_wallet"),mn=ue==="coinbase_wallet"&&(Jl(O)||n===Xo.ERROR_USER_EXISTS);return(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(k,{backFn:!m||y===m?void 0:c}),(0,ve.jsxs)(Cw,{children:[(0,ve.jsx)(gc,{walletLogo:so,success:e,fail:!!n}),(0,ve.jsxs)(ro,{children:[(0,ve.jsx)("h3",{children:xt}),(0,ve.jsx)("p",{children:je}),!Q&&B&&!j?(0,ve.jsxs)("p",{children:["Still here?"," ",(0,ve.jsx)("a",{href:B,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),mn?(0,ve.jsx)(F,{onClick:()=>ko&&ko?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Xo.ERROR_USER_EXISTS&&y!==m?(0,ve.jsx)(F,{onClick:c,children:"Use a different wallet"}):Q&&!e&&pe?(0,ve.jsx)(F,{onClick:()=>{r(!0),Pt(),ww(ue)},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&W<fc?(0,ve.jsx)(F,{onClick:()=>{S(W+1),i(void 0),Q?(r(!0),Pt()):b?.connectRetry()},disabled:!e&&(!n?.retryable||W>=fc),children:"Retry"}):!e&&!n?(0,ve.jsx)(F,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,ve.jsx)(re,{})]})},ww=e=>{if(!$n.isMobile||!ru(e))return;let t=nu(e);t&&window.open(t,"_self","noopener,noreferrer")},Cw=hc.default.div`
|
|
876
876
|
display: flex;
|
|
877
877
|
flex-direction: column;
|
|
878
878
|
align-items: center;
|
|
879
879
|
justify-content: center;
|
|
880
880
|
gap: 24px;
|
|
881
881
|
width: 100%;
|
|
882
|
-
`,
|
|
882
|
+
`,bw=hc.default.div`
|
|
883
883
|
display: flex;
|
|
884
884
|
flex-direction: column;
|
|
885
885
|
justify-content: center;
|
|
@@ -902,14 +902,14 @@ Resources:
|
|
|
902
902
|
left: -19px;
|
|
903
903
|
top: -19px;
|
|
904
904
|
}
|
|
905
|
-
`,
|
|
905
|
+
`,gc=e=>{let t=e.walletLogo;return(0,ve.jsx)(ve.Fragment,{children:(0,ve.jsx)(bw,{children:(0,ve.jsxs)("div",{children:[(0,ve.jsx)(_r,{success:e.success,fail:e.fail}),typeof t=="string"?(0,ve.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,ve.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var lt=require("react/jsx-runtime"),Rs=2,Pm=()=>{let{navigateBack:e,lastScreen:t,currentScreen:o}=_(),{walletConnectionStatus:r,closePrivyModal:n}=M(),[i,a]=(0,qn.useState)(void 0),[l,s]=(0,qn.useState)(0),c=r?.status==="connected",m=r?.status==="switching_to_supported_chain";(0,qn.useEffect)(()=>{if(c){let I=setTimeout(n,gt);return()=>clearTimeout(I)}},[c]);let y=I=>{a(yc(I))};(0,qn.useEffect)(()=>{r?.connectError&&y(r?.connectError)},[r]);let g=r?.connector?.connectorType||"injected",v=r?.connector?.walletClientType||"unknown",b=Do[v]?.displayName||r?.connector?.walletBranding.name||"Browser Extension",T=Do[v]?.logo||r?.connector?.walletBranding.icon||(I=>(0,lt.jsx)(Sn,{...I})),x=b==="Browser Extension"?b.toLowerCase():b,E;c?E=`Successfully connected with ${x}`:i?E=i.message:m?E="Switching networks":E=`Waiting for ${x}`;let A="Don\u2019t see your wallet? Check your other browser windows.";return c?A="You\u2019re good to go!":l>=Rs&&i?A="Unable to connect wallet":i?A=i.detail:m?A="Switch your wallet to the requested network.":v==="metamask"&&Em.isMobile?A="Click to continue to open and connect MetaMask.":v==="metamask"?A="For the best experience, connect only one wallet at a time.":g==="wallet_connect_v2"?A="Open your mobile wallet app to continue":g==="coinbase_wallet"&&(A="Open the Coinbase app on your phone to continue."),(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(k,{backFn:o===t?void 0:e}),(0,lt.jsxs)(Ew,{children:[(0,lt.jsx)(gc,{walletLogo:T,success:c,fail:!!i}),(0,lt.jsxs)(ro,{children:[(0,lt.jsx)("h3",{children:E}),(0,lt.jsx)("p",{children:A})]}),i==Xo.ERROR_USER_EXISTS?(0,lt.jsx)(F,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<Rs?(0,lt.jsx)(F,{onClick:()=>{s(l+1),a(void 0),r?.connectRetry()},disabled:!c&&(!i?.retryable||l>=Rs),children:"Retry"}):!c&&i&&l>=Rs?(0,lt.jsx)(F,{onClick:e,children:"Use a different wallet"}):null]}),(0,lt.jsx)(re,{})]})},Ew=Tm.default.div`
|
|
906
906
|
display: flex;
|
|
907
907
|
flex-direction: column;
|
|
908
908
|
align-items: center;
|
|
909
909
|
justify-content: center;
|
|
910
910
|
gap: 24px;
|
|
911
911
|
width: 100%;
|
|
912
|
-
`;var
|
|
912
|
+
`;var Am=f(require("@heroicons/react/24/solid/XCircleIcon")),Jn=require("react"),km=f(require("styled-components"));var Ui=f(require("styled-components")),jn=require("react/jsx-runtime"),Kn=()=>(0,jn.jsx)(Tw,{children:(0,jn.jsxs)(Pw,{children:[(0,jn.jsx)(xw,{}),(0,jn.jsx)(Sw,{})]})}),Tw=Ui.default.div`
|
|
913
913
|
display: flex;
|
|
914
914
|
justify-content: center;
|
|
915
915
|
align-items: center;
|
|
@@ -921,14 +921,14 @@ Resources:
|
|
|
921
921
|
@media all and (display-mode: standalone) {
|
|
922
922
|
margin-bottom: 30px;
|
|
923
923
|
}
|
|
924
|
-
`,
|
|
924
|
+
`,Pw=Ui.default.div`
|
|
925
925
|
position: relative;
|
|
926
926
|
height: 140px;
|
|
927
927
|
width: 140px;
|
|
928
928
|
|
|
929
929
|
opacity: 1;
|
|
930
930
|
animation: fadein 200ms ease;
|
|
931
|
-
`,
|
|
931
|
+
`,xw=Ui.default.div`
|
|
932
932
|
position: absolute;
|
|
933
933
|
top: 0;
|
|
934
934
|
right: 0;
|
|
@@ -941,7 +941,7 @@ Resources:
|
|
|
941
941
|
border: 4px solid var(--privy-color-accent-light);
|
|
942
942
|
border-radius: 50%;
|
|
943
943
|
}
|
|
944
|
-
`,
|
|
944
|
+
`,Sw=Ui.default.div`
|
|
945
945
|
position: absolute;
|
|
946
946
|
top: 0;
|
|
947
947
|
right: 0;
|
|
@@ -965,20 +965,20 @@ Resources:
|
|
|
965
965
|
transform: rotate(360deg);
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
|
-
`;var
|
|
968
|
+
`;var xm=["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 Ve=class extends Error{constructor(o,r){super(r);this.type=o}};function Yn(e){let t=e.type;return typeof t=="string"&&xm.includes(t)}function _w(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function Kr(e){return Yn(e)&&e.type==="wallet_not_on_device"}function Sm(e){return Yn(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Yr(e){return!!(Yn(e)&&e.type==="mfa_timeout")}function Jr(e){return!!(Yn(e)&&e.type==="missing_or_invalid_mfa")}function Is(e){return!!(Yn(e)&&e.type==="mfa_verification_max_attempts_reached")}function vc(e){return!!(Yn(e)&&e.message.includes("code 429"))}function wc(e){return!!(_w(e)&&e.message==="MFA canceled")}var Rt=require("react/jsx-runtime"),_m=1,Rm=()=>{let{authenticated:e,user:t,getAccessToken:o}=G(),{closePrivyModal:r,createAnalyticsEvent:n,walletProxy:i}=M(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=_(),m=(0,Jn.useMemo)(()=>Date.now(),[]),[y,g]=(0,Jn.useState)(!1),{onCompleteNavigateTo:v,onFailure:b}=l?.connectWallet,T=E=>{y||(g(!0),b(typeof E=="string"?new Error(E):E))};(0,Jn.useEffect)(()=>{let E=ke(t),A;return!e||!E?T("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let W=await o();if(!W)return T("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:W,address:E.address});let S=(Date.now()-m)/1e3;v==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&S<_m?A=setTimeout(()=>{a(v)},(_m-S)*1e3):a(v)}catch(S){if(Kr(S)&&E.recoveryMethod==="privy"){let O=await o();if(!O)return T("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:O}))?.address||T(new Error("Unable to recover wallet")),v?a(v):r({shouldCallAuthOnSuccess:!1}),n("embedded_wallet_recovery_completed",{walletAddress:E.address}),a(v)}catch{T("An error has occurred, please try again.")}}else Kr(S)?(s({...l,recoverWallet:{privyWallet:E,onCompleteNavigateTo:v,onFailure:b}}),a("EMBEDDED_WALLET_RECOVERY_SCREEN")):T(S)}})(),()=>clearTimeout(A)):void 0},[e,t,i]);let x=()=>{T("User exited before wallet could be connected"),r({shouldCallAuthOnSuccess:!1})};return c.current=x,(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(k,{onClose:x}),y?(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsxs)(go,{children:[(0,Rt.jsx)(Am.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Rt.jsx)(Oe,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,Rt.jsx)(F,{onClick:()=>r({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,Rt.jsx)(Kn,{}),(0,Rt.jsx)(Aw,{})]})},Aw=km.default.div`
|
|
969
969
|
height: 44px;
|
|
970
|
-
`;var
|
|
970
|
+
`;var Im=f(require("@heroicons/react/24/solid/CheckCircleIcon")),Wm=require("react");var io=require("react/jsx-runtime"),Mm=()=>{let{user:e}=G(),{closePrivyModal:t,isNewUserThisSession:o,updateWallets:r}=M(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=_(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,m=()=>{let y=ke(e);y?(r(),l(y)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,Wm.useEffect)(()=>{let y=setTimeout(m,np);return()=>clearTimeout(y)},[]),a.current=m,(0,io.jsxs)(io.Fragment,{children:[(0,io.jsx)(k,{onClose:m}),(0,io.jsx)(X,{}),(0,io.jsxs)(go,{children:[(0,io.jsx)(Im.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,io.jsx)(Oe,{title:o?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:o?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,io.jsx)(ee,{}),(0,io.jsx)($,{protectedByPrivy:!0})]})};var Om=f(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),Dm=f(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),ar=require("react"),sr=f(require("styled-components"));var ne=require("react/jsx-runtime"),Um=()=>{let[e,t]=(0,ar.useState)(null),{authenticated:o,user:r,getAccessToken:n}=G(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=M(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),m=ke(r)?.address,{onFailure:y,onSuccess:g,origin:v,appId:b}=s.keyExport,T=E=>{i({shouldCallAuthOnSuccess:!1}),y(typeof E=="string"?new Error(E):E)},x=()=>{i({shouldCallAuthOnSuccess:!1}),g(),a("embedded_wallet_key_export_completed",{walletAddress:m})};return(0,ar.useEffect)(()=>{let E=ke(r);if(!o||!E)return T("User must be authenticated before exporting their wallet");n().then(t,T)},[o,r]),c.current=x,(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(k,{onClose:x}),(0,ne.jsxs)(Iw,{children:[(0,ne.jsxs)(Oe,{icon:(0,ne.jsx)(Dm.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,ne.jsxs)(Lw,{children:[(0,ne.jsx)(Rw,{style:{marginRight:6}}),Cr(m)]}),(0,ne.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,ne.jsxs)(Ww,{children:[(0,ne.jsxs)(Nm,{children:[(0,ne.jsx)(Lm,{children:"1"}),(0,ne.jsxs)("span",{children:[(0,ne.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,ne.jsxs)(Nm,{children:[(0,ne.jsx)(Lm,{children:"2"}),(0,ne.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,ne.jsx)("div",{style:{width:"100%"},children:e&&(0,ne.jsx)(kw,{origin:v,appId:b,accessToken:e,clientAnalyticsId:l,address:m,dimensions:{height:"44px"}})}),(0,ne.jsxs)(Ow,{children:[(0,ne.jsxs)("div",{children:[(0,ne.jsx)(Om.default,{viewBox:"0 0 20 18"}),(0,ne.jsx)("h4",{children:"Warning"})]}),(0,ne.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,ne.jsx)($,{protectedByPrivy:!0})]})};function kw(e){let[t,o]=(0,ar.useState)(e.dimensions.width),[r,n]=(0,ar.useState)(void 0),i=(0,ar.useRef)(null);return(0,ar.useEffect)(()=>{if(i.current&&t===void 0){let{width:l}=i.current.getBoundingClientRect();o(l)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,ne.jsx)("div",{ref:i,children:t&&(0,ne.jsxs)(Mw,{children:[(0,ne.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Ia(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...r})}),(0,ne.jsx)(Nw,{children:"Loading..."})]})})}function Rw(e){return(0,ne.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,ne.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Iw=sr.default.div`
|
|
971
971
|
display: flex;
|
|
972
972
|
flex-direction: column;
|
|
973
973
|
text-align: left;
|
|
974
|
-
`,
|
|
974
|
+
`,Ww=sr.default.div`
|
|
975
975
|
display: flex;
|
|
976
976
|
flex-direction: column;
|
|
977
977
|
gap: 24px;
|
|
978
978
|
padding-bottom: 16px;
|
|
979
979
|
margin-left: 11px;
|
|
980
980
|
border-left: 1px solid var(--privy-color-foreground-4) !important;
|
|
981
|
-
`,
|
|
981
|
+
`,Nm=sr.default.div`
|
|
982
982
|
display: flex;
|
|
983
983
|
align-items: top;
|
|
984
984
|
gap: 8px;
|
|
@@ -987,7 +987,7 @@ Resources:
|
|
|
987
987
|
color: var(--privy-color-accent);
|
|
988
988
|
text-decoration: underline;
|
|
989
989
|
}
|
|
990
|
-
`,
|
|
990
|
+
`,Lm=sr.default.div`
|
|
991
991
|
display: flex;
|
|
992
992
|
align-items: center;
|
|
993
993
|
justify-content: center;
|
|
@@ -1001,11 +1001,11 @@ Resources:
|
|
|
1001
1001
|
border-radius: 100%;
|
|
1002
1002
|
background: var(--privy-color-background);
|
|
1003
1003
|
color: var(--privy-color-accent);
|
|
1004
|
-
`,
|
|
1004
|
+
`,Mw=sr.default.div`
|
|
1005
1005
|
overflow: visible;
|
|
1006
1006
|
position: relative;
|
|
1007
1007
|
height: 44px;
|
|
1008
|
-
`,
|
|
1008
|
+
`,Nw=sr.default.div`
|
|
1009
1009
|
position: absolute;
|
|
1010
1010
|
display: flex;
|
|
1011
1011
|
align-items: center;
|
|
@@ -1017,7 +1017,7 @@ Resources:
|
|
|
1017
1017
|
border-radius: var(--privy-border-radius-md);
|
|
1018
1018
|
background-color: var(--privy-color-background-2);
|
|
1019
1019
|
color: var(--privy-color-foreground-3);
|
|
1020
|
-
`,
|
|
1020
|
+
`,Lw=sr.default.div`
|
|
1021
1021
|
display: flex;
|
|
1022
1022
|
align-items: center;
|
|
1023
1023
|
padding-top: 1px;
|
|
@@ -1030,7 +1030,7 @@ Resources:
|
|
|
1030
1030
|
font-size: 12px;
|
|
1031
1031
|
font-weight: 500;
|
|
1032
1032
|
margin: auto;
|
|
1033
|
-
`,
|
|
1033
|
+
`,Ow=sr.default.div`
|
|
1034
1034
|
border: 1px solid var(--privy-color-background-2) !important;
|
|
1035
1035
|
border-radius: var(--privy-border-radius-md);
|
|
1036
1036
|
padding: 16px;
|
|
@@ -1052,7 +1052,7 @@ Resources:
|
|
|
1052
1052
|
color: var(--privy-color-error);
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
|
-
`;var
|
|
1055
|
+
`;var Ef=f(require("@heroicons/react/24/solid/XCircleIcon")),bo=require("react"),Tf=f(require("styled-components"));var Vi=require("react");var qm=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ei=require("react");var Fm=f(require("@heroicons/react/24/outline/ArrowPathIcon")),Bm=f(require("@heroicons/react/24/outline/EyeIcon")),Hm=f(require("@heroicons/react/24/outline/EyeSlashIcon")),De=f(require("styled-components"));var Dw=De.css`
|
|
1056
1056
|
font-size: 14px;
|
|
1057
1057
|
font-style: normal;
|
|
1058
1058
|
font-weight: 400;
|
|
@@ -1060,8 +1060,8 @@ Resources:
|
|
|
1060
1060
|
letter-spacing: -0.008px;
|
|
1061
1061
|
text-align: left;
|
|
1062
1062
|
transition: color 0.1s ease-in;
|
|
1063
|
-
`,
|
|
1064
|
-
${
|
|
1063
|
+
`,Ws=De.default.span`
|
|
1064
|
+
${Dw}
|
|
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
|
-
`,
|
|
1072
|
+
`,Ir=De.default.div`
|
|
1073
1073
|
display: flex;
|
|
1074
1074
|
flex-direction: column;
|
|
1075
1075
|
justify-content: center;
|
|
1076
1076
|
flex-grow: 1;
|
|
1077
|
-
`,
|
|
1078
|
-
${e=>e.hideAnimations&&
|
|
1077
|
+
`,Wr=(0,De.default)(F)`
|
|
1078
|
+
${e=>e.hideAnimations&&De.css`
|
|
1079
1079
|
&& {
|
|
1080
1080
|
transition: none;
|
|
1081
1081
|
}
|
|
1082
1082
|
`}
|
|
1083
|
-
`,
|
|
1083
|
+
`,Gm=De.css`
|
|
1084
1084
|
&& {
|
|
1085
1085
|
width: 100%;
|
|
1086
1086
|
border-width: 1px;
|
|
@@ -1095,23 +1095,23 @@ Resources:
|
|
|
1095
1095
|
font-weight: 300;
|
|
1096
1096
|
line-height: 22px; /* 137.5% */
|
|
1097
1097
|
}
|
|
1098
|
-
`,
|
|
1099
|
-
${
|
|
1098
|
+
`,Qr=De.default.input`
|
|
1099
|
+
${Gm}
|
|
1100
1100
|
|
|
1101
1101
|
&::placeholder {
|
|
1102
1102
|
color: var(--privy-color-foreground-3);
|
|
1103
1103
|
font-style: italic;
|
|
1104
1104
|
font-size: 14px;
|
|
1105
1105
|
}
|
|
1106
|
-
`,
|
|
1107
|
-
${
|
|
1108
|
-
`,
|
|
1106
|
+
`,Vm=De.default.div`
|
|
1107
|
+
${Gm}
|
|
1108
|
+
`,Mr=De.default.div`
|
|
1109
1109
|
position: relative;
|
|
1110
1110
|
width: 100%;
|
|
1111
1111
|
display: flex;
|
|
1112
1112
|
align-items: center;
|
|
1113
1113
|
justify-content: ${({centered:e})=>e?"center":"space-between"};
|
|
1114
|
-
`,
|
|
1114
|
+
`,Nr=De.default.div`
|
|
1115
1115
|
display: flex;
|
|
1116
1116
|
flex-direction: column;
|
|
1117
1117
|
align-items: center;
|
|
@@ -1133,12 +1133,12 @@ Resources:
|
|
|
1133
1133
|
font-weight: 400;
|
|
1134
1134
|
line-height: 20px;
|
|
1135
1135
|
}
|
|
1136
|
-
`,
|
|
1136
|
+
`,Fi=De.default.div`
|
|
1137
1137
|
display: flex;
|
|
1138
1138
|
flex-direction: column;
|
|
1139
1139
|
gap: 10px;
|
|
1140
1140
|
padding-bottom: 1rem;
|
|
1141
|
-
`,
|
|
1141
|
+
`,Bi=De.default.div`
|
|
1142
1142
|
display: flex;
|
|
1143
1143
|
text-align: left;
|
|
1144
1144
|
align-items: center;
|
|
@@ -1158,13 +1158,13 @@ Resources:
|
|
|
1158
1158
|
> :first-child {
|
|
1159
1159
|
min-width: 24px;
|
|
1160
1160
|
}
|
|
1161
|
-
`,
|
|
1161
|
+
`,PS=De.default.div`
|
|
1162
1162
|
height: var(--privy-height-modal-full);
|
|
1163
1163
|
|
|
1164
1164
|
@media (max-width: 440px) {
|
|
1165
1165
|
height: var(--privy-height-modal-compact);
|
|
1166
1166
|
}
|
|
1167
|
-
`,
|
|
1167
|
+
`,Cc=(0,De.default)(hs)`
|
|
1168
1168
|
display: flex;
|
|
1169
1169
|
flex: 1;
|
|
1170
1170
|
gap: 4px;
|
|
@@ -1176,7 +1176,7 @@ Resources:
|
|
|
1176
1176
|
border-color: var(--privy-color-foreground-3);
|
|
1177
1177
|
border-width: 1px;
|
|
1178
1178
|
}
|
|
1179
|
-
`,Qn=
|
|
1179
|
+
`,Qn=De.default.div`
|
|
1180
1180
|
position: absolute;
|
|
1181
1181
|
right: 0.5rem;
|
|
1182
1182
|
|
|
@@ -1184,7 +1184,7 @@ Resources:
|
|
|
1184
1184
|
flex-direction: row;
|
|
1185
1185
|
justify-content: space-around;
|
|
1186
1186
|
align-items: center;
|
|
1187
|
-
`,
|
|
1187
|
+
`,zm=(0,De.default)(Fm.default)`
|
|
1188
1188
|
height: 1.25rem;
|
|
1189
1189
|
width: 1.25rem;
|
|
1190
1190
|
stroke: var(--privy-color-accent);
|
|
@@ -1193,7 +1193,7 @@ Resources:
|
|
|
1193
1193
|
:active {
|
|
1194
1194
|
stroke: var(--privy-color-accent-light);
|
|
1195
1195
|
}
|
|
1196
|
-
`,Zn=(0,
|
|
1196
|
+
`,Zn=(0,De.default)(Hm.default)`
|
|
1197
1197
|
height: 1.25rem;
|
|
1198
1198
|
width: 1.25rem;
|
|
1199
1199
|
stroke: var(--privy-color-accent);
|
|
@@ -1202,7 +1202,7 @@ Resources:
|
|
|
1202
1202
|
:active {
|
|
1203
1203
|
stroke: var(--privy-color-accent-light);
|
|
1204
1204
|
}
|
|
1205
|
-
`,Xn=(0,
|
|
1205
|
+
`,Xn=(0,De.default)(Bm.default)`
|
|
1206
1206
|
height: 1.25rem;
|
|
1207
1207
|
width: 1.25rem;
|
|
1208
1208
|
stroke: var(--privy-color-accent);
|
|
@@ -1211,7 +1211,7 @@ Resources:
|
|
|
1211
1211
|
:active {
|
|
1212
1212
|
stroke: var(--privy-color-accent-light);
|
|
1213
1213
|
}
|
|
1214
|
-
|
|
1214
|
+
`,$m=De.default.progress`
|
|
1215
1215
|
height: 4px;
|
|
1216
1216
|
width: 100%;
|
|
1217
1217
|
margin: 8px 0;
|
|
@@ -1227,14 +1227,14 @@ Resources:
|
|
|
1227
1227
|
transition: all 0.1s ease-out;
|
|
1228
1228
|
background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
|
|
1229
1229
|
}
|
|
1230
|
-
`;var
|
|
1230
|
+
`;var Ue=require("react/jsx-runtime"),jm=({buttonHideAnimations:e,buttonLoading:t,password:o,onSubmit:r,onBack:n})=>{let[i,a]=(0,ei.useState)(!0),[l,s]=(0,ei.useState)(!1),[c,m]=(0,ei.useState)(""),y=o===c;return(0,ei.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)(k,{title:"Confirm Password",closeable:!1,backFn:n}),(0,Ue.jsx)(X,{}),(0,Ue.jsxs)(Ir,{children:[(0,Ue.jsxs)(Nr,{children:[(0,Ue.jsx)(qm.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Ue.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,Ue.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,Ue.jsxs)(Mr,{children:[(0,Ue.jsx)(Qr,{value:c,onChange:g=>m(g.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text"}),(0,Ue.jsx)(Qn,{style:{right:"0.75rem"},children:i?(0,Ue.jsx)(Zn,{onClick:()=>a(!1)}):(0,Ue.jsx)(Xn,{onClick:()=>a(!0)})})]}),(0,Ue.jsx)(Ws,{"aria-hidden":!l||y,error:!0,children:"Passwords do not match"})]}),(0,Ue.jsx)(Wr,{onClick:r,loading:t,disabled:!y,hideAnimations:e,children:"Continue"}),(0,Ue.jsx)(ee,{}),(0,Ue.jsx)($,{protectedByPrivy:!0})]})};var Qm=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Zm=require("react"),Xm=f(require("styled-components"));var Hi=f(require("styled-components")),Lr=require("react/jsx-runtime"),Km=({className:e,checked:t,color:o="var(--privy-color-accent)",...r})=>(0,Lr.jsx)("label",{children:(0,Lr.jsxs)(Uw,{className:e,children:[(0,Lr.jsx)(Jm,{checked:t,...r}),(0,Lr.jsx)(Fw,{color:o,checked:t,children:(0,Lr.jsx)(Ym,{viewBox:"0 0 24 24",children:(0,Lr.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})}),Uw=Hi.default.div`
|
|
1231
1231
|
display: inline-block;
|
|
1232
1232
|
vertical-align: middle;
|
|
1233
|
-
`,
|
|
1233
|
+
`,Ym=Hi.default.svg`
|
|
1234
1234
|
fill: none;
|
|
1235
1235
|
stroke: white;
|
|
1236
1236
|
stroke-width: 3px;
|
|
1237
|
-
`,
|
|
1237
|
+
`,Jm=Hi.default.input.attrs({type:"checkbox"})`
|
|
1238
1238
|
border: 0;
|
|
1239
1239
|
clip: rect(0 0 0 0);
|
|
1240
1240
|
clippath: inset(50%);
|
|
@@ -1245,7 +1245,7 @@ Resources:
|
|
|
1245
1245
|
position: absolute;
|
|
1246
1246
|
white-space: nowrap;
|
|
1247
1247
|
width: 1px;
|
|
1248
|
-
`,
|
|
1248
|
+
`,Fw=Hi.default.div`
|
|
1249
1249
|
display: inline-block;
|
|
1250
1250
|
width: 18px;
|
|
1251
1251
|
height: 18px;
|
|
@@ -1260,30 +1260,30 @@ Resources:
|
|
|
1260
1260
|
border-width: 1px;
|
|
1261
1261
|
}
|
|
1262
1262
|
|
|
1263
|
-
${
|
|
1263
|
+
${Jm}:focus + & {
|
|
1264
1264
|
box-shadow: 0 0 0 1px ${e=>e.color};
|
|
1265
1265
|
}
|
|
1266
1266
|
|
|
1267
|
-
${
|
|
1267
|
+
${Ym} {
|
|
1268
1268
|
visibility: ${e=>e.checked?"visible":"hidden"};
|
|
1269
1269
|
}
|
|
1270
|
-
`;var We=require("react/jsx-runtime"),
|
|
1270
|
+
`;var We=require("react/jsx-runtime"),ef=({buttonHideAnimations:e,buttonLoading:t,onSubmit:o,onBack:r,config:n})=>{let[i,a]=(0,Zm.useState)(!1);return(0,We.jsxs)(We.Fragment,{children:[(0,We.jsx)(k,{title:"Confirm Password",closeable:!1,backFn:r}),(0,We.jsx)(X,{}),(0,We.jsxs)(Ir,{children:[(0,We.jsxs)(Nr,{children:[(0,We.jsx)(Qm.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,We.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,We.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,We.jsx)(Fi,{children:(0,We.jsxs)(Bi,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[(0,We.jsx)(Km,{color:"var(--privy-color-error)",checked:i}),(0,We.jsx)(We.Fragment,{children:"I understand losing my password means losing my account."})]})})]}),(0,We.jsxs)(Bw,{children:[n.initiatedBy==="user"&&(0,We.jsx)(yo,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,We.jsx)(Wr,{onClick:o,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,We.jsx)(ee,{}),(0,We.jsx)($,{protectedByPrivy:!0})]})},Bw=Xm.default.div`
|
|
1271
1271
|
display: flex;
|
|
1272
1272
|
gap: 10px;
|
|
1273
|
-
`;var
|
|
1273
|
+
`;var df=f(require("@heroicons/react/24/outline/KeyIcon")),bc=f(require("@heroicons/react/24/solid/CheckCircleIcon")),lr=require("react"),Ec=f(require("styled-components"));var tf=f(require("fast-password-entropy")),of=f(require("secure-password-utilities")),rf=require("secure-password-utilities/wordlists"),Hw=95,Gw=8,Vw=3,zw=.3,$w=/[a-z]/,qw=/[A-Z]/,jw=/[0-9]/,Kw="a-zA-Z0-9",nf="!@#$%^&*()\\-_+.",af=`${Kw}${nf}`,Yw=new RegExp(`[${nf}]`),Jw=new RegExp(`[${af}]`),sf=new RegExp(`^[${af}]{6,}$`),lf=(e="")=>{let t=e.split("").filter(o=>!Jw.test(o)).map(o=>o.replace(" ","SPACE"));return[...new Set(t)]},Ms=()=>of.generatePassphrase(4,rf.DEFAULT_WORDLIST);function Qw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function Zw(e){if(e.length<Gw)return 0;let t=0;$w.test(e)&&(t+=1),qw.test(e)&&(t+=1),jw.test(e)&&(t+=1),Yw.test(e)&&(t+=1);let o=t/Vw;return Math.max(0,Math.min(1,o))}function Xw(e=""){let t=Zw(e),o=(0,tf.default)(e)/Hw;return(t*zw+o)/2}function cf(e=""){let t=Xw(e);return{value:t,label:Qw(t)}}var se=require("react/jsx-runtime"),pf=({buttonHideAnimations:e,buttonLoading:t,password:o="",config:r,onSubmit:n,onClose:i,onPasswordChange:a,onPasswordGenerate:l})=>{let[s,c]=(0,lr.useState)(!1),[m,y]=(0,lr.useState)(!1);(0,lr.useEffect)(()=>{o&&!m&&y(!0)},[o]);let g=(0,lr.useMemo)(()=>m?(o?.length||0)<6?"Password must be at least 6 characters":sf.test(o||"")?null:`Invalid characters used ( ${lf(o).join(" ")} )`:null,[o,m]),v=(0,lr.useMemo)(()=>g?{value:0,label:"Weak"}:cf(o),[o,g]),b=(0,lr.useMemo)(()=>!!(!o?.length||g),[g,o]);return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(k,{onClose:i,title:"Secure your account",closeable:r.initiatedBy==="user"}),(0,se.jsx)(X,{}),(0,se.jsxs)(Ir,{children:[(0,se.jsxs)(Nr,{children:[(0,se.jsx)(df.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,se.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),(0,se.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,se.jsxs)(Mr,{children:[(0,se.jsx)(Qr,{value:o,onChange:T=>a(T.target.value),placeholder:"enter or generate a strong password",type:s?"password":"text"}),(0,se.jsxs)(Qn,{style:{width:"3.5rem"},children:[s?(0,se.jsx)(Zn,{onClick:()=>c(!1)}):(0,se.jsx)(Xn,{onClick:()=>c(!0)}),(0,se.jsx)(zm,{onClick:l})]})]}),(0,se.jsx)($m,{value:v.value===0?.01:v.value,label:v.label}),(0,se.jsx)(Ws,{error:!!g,children:g||`Password Strength: ${m?v.label:"--"}`}),(0,se.jsxs)(t1,{children:[(0,se.jsx)(e1,{children:(0,se.jsxs)(Fi,{children:[(0,se.jsxs)(Bi,{children:[(0,se.jsx)(bc.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,se.jsxs)(Bi,{children:[(0,se.jsx)(bc.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"You will only be asked to enter it when signing on to a new device."]})]})}),(0,se.jsx)(Wr,{onClick:n,loading:t,disabled:b,hideAnimations:e,children:"Continue"})]})]}),(0,se.jsx)(ee,{}),(0,se.jsx)($,{protectedByPrivy:!0})]})},e1=(0,Ec.default)(Fi)`
|
|
1274
1274
|
flex: 1;
|
|
1275
1275
|
padding-top: 1rem;
|
|
1276
|
-
`,
|
|
1276
|
+
`,t1=Ec.default.div`
|
|
1277
1277
|
display: flex;
|
|
1278
1278
|
flex-direction: column;
|
|
1279
1279
|
height: 100%;
|
|
1280
|
-
`;var
|
|
1280
|
+
`;var uf=f(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),mf=f(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),ff=f(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),hf=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Gi=require("react");var we=require("react/jsx-runtime"),yf=({buttonHideAnimations:e,buttonLoading:t,appName:o,password:r,onSubmit:n,onBack:i})=>{let[a,l]=(0,Gi.useState)(!1),s=(0,Gi.useCallback)(()=>{l(!0),r&&navigator.clipboard.writeText(r)},[r]),c=(0,Gi.useCallback)(()=>{let m=document.createElement("a"),y=o.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),g=new Blob([o1(o,r)],{type:"text/plain"}),v=URL.createObjectURL(g);m.href=v,m.target="_blank",m.download=`${y}-privy-wallet-recovery.txt`,document.body.appendChild(m),m.click(),setTimeout(()=>{m.remove(),URL.revokeObjectURL(v)},5e3)},[r]);return(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(k,{backFn:i,title:"Save Password",closeable:!1}),(0,we.jsx)(X,{}),(0,we.jsxs)(Ir,{children:[(0,we.jsxs)(Nr,{children:[(0,we.jsx)(hf.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,we.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,we.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset if you lose your device. Make sure to secure it to keep your assets safe."})]}),(0,we.jsx)(Mr,{centered:!0,children:(0,we.jsx)(Vm,{children:r})}),(0,we.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,we.jsx)(Cc,{onClick:s,children:a?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(mf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(ff.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,we.jsxs)(Cc,{onClick:c,children:[(0,we.jsx)(uf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,we.jsx)(Wr,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,we.jsx)(ee,{}),(0,we.jsx)($,{protectedByPrivy:!0})]})},o1=(e,t)=>`Your wallet recovery password for ${e} is
|
|
1281
1281
|
|
|
1282
1282
|
${t}
|
|
1283
1283
|
|
|
1284
|
-
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var
|
|
1284
|
+
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var gf=f(require("@heroicons/react/24/solid/CheckCircleIcon")),vf=f(require("@heroicons/react/24/solid/XCircleIcon"));var ct=require("react/jsx-runtime"),wf=({error:e,onClose:t})=>(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsx)(k,{closeable:!1}),(0,ct.jsx)(X,{}),e?(0,ct.jsxs)(go,{children:[(0,ct.jsx)(vf.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,ct.jsx)(Oe,{title:"Something went wrong",description:e})]}):(0,ct.jsxs)(go,{children:[(0,ct.jsx)(gf.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,ct.jsx)(Oe,{title:"Success"})]}),(0,ct.jsx)(F,{onClick:t,children:"Close"}),(0,ct.jsx)(ee,{}),(0,ct.jsx)($,{protectedByPrivy:!0})]});var Cf=require("react"),r1=(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}},bf=()=>{let[e,t]=(0,Cf.useReducer)(r1,"creating");return{send:t,state:e}};var ti=require("react/jsx-runtime"),Ns=({onSubmit:e,...t})=>{let{send:o,state:r}=bf(),n=(0,Vi.useCallback)(async()=>{r==="finalizing"&&await e(),o("next")},[r,o,e]);(0,Vi.useEffect)(()=>{let a;return r==="done"&&t.config.initiatedBy==="automatic"&&(a=setTimeout(()=>t.onClose?.(),gt)),()=>{a&&clearTimeout(a)}},[r,t.config.initiatedBy,t.onClose]);let i=(0,Vi.useCallback)(()=>{o("back")},[o]);return r==="creating"?(0,ti.jsx)(pf,{...t,onSubmit:n}):r==="saving"?(0,ti.jsx)(yf,{...t,onSubmit:n,onBack:i}):r==="confirming"?(0,ti.jsx)(jm,{...t,onSubmit:n,onBack:i}):r==="finalizing"?(0,ti.jsx)(ef,{...t,onSubmit:n,onBack:i}):r==="done"?(0,ti.jsx)(wf,{...t,onSubmit:n}):null};var Dt=require("react/jsx-runtime"),Pf=()=>{let{app:e,navigate:t,data:o,onUserCloseViaDialogOrKeybindRef:r}=_(),[n,i]=(0,bo.useState)(""),[a,l]=(0,bo.useState)(!1),[s,c]=(0,bo.useState)(),[m,y]=(0,bo.useState)(null),[g,v]=(0,bo.useState)(null),b=(0,bo.useRef)(!1),{authenticated:T,getAccessToken:x}=G(),{refreshUser:E,closePrivyModal:A,createAnalyticsEvent:I,isNewUserThisSession:W,initializeWalletProxy:S}=M(),{onSuccess:O,onFailure:D,callAuthOnSuccessOnClose:B}=o.createWallet,V=e?.embeddedWallets.requireUserPasswordOnCreate===!0,Y=!!(!n||b.current)&&!V,U=new yt(async()=>R());(0,bo.useEffect)(()=>{m||S(3e4).then(pe=>y(pe))},[m]),(0,bo.useEffect)(()=>{if(!T){t("LANDING"),D(new Error("User must be authenticated before creating a Privy wallet"));return}!V&&!a&&!b.current&&(l(!0),U.execute().finally(()=>l(!1)))},[V,T]);let j=()=>{V&&g&&g?.recoveryMethod!=="user-passcode"?D(new Nt("User created a wallet but failed to set a password for it")):g?O(g):D(new Nt("User wallet creation failed")),A({shouldCallAuthOnSuccess:B})};r.current=()=>null;let R=async function(){let pe=await x();if(pe)try{I("embedded_wallet_creation_started");let Q=await S(bn);if(!Q)throw new Error("walletProxy does not exist.");let pt=1e4,Ie=new Promise((Jo,so)=>{setTimeout(()=>{so(new Error("walletProxy.create timed out."))},pt)});if(!await Promise.race([Q.create({accessToken:pe,recoveryPassword:s}),Ie]))throw new Error("walletProxy.create did not send a response.");let qe=await E();if(!qe)throw new Error("Failed to refresh user.");let ue=ke(qe);if(!ue)throw new Error("Updated user is missing embedded wallet.");v(ue),I("embedded_wallet_creation_completed",{walletAddress:ue.address}),i(""),b.current=!0,V?t("EMBEDDED_WALLET_CREATED_SCREEN"):W?t("EMBEDDED_WALLET_CREATED_SCREEN"):ue&&(O(ue),A({shouldCallAuthOnSuccess:B}))}catch(Q){if(b.current)return;I("embedded_wallet_creation_failed",{error:Q.toString()}),i("An error has occurred, please try again."),console.warn(Q)}else i("An error has occured, please login again."),I("embedded_wallet_creation_failed",{error:"Missing access token for user."})},le=async()=>{if(!V)return A({shouldCallAuthOnSuccess:B});l(!0);let pe=250;return U.execute().then(()=>new Promise(Q=>setTimeout(Q,pe))).finally(()=>l(!1))};return!V&&n?(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsx)(k,{closeable:!1}),(0,Dt.jsxs)(go,{children:[(0,Dt.jsx)(Ef.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Dt.jsx)(Oe,{title:"Something went wrong",description:n})]}),(0,Dt.jsx)(F,{onClick:j,children:"Close"}),(0,Dt.jsx)(n1,{})]}):Y?(0,Dt.jsx)(Kn,{}):(0,Dt.jsx)(Ns,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:Y||!m,buttonLoading:a,buttonHideAnimations:!g&&a,error:n,password:s||"",onClose:j,onPasswordChange:c,onPasswordGenerate:()=>c(Ms()),onSubmit:le})},n1=Tf.default.div`
|
|
1285
1285
|
height: 44px;
|
|
1286
|
-
`;var
|
|
1286
|
+
`;var Zr=require("react");var Sf=require("react/jsx-runtime"),xf=()=>{let[e,t]=(0,Zr.useState)(null),[o,r]=(0,Zr.useState)(!1),[n,i]=(0,Zr.useState)(null),[a,l]=(0,Zr.useState)(""),{authenticated:s,getAccessToken:c,user:m}=G(),{walletProxy:y,refreshUser:g,closePrivyModal:v,createAnalyticsEvent:b}=M(),{app:T,navigate:x,data:E,onUserCloseViaDialogOrKeybindRef:A}=_(),{onSuccess:I,onFailure:W}=E.createWallet,S=ke(m),O=e?.recoveryMethod==="user-passcode";(0,Zr.useEffect)(()=>{s||(x("LANDING"),W(new ga("User must be authenticated before setting a password on a Privy wallet")))},[s]);let D=()=>{if(n){W(n),v({shouldCallAuthOnSuccess:!1});return}if(!O){W(new Nt("Exited before password was added to wallet")),v({shouldCallAuthOnSuccess:!1});return}I(e),v({shouldCallAuthOnSuccess:!1})};A.current=D;let B=async()=>{let Y=await c();if(Y&&S?.address&&a&&y)try{if(b("embedded_wallet_set_password_started",{walletAddress:S.address}),!(await y.setRecoveryPassword({accessToken:Y,address:S.address,recoveryPassword:a})).address){i(new Nt("Error setting password on privy wallet")),b("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"error setting password"});return}let j=await g(),R=ke(j);if(!R){i(new Nt("Error setting password on privy wallet")),b("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"wallet disconnected"});return}t(R),b("embedded_wallet_set_password_completed",{walletAddress:S.address})}catch(U){console.warn(U),i(U instanceof Error?U:new Error("Error setting password on privy wallet")),b("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:U})}},V=async()=>{O?(I(e),v({shouldCallAuthOnSuccess:!1})):(r(!0),i(null),await B(),r(!1))};return(0,Sf.jsx)(Ns,{appName:T?.name||"privy",config:{initiatedBy:"user",onCancel:D},error:n?"An error has occurred, please try again.":void 0,buttonLoading:o,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(Ms()),onPasswordChange:l,onSubmit:V,onClose:D})};var _f=f(require("@heroicons/react/24/outline/UserCircleIcon")),Af=f(require("@heroicons/react/24/solid/LockClosedIcon"));var et=require("react/jsx-runtime"),kf=()=>{let{user:e}=G(),{closePrivyModal:t,createAnalyticsEvent:o}=M(),{data:r,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=_(),{onSuccess:l,onFailure:s}=r.setWalletPassword,c=()=>{s(new Nt("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(k,{onClose:c}),(0,et.jsx)(X,{}),(0,et.jsxs)(go,{children:[(0,et.jsxs)(Vu,{children:[(0,et.jsx)(_f.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,et.jsx)(zu,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,et.jsx)(Af.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,et.jsxs)(Oe,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,et.jsx)("p",{children:"Losing this password will make your account inaccessible on new devices. You will only be asked for it when you log on to a new device."})]})]}),(0,et.jsx)(F,{onClick:()=>{let y=ke(e);o("embedded_wallet_set_password_started",{walletAddress:y?.address}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,et.jsx)(ee,{}),(0,et.jsx)($,{protectedByPrivy:!0})]})};var Rf=f(require("@heroicons/react/24/outline/ShieldCheckIcon")),Xr=require("react"),en=f(require("styled-components"));var Ee=require("react/jsx-runtime"),If=()=>{let[e,t]=(0,Xr.useState)(!0),{authenticated:o,getAccessToken:r}=G(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),[m,y]=(0,Xr.useState)(void 0),[g,v]=(0,Xr.useState)(""),[b,T]=(0,Xr.useState)(!1),{privyWallet:x,onCompleteNavigateTo:E,onSuccess:A,onFailure:I}=s.recoverWallet,W=(D="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),I(typeof D=="string"?new Nt(D):D)};c.current=W,(0,Xr.useEffect)(()=>{if(!o||!x)return W("User must be authenticated and have a Privy wallet before it can be recovered")},[o]);let S=D=>{D&&y(D)};return(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(k,{onClose:W}),(0,Ee.jsx)(X,{}),(0,Ee.jsxs)(a1,{children:[(0,Ee.jsxs)(i1,{children:[(0,Ee.jsx)(Rf.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ee.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),(0,Ee.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,Ee.jsxs)("div",{children:[(0,Ee.jsxs)(Mr,{children:[(0,Ee.jsx)(Qr,{type:e?"password":"text",onChange:D=>S(D.target.value),disabled:b}),(0,Ee.jsx)(Qn,{style:{right:"0.75rem"},children:e?(0,Ee.jsx)(Zn,{onClick:()=>t(!1)}):(0,Ee.jsx)(Xn,{onClick:()=>t(!0)})})]}),!!g&&(0,Ee.jsx)(s1,{children:g})]}),(0,Ee.jsxs)("div",{children:[(0,Ee.jsxs)(Gu,{children:[(0,Ee.jsx)("h4",{children:"Why is this necessary?"}),(0,Ee.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Ee.jsx)(l1,{loading:b||!n,disabled:!m,onClick:async()=>{T(!0);let D=await r();if(D&&x&&m!==null)try{a("embedded_wallet_recovery_started",{walletAddress:x.address}),await n?.recover({address:x.address,accessToken:D,recoveryPin:m}),v(""),E?l(E):i({shouldCallAuthOnSuccess:!1}),A?.(x),a("embedded_wallet_recovery_completed",{walletAddress:x.address})}catch(B){Sm(B)?v("Invalid recovery password, please try again."):v("An error has occurred, please try again.")}finally{T(!1)}else return W("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!x&&b,children:"Recover your account"})]})]}),(0,Ee.jsx)(ee,{}),(0,Ee.jsx)($,{protectedByPrivy:!0})]})},i1=en.default.div`
|
|
1287
1287
|
display: flex;
|
|
1288
1288
|
flex-direction: column;
|
|
1289
1289
|
align-items: center;
|
|
@@ -1305,26 +1305,26 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1305
1305
|
font-weight: 400;
|
|
1306
1306
|
line-height: 20px;
|
|
1307
1307
|
}
|
|
1308
|
-
`,
|
|
1308
|
+
`,a1=en.default.div`
|
|
1309
1309
|
display: flex;
|
|
1310
1310
|
flex-direction: column;
|
|
1311
1311
|
justify-content: space-between;
|
|
1312
|
-
`,
|
|
1312
|
+
`,s1=en.default.div`
|
|
1313
1313
|
line-height: 20px;
|
|
1314
1314
|
height: 20px;
|
|
1315
1315
|
font-size: 13px;
|
|
1316
1316
|
color: var(--privy-color-error);
|
|
1317
1317
|
text-align: left;
|
|
1318
1318
|
margin-top: 0.5rem;
|
|
1319
|
-
`,
|
|
1320
|
-
${e=>e.hideAnimations&&
|
|
1319
|
+
`,l1=(0,en.default)(F)`
|
|
1320
|
+
${e=>e.hideAnimations&&en.css`
|
|
1321
1321
|
&& {
|
|
1322
1322
|
// Remove animations because the recoverWallet task on the iframe partially
|
|
1323
1323
|
// blocks the renderer, so the animation stutters and doesn't look good
|
|
1324
1324
|
transition: none;
|
|
1325
1325
|
}
|
|
1326
1326
|
`}
|
|
1327
|
-
`;var
|
|
1327
|
+
`;var Wf=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Mf=f(require("@heroicons/react/24/outline/PhoneIcon")),Ls=f(require("styled-components"));var ze=require("react/jsx-runtime"),c1=e=>{let t=(0,ze.jsx)(Wf.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof C)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 Ve&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,ze.jsx)(Mf.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof nt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,ze.jsx)(Ss,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,ze.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,ze.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof Ro&&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}}},Nf=()=>{let{navigate:e,navigateBack:t,data:o,lastScreen:r,currentScreen:n}=_(),{reset:i}=_e(),a=o?.errorModalData,l=c1(a?.error||new Error),s=c=>{if(c instanceof nt)switch(c.privyErrorCode){case"invalid_captcha":return()=>i()}return()=>{}};return(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(k,{backFn:!r||n===r?void 0:t}),(0,ze.jsxs)(d1,{children:[(0,ze.jsx)(u1,{children:(0,ze.jsxs)("div",{children:[(0,ze.jsx)(xs,{color:"var(--privy-color-error)"}),l.icon]})}),(0,ze.jsxs)(p1,{children:[(0,ze.jsx)("h3",{children:l.title}),(0,ze.jsx)("p",{children:l.detail})]}),(0,ze.jsx)(F,{color:"var(--privy-color-error)",onClick:()=>{s(a?.error||new Error)(),e(r||"LANDING",!1)},children:l.ctaText})]})]})},d1=Ls.default.div`
|
|
1328
1328
|
display: flex;
|
|
1329
1329
|
flex-direction: column;
|
|
1330
1330
|
align-items: center;
|
|
@@ -1332,11 +1332,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1332
1332
|
gap: 24px;
|
|
1333
1333
|
width: 100%;
|
|
1334
1334
|
padding-bottom: 16px;
|
|
1335
|
-
`,
|
|
1335
|
+
`,p1=Ls.default.div`
|
|
1336
1336
|
display: flex;
|
|
1337
1337
|
flex-direction: column;
|
|
1338
1338
|
gap: 8px;
|
|
1339
|
-
`,
|
|
1339
|
+
`,u1=Ls.default.div`
|
|
1340
1340
|
display: flex;
|
|
1341
1341
|
flex-direction: column;
|
|
1342
1342
|
justify-content: center;
|
|
@@ -1359,7 +1359,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1359
1359
|
left: -19px;
|
|
1360
1360
|
top: -19px;
|
|
1361
1361
|
}
|
|
1362
|
-
`;var
|
|
1362
|
+
`;var cr=require("react"),Sc=require("react-device-detect"),_c=f(require("styled-components"));var Of=require("react"),Df=f(require("styled-components"));var Tc=require("react/jsx-runtime"),Os=({style:e,color:t,...o})=>(0,Tc.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...o,children:(0,Tc.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var Ds=require("react/jsx-runtime"),Lf=({color:e,...t})=>(0,Ds.jsx)("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:(0,Ds.jsx)("g",{children:(0,Ds.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});var zi=require("react/jsx-runtime"),oi=e=>{let[t,o]=(0,Of.useState)(!1);return(0,zi.jsxs)(m1,{color:e.color,onClick:()=>{o(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>o(!1),1500)},justCopied:t,children:[t?(0,zi.jsx)(Os,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,zi.jsx)(Lf,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},m1=Df.default.button`
|
|
1363
1363
|
display: flex;
|
|
1364
1364
|
align-items: center;
|
|
1365
1365
|
gap: 6px;
|
|
@@ -1397,7 +1397,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1397
1397
|
width: 14px;
|
|
1398
1398
|
height: 14px;
|
|
1399
1399
|
}
|
|
1400
|
-
`;var
|
|
1400
|
+
`;var Uf=require("react"),Ff=f(require("styled-components")),Hf=require("react/jsx-runtime"),Bf=e=>{let[t,o]=(0,Uf.useState)(!1);return(0,Hf.jsx)(f1,{color:e.color,onClick:()=>{o(!0),window.open(e.url,"_blank"),setTimeout(()=>o(!1),1500)},justOpened:t,children:e.text})},f1=Ff.default.button`
|
|
1401
1401
|
display: flex;
|
|
1402
1402
|
align-items: center;
|
|
1403
1403
|
gap: 6px;
|
|
@@ -1435,7 +1435,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1435
1435
|
width: 14px;
|
|
1436
1436
|
height: 14px;
|
|
1437
1437
|
}
|
|
1438
|
-
`;var
|
|
1438
|
+
`;var zf=f(require("qrcode")),$f=f(require("react")),qf=f(require("styled-components"));var Pc=require("react/jsx-runtime"),Gf=()=>(0,Pc.jsx)("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:(0,Pc.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var xe=require("react/jsx-runtime"),Ut=7,xc=(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},h1=e=>{let t=zf.default.create(e,{errorCorrectionLevel:"high"}).modules,o=gp(Array.from(t.data),t.size);return o=xc(o,0,0,Ut,Ut),o=xc(o,o.length-Ut,0,Ut,Ut),o=xc(o,0,o.length-Ut,Ut,Ut),o},y1=({x:e,y:t,cellSize:o,bgColor:r,fgColor:n})=>(0,xe.jsx)(xe.Fragment,{children:[0,1,2].map(i=>(0,xe.jsx)("circle",{r:o*(Ut-i*2)/2,cx:e+o*Ut/2,cy:t+o*Ut/2,fill:i%2!==0?r:n},`finder-${e}-${t}-${i}`))}),g1=({cellSize:e,matrixSize:t,bgColor:o,fgColor:r})=>{let n=[[0,0],[(t-Ut)*e,0],[0,(t-Ut)*e]];return(0,xe.jsx)(xe.Fragment,{children:n.map(([i,a])=>(0,xe.jsx)(y1,{x:i,y:a,cellSize:e,bgColor:o,fgColor:r},`finder-${i}-${a}`))})},v1=({matrix:e,cellSize:t,color:o})=>(0,xe.jsx)(xe.Fragment,{children:e.map((r,n)=>r.map((i,a)=>i?(0,xe.jsx)("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:o},`circle-${n}-${a}`):(0,xe.jsx)($f.default.Fragment,{},`circle-${n}-${a}`)))}),Vf=(e,t)=>e-e%t,w1=({outputSize:e,cellSize:t,element:o,size:r,padding:n,bgColor:i})=>{if(!o)return(0,xe.jsx)(xe.Fragment,{});let a=r||40,l=n||4,s=o,c=e/2-a/2-l;return(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)("rect",{x:Vf(c,t),y:Vf(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),(0,xe.jsx)(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},C1=e=>{let t=e.outputSize,o=h1(e.url),r=t/o.length;return(0,xe.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,xe.jsx)(v1,{matrix:o,cellSize:r,color:e.fgColor}),(0,xe.jsx)(g1,{cellSize:r,matrixSize:o.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,xe.jsx)(w1,{outputSize:e.outputSize,cellSize:r,element:e.logo?.element,bgColor:e.bgColor})]})},b1=qf.default.div`
|
|
1439
1439
|
display: flex;
|
|
1440
1440
|
justify-content: center;
|
|
1441
1441
|
align-items: center;
|
|
@@ -1450,7 +1450,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1450
1450
|
border-color: ${e=>e.fgColor};
|
|
1451
1451
|
border-radius: var(--privy-border-radius-md);
|
|
1452
1452
|
}
|
|
1453
|
-
`,
|
|
1453
|
+
`,Us=e=>{let t=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",r=e.size||160;return(0,xe.jsx)(b1,{size:r,bgColor:t,fgColor:o,children:(0,xe.jsx)(C1,{url:e.url,logo:{element:e.squareLogoElement??Gf},outputSize:r,bgColor:t,fgColor:o})})};var tn=require("react/jsx-runtime"),$i=({style:e,...t})=>(0,tn.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,tn.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,tn.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,tn.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,tn.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var ie=require("react/jsx-runtime"),jf="#8a63d2",Yf=1e3,E1=Yf*2,T1=Yf*120,Jf=()=>{let{ready:e,authenticated:t,user:o}=G(),{lastScreen:r,navigate:n,navigateBack:i,setModalData:a,app:l}=_(),{getAuthFlow:s,loginWithFarcaster:c,closePrivyModal:m}=M(),[y,g]=(0,cr.useState)(void 0),[v,b]=(0,cr.useState)(!1),[T,x]=(0,cr.useState)(!1),E=(0,cr.useRef)([]),A=l?.render.inDialog?gt:0,I=s(),W=I?.meta.connectUri;return(0,cr.useEffect)(()=>{let S=Date.now(),O=setInterval(async()=>{let D=await I.pollForReady.execute(),B=Date.now()-S;if(D){clearInterval(O),b(!0);try{await c(),x(!0)}catch(V){let Y={retryable:!1,message:"Authentication failed"};if(V?.privyErrorCode==="allowlist_rejected"){n("ALLOWLIST_REJECTION_SCREEN");return}else V?.privyErrorCode==="linked_to_another_user"?Y.detail="This account has already been linked to another user.":V?.privyErrorCode==="invalid_credentials"?(Y.retryable=!0,Y.detail="Something went wrong. Try again."):V?.privyErrorCode==="too_many_requests"&&(Y.detail="Too many requests. Please wait before trying again.");g(Y)}}else B>T1&&(clearInterval(O),g({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},E1);return()=>{clearInterval(O),E.current.forEach(D=>clearTimeout(D))}},[]),(0,cr.useEffect)(()=>{if(e&&t&&T&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let O=setTimeout(()=>{n("AFFIRMATIVE_CONSENT_SCREEN")},A);return()=>clearTimeout(O)}T&&(jt(o,l?.embeddedWallets.createOnLogin)?E.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:O=>console.error(O),callAuthOnSuccessOnClose:!0}}),n("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},A)):E.current.push(setTimeout(m,A)))}},[T,e,t,o]),Sc.isMobile||v?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(k,{backFn:r?i:void 0,onClose:m},"header"),(0,ie.jsx)(X,{}),(0,ie.jsxs)(Kf,{children:[(0,ie.jsx)(P1,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(_r,{success:T,fail:!!y}),(0,ie.jsx)($i,{style:{width:"38px",height:"38px"}})]})}),(0,ie.jsxs)(ro,{children:[(0,ie.jsx)(Le,{children:y?y.message:"Signing in with Farcaster"}),(0,ie.jsx)(Re,{children:y?y.detail:"This should only take a moment"}),(0,ie.jsx)(oo,{children:W&&Sc.isMobile&&(0,ie.jsx)(Bf,{text:"Take me to Warpcast",url:W,color:jf})})]})]}),(0,ie.jsx)(re,{})]}):(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(k,{backFn:r?i:void 0,onClose:m},"header"),(0,ie.jsx)(X,{}),(0,ie.jsx)(Kf,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(Le,{children:"Sign in with Farcaster"}),(0,ie.jsx)(Re,{children:"Scan with your phone's camera to continue."}),(0,ie.jsx)(As,{children:W?(0,ie.jsx)(Us,{url:W,size:275,squareLogoElement:$i}):(0,ie.jsx)(Zt,{})}),(0,ie.jsxs)(oo,{children:[(0,ie.jsx)(Re,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),W&&(0,ie.jsx)(oi,{text:W,itemName:"link",color:jf})]})]})}),(0,ie.jsx)(re,{})]})},Kf=_c.default.div`
|
|
1454
1454
|
display: flex;
|
|
1455
1455
|
flex-direction: column;
|
|
1456
1456
|
align-items: center;
|
|
@@ -1458,7 +1458,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1458
1458
|
margin-left: 27px;
|
|
1459
1459
|
margin-right: 27px;
|
|
1460
1460
|
gap: 24px;
|
|
1461
|
-
`,
|
|
1461
|
+
`,P1=_c.default.div`
|
|
1462
1462
|
display: flex;
|
|
1463
1463
|
flex-direction: column;
|
|
1464
1464
|
justify-content: center;
|
|
@@ -1481,7 +1481,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1481
1481
|
left: -19px;
|
|
1482
1482
|
top: -19px;
|
|
1483
1483
|
}
|
|
1484
|
-
`;var
|
|
1484
|
+
`;var Qf=f(require("@heroicons/react/24/outline/ClockIcon")),Zf=f(require("@heroicons/react/24/outline/EyeSlashIcon")),Xf=f(require("@heroicons/react/24/outline/LinkIcon")),Eo=f(require("styled-components"));var ri=require("react/jsx-runtime"),Fs=({size:e=61,...t})=>(0,ri.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,ri.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,ri.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,ri.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var Ce=require("react/jsx-runtime"),Ac=({title:e,desc:t,icon:o})=>(0,Ce.jsxs)(R1,{children:[(0,Ce.jsx)(W1,{children:o}),(0,Ce.jsxs)(I1,{children:[(0,Ce.jsx)(A1,{children:e}),(0,Ce.jsx)(k1,{children:t})]})]}),eh=({app:e,signedUrl:t,onContinue:o})=>(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)(S1,{children:[(0,Ce.jsx)(Fs,{size:"3.75rem"}),(0,Ce.jsxs)(_1,{children:[e?.name," uses ",(0,Ce.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,Ce.jsxs)(M1,{children:[(0,Ce.jsx)(Ac,{icon:(0,Ce.jsx)(Xf.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,Ce.jsxs)(Ce.Fragment,{children:["Connect a payment method (",(0,Ce.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,Ce.jsx)(Ac,{icon:(0,Ce.jsx)(Qf.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,Ce.jsx)(Ac,{icon:(0,Ce.jsx)(Zf.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,Ce.jsx)(N1,{className:"mobile-only"})]}),(0,Ce.jsx)(x1,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,Ce.jsx)(ys,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:o,children:"Continue to Moonpay"})]}),x1=Eo.default.span`
|
|
1485
1485
|
display: inline-block;
|
|
1486
1486
|
color: var(--privy-color-foreground-3);
|
|
1487
1487
|
text-align: center;
|
|
@@ -1490,13 +1490,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1490
1490
|
font-weight: 400;
|
|
1491
1491
|
line-height: 140%; /* 0.875rem */
|
|
1492
1492
|
margin-bottom: 0.25rem;
|
|
1493
|
-
`,
|
|
1493
|
+
`,S1=Eo.default.div`
|
|
1494
1494
|
display: flex;
|
|
1495
1495
|
flex-direction: column;
|
|
1496
1496
|
align-items: center;
|
|
1497
1497
|
justify-content: center;
|
|
1498
1498
|
padding: 1.5rem 0;
|
|
1499
|
-
`,
|
|
1499
|
+
`,_1=Eo.default.span`
|
|
1500
1500
|
color: var(--privy-color-foreground);
|
|
1501
1501
|
text-align: center;
|
|
1502
1502
|
font-size: 1.125rem;
|
|
@@ -1505,46 +1505,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1505
1505
|
margin: 1.5rem 0;
|
|
1506
1506
|
text-align: center;
|
|
1507
1507
|
max-width: 19.5rem;
|
|
1508
|
-
`,
|
|
1508
|
+
`,A1=Eo.default.span`
|
|
1509
1509
|
color: var(--privy-color-foreground);
|
|
1510
1510
|
font-size: 0.875rem;
|
|
1511
1511
|
font-weight: 500;
|
|
1512
1512
|
line-height: 1.225rem;
|
|
1513
1513
|
width: 100%;
|
|
1514
|
-
`,
|
|
1514
|
+
`,k1=Eo.default.span`
|
|
1515
1515
|
color: var(--privy-color-foreground-2);
|
|
1516
1516
|
font-size: 0.875rem;
|
|
1517
1517
|
font-weight: 400;
|
|
1518
1518
|
line-height: 1.225rem;
|
|
1519
|
-
`,
|
|
1519
|
+
`,R1=Eo.default.div`
|
|
1520
1520
|
display: flex;
|
|
1521
1521
|
align-items: flex-start;
|
|
1522
1522
|
gap: 0.5rem;
|
|
1523
1523
|
align-self: stretch;
|
|
1524
|
-
`,
|
|
1524
|
+
`,I1=Eo.default.div`
|
|
1525
1525
|
display: flex;
|
|
1526
1526
|
flex-direction: column;
|
|
1527
1527
|
gap: 0.25rem;
|
|
1528
1528
|
align-items: flex-start;
|
|
1529
1529
|
text-align: left;
|
|
1530
1530
|
flex: 1 0 0;
|
|
1531
|
-
`,
|
|
1531
|
+
`,W1=Eo.default.div`
|
|
1532
1532
|
padding-top: 2px;
|
|
1533
|
-
`,
|
|
1533
|
+
`,M1=Eo.default.div`
|
|
1534
1534
|
display: flex;
|
|
1535
1535
|
flex-direction: column;
|
|
1536
1536
|
gap: 1.25rem;
|
|
1537
1537
|
margin: 0 0.5rem;
|
|
1538
|
-
`,
|
|
1538
|
+
`,N1=Eo.default.div`
|
|
1539
1539
|
margin: 30px 0;
|
|
1540
|
-
`;var
|
|
1540
|
+
`;var oh=require("ofetch"),ni=require("react");var Bs="moonpay",th="sdk_fiat_on_ramp_completed_with_status";async function rh(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 L1(e,t){let o=t?ap:ip,r=t?lp:sp;return(0,oh.ofetch)(`${o}/transactions/ext/${e}`,{query:{apiKey:r}})}function nh(e,t=!1){let[o,r]=(0,ni.useState)(null),{createAnalyticsEvent:n}=M(),i=(0,ni.useRef)(0);return(0,ni.useEffect)(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await L1(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;r(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n(th,{status:s,provider:Bs,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(th,{status:"serviceFailure",provider:Bs}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),o}var Or=require("react/jsx-runtime"),ih=()=>{let{app:e,data:t,navigate:o}=_(),{createAnalyticsEvent:r}=M(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsx)(k,{title:"Fund account"},"header"),(0,Or.jsx)(eh,{app:e,signedUrl:n,onContinue:()=>{r("sdk_fiat_on_ramp_started",{provider:Bs}),o("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,Or.jsx)($,{protectedByPrivy:!0})]})};var ah=f(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),sh=f(require("@heroicons/react/24/solid/CheckCircleIcon")),lh=f(require("@heroicons/react/24/solid/XCircleIcon")),ch=require("react"),kc=f(require("styled-components"));var fe=require("react/jsx-runtime"),dh=()=>{let{app:e,data:t}=_(),{closePrivyModal:o}=M(),{externalTransactionId:r}=t?.fiatOnRampStatus,n=nh(r||null,e.fiatOnRamp.useSandbox);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(k,{title:"Fund account"},"header"),(0,fe.jsx)(D1,{status:n,onClickCta:o}),(0,fe.jsx)($,{protectedByPrivy:!0})]})},O1=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"failed":return{title:"Something went wrong!",body:(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,fe.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,fe.jsx)("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},D1=({status:e,onClickCta:t})=>{let{title:o,body:r,cta:n}=(0,ch.useMemo)(()=>O1(e),[e]);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsxs)(G1,{children:[(0,fe.jsx)(B1,{status:e}),(0,fe.jsxs)(ro,{children:[(0,fe.jsx)("h3",{children:o}),(0,fe.jsx)(H1,{children:r})]})]}),n&&(0,fe.jsx)(F,{onClick:t,children:n})]})},U1=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)",F1=e=>{switch(e){case"serviceFailure":case"failed":return lh.default;case"completed":return sh.default;case"waitingAuthorization":return()=>(0,fe.jsx)(ah.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},B1=({status:e})=>{if(!e||e==="pending"){let r="var(--privy-color-foreground-4)";return(0,fe.jsxs)("div",{style:{position:"relative"},children:[(0,fe.jsx)(Zt,{color:r,style:{position:"absolute"}}),(0,fe.jsx)(tc,{color:r}),(0,fe.jsx)(Fs,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=F1(e),o=U1(e);return(0,fe.jsx)("div",{style:{borderColor:o,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,fe.jsx)(t,{width:"4rem",height:"4rem",color:o})})},H1=kc.default.p`
|
|
1541
1541
|
font-size: 1rem;
|
|
1542
1542
|
color: var(--privy-color-foreground-3);
|
|
1543
1543
|
margin-bottom: 1rem;
|
|
1544
1544
|
display: flex;
|
|
1545
1545
|
flex-direction: column;
|
|
1546
1546
|
gap: 1rem;
|
|
1547
|
-
`,
|
|
1547
|
+
`,G1=kc.default.div`
|
|
1548
1548
|
display: flex;
|
|
1549
1549
|
flex-direction: column;
|
|
1550
1550
|
align-items: center;
|
|
@@ -1552,7 +1552,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1552
1552
|
margin-left: 1.75rem;
|
|
1553
1553
|
margin-right: 1.75rem;
|
|
1554
1554
|
padding: 2rem 0;
|
|
1555
|
-
`;var
|
|
1555
|
+
`;var ph=f(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),uh=f(require("styled-components"));var Ft=require("react/jsx-runtime"),mh=()=>{let{closePrivyModal:e}=M();return(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsx)(k,{},"header"),(0,Ft.jsx)(V1,{children:(0,Ft.jsx)(ph.default,{style:{width:32,height:32}})}),(0,Ft.jsx)(Oo,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Ft.jsx)(to,{children:(0,Ft.jsx)(F,{onClick:()=>e(),children:"Close"})}),(0,Ft.jsx)(ee,{}),(0,Ft.jsx)($,{protectedByPrivy:!0})]})},V1=uh.default.div`
|
|
1556
1556
|
border-radius: 50%;
|
|
1557
1557
|
height: 68px;
|
|
1558
1558
|
width: 68px;
|
|
@@ -1562,18 +1562,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1562
1562
|
background-color: var(--privy-color-accent);
|
|
1563
1563
|
color: white;
|
|
1564
1564
|
margin: 0 auto 24px auto;
|
|
1565
|
-
`;var
|
|
1565
|
+
`;var yh=f(require("react-device-detect")),gh=f(require("styled-components"));var Hs=f(require("styled-components"));var Rc=require("react/jsx-runtime"),fh=({style:e,...t})=>(0,Rc.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,Rc.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var Vs=require("react/jsx-runtime"),hh=Hs.default.div`
|
|
1566
1566
|
display: flex;
|
|
1567
1567
|
flex-direction: column;
|
|
1568
1568
|
justify-content: flex-start;
|
|
1569
1569
|
gap: 4px;
|
|
1570
|
-
`,
|
|
1570
|
+
`,Ic=Hs.default.div`
|
|
1571
1571
|
&&& {
|
|
1572
1572
|
margin-left: 7px; /* TODO: This is a total hack */
|
|
1573
1573
|
border-left: 2px solid var(--privy-color-foreground-4);
|
|
1574
1574
|
height: 12px;
|
|
1575
1575
|
}
|
|
1576
|
-
`,
|
|
1576
|
+
`,Gs=({children:e})=>(0,Vs.jsxs)(z1,{children:[(0,Vs.jsx)(fh,{style:{width:"16px",height:"16px"}}),e]}),z1=Hs.default.div`
|
|
1577
1577
|
display: flex;
|
|
1578
1578
|
justify-content: flex-start;
|
|
1579
1579
|
justify-items: center;
|
|
@@ -1591,15 +1591,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1591
1591
|
margin-bottom: auto;
|
|
1592
1592
|
}
|
|
1593
1593
|
}
|
|
1594
|
-
`;var Te=require("react/jsx-runtime")
|
|
1594
|
+
`;var Te=require("react/jsx-runtime"),$1=()=>{let{navigate:e}=_(),t="https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en";return yh.isFirefox&&(t="https://addons.mozilla.org/en-US/firefox/addon/phantom-app/"),(0,Te.jsxs)(q1,{children:[(0,Te.jsx)(Oi,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,Te.jsx)(oo,{children:(0,Te.jsx)(Wo,{style:{width:"152px",height:"152px"}})}),(0,Te.jsxs)(hh,{children:[(0,Te.jsx)(Gs,{children:(0,Te.jsxs)("div",{children:[(0,Te.jsx)("span",{children:"Install the "}),(0,Te.jsx)("a",{href:t,target:"_blank",children:"Phantom browser extension"})]})}),(0,Te.jsx)(Ic,{}),(0,Te.jsx)(Gs,{children:"Set up your first wallet"}),(0,Te.jsx)(Ic,{}),(0,Te.jsx)(Gs,{children:"Store your recovery phrase in a safe place!"})]}),(0,Te.jsx)(gs,{onClick:()=>e("LANDING"),children:"Done! I have my wallet"})]})},vh=()=>{let{navigateBack:e}=_();return(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(k,{backFn:e},"header"),(0,Te.jsx)(X,{}),(0,Te.jsx)($1,{}),(0,Te.jsx)(ee,{}),(0,Te.jsxs)(re,{children:[(0,Te.jsx)("span",{children:"Still not sure? "}),(0,Te.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},q1=(0,gh.default)(oo)`
|
|
1595
1595
|
gap: 30px;
|
|
1596
1596
|
|
|
1597
1597
|
> :first-child > svg {
|
|
1598
1598
|
margin-top: 20px;
|
|
1599
1599
|
}
|
|
1600
|
-
`;var
|
|
1600
|
+
`;var Ih=f(require("@heroicons/react/24/outline/UserCircleIcon")),Zi=require("react"),Wh=require("react-device-detect"),Mh=f(require("styled-components"));var Ch=f(require("@heroicons/react/24/outline/EnvelopeIcon")),bh=require("react");var wh=f(require("@heroicons/react/24/outline/EnvelopeIcon")),qi=require("react"),Wc=f(require("styled-components"));var To=require("react/jsx-runtime"),zs=(0,qi.forwardRef)((e,t)=>{let[o,r]=(0,qi.useState)(""),[n,i]=(0,qi.useState)(!1),{authenticated:a}=G(),{initLoginWithEmail:l}=M(),{navigate:s,setModalData:c,currentScreen:m}=_(),{enabled:y,token:g}=_e(),v=Ra(o),b=n,T=n||!v,x=A=>{i(!0),l(o,A).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(I=>{c({errorModalData:{error:I,previousScreen:m||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},E=()=>{y&&!g&&!a?(c({captchaModalData:{callback:A=>l(o,A),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):x(g)};return(0,To.jsxs)(To.Fragment,{children:[(0,To.jsx)(j1,{children:(0,To.jsxs)(K1,{children:[(0,To.jsx)(wh.default,{}),(0,To.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:A=>r(A.target.value),onKeyUp:A=>{A.key==="Enter"&&E()},value:o,autoComplete:"email"}),e.stacked?null:(0,To.jsx)(Dn,{isSubmitting:b,onClick:E,disabled:T,children:"Submit"})]})}),e.stacked?(0,To.jsx)(F,{loadingText:null,loading:b,disabled:T,onClick:E,children:"Submit"}):null]})}),j1=Wc.default.div`
|
|
1601
1601
|
width: 100%;
|
|
1602
|
-
`,
|
|
1602
|
+
`,K1=Wc.default.label`
|
|
1603
1603
|
display: block;
|
|
1604
1604
|
position: relative;
|
|
1605
1605
|
width: 100%;
|
|
@@ -1657,9 +1657,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1657
1657
|
&& > input::placeholder {
|
|
1658
1658
|
color: var(--privy-color-foreground-3);
|
|
1659
1659
|
}
|
|
1660
|
-
`;var
|
|
1660
|
+
`;var Bo=require("react/jsx-runtime"),$s=({isEditable:e,setIsEditable:t})=>{let o=(0,bh.useRef)(null);return(0,Bo.jsxs)(Bo.Fragment,{children:[(0,Bo.jsx)(rr,{if:!e,children:(0,Bo.jsx)(zs,{ref:o})}),(0,Bo.jsx)(rr,{if:e,children:(0,Bo.jsxs)(Ne,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[(0,Bo.jsx)(Ch.default,{})," Continue with Email"]})})]})};var Eh=require("react");var ii=require("react/jsx-runtime"),qs=()=>{let[e,t]=(0,Eh.useState)(!1),{currentScreen:o,navigate:r,setModalData:n}=_(),{enabled:i,token:a}=_e(),{initLoginWithFarcaster:l}=M();return(0,ii.jsxs)(Ne,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:c=>l(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await l(a),r("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:o||"LANDING"}}),r("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,ii.jsx)($i,{})," Farcaster",e&&(0,ii.jsx)("span",{children:(0,ii.jsx)(jr,{})})]})};var Ah=f(require("@heroicons/react/24/outline/PhoneIcon")),kh=require("react");var ai=require("react"),Mc=f(require("styled-components"));var Th=f(require("libphonenumber-js/examples.mobile.json")),Bt=require("libphonenumber-js/min"),Ks=require("react/jsx-runtime");var ji=(e,t)=>(0,Bt.isPossiblePhoneNumber)(String(e),t),js=(e,t)=>`+${(0,Bt.getCountryCallingCode)(t)} ${e}`,Ph=e=>`*${e.replaceAll("-","").slice(-4)}`,xh=e=>new Bt.AsYouType(e),Y1=(0,Bt.getCountries)().map(e=>({code:e,callCode:(0,Bt.getCountryCallingCode)(e)})),Sh=e=>(0,Bt.getExampleNumber)(e,Th.default)?.formatNational(),_h=({value:e,onChange:t})=>(0,Ks.jsx)("select",{value:e,onChange:t,children:Y1.map(o=>(0,Ks.jsxs)("option",{value:o.code,children:[o.code," +",o.callCode]},o.code))});var Po=require("react/jsx-runtime"),si=(0,ai.forwardRef)((e,t)=>{let{app:o}=_(),[r,n]=(0,ai.useState)(""),[i,a]=(0,ai.useState)(o?.intl.defaultCountry??"US"),l=ji(r,i),s=xh(i),c=Sh(i),m=(0,Bt.getCountryCallingCode)(i),y=!l,[g,v]=(0,ai.useState)(!1),b=m.length,T=A=>{let I=A.target.value;a(I),n(""),e.onChange&&e.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:js(r,I),countryCode:I,isValid:ji(r,i)})},x=A=>{try{let I=A.replace(/\D/g,""),W=r.replace(/\D/g,""),S=I===W?A:s.input(A);n(S),e.onChange&&e.onChange({rawPhoneNumber:S,qualifiedPhoneNumber:js(A,i),countryCode:i,isValid:ji(A,i)})}catch(I){console.error("Error processing phone number:",I)}},E=()=>{v(!0);let A=js(r,i);e.onSubmit({rawPhoneNumber:r,qualifiedPhoneNumber:A,countryCode:i,isValid:ji(r,i)}).finally(()=>v(!1))};return(0,Po.jsxs)(Po.Fragment,{children:[(0,Po.jsx)(J1,{children:(0,Po.jsxs)(Q1,{callingCodeLength:b,children:[(0,Po.jsx)(_h,{value:i,onChange:T}),(0,Po.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:A=>{x(A.target.value)},onKeyUp:A=>{A.key==="Enter"&&E()},value:r,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,Po.jsx)(Dn,{isSubmitting:g,onClick:E,disabled:y,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,Po.jsx)(F,{loading:g,loadingText:null,onClick:E,disabled:y,children:"Submit"}):null]})}),J1=Mc.default.div`
|
|
1661
1661
|
width: 100%;
|
|
1662
|
-
`,
|
|
1662
|
+
`,Q1=Mc.default.label`
|
|
1663
1663
|
--country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
|
|
1664
1664
|
--phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
|
|
1665
1665
|
display: block;
|
|
@@ -1745,11 +1745,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1745
1745
|
&& > input::placeholder {
|
|
1746
1746
|
color: var(--privy-color-foreground-3);
|
|
1747
1747
|
}
|
|
1748
|
-
`;var Vo=require("react/jsx-runtime"),js=({isEditable:e,setIsEditable:t})=>{let o=(0,Th.useRef)(null),{authenticated:r}=G(),{navigate:n,setModalData:i,currentScreen:a}=_(),{initLoginWithSms:l}=M(),{enabled:s,token:c}=_e();async function m({qualifiedPhoneNumber:y}){if(s&&!c&&!r)i({captchaModalData:{callback:g=>l(y,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(y,c),n("AWAITING_PASSWORDLESS_CODE")}catch(g){i({errorModalData:{error:g,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Vo.jsxs)(Vo.Fragment,{children:[(0,Vo.jsx)(ar,{if:!e,children:(0,Vo.jsx)(si,{ref:o,onSubmit:m})}),(0,Vo.jsx)(ar,{if:e,children:(0,Vo.jsxs)(Me,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[(0,Vo.jsx)(Eh.default,{})," Continue with SMS"]})})]})};var qi=require("react/jsx-runtime"),Ks=({style:e,...t})=>(0,qi.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,qi.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,qi.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var Br=require("react/jsx-runtime"),Ys=({style:e,...t})=>(0,Br.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,Br.jsx)("g",{clipPath:"url(#clip0)",children:(0,Br.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,Br.jsx)("defs",{children:(0,Br.jsx)("clipPath",{id:"clip0",children:(0,Br.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Rc=require("react/jsx-runtime"),Js=({style:e,...t})=>(0,Rc.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,Rc.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"#171515"})});var an=require("react/jsx-runtime"),Qs=({style:e,...t})=>(0,an.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,an.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,an.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,an.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,an.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var ji=require("react/jsx-runtime");function Zs({style:e,...t}){return(0,ji.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,ji.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ji.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ji.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var Ki=require("react/jsx-runtime");function Xs(e){return(0,Ki.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,Ki.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,Ki.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var li=require("react/jsx-runtime");function el(e){return(0,li.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,li.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,li.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,li.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Ic=require("react/jsx-runtime"),tl=({style:e,...t})=>(0,Ic.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Ic.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"#000000"})});var So=require("react/jsx-runtime"),Hw={apple:{logo:(0,So.jsx)(Ks,{}),displayName:"Apple"},discord:{logo:(0,So.jsx)(Ys,{}),displayName:"Discord"},github:{logo:(0,So.jsx)(Js,{}),displayName:"GitHub"},google:{logo:(0,So.jsx)(Qs,{}),displayName:"Google"},linkedin:{logo:(0,So.jsx)(Zs,{}),displayName:"LinkedIn"},spotify:{logo:(0,So.jsx)(Xs,{}),displayName:"Spotify"},twitter:{logo:(0,So.jsx)(tl,{}),displayName:"Twitter"},tiktok:{logo:(0,So.jsx)(el,{}),displayName:"TikTok"}},tt=({provider:e})=>{let{enabled:t,token:o}=_e(),{navigate:r,setModalData:n}=_(),{initLoginWithOAuth:i}=M(),{displayName:a,logo:l}=Hw[e];return(0,So.jsxs)(Me,{onClick:()=>{t&&!o?(n({captchaModalData:{callback:c=>i(e,c),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):i(e)},children:[l," ",a]})};var Ph=f(require("@heroicons/react/24/outline/ChevronRightIcon"));var Yi=require("react/jsx-runtime"),ol=({onClick:e,text:t,icon:o})=>(0,Yi.jsxs)(Me,{onClick:e,children:[o,(0,Yi.jsx)(gs,{children:t}),(0,Yi.jsx)(Ph.default,{})]});var be=require("react/jsx-runtime"),nl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=M(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=_(),i=r.loginMethodsAndOrder?.primary??[],a=r.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=(0,Ji.useState)("default"),[m,y]=(0,Ji.useState)("email");(0,Ji.useEffect)(()=>{let S=l.indexOf("sms"),O=l.indexOf("email");S>-1&&S<O&&y("sms")},[i,a]);let g=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=g;let v=S=>S==="email"?(0,be.jsx)(Vs,{isEditable:m==="email",setIsEditable:()=>{y("email")}},S):S==="sms"?(0,be.jsx)(js,{isEditable:m==="sms",setIsEditable:()=>{y("sms")}},S):S==="apple"?(0,be.jsx)(tt,{provider:"apple"},S):S==="discord"?(0,be.jsx)(tt,{provider:"discord"},S):S==="farcaster"?(0,be.jsx)(zs,{},S):S==="github"?(0,be.jsx)(tt,{provider:"github"},S):S==="google"?(0,be.jsx)(tt,{provider:"google"},S):S==="linkedin"?(0,be.jsx)(tt,{provider:"linkedin"},S):S==="tiktok"?(0,be.jsx)(tt,{provider:"tiktok"},S):S==="twitter"&&(!Sh.isMobile||r?.loginConfig.twitterOAuthOnMobileEnabled)?(0,be.jsx)(tt,{provider:"twitter"},S):Li([S],o,e,l),b=i.map(v).flat(),T=a.map(v).flat(),x=[...b,...T],E=Gw({primary:b.length,overflow:T.length}),[k,I]=cp(x,E);return(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(A,{title:"Log in or sign up",onClose:g,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&(0,be.jsx)(Vw,{}),(0,be.jsx)(vs,{style:{overflow:"hidden",padding:2},children:(0,be.jsxs)(eo,{children:[s==="default"&&(0,be.jsxs)(be.Fragment,{children:[...k,I.length>0&&(0,be.jsx)(ol,{text:"More options",icon:(0,be.jsx)(xh.default,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&(0,be.jsxs)(be.Fragment,{children:[...I]})]})}),r&&(0,be.jsx)(Fn,{app:r}),(0,be.jsx)($,{protectedByPrivy:!0})]})},rl=5,Gw=({primary:e,overflow:t})=>e<rl?e:e===rl&&t===0?rl:rl-1,Vw=(0,_h.default)(zn)`
|
|
1748
|
+
`;var Ho=require("react/jsx-runtime"),Ys=({isEditable:e,setIsEditable:t})=>{let o=(0,kh.useRef)(null),{authenticated:r}=G(),{navigate:n,setModalData:i,currentScreen:a}=_(),{initLoginWithSms:l}=M(),{enabled:s,token:c}=_e();async function m({qualifiedPhoneNumber:y}){if(s&&!c&&!r)i({captchaModalData:{callback:g=>l(y,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(y,c),n("AWAITING_PASSWORDLESS_CODE")}catch(g){i({errorModalData:{error:g,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Ho.jsxs)(Ho.Fragment,{children:[(0,Ho.jsx)(rr,{if:!e,children:(0,Ho.jsx)(si,{ref:o,onSubmit:m})}),(0,Ho.jsx)(rr,{if:e,children:(0,Ho.jsxs)(Ne,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[(0,Ho.jsx)(Ah.default,{})," Continue with SMS"]})})]})};var Ki=require("react/jsx-runtime"),Js=({style:e,...t})=>(0,Ki.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,Ki.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,Ki.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var Dr=require("react/jsx-runtime"),Qs=({style:e,...t})=>(0,Dr.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,Dr.jsx)("g",{clipPath:"url(#clip0)",children:(0,Dr.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,Dr.jsx)("defs",{children:(0,Dr.jsx)("clipPath",{id:"clip0",children:(0,Dr.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Nc=require("react/jsx-runtime"),Zs=({style:e,...t})=>(0,Nc.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,Nc.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"#171515"})});var on=require("react/jsx-runtime"),Xs=({style:e,...t})=>(0,on.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,on.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,on.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,on.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,on.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Yi=require("react/jsx-runtime");function el({style:e,...t}){return(0,Yi.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,Yi.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,Yi.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,Yi.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var Ji=require("react/jsx-runtime");function tl(e){return(0,Ji.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,Ji.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,Ji.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var li=require("react/jsx-runtime");function ol(e){return(0,li.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,li.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,li.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,li.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Lc=require("react/jsx-runtime"),rl=({style:e,...t})=>(0,Lc.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Lc.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"#000000"})});var xo=require("react/jsx-runtime"),Z1={apple:{logo:(0,xo.jsx)(Js,{}),displayName:"Apple"},discord:{logo:(0,xo.jsx)(Qs,{}),displayName:"Discord"},github:{logo:(0,xo.jsx)(Zs,{}),displayName:"GitHub"},google:{logo:(0,xo.jsx)(Xs,{}),displayName:"Google"},linkedin:{logo:(0,xo.jsx)(el,{}),displayName:"LinkedIn"},spotify:{logo:(0,xo.jsx)(tl,{}),displayName:"Spotify"},twitter:{logo:(0,xo.jsx)(rl,{}),displayName:"Twitter"},tiktok:{logo:(0,xo.jsx)(ol,{}),displayName:"TikTok"}},tt=({provider:e})=>{let{enabled:t,token:o}=_e(),{navigate:r,setModalData:n}=_(),{initLoginWithOAuth:i}=M(),{displayName:a,logo:l}=Z1[e];return(0,xo.jsxs)(Ne,{onClick:()=>{t&&!o?(n({captchaModalData:{callback:c=>i(e,c),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):i(e)},children:[l," ",a]})};var Rh=f(require("@heroicons/react/24/outline/ChevronRightIcon"));var Qi=require("react/jsx-runtime"),nl=({onClick:e,text:t,icon:o})=>(0,Qi.jsxs)(Ne,{onClick:e,children:[o,(0,Qi.jsx)(ws,{children:t}),(0,Qi.jsx)(Rh.default,{})]});var be=require("react/jsx-runtime"),al=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=M(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=_(),i=r.loginMethodsAndOrder?.primary??[],a=r.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=(0,Zi.useState)("default"),[m,y]=(0,Zi.useState)("email");(0,Zi.useEffect)(()=>{let S=l.indexOf("sms"),O=l.indexOf("email");S>-1&&S<O&&y("sms")},[i,a]);let g=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=g;let v=S=>S==="email"?(0,be.jsx)($s,{isEditable:m==="email",setIsEditable:()=>{y("email")}},S):S==="sms"?(0,be.jsx)(Ys,{isEditable:m==="sms",setIsEditable:()=>{y("sms")}},S):S==="apple"?(0,be.jsx)(tt,{provider:"apple"},S):S==="discord"?(0,be.jsx)(tt,{provider:"discord"},S):S==="farcaster"?(0,be.jsx)(qs,{},S):S==="github"?(0,be.jsx)(tt,{provider:"github"},S):S==="google"?(0,be.jsx)(tt,{provider:"google"},S):S==="linkedin"?(0,be.jsx)(tt,{provider:"linkedin"},S):S==="tiktok"?(0,be.jsx)(tt,{provider:"tiktok"},S):S==="twitter"&&(!Wh.isMobile||r?.loginConfig.twitterOAuthOnMobileEnabled)?(0,be.jsx)(tt,{provider:"twitter"},S):Di([S],o,e,l),b=i.map(v).flat(),T=a.map(v).flat(),x=[...b,...T],E=X1({primary:b.length,overflow:T.length}),[A,I]=yp(x,E);return(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(k,{title:"Log in or sign up",onClose:g,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&(0,be.jsx)(eC,{}),(0,be.jsx)(Cs,{style:{overflow:"hidden",padding:2},children:(0,be.jsxs)(eo,{children:[s==="default"&&(0,be.jsxs)(be.Fragment,{children:[...A,I.length>0&&(0,be.jsx)(nl,{text:"More options",icon:(0,be.jsx)(Ih.default,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&(0,be.jsxs)(be.Fragment,{children:[...I]})]})}),r&&(0,be.jsx)(Un,{app:r}),(0,be.jsx)($,{protectedByPrivy:!0})]})},il=5,X1=({primary:e,overflow:t})=>e<il?e:e===il&&t===0?il:il-1,eC=(0,Mh.default)(Vn)`
|
|
1749
1749
|
margin-bottom: 16px;
|
|
1750
|
-
`;var
|
|
1750
|
+
`;var Uh=f(require("@heroicons/react/24/outline/EnvelopeIcon")),Fh=f(require("@heroicons/react/24/outline/PhoneIcon")),Bh=f(require("@heroicons/react/24/outline/UserCircleIcon")),Xi=require("react"),Hh=require("react-device-detect"),Gh=f(require("styled-components"));var dr=require("react/jsx-runtime"),Nh=({...e})=>(0,dr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,dr.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,dr.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,dr.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,dr.jsx)("defs",{children:(0,dr.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,dr.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var Lh=f(require("@heroicons/react/24/outline/ChevronRightIcon")),Oh=f(require("@heroicons/react/24/outline/WalletIcon"));var ci=require("react/jsx-runtime"),Dh=({onClick:e,text:t})=>(0,ci.jsxs)(Ne,{onClick:e,children:[(0,ci.jsx)(Oh.default,{}),(0,ci.jsx)(ws,{children:t}),(0,ci.jsx)(Lh.default,{})]});var te=require("react/jsx-runtime"),sl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=M(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=_(),{email:i,sms:a,google:l,twitter:s,discord:c,github:m,spotify:y,tiktok:g,linkedin:v,apple:b,wallet:T,farcaster:x}=r?.loginMethods??{},E=r?.appearance.loginGroupPriority||"web2-first",A=r?.appearance.hideDirectWeb2Inputs,[I,W]=(0,Xi.useState)("default"),[S,O]=(0,Xi.useState)(i?"email":"sms");(0,Xi.useEffect)(()=>{O(i?"email":"sms")},[i]);let D=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{W("default")},150)};n.current=D;let B=[i&&(0,te.jsx)($s,{isEditable:S==="email",setIsEditable:()=>{O("email")}}),a&&(0,te.jsx)(Ys,{isEditable:S==="sms",setIsEditable:()=>{O("sms")}})].filter(Boolean),V=[l&&(0,te.jsx)(tt,{provider:"google"}),s&&(!Hh.isMobile||r?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,te.jsx)(tt,{provider:"twitter"}),c&&(0,te.jsx)(tt,{provider:"discord"}),m&&(0,te.jsx)(tt,{provider:"github"}),y&&(0,te.jsx)(tt,{provider:"spotify"}),g&&(0,te.jsx)(tt,{provider:"tiktok"}),v&&(0,te.jsx)(tt,{provider:"linkedin"}),b&&(0,te.jsx)(tt,{provider:"apple"}),x&&(0,te.jsx)(qs,{})].filter(Boolean),Y=Di(r.appearance.walletList,o,e,r.appearance.walletList),U=I==="default"?void 0:()=>{W("default")},j=oC({priority:E,email:i,sms:a,social:V}),R=rC({priority:E,email:i,sms:a,social:V}),le=nC({priority:E,email:i,sms:a,social:V}),pe=(0,te.jsx)(Dh,{text:le,onClick:()=>W("web3-overflow")}),Q=(0,te.jsx)(nl,{text:j,icon:R,onClick:()=>W("web2-overflow")}),pt=A?0:1;return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{title:"Log in or sign up",onClose:D,backFn:U}),I==="default"&&(0,te.jsx)(tC,{}),(0,te.jsx)(Cs,{style:{overflow:"hidden",padding:2},children:(0,te.jsxs)(eo,{children:[I==="default"&&E==="web2-first"&&(0,te.jsxs)(te.Fragment,{children:[...B,...V.length+B.length>4?V.slice(0,3-B.length):V,B.length+V.length>4&&Q,T&&pe]}),I==="default"&&E==="web3-first"&&(0,te.jsxs)(te.Fragment,{children:[T&&(0,te.jsxs)(te.Fragment,{children:[...Y.length>4?Y.slice(0,3):Y,Y.length>4&&pe]}),B.length+V.length>pt&&Q,B.length+V.length===pt&&B.length?B[0]:null,B.length+V.length===pt&&V.length?V[0]:null]}),I==="web2-overflow"&&(0,te.jsxs)(te.Fragment,{children:[...E==="web3-first"?B:[],...V]}),...I==="web3-overflow"?Y:[]]})}),r&&(0,te.jsx)(Un,{app:r}),(0,te.jsx)($,{protectedByPrivy:!0})]})},tC=(0,Gh.default)(Vn)`
|
|
1751
1751
|
margin-bottom: 16px;
|
|
1752
|
-
|
|
1752
|
+
`,oC=({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",rC=({priority:e,email:t,sms:o,social:r})=>e==="web2-first"||r.length>0?(0,te.jsx)(Bh.default,{}):t&&o?(0,te.jsx)(Nh,{}):t?(0,te.jsx)(Uh.default,{}):o?(0,te.jsx)(Fh.default,{}):null,nC=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var Oc=require("react/jsx-runtime"),Vh=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Oc.jsx)(al,{connectOnly:!0}):(0,Oc.jsx)(sl,{connectOnly:!0})};var Dc=require("react/jsx-runtime"),zh=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Dc.jsx)(al,{connectOnly:!1}):(0,Dc.jsx)(sl,{connectOnly:!1})};var $h=f(require("@heroicons/react/24/outline/EnvelopeIcon"));var Ht=require("react/jsx-runtime"),qh=()=>{let{app:e}=_();return(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)(k,{},"header"),(0,Ht.jsx)(X,{}),(0,Ht.jsx)(Oe,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Ht.jsx)($h.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Ht.jsx)(to,{children:(0,Ht.jsx)(zs,{stacked:!0})}),(0,Ht.jsx)(ee,{}),(0,Ht.jsx)($,{protectedByPrivy:!0})]})};var jh=f(require("@heroicons/react/24/outline/PhoneIcon"));var Gt=require("react/jsx-runtime"),Kh=()=>{let{app:e,currentScreen:t,data:o,navigate:r,setModalData:n}=_(),{initLoginWithSms:i}=M();async function a({qualifiedPhoneNumber:l}){try{await i(l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:o?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return(0,Gt.jsxs)(Gt.Fragment,{children:[(0,Gt.jsx)(k,{},"header"),(0,Gt.jsx)(X,{}),(0,Gt.jsx)(Oe,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Gt.jsx)(jh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Gt.jsx)(to,{children:(0,Gt.jsx)(si,{stacked:!0,onSubmit:a})}),(0,Gt.jsx)(ee,{}),(0,Gt.jsx)($,{protectedByPrivy:!0})]})};var Go=require("react/jsx-runtime"),Yh=()=>{let{linkingHint:e}=M(),{app:t}=_(),o=e?`Select the wallet with ${Cr(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(k,{},"header"),(0,Go.jsx)(Oo,{title:`${e?"Reconnect":"Connect"} your wallet`,description:o}),(0,Go.jsx)(eo,{children:(0,Go.jsx)(Gn,{connectOnly:!1})}),(0,Go.jsx)($,{protectedByPrivy:!0})]})};var ea=require("react/jsx-runtime"),Jh=({style:e,...t})=>(0,ea.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,ea.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,ea.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var It=require("react/jsx-runtime"),Qh=()=>{let{closePrivyModal:e}=M(),{navigate:t}=_();return(0,It.jsxs)(It.Fragment,{children:[(0,It.jsx)(k,{},"header"),(0,It.jsx)(X,{}),(0,It.jsx)(Jh,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,It.jsx)(Oo,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,It.jsxs)(to,{children:[(0,It.jsx)(F,{onClick:()=>t("LANDING"),children:"Try again"}),(0,It.jsx)(yo,{onClick:()=>e(),children:"Cancel"})]}),(0,It.jsx)(ee,{}),(0,It.jsx)($,{protectedByPrivy:!0})]})};var Bc=f(require("@heroicons/react/20/solid/CheckIcon")),cy=f(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),dy=f(require("@heroicons/react/24/outline/FingerPrintIcon")),py=f(require("@heroicons/react/24/outline/PhoneIcon")),Hc=f(require("@heroicons/react/24/outline/TrashIcon")),uy=f(require("@heroicons/react/24/solid/CheckBadgeIcon")),Gc=f(require("@heroicons/react/24/solid/CheckCircleIcon")),Vc=f(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),my=f(require("@heroicons/react/24/solid/IdentificationIcon")),pl=f(require("@heroicons/react/24/solid/PhoneIcon")),dl=f(require("@heroicons/react/24/solid/ShieldCheckIcon")),Vt=require("react");var cl=require("react"),ty=require("react-device-detect"),Fc=f(require("styled-components"));var rn=require("@headlessui/react"),ll=f(require("react")),nn=f(require("styled-components")),pr=require("react/jsx-runtime"),Zh=({children:e,open:t,onClick:o,...r})=>(0,pr.jsx)(rn.Transition,{show:t,as:ll.default.Fragment,children:(0,pr.jsxs)(rn.Dialog,{onClose:o,...r,as:aC,children:[(0,pr.jsx)(rn.Transition.Child,{as:ll.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,pr.jsx)(iC,{"aria-hidden":"true"})}),(0,pr.jsx)(sC,{children:(0,pr.jsx)(rn.Transition.Child,{as:ll.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,pr.jsx)(rn.Dialog.Panel,{as:lC,children:e})})})]})}),di=nn.default.div`
|
|
1753
1753
|
display: flex;
|
|
1754
1754
|
flex-direction: column;
|
|
1755
1755
|
text-align: center;
|
|
@@ -1772,7 +1772,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1772
1772
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
1773
1773
|
border-radius: var(--privy-border-radius-lg);
|
|
1774
1774
|
}
|
|
1775
|
-
`,
|
|
1775
|
+
`,iC=nn.default.div`
|
|
1776
1776
|
position: fixed;
|
|
1777
1777
|
inset: 0;
|
|
1778
1778
|
|
|
@@ -1785,10 +1785,10 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1785
1785
|
backdrop-filter: unset;
|
|
1786
1786
|
-webkit-backdrop-filter: unset;
|
|
1787
1787
|
}
|
|
1788
|
-
`,
|
|
1788
|
+
`,aC=nn.default.div`
|
|
1789
1789
|
position: relative;
|
|
1790
1790
|
z-index: 999999;
|
|
1791
|
-
`,
|
|
1791
|
+
`,sC=nn.default.div`
|
|
1792
1792
|
position: fixed;
|
|
1793
1793
|
inset: 0;
|
|
1794
1794
|
display: flex;
|
|
@@ -1796,7 +1796,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1796
1796
|
justify-content: center;
|
|
1797
1797
|
width: 100vw;
|
|
1798
1798
|
min-height: 100vh;
|
|
1799
|
-
`,
|
|
1799
|
+
`,lC=nn.default.div`
|
|
1800
1800
|
// reset some default dialog styles
|
|
1801
1801
|
padding: 0;
|
|
1802
1802
|
background: transparent;
|
|
@@ -1843,13 +1843,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1843
1843
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
1844
1844
|
border-radius: var(--privy-border-radius-lg);
|
|
1845
1845
|
}
|
|
1846
|
-
`,
|
|
1846
|
+
`,Xh=nn.default.div`
|
|
1847
1847
|
display: flex;
|
|
1848
1848
|
flex-direction: column;
|
|
1849
1849
|
align-items: center;
|
|
1850
1850
|
justify-content: center;
|
|
1851
1851
|
height: 100%;
|
|
1852
|
-
`;var
|
|
1852
|
+
`;var Vo=require("react/jsx-runtime"),ta=6,cC=new Array(ta).fill("");function dC(e){return e.replace(/\s+/g,"")}function Uc(e){return/^[0-9]{1}$/.test(e)}function ey(e){return e.length===ta&&e.every(Uc)}function pC(e,t){return e.reduce((o,r)=>o+Number(t(r)),0)}var pi=({onChange:e,disabled:t,errorReasonOverride:o,success:r})=>{let[n,i]=(0,cl.useState)(cC),[a,l]=(0,cl.useState)(null),[s,c]=(0,cl.useState)(null),m=async b=>{b.preventDefault();let T=dC(b.currentTarget.value);if(T==="")return;let x=pC(n,Uc),E=T.split(""),A=!E.every(Uc),I=E.length+x>ta;if(A){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 W=Number(b.currentTarget.name?.charAt(4)),S=[...T||[""]].slice(0,ta-W),O=[...n.slice(0,W),...S,...n.slice(W+S.length)];i(O);let D=S.length,B=Math.min(Math.max(W+D,0),ta-1);if(document.querySelector(`input[name=pin-${B}]`)?.focus(),ey(O))try{await e(O.join("")),document.querySelector(`input[name=pin-${B}]`)?.blur()}catch(Y){c(1),l(Y.message)}else try{await e(null)}catch(Y){c(1),l(Y.message)}},y=b=>{s===1&&(l(null),c(null));let T=[...n.slice(0,b),"",...n.slice(b+1)];i(T),b>0&&document.querySelector(`input[name=pin-${b-1}]`)?.focus(),ey(T)?e(T.join("")):e(null)},v=r?"success":!!(o||a)?"fail":"";return(0,Vo.jsx)(Vo.Fragment,{children:(0,Vo.jsxs)(uC,{children:[(0,Vo.jsx)("div",{children:n.map((b,T)=>(0,Vo.jsx)("input",{name:`pin-${T}`,type:"text",value:n[T],onChange:m,onKeyUp:x=>{x.key==="Backspace"&&y(T)},inputMode:"numeric",autoFocus:T===0,pattern:"[0-9]",className:v,autoComplete:ty.isMobile?"one-time-code":"off",disabled:t},T))}),(0,Vo.jsx)("div",{children:(0,Vo.jsx)(mC,{fail:!!o||!!a,children:o||a})})]})})},uC=Fc.default.div`
|
|
1853
1853
|
display: flex;
|
|
1854
1854
|
flex-direction: column;
|
|
1855
1855
|
width: 100%;
|
|
@@ -1920,7 +1920,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1920
1920
|
transform: translate(1px, 0px);
|
|
1921
1921
|
}
|
|
1922
1922
|
}
|
|
1923
|
-
`,
|
|
1923
|
+
`,mC=Fc.default.div`
|
|
1924
1924
|
line-height: 20px;
|
|
1925
1925
|
font-size: 13px;
|
|
1926
1926
|
display: flex;
|
|
@@ -1928,7 +1928,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1928
1928
|
width: 100%;
|
|
1929
1929
|
|
|
1930
1930
|
color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
1931
|
-
`;var
|
|
1931
|
+
`;var oy=require("react");function an(){let{promptMfa:e,init:t,submit:o,cancel:r}=(0,oy.useContext)(ge);return{promptMfa:e,init:t,submit:o,cancel:r}}var ry=require("react");function ui(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:r,unenroll:n,enrollInMfa:i}=(0,ry.useContext)(ge);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:r,unenrollWithSms:()=>n("sms"),unenrollWithTotp:()=>n("totp"),showMfaEnrollmentModal:()=>i(!0),closeMfaEnrollmentModal:()=>i(!1)}}var ny=f(require("styled-components")),oa=require("react/jsx-runtime"),iy=e=>(0,oa.jsxs)(fC,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,oa.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,oa.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),fC=ny.default.svg`
|
|
1932
1932
|
height: 90px;
|
|
1933
1933
|
width: 90px;
|
|
1934
1934
|
|
|
@@ -1939,7 +1939,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1939
1939
|
> path {
|
|
1940
1940
|
fill: white;
|
|
1941
1941
|
}
|
|
1942
|
-
`;var ey=f(require("@heroicons/react/24/solid/ShieldCheckIcon"));var oy=require("react/jsx-runtime");var ty=({size:e,authUrl:t})=>(0,oy.jsx)(Os,{url:t,squareLogoElement:ey.default,size:e,fgColor:"#1F1F1F"});var u=require("react/jsx-runtime"),ly=()=>{let{user:e,enrollInMfa:t}=G(),[o,r]=(0,Vt.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i}=ui(),{app:a,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),{closePrivyModal:m}=M(),{promptMfa:y}=cn(),[g,v]=(0,Vt.useState)(s?.mfaEnrollmentFlow?.seenIntro||!1),[b,T]=(0,Vt.useState)(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),x=()=>{m({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{r(null),T(null)},500)};c.current=x;let E=e?.mfaMethods.includes("sms"),k=!!e?.phone,I=e?.mfaMethods.includes("totp"),W=E||I;(0,Vt.useEffect)(()=>{W&&v(!0)},[W]);function S(){r(null),T(null)}function O(){v(!1)}async function D(U){await y(),T(U)}if(!l||!e||!a)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Xh,{})}),(0,u.jsx)(Ir,{children:(0,u.jsx)(Zt,{})}),(0,u.jsx)(re,{})]});async function B(){r(null);try{await n()}catch{r(null)}}async function V(){r(null);try{await i()}catch{r(null)}}if(o==="sms")return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:S,onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(cl.default,{})})}),(0,u.jsx)(Ne,{children:"Remove SMS verification?"}),(0,u.jsxs)(Re,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,u.jsx)(Wr,{children:(0,u.jsx)(F,{warn:!0,onClick:B,children:"Remove SMS for MFA"})}),(0,u.jsx)(re,{})]});if(o==="totp")return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:S,onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(Fc.default,{})})}),(0,u.jsx)(Ne,{children:"Remove Authenticator App verification?"}),(0,u.jsxs)(Re,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,u.jsx)(Wr,{children:(0,u.jsx)(F,{warn:!0,onClick:V,children:"Remove Authenticator App for MFA"})}),(0,u.jsx)(re,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!W)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(ll.default,{})})}),(0,u.jsx)(Ne,{children:"Add more security"}),(0,u.jsxs)(Re,{children:[a?.name," does not have any verification methods enabled."]}),(0,u.jsx)(Wr,{children:(0,u.jsx)(F,{onClick:x,children:"Close"})}),(0,u.jsx)(re,{})]});let K=!W&&!g;if(K)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(ll.default,{})})}),(0,u.jsx)(Ne,{children:"Transaction Protection"}),(0,u.jsx)(Re,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,u.jsxs)(_u,{children:[(0,u.jsxs)(oc,{children:[(0,u.jsx)(tc,{children:(0,u.jsx)(ay.default,{})}),"Enable 2-Step verification for your ",a?.name," wallet."]}),(0,u.jsxs)(oc,{children:[(0,u.jsx)(tc,{children:(0,u.jsx)(sy.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,u.jsxs)(Wr,{children:[(0,u.jsx)(F,{onClick:()=>v(!0),children:"Continue"}),(0,u.jsx)(go,{onClick:x,children:"Not now"})]}),(0,u.jsx)(re,{})]});switch(b){case"sms":return(0,u.jsx)(nC,{onComplete:x,onReset:S,onClose:x});case"totp":return(0,u.jsx)(iC,{onComplete:x,onClose:x,onReset:S});default:return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:K?O:void 0,onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(ll.default,{})})}),(0,u.jsx)(Ne,{children:"Choose a verification method"}),W?(0,u.jsx)(Re,{children:"To add or delete verification methods, verification is required."}):(0,u.jsx)(Re,{children:"How would you like to verify your identity? You can change this later."}),(0,u.jsxs)(ws,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||I)&&(0,u.jsxs)(Cs,{children:[(0,u.jsx)(Me,{disabled:I,onClick:()=>D("totp"),children:(0,u.jsxs)(Es,{children:[(0,u.jsxs)(bs,{children:[(0,u.jsx)(ry.default,{}),"Authenticator App"]}),I?(0,u.jsxs)(Bn,{children:[(0,u.jsx)(Oc.default,{}),"Added"]}):(0,u.jsx)(Bn,{children:"Recommended"})]})}),I&&(0,u.jsx)(rc,{id:"remove",onClick:()=>r("totp"),children:(0,u.jsx)(Dc.default,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||E)&&(0,u.jsxs)(Cs,{children:[(0,u.jsx)(Me,{disabled:E||k,onClick:()=>D("sms"),children:(0,u.jsxs)(Es,{children:[(0,u.jsxs)(bs,{children:[(0,u.jsx)(iy.default,{}),"SMS"]}),E&&(0,u.jsxs)(Bn,{children:[(0,u.jsx)(Oc.default,{}),"Added"]}),k&&(0,u.jsx)(Bn,{children:"Disabled"})]})}),E&&(0,u.jsx)(rc,{id:"remove",onClick:()=>r("sms"),children:(0,u.jsx)(Dc.default,{})})]},"sms"),(0,u.jsx)(Cs,{children:(0,u.jsx)(Me,{disabled:!0,children:(0,u.jsxs)(Es,{children:[(0,u.jsxs)(bs,{children:[(0,u.jsx)(ny.default,{}),"Passkey"]}),(0,u.jsx)(Bn,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),(0,u.jsx)(re,{})]})}},nC=({onComplete:e,onReset:t,onClose:o})=>{let[r,n]=(0,Vt.useState)(""),[i,a]=(0,Vt.useState)(!1),[l,s]=(0,Vt.useState)("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:m}=ui(),{app:y,data:g,currentScreen:v,navigate:b,setModalData:T}=_();function x(){g?.mfaEnrollmentFlow?.onSuccess(),e()}async function E({qualifiedPhoneNumber:W}){try{await c({phoneNumber:W}),n(W),s("verify")}catch(S){T({mfaEnrollmentFlow:g?.mfaEnrollmentFlow?{...g?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:S,previousScreen:v||"MFA_ENROLLMENT_FLOW_SCREEN"}}),b("ERROR_SCREEN")}}async function k(W){try{if(!W)return;await m({phoneNumber:r,mfaCode:W}),a(!0)}catch(S){throw fc(S)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Xr(S)?new Error("The code you entered is not valid"):Zr(S)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):hc(S)?new Error("Verification canceled"):new Error("Unknown error")}}function I(){l==="verify"?s("enroll"):t()}return l==="enroll"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:t,onClose:o},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(cl.default,{})})}),(0,u.jsx)(Ne,{children:"Set up SMS verification"}),(0,u.jsx)(Re,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,u.jsxs)(Ir,{children:[(0,u.jsx)(si,{onSubmit:E}),(0,u.jsxs)(Au,{children:["By providing your mobile number, you agree to receive text messages from ",y?.name,". Some carrier charges may apply"]})]}),(0,u.jsx)(re,{})]}):i?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{status:"success",children:(0,u.jsx)(Uc.default,{})})}),(0,u.jsx)(Ne,{children:"SMS verification added"}),(0,u.jsx)(Re,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,u.jsx)(Wr,{children:(0,u.jsx)(F,{onClick:x,children:"Done"})}),(0,u.jsx)(re,{})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:I,onClose:o},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(cl.default,{})})}),(0,u.jsx)(Ne,{children:"Enter enrollment code"}),(0,u.jsxs)(Ir,{children:[(0,u.jsx)(pi,{onChange:k}),(0,u.jsxs)(Re,{children:["To continue, enter the 6-digit code sent to ",(0,u.jsx)("strong",{children:vh(r)})]})]}),(0,u.jsx)(re,{})]})},iC=({onComplete:e,onClose:t,onReset:o})=>{let[r,n]=(0,Vt.useState)("enroll"),[i,a]=(0,Vt.useState)(null),[l,s]=(0,Vt.useState)(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:m}=ui(),{data:y}=_();(0,Vt.useEffect)(()=>{a(null),c().then(x=>{a(x)}).catch(()=>{a(null),o()})},[]);function g(){y?.mfaEnrollmentFlow?.onSuccess(),e()}function v(){n("verify")}async function b(x){try{if(!x)return;await m({mfaCode:x}),s(!0)}catch(E){throw fc(E)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Xr(E)?new Error("The code you entered is not valid"):Zr(E)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):hc(E)?new Error("Verification canceled"):new Error("Unknown error")}}function T(){r==="verify"?n("enroll"):o()}return r==="enroll"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:o,onClose:t},"header"),(0,u.jsx)(Ne,{children:"Scan QR code"}),(0,u.jsx)(Re,{children:"Open your authenticator app and scan the QR code to continue."}),(0,u.jsx)(Ss,{children:i?.authUrl?(0,u.jsx)(ty,{authUrl:i.authUrl,size:200}):(0,u.jsx)(Zt,{})}),(0,u.jsxs)(Wr,{children:[(0,u.jsx)(oo,{children:i?.secret&&(0,u.jsx)(oi,{itemName:"secret",text:i.secret})}),(0,u.jsx)(F,{onClick:v,children:"Continue"})]}),(0,u.jsx)(re,{})]}):l?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:g},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{status:"success",children:(0,u.jsx)(Uc.default,{})})}),(0,u.jsx)(Ne,{children:"Authenticator app verification added"}),(0,u.jsx)(Re,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,u.jsx)(Wr,{children:(0,u.jsx)(F,{onClick:g,children:"Done"})}),(0,u.jsx)(re,{})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:T,onClose:t},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(Fc.default,{})})}),(0,u.jsx)(Ne,{children:"Enter enrollment code"}),(0,u.jsx)(Ir,{children:(0,u.jsx)(pi,{onChange:b})}),(0,u.jsxs)(Re,{children:["To continue, enter the 6-digit code generated from your ",(0,u.jsx)("strong",{children:"authenticator app"})]}),(0,u.jsx)(re,{})]})};var By=f(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),Hy=f(require("@heroicons/react/24/outline/PhoneIcon")),Gy=f(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Vy=f(require("@heroicons/react/24/solid/PhoneIcon")),zy=f(require("@heroicons/react/24/solid/ShieldCheckIcon")),wi=require("react");var Uy=require("@ethersproject/providers"),pn=require("react"),Fy=f(require("styled-components"));var qc=f(require("styled-components"));var Bc=f(require("styled-components")),ta=require("react/jsx-runtime"),dl=({label:e,children:t,valueStyles:o})=>(0,ta.jsxs)(aC,{children:[(0,ta.jsx)("div",{children:e}),(0,ta.jsx)(sC,{style:{...o},children:t})]}),aC=Bc.default.div`
|
|
1942
|
+
`;var ay=f(require("@heroicons/react/24/solid/ShieldCheckIcon"));var ly=require("react/jsx-runtime");var sy=({size:e,authUrl:t})=>(0,ly.jsx)(Us,{url:t,squareLogoElement:ay.default,size:e,fgColor:"#1F1F1F"});var u=require("react/jsx-runtime"),fy=()=>{let{user:e,enrollInMfa:t}=G(),[o,r]=(0,Vt.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i}=ui(),{app:a,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),{closePrivyModal:m}=M(),{promptMfa:y}=an(),[g,v]=(0,Vt.useState)(s?.mfaEnrollmentFlow?.seenIntro||!1),[b,T]=(0,Vt.useState)(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),x=()=>{m({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{r(null),T(null)},500)};c.current=x;let E=e?.mfaMethods.includes("sms"),A=!!e?.phone,I=e?.mfaMethods.includes("totp"),W=E||I;(0,Vt.useEffect)(()=>{W&&v(!0)},[W]);function S(){r(null),T(null)}function O(){v(!1)}async function D(U){await y(),T(U)}if(!l||!e||!a)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{onClose:x},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(iy,{})}),(0,u.jsx)(Ar,{children:(0,u.jsx)(Zt,{})}),(0,u.jsx)(re,{})]});async function B(){r(null);try{await n()}catch{r(null)}}async function V(){r(null);try{await i()}catch{r(null)}}if(o==="sms")return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{backFn:S,onClose:x},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{children:(0,u.jsx)(pl.default,{})})}),(0,u.jsx)(Le,{children:"Remove SMS verification?"}),(0,u.jsxs)(Re,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,u.jsx)(kr,{children:(0,u.jsx)(F,{warn:!0,onClick:B,children:"Remove SMS for MFA"})}),(0,u.jsx)(re,{})]});if(o==="totp")return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{backFn:S,onClose:x},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{children:(0,u.jsx)(Vc.default,{})})}),(0,u.jsx)(Le,{children:"Remove Authenticator App verification?"}),(0,u.jsxs)(Re,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,u.jsx)(kr,{children:(0,u.jsx)(F,{warn:!0,onClick:V,children:"Remove Authenticator App for MFA"})}),(0,u.jsx)(re,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!W)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{onClose:x},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{children:(0,u.jsx)(dl.default,{})})}),(0,u.jsx)(Le,{children:"Add more security"}),(0,u.jsxs)(Re,{children:[a?.name," does not have any verification methods enabled."]}),(0,u.jsx)(kr,{children:(0,u.jsx)(F,{onClick:x,children:"Close"})}),(0,u.jsx)(re,{})]});let Y=!W&&!g;if(Y)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{onClose:x},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{children:(0,u.jsx)(dl.default,{})})}),(0,u.jsx)(Le,{children:"Transaction Protection"}),(0,u.jsx)(Re,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,u.jsxs)(Nu,{children:[(0,u.jsxs)(ac,{children:[(0,u.jsx)(ic,{children:(0,u.jsx)(uy.default,{})}),"Enable 2-Step verification for your ",a?.name," wallet."]}),(0,u.jsxs)(ac,{children:[(0,u.jsx)(ic,{children:(0,u.jsx)(my.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,u.jsxs)(kr,{children:[(0,u.jsx)(F,{onClick:()=>v(!0),children:"Continue"}),(0,u.jsx)(yo,{onClick:x,children:"Not now"})]}),(0,u.jsx)(re,{})]});switch(b){case"sms":return(0,u.jsx)(hC,{onComplete:x,onReset:S,onClose:x});case"totp":return(0,u.jsx)(yC,{onComplete:x,onClose:x,onReset:S});default:return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{backFn:Y?O:void 0,onClose:x},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{children:(0,u.jsx)(dl.default,{})})}),(0,u.jsx)(Le,{children:"Choose a verification method"}),W?(0,u.jsx)(Re,{children:"To add or delete verification methods, verification is required."}):(0,u.jsx)(Re,{children:"How would you like to verify your identity? You can change this later."}),(0,u.jsxs)(bs,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||I)&&(0,u.jsxs)(Es,{children:[(0,u.jsx)(Ne,{disabled:I,onClick:()=>D("totp"),children:(0,u.jsxs)(Ps,{children:[(0,u.jsxs)(Ts,{children:[(0,u.jsx)(cy.default,{}),"Authenticator App"]}),I?(0,u.jsxs)(Fn,{children:[(0,u.jsx)(Bc.default,{}),"Added"]}):(0,u.jsx)(Fn,{children:"Recommended"})]})}),I&&(0,u.jsx)(sc,{id:"remove",onClick:()=>r("totp"),children:(0,u.jsx)(Hc.default,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||E)&&(0,u.jsxs)(Es,{children:[(0,u.jsx)(Ne,{disabled:E||A,onClick:()=>D("sms"),children:(0,u.jsxs)(Ps,{children:[(0,u.jsxs)(Ts,{children:[(0,u.jsx)(py.default,{}),"SMS"]}),E&&(0,u.jsxs)(Fn,{children:[(0,u.jsx)(Bc.default,{}),"Added"]}),A&&(0,u.jsx)(Fn,{children:"Disabled"})]})}),E&&(0,u.jsx)(sc,{id:"remove",onClick:()=>r("sms"),children:(0,u.jsx)(Hc.default,{})})]},"sms"),(0,u.jsx)(Es,{children:(0,u.jsx)(Ne,{disabled:!0,children:(0,u.jsxs)(Ps,{children:[(0,u.jsxs)(Ts,{children:[(0,u.jsx)(dy.default,{}),"Passkey"]}),(0,u.jsx)(Fn,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),(0,u.jsx)(re,{})]})}},hC=({onComplete:e,onReset:t,onClose:o})=>{let[r,n]=(0,Vt.useState)(""),[i,a]=(0,Vt.useState)(!1),[l,s]=(0,Vt.useState)("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:m}=ui(),{app:y,data:g,currentScreen:v,navigate:b,setModalData:T}=_();function x(){g?.mfaEnrollmentFlow?.onSuccess(),e()}async function E({qualifiedPhoneNumber:W}){try{await c({phoneNumber:W}),n(W),s("verify")}catch(S){T({mfaEnrollmentFlow:g?.mfaEnrollmentFlow?{...g?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:S,previousScreen:v||"MFA_ENROLLMENT_FLOW_SCREEN"}}),b("ERROR_SCREEN")}}async function A(W){try{if(!W)return;await m({phoneNumber:r,mfaCode:W}),a(!0)}catch(S){throw vc(S)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Jr(S)?new Error("The code you entered is not valid"):Yr(S)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):wc(S)?new Error("Verification canceled"):new Error("Unknown error")}}function I(){l==="verify"?s("enroll"):t()}return l==="enroll"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{backFn:t,onClose:o},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{children:(0,u.jsx)(pl.default,{})})}),(0,u.jsx)(Le,{children:"Set up SMS verification"}),(0,u.jsx)(Re,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,u.jsxs)(Ar,{children:[(0,u.jsx)(si,{onSubmit:E}),(0,u.jsxs)(Lu,{children:["By providing your mobile number, you agree to receive text messages from ",y?.name,". Some carrier charges may apply"]})]}),(0,u.jsx)(re,{})]}):i?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{onClose:x},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{status:"success",children:(0,u.jsx)(Gc.default,{})})}),(0,u.jsx)(Le,{children:"SMS verification added"}),(0,u.jsx)(Re,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,u.jsx)(kr,{children:(0,u.jsx)(F,{onClick:x,children:"Done"})}),(0,u.jsx)(re,{})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{backFn:I,onClose:o},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{children:(0,u.jsx)(pl.default,{})})}),(0,u.jsx)(Le,{children:"Enter enrollment code"}),(0,u.jsxs)(Ar,{children:[(0,u.jsx)(pi,{onChange:A}),(0,u.jsxs)(Re,{children:["To continue, enter the 6-digit code sent to ",(0,u.jsx)("strong",{children:Ph(r)})]})]}),(0,u.jsx)(re,{})]})},yC=({onComplete:e,onClose:t,onReset:o})=>{let[r,n]=(0,Vt.useState)("enroll"),[i,a]=(0,Vt.useState)(null),[l,s]=(0,Vt.useState)(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:m}=ui(),{data:y}=_();(0,Vt.useEffect)(()=>{a(null),c().then(x=>{a(x)}).catch(()=>{a(null),o()})},[]);function g(){y?.mfaEnrollmentFlow?.onSuccess(),e()}function v(){n("verify")}async function b(x){try{if(!x)return;await m({mfaCode:x}),s(!0)}catch(E){throw vc(E)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Jr(E)?new Error("The code you entered is not valid"):Yr(E)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):wc(E)?new Error("Verification canceled"):new Error("Unknown error")}}function T(){r==="verify"?n("enroll"):o()}return r==="enroll"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{backFn:o,onClose:t},"header"),(0,u.jsx)(Le,{children:"Scan QR code"}),(0,u.jsx)(Re,{children:"Open your authenticator app and scan the QR code to continue."}),(0,u.jsx)(As,{children:i?.authUrl?(0,u.jsx)(sy,{authUrl:i.authUrl,size:200}):(0,u.jsx)(Zt,{})}),(0,u.jsxs)(kr,{children:[(0,u.jsx)(oo,{children:i?.secret&&(0,u.jsx)(oi,{itemName:"secret",text:i.secret})}),(0,u.jsx)(F,{onClick:v,children:"Continue"})]}),(0,u.jsx)(re,{})]}):l?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{onClose:g},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{status:"success",children:(0,u.jsx)(Gc.default,{})})}),(0,u.jsx)(Le,{children:"Authenticator app verification added"}),(0,u.jsx)(Re,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,u.jsx)(kr,{children:(0,u.jsx)(F,{onClick:g,children:"Done"})}),(0,u.jsx)(re,{})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k,{backFn:T,onClose:t},"header"),(0,u.jsx)(st,{children:(0,u.jsx)(bt,{children:(0,u.jsx)(Vc.default,{})})}),(0,u.jsx)(Le,{children:"Enter enrollment code"}),(0,u.jsx)(Ar,{children:(0,u.jsx)(pi,{onChange:b})}),(0,u.jsxs)(Re,{children:["To continue, enter the 6-digit code generated from your ",(0,u.jsx)("strong",{children:"authenticator app"})]}),(0,u.jsx)(re,{})]})};var Qy=f(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),Zy=f(require("@heroicons/react/24/outline/PhoneIcon")),Xy=f(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),eg=f(require("@heroicons/react/24/solid/PhoneIcon")),tg=f(require("@heroicons/react/24/solid/ShieldCheckIcon")),bi=require("react");var Yy=require("@ethersproject/providers"),cn=require("react"),Jy=f(require("styled-components"));var Jc=f(require("styled-components"));var zc=f(require("styled-components")),ra=require("react/jsx-runtime"),ul=({label:e,children:t,valueStyles:o})=>(0,ra.jsxs)(gC,{children:[(0,ra.jsx)("div",{children:e}),(0,ra.jsx)(vC,{style:{...o},children:t})]}),gC=zc.default.div`
|
|
1943
1943
|
display: flex;
|
|
1944
1944
|
align-items: center;
|
|
1945
1945
|
justify-content: space-between;
|
|
@@ -1954,7 +1954,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1954
1954
|
color: var(--privy-color-foreground-2);
|
|
1955
1955
|
text-align: right;
|
|
1956
1956
|
}
|
|
1957
|
-
`,
|
|
1957
|
+
`,vC=zc.default.div`
|
|
1958
1958
|
font-size: 14px;
|
|
1959
1959
|
line-height: 100%;
|
|
1960
1960
|
display: flex;
|
|
@@ -1963,28 +1963,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1963
1963
|
border-radius: var(--privy-border-radius-full);
|
|
1964
1964
|
background-color: var(--privy-color-background-2);
|
|
1965
1965
|
padding: 4px 8px;
|
|
1966
|
-
`;var
|
|
1966
|
+
`;var ia=f(require("styled-components"));var $c=require("@ethersproject/bignumber"),qc=require("@ethersproject/units");var na=(e,t)=>{let o=(t*parseFloat((0,qc.formatEther)(e))).toFixed(2);return o!=="0.00"?`$${o}`:"<$0.01"},zo=(e,t,o=6,r=!1)=>{let i=parseFloat((0,qc.formatEther)(e)).toFixed(o).replace(/0+$/,"").replace(/\.$/,"");return r?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},jc=e=>e.map(dt).reduce((t,o)=>t.add(o),$c.BigNumber.from(0)).toHexString(),hy=(e,t)=>{let{chains:o}=M(),r=`https://etherscan.io/address/${t}`,n=`${bp(e,o)}/address/${t}`;if(!n)return r;try{new URL(n)}catch{return r}return n},dt=e=>$c.BigNumber.from(e);var $o=require("react/jsx-runtime"),yy=({weiQuantities:e,tokenPrice:t,tokenSymbol:o})=>{let r=jc(e),n=t?na(r,t):void 0,i=zo(r,o);return(0,$o.jsx)(gy,{children:n||i})},Kc=({weiQuantities:e,tokenPrice:t,tokenSymbol:o})=>{let r=jc(e),n=t?na(r,t):void 0,i=zo(r,o);return(0,$o.jsx)(gy,{children:n?(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)(wC,{children:"USD"}),n==="<$0.01"?(0,$o.jsxs)(bC,{children:[(0,$o.jsx)(CC,{children:"<"}),"$0.01"]}):n]}):i})},gy=ia.default.span`
|
|
1967
1967
|
font-size: 14px;
|
|
1968
1968
|
line-height: 140%;
|
|
1969
1969
|
display: flex;
|
|
1970
1970
|
gap: 4px;
|
|
1971
1971
|
align-items: center;
|
|
1972
|
-
`,
|
|
1972
|
+
`,wC=ia.default.span`
|
|
1973
1973
|
font-size: 12px;
|
|
1974
1974
|
line-height: 12px;
|
|
1975
1975
|
color: var(--privy-color-foreground-3);
|
|
1976
|
-
`,
|
|
1976
|
+
`,CC=ia.default.span`
|
|
1977
1977
|
font-size: 10px;
|
|
1978
|
-
`,
|
|
1978
|
+
`,bC=ia.default.span`
|
|
1979
1979
|
display: flex;
|
|
1980
1980
|
align-items: center;
|
|
1981
|
-
`;var
|
|
1981
|
+
`;var ml=f(require("styled-components"));var Wt=require("react/jsx-runtime"),vy=({gas:e,tokenPrice:t,tokenSymbol:o})=>(0,Wt.jsxs)(pc,{style:{paddingBottom:"12px"},children:[(0,Wt.jsxs)(Cy,{children:[(0,Wt.jsx)(Ey,{children:"Est. Fees"}),(0,Wt.jsx)("div",{children:(0,Wt.jsx)(Kc,{weiQuantities:[e],tokenPrice:t,tokenSymbol:o})})]}),t&&(0,Wt.jsx)(by,{children:`${zo(e,o)}`})]}),wy=({transactionData:e,gas:t,tokenPrice:o,tokenSymbol:r})=>{let n=dt(e.value||0).add(dt(t)).toHexString();return(0,Wt.jsxs)(pc,{children:[(0,Wt.jsxs)(Cy,{children:[(0,Wt.jsx)(Ey,{children:"Total (including fees)"}),(0,Wt.jsx)("div",{children:(0,Wt.jsx)(Kc,{weiQuantities:[e.value||0,t],tokenPrice:o,tokenSymbol:r})})]}),o&&(0,Wt.jsx)(by,{children:zo(n,r)})]})},Cy=ml.default.div`
|
|
1982
1982
|
display: flex;
|
|
1983
1983
|
flex-direction: row;
|
|
1984
1984
|
justify-content: space-between;
|
|
1985
1985
|
align-items: center;
|
|
1986
1986
|
padding-top: 4px;
|
|
1987
|
-
`,
|
|
1987
|
+
`,by=ml.default.div`
|
|
1988
1988
|
display: flex;
|
|
1989
1989
|
flex-direction: row;
|
|
1990
1990
|
height: 12px;
|
|
@@ -1993,23 +1993,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1993
1993
|
line-height: 12px;
|
|
1994
1994
|
color: var(--privy-color-foreground-3);
|
|
1995
1995
|
font-weight: 400;
|
|
1996
|
-
`,
|
|
1996
|
+
`,Ey=ml.default.div`
|
|
1997
1997
|
font-size: 14px;
|
|
1998
1998
|
line-height: 22.4px;
|
|
1999
1999
|
font-weight: 400;
|
|
2000
|
-
`;var
|
|
2000
|
+
`;var Ty=f(require("@heroicons/react/24/outline/ChevronDownIcon")),qo=require("react"),ur=f(require("styled-components"));var fl=require("react"),mi=(0,fl.createContext)(void 0);var aa=(0,fl.createContext)(void 0);var ot=require("react/jsx-runtime"),Py=({defaultValue:e,children:t})=>{let[o,r]=(0,qo.useState)(e||null),n=i=>{r(o===i?null:i)};return(0,ot.jsx)(mi.Provider,{value:{activePanel:o,togglePanel:n},children:(0,ot.jsx)(EC,{children:t})})},xy=({value:e,children:t})=>{let{activePanel:o,togglePanel:r}=(0,qo.useContext)(mi),n=o===e;return(0,ot.jsx)(aa.Provider,{value:{onToggle:()=>r(e),value:e},children:(0,ot.jsx)(SC,{isActive:n,"data-open":n,children:t})})},Sy=({children:e})=>{let{activePanel:t}=(0,qo.useContext)(mi),{onToggle:o,value:r}=(0,qo.useContext)(aa),n=t===r;return(0,ot.jsxs)(ot.Fragment,{children:[(0,ot.jsxs)(TC,{onClick:o,"data-open":n,children:[(0,ot.jsx)(xC,{children:e}),(0,ot.jsx)(AC,{isactive:n,children:(0,ot.jsx)(Ty.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,ot.jsx)(PC,{})]})},_y=({children:e})=>{let{activePanel:t}=(0,qo.useContext)(mi),{value:o}=(0,qo.useContext)(aa);return(0,ot.jsx)(_C,{"data-open":t===o,children:(0,ot.jsx)(ky,{children:e})})},Ay=({children:e})=>{let{activePanel:t}=(0,qo.useContext)(mi),{value:o}=(0,qo.useContext)(aa);return(0,ot.jsx)(ky,{children:typeof e=="function"?e({isActive:t===o}):e})},EC=ur.default.div`
|
|
2001
2001
|
display: flex;
|
|
2002
2002
|
flex-direction: column;
|
|
2003
2003
|
width: 100%;
|
|
2004
2004
|
gap: 8px;
|
|
2005
|
-
`,
|
|
2005
|
+
`,TC=ur.default.div`
|
|
2006
2006
|
display: flex;
|
|
2007
2007
|
justify-content: space-between;
|
|
2008
2008
|
align-items: center;
|
|
2009
2009
|
width: 100%;
|
|
2010
2010
|
cursor: pointer;
|
|
2011
2011
|
padding-bottom: 8px;
|
|
2012
|
-
`,
|
|
2012
|
+
`,PC=ur.default.div`
|
|
2013
2013
|
width: 100%;
|
|
2014
2014
|
|
|
2015
2015
|
&& {
|
|
@@ -2017,13 +2017,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2017
2017
|
border-color: var(--privy-color-foreground-4);
|
|
2018
2018
|
}
|
|
2019
2019
|
padding-bottom: 12px;
|
|
2020
|
-
`,
|
|
2020
|
+
`,xC=ur.default.div`
|
|
2021
2021
|
font-size: 14px;
|
|
2022
2022
|
font-weight: 500;
|
|
2023
2023
|
line-height: 19.6px;
|
|
2024
2024
|
width: 100%;
|
|
2025
2025
|
padding-right: 8px;
|
|
2026
|
-
`,
|
|
2026
|
+
`,SC=ur.default.div`
|
|
2027
2027
|
display: flex;
|
|
2028
2028
|
flex-direction: column;
|
|
2029
2029
|
width: 100%;
|
|
@@ -2035,7 +2035,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2035
2035
|
border-color: var(--privy-color-foreground-4);
|
|
2036
2036
|
border-radius: var(--privy-border-radius-md);
|
|
2037
2037
|
}
|
|
2038
|
-
`,
|
|
2038
|
+
`,_C=ur.default.div`
|
|
2039
2039
|
position: relative;
|
|
2040
2040
|
overflow: hidden;
|
|
2041
2041
|
transition: max-height 25ms ease-out;
|
|
@@ -2047,38 +2047,38 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2047
2047
|
&[data-open='false'] {
|
|
2048
2048
|
max-height: 0;
|
|
2049
2049
|
}
|
|
2050
|
-
`,
|
|
2050
|
+
`,ky=ur.default.div`
|
|
2051
2051
|
display: flex;
|
|
2052
2052
|
flex-direction: column;
|
|
2053
2053
|
gap: 12px;
|
|
2054
2054
|
flex: 1 1 auto;
|
|
2055
2055
|
min-height: 1px;
|
|
2056
|
-
`,
|
|
2056
|
+
`,AC=ur.default.div`
|
|
2057
2057
|
transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
|
|
2058
|
-
`;var
|
|
2058
|
+
`;var Ry=f(require("styled-components"));var Iy=require("react/jsx-runtime"),Yc=({walletAddress:e,chainId:t=Zo})=>(0,Iy.jsx)(kC,{href:hy(t,e),target:"_blank",children:Cr(e)}),kC=Ry.default.a`
|
|
2059
2059
|
&:hover {
|
|
2060
2060
|
text-decoration: underline;
|
|
2061
2061
|
}
|
|
2062
|
-
`;var Ze=require("react/jsx-runtime"),fi=({from:e,to:t,txn:o,transactionInfo:r,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=o?.value||0;return(0,Ze.jsx)(
|
|
2062
|
+
`;var Ze=require("react/jsx-runtime"),fi=({from:e,to:t,txn:o,transactionInfo:r,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=o?.value||0;return(0,Ze.jsx)(Py,{children:(0,Ze.jsxs)(xy,{value:"details",children:[(0,Ze.jsx)(Sy,{children:(0,Ze.jsxs)(RC,{children:[(0,Ze.jsx)("div",{children:r?.title||r?.actionDescription||"Details"}),(0,Ze.jsx)(IC,{children:(0,Ze.jsx)(yy,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),(0,Ze.jsxs)(_y,{children:[(0,Ze.jsx)(ul,{label:"From",children:(0,Ze.jsx)(Yc,{walletAddress:e,chainId:o.chainId||Zo})}),(0,Ze.jsx)(ul,{label:"To",children:(0,Ze.jsx)(Yc,{walletAddress:t,chainId:o.chainId||Zo})}),r&&r.action&&(0,Ze.jsx)(ul,{label:"Action",children:r.action}),i&&(0,Ze.jsx)(vy,{transactionData:o,gas:i,tokenPrice:n,tokenSymbol:a})]}),(0,Ze.jsx)(Ay,{children:({isActive:s})=>(0,Ze.jsx)(wy,{transactionData:o,displayFee:s,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},RC=Jc.default.div`
|
|
2063
2063
|
display: flex;
|
|
2064
2064
|
flex-direction: row;
|
|
2065
2065
|
justify-content: space-between;
|
|
2066
|
-
`,
|
|
2066
|
+
`,IC=Jc.default.div`
|
|
2067
2067
|
flex-shrink: 0;
|
|
2068
2068
|
padding-left: 8px;
|
|
2069
|
-
`;var hi=f(require("styled-components")),
|
|
2069
|
+
`;var hi=f(require("styled-components")),Ur=require("react/jsx-runtime"),Qc=({description:e,contractInfo:t})=>(0,Ur.jsxs)(WC,{children:[t.imgUrl&&(0,Ur.jsx)(MC,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&(0,Ur.jsx)(NC,{children:(0,Ur.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&(0,Ur.jsx)(LC,{children:t.name}),(0,Ur.jsx)(OC,{children:e||t.actionText})]}),WC=hi.default.div`
|
|
2070
2070
|
display: flex;
|
|
2071
2071
|
flex-direction: column;
|
|
2072
2072
|
align-items: center;
|
|
2073
2073
|
margin-bottom: 8px;
|
|
2074
|
-
`,
|
|
2074
|
+
`,MC=hi.default.img`
|
|
2075
2075
|
&& {
|
|
2076
2076
|
height: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2077
2077
|
width: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2078
2078
|
border-radius: 16px;
|
|
2079
2079
|
margin-bottom: 12px;
|
|
2080
2080
|
}
|
|
2081
|
-
`,
|
|
2081
|
+
`,NC=hi.default.div`
|
|
2082
2082
|
font-size: 12px;
|
|
2083
2083
|
line-height: 12px;
|
|
2084
2084
|
padding: 7px;
|
|
@@ -2091,7 +2091,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2091
2091
|
text-decoration: underline;
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
2094
|
-
`,
|
|
2094
|
+
`,LC=hi.default.div`
|
|
2095
2095
|
font-size: 18px;
|
|
2096
2096
|
line-height: 18px;
|
|
2097
2097
|
font-weight: 500;
|
|
@@ -2099,7 +2099,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2099
2099
|
white-space: nowrap;
|
|
2100
2100
|
max-width: 275px;
|
|
2101
2101
|
text-overflow: ellipsis;
|
|
2102
|
-
`,
|
|
2102
|
+
`,OC=hi.default.div`
|
|
2103
2103
|
font-size: 16px;
|
|
2104
2104
|
line-height: 140%;
|
|
2105
2105
|
font-weight: 400;
|
|
@@ -2107,7 +2107,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2107
2107
|
overflow: hidden;
|
|
2108
2108
|
max-width: 275px;
|
|
2109
2109
|
text-overflow: ellipsis;
|
|
2110
|
-
`;var
|
|
2110
|
+
`;var Wy=f(require("@heroicons/react/24/outline/WalletIcon")),hl=f(require("styled-components"));var sn=require("react/jsx-runtime"),My=({address:e,txn:t,balance:o,hasFunds:r})=>{let n=!!o,{nativeTokenSymbolForChainId:i}=M(),a=i(t.chainId)||"ETH";return(0,sn.jsxs)(DC,{children:[(0,sn.jsxs)(UC,{children:[(0,sn.jsx)(Wy.default,{strokeWidth:"2",width:"16px",height:"16px"}),(0,sn.jsx)("div",{children:Cr(e)})]}),(0,sn.jsxs)(FC,{displayBalanceColor:n,hasFunds:r,children:[o?zo(o,a,6,!0):0," available"]})]})},DC=hl.default.div`
|
|
2111
2111
|
display: flex;
|
|
2112
2112
|
flex-direction: row;
|
|
2113
2113
|
justify-content: space-between;
|
|
@@ -2120,12 +2120,12 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2120
2120
|
border: 1px solid var(--privy-color-foreground-4);
|
|
2121
2121
|
border-radius: var(--privy-border-radius-md);
|
|
2122
2122
|
}
|
|
2123
|
-
`,
|
|
2123
|
+
`,UC=hl.default.div`
|
|
2124
2124
|
display: flex;
|
|
2125
2125
|
flex-direction: row;
|
|
2126
2126
|
align-items: center;
|
|
2127
2127
|
gap: 8px;
|
|
2128
|
-
`,
|
|
2128
|
+
`,FC=hl.default.div`
|
|
2129
2129
|
display: flex;
|
|
2130
2130
|
align-items: center;
|
|
2131
2131
|
justify-content: center;
|
|
@@ -2135,35 +2135,35 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2135
2135
|
background-color: var(--privy-color-background-2);
|
|
2136
2136
|
padding: 5px 8px;
|
|
2137
2137
|
color: ${e=>e.displayBalanceColor?e.hasFunds?"var(--privy-color-success-dark)":"var(--privy-color-error)":"inherit"};
|
|
2138
|
-
`;var
|
|
2138
|
+
`;var sa=f(require("styled-components"));var ao=require("react/jsx-runtime"),Ly=({description:e,txn:t,tokenSymbol:o,tokenPrice:r})=>{let n=t.value||0,i=r?na(n,r):void 0,a=zo(n,o);return(0,ao.jsxs)(BC,{children:[i?(0,ao.jsxs)(ao.Fragment,{children:[(0,ao.jsx)(Ny,{children:i}),(0,ao.jsx)(HC,{children:a})]}):(0,ao.jsx)(ao.Fragment,{children:(0,ao.jsx)(Ny,{children:a})}),(0,ao.jsx)(GC,{children:e})]})},BC=sa.default.div`
|
|
2139
2139
|
display: flex;
|
|
2140
2140
|
flex-direction: column;
|
|
2141
2141
|
align-items: center;
|
|
2142
2142
|
margin-bottom: 20px;
|
|
2143
|
-
`,
|
|
2143
|
+
`,Ny=sa.default.h2`
|
|
2144
2144
|
&& {
|
|
2145
2145
|
font-size: 48px;
|
|
2146
2146
|
line-height: 48px;
|
|
2147
2147
|
margin: 8px auto;
|
|
2148
2148
|
}
|
|
2149
|
-
`,
|
|
2149
|
+
`,HC=sa.default.p`
|
|
2150
2150
|
margin-bottom: 12px;
|
|
2151
2151
|
&& {
|
|
2152
2152
|
font-size: 17px;
|
|
2153
2153
|
line-height: 17px;
|
|
2154
2154
|
color: var(--privy-color-foreground-3);
|
|
2155
2155
|
}
|
|
2156
|
-
`,
|
|
2156
|
+
`,GC=sa.default.div`
|
|
2157
2157
|
font-size: 16px;
|
|
2158
2158
|
line-height: 22.4px;
|
|
2159
2159
|
font-weight: 400;
|
|
2160
2160
|
overflow: hidden;
|
|
2161
2161
|
max-width: 275px;
|
|
2162
2162
|
text-overflow: ellipsis;
|
|
2163
|
-
`;var
|
|
2163
|
+
`;var jy=require("@ethersproject/abstract-signer"),$C=require("@ethersproject/providers");var Zc=require("@ethersproject/bignumber");var ln=require("@ethersproject/bignumber"),Oy=require("@ethersproject/contracts"),Dy=require("@ethersproject/transactions");var yi=e=>[qa.id,ja.id,Ka.id,Ja.id,Qa.id,Za.id,Xa.id,ts.id,es.id].includes(e),Uy=async(e,t)=>{if(!yi(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=ln.BigNumber.from(o).mul(ln.BigNumber.from(126)).div(ln.BigNumber.from(100)).add(ln.BigNumber.from(e.maxPriorityFeePerGas));e.maxFeePerGas=la(i)}}catch(o){throw new Error(`Failed to set gas price for OP stack transaction: ${o}.`)}return e};async function Fy(e,t){if(!e.chainId||e.chainId&&!yi(e.chainId))return ln.BigNumber.from(0);let o=ln.BigNumber.from(0);try{let r=new Oy.Contract(cp,dp,t),n=By(e),i=(0,Dy.serialize)(n);o=await r.getL1Fee(i)}catch{}return o}async function Hy(e,t){return delete e.from,(await t.estimateGas(e)).toHexString()}var Gy=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 gi(e,t){if(!e.gasLimit)throw new Me("gasLimit was not successfully set for transaction.");let o=dt(e.gasLimit),r=Zc.BigNumber.from(0);if(e.type==2)if(e.maxFeePerGas)r=dt(e.maxFeePerGas);else throw new Me("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)r=dt(e.gasPrice);else throw new Me("gasPrice was not successfully set for transaction of type 0 or 1.");let n=o.mul(r),i=Zc.BigNumber.from(0);if(e.chainId&&yi(e.chainId))try{i=await Fy(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}var yl=require("@ethersproject/bignumber");var Xc=e=>[Va.id,za.id,$a.id].includes(e),Vy=async(e,t)=>{if(!Xc(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(yl.BigNumber.from(120)).div(yl.BigNumber.from(100));e.maxFeePerGas=la(r),e.maxPriorityFeePerGas=la(yl.BigNumber.from(0))}}catch(o){throw new Error(`Failed to set gas price for Arbitrum transaction: ${o}.`)}return e};var ed=e=>[56,97].includes(e),zy=async(e,t)=>{if(!ed(e.chainId))throw new Error("Invalid chain ID for BSC gas estimation.");if(e.type===void 0?e.type=0:(e.type==1||e.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!e.gasPrice){let o=await t.getFeeData();e.gasPrice=o.gasPrice?.toHexString()}return e};var od=require("@ethersproject/units"),$y=require("ofetch");var rd=e=>[Mi.id,Ni.id].includes(e),td=e=>({maxPriorityFee:(0,od.parseUnits)(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:(0,od.parseUnits)(e.maxFee.toFixed(9),"gwei").toHexString()}),VC=e=>({safeLow:td(e.safeLow),standard:td(e.standard),fast:td(e.fast)}),zC=async e=>{let t="";switch(e){case Mi.id:t="https://gasstation.polygon.technology/v2";break;case Ni.id:t="https://gasstation-testnet.polygon.technology/v2";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return VC(await(0,$y.ofetch)(t))};async function qy(e){if(!rd(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 zC(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 la(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 By(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=dt(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=dt(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=dt(e.gasPrice)),e.value!==void 0&&(t.value=dt(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=dt(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=dt(e.maxPriorityFeePerGas)),t}async function vi(e,t,o){if(t.chainId=Number(t.chainId),Ky(t),!t.nonce){let r=new jy.VoidSigner(e,o);t.nonce=await r.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await Hy(t,o)),t.from||(t.from=e),rd(t.chainId)?t=await qy(t):Xc(t.chainId)?t=await Vy(t,o):yi(t.chainId)?t=await Uy(t,o):ed(t.chainId)?t=await zy(t,o):t=await Gy(t,o),t}async function gl(e,t,o,r,n){r=Object.assign({chainId:Zo},r),Ky(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 vl(e,t,o,r){let n=await r.getBalance(e),i=t.value||0,l=!n.sub(dt(i)).sub(o).isNegative();return{balance:n,hasSufficientFunds:l}}function Ky(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let o of t){let r=e[o];if(!(typeof r>"u")&&!qC(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 qC(e){let t=typeof e=="number",o=typeof e=="bigint",r=typeof e=="string"&&jC(e);return t||o||r}function jC(e){return/^-?0x[a-f0-9]+$/i.test(e)}function wl(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var wi=require("react");var Cl=e=>{let{showFiatPrices:t,getUsdTokenPrice:o,chains:r}=M(),[n,i]=(0,wi.useState)(!0),[a,l]=(0,wi.useState)(void 0),[s,c]=(0,wi.useState)(void 0);return(0,wi.useEffect)(()=>{let m=e.chainId||Zo,y=r.find(v=>v.id===Number(m));if(!y)throw new Z(`Unsupported chain: ${m}`);(async()=>{if(!t){i(!1);return}try{i(!0);let v=await o(y);v?c(v):l(new Error(`Unable to fetch token price on chain id ${y.id}`))}catch(v){l(v)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var bl=require("react"),nd=(0,bl.createContext)(null);function Ci(){let e=(0,bl.useContext)(nd);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var id=require("react/jsx-runtime"),ad=({pendingTransaction:e})=>{let{getAccessToken:t}=G(),{wallets:o}=Ci(),{walletProxy:r,rpcConfig:n,chains:i,nativeTokenSymbolForChainId:a}=M(),[l,s]=(0,cn.useState)(null),[c,m]=(0,cn.useState)(e),{tokenPrice:y}=Cl(c),g=a(e.chainId)||"ETH",v=(0,cn.useMemo)(()=>o.find(b=>b.walletClientType==="privy"),[o]);return(0,cn.useEffect)(()=>{async function b(){if(!await t()||!r||!v)return c;let x=new Yy.StaticJsonRpcProvider(uo(c.chainId,i,n)),E=await vi(v.address,c,x),{totalGasEstimate:A}=await gi(E,x);return s(A.toHexString()),E}b().then(T=>{m(T)})},[r]),v?(0,id.jsx)(KC,{children:(0,id.jsx)(fi,{from:v.address,to:c.to,txn:c,gas:l??void 0,tokenPrice:y,tokenSymbol:g})}):null},KC=Jy.default.div`
|
|
2164
2164
|
width: 100%;
|
|
2165
2165
|
padding: 1rem 0;
|
|
2166
|
-
`;var q=require("react/jsx-runtime"),
|
|
2166
|
+
`;var q=require("react/jsx-runtime"),sd=({open:e,onClose:t})=>{let{user:o}=G(),[r,n]=(0,bi.useState)(null),{init:i,cancel:a}=an();(0,bi.useEffect)(()=>{e&&o?.mfaMethods&&o.mfaMethods.length>0?l(o.mfaMethods[0]):n(null)},[o?.mfaMethods,e]);async function l(c){try{n(c),await i(c)}catch(m){console.error(m)}}let s=()=>{n(null),a(),t()};return!e||!o?null:r?(0,q.jsx)(YC,{selectedMethod:r,onClose:s,onBack:o.mfaMethods.length>1?()=>n(null):void 0}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(k,{onClose:s},"header"),(0,q.jsx)(st,{children:(0,q.jsx)(bt,{children:(0,q.jsx)(tg.default,{})})}),(0,q.jsx)(Le,{children:"Verify your identity"}),(0,q.jsx)(Re,{children:"Choose a verification method"}),(0,q.jsxs)(bs,{children:[o.mfaMethods.includes("totp")&&(0,q.jsxs)(Ne,{onClick:()=>l("totp"),children:[(0,q.jsx)(Qy.default,{}),"Authenticator App"]},"totp"),o.mfaMethods.includes("sms")&&(0,q.jsxs)(Ne,{onClick:()=>l("sms"),children:[(0,q.jsx)(Zy.default,{}),"SMS"]},"sms")]}),(0,q.jsx)(re,{})]})},YC=({selectedMethod:e,onClose:t,onBack:o})=>{let{app:r}=_(),{pendingTransaction:n}=M(),[i,a]=(0,bi.useState)(!1),[l,s]=(0,bi.useState)(!1),{submit:c}=an();async function m(y){try{if(!y)return;await c(e,y),s(!0),a(!1),t()}catch(g){throw Is(g)?(a(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Jr(g)?(a(!1),new Error("The code you entered is not valid")):Yr(g)?(a(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(a(!1),new Error("Unknown error"))}}switch(e){case"sms":return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(k,{onClose:t},"header"),(0,q.jsx)(st,{children:(0,q.jsx)(bt,{children:(0,q.jsx)(eg.default,{})})}),(0,q.jsx)(Le,{children:"Enter verification code"}),(0,q.jsxs)(Ar,{children:[(0,q.jsx)(pi,{success:l,disabled:i,onChange:m}),(0,q.jsxs)(Re,{children:["To continue, please enter the 6-digit code sent to your ",(0,q.jsx)("strong",{children:"mobile device"})]}),n&&(0,q.jsx)(ad,{pendingTransaction:n})]}),o&&(0,q.jsx)(lc,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),(0,q.jsx)(yo,{onClick:t,children:"Not now"}),(0,q.jsx)(re,{})]});case"totp":return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(k,{onClose:t},"header"),(0,q.jsx)(st,{children:(0,q.jsx)(bt,{children:(0,q.jsx)(Xy.default,{})})}),(0,q.jsx)(Le,{children:"Enter verification code"}),(0,q.jsxs)(Ar,{children:[(0,q.jsx)(pi,{success:l,disabled:i,onChange:m}),(0,q.jsxs)(Re,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,q.jsx)("strong",{children:"authenticator app"})]}),n&&(0,q.jsx)(ad,{pendingTransaction:n})]}),o&&(0,q.jsx)(lc,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),(0,q.jsx)(yo,{onClick:t,children:"Not now"}),(0,q.jsx)(re,{})]});default:return null}};var Ei=require("react"),cd=f(require("styled-components"));function ld(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Xe=require("react/jsx-runtime"),og={google:{name:"Google",component:Xs},discord:{name:"Discord",component:Qs},github:{name:"Github",component:Zs},linkedin:{name:"LinkedIn",component:el},twitter:{name:"Twitter",component:rl},spotify:{name:"Spotify",component:tl},tiktok:{name:"Tiktok",component:ol},apple:{name:"Apple",component:Js}},El=()=>{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"),po.del(wn),window.history.pushState({},"",e)},rg=()=>{let{ready:e,user:t,authenticated:o}=G(),{app:r,setModalData:n,navigate:i,resetNavigation:a}=_(),{getAuthMeta:l,initLoginWithOAuth:s,loginWithOAuth:c,updateWallets:m,setReadyToTrue:y,closePrivyModal:g}=M(),[v,b]=(0,Ei.useState)(!1),[T,x]=(0,Ei.useState)(void 0),E=l()?.provider||"google",A=og[E].name,I=og[E].component,W=r?.render.inDialog?gt:0;(0,Ei.useEffect)(()=>{c(E).then(()=>{El(),b(!0)}).catch(D=>{let B={retryable:!1,message:"Authentication failed"};if(D?.privyErrorCode==="allowlist_rejected"){x(void 0),a(),i("ALLOWLIST_REJECTION_SCREEN"),El();return}else D?.privyErrorCode==="linked_to_another_user"?B.detail="This account has already been linked to another user.":D?.privyErrorCode==="invalid_credentials"?(B.retryable=!0,B.detail="Something went wrong. Try again."):D.privyErrorCode==="oauth_user_denied"?(B.detail=`Retry and check ${ld(E)} to finish connecting your account.`,B.retryable=!0):D?.privyErrorCode==="too_many_requests"?B.detail="Too many requests. Please wait before trying again.":D?.privyErrorCode==="oauth_account_suspended"&&(B.detail=`Your ${A} account is suspended. Please try another login method.`);El(),x(B)}).finally(()=>{y()})},[A,E]),(0,Ei.useEffect)(()=>{if(e&&o&&v&&t){if(r?.legal.requireUsersAcceptTerms&&!t.hasAcceptedTerms){let B=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},W);return()=>clearTimeout(B)}if(jt(t,r?.embeddedWallets?.createOnLogin)){let B=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:V=>console.error(V),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},W);return()=>clearTimeout(B)}else{let B=setTimeout(g,W);return m(),()=>clearTimeout(B)}}},[e,o,v,t]);let S=v?`Successfully connected with ${A}`:T?T.message:`Verifying connection to ${A}`,O="";return v?O="You\u2019re good to go!":T?O=T.detail:O="Just a few moments more",(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(k,{}),(0,Xe.jsx)(X,{}),(0,Xe.jsxs)(JC,{children:[(0,Xe.jsx)(QC,{children:(0,Xe.jsxs)("div",{children:[(0,Xe.jsx)(_r,{success:v,fail:!!T}),(0,Xe.jsx)(I,{style:{width:"38px",height:"38px"}})]})}),(0,Xe.jsxs)(ro,{children:[(0,Xe.jsx)("h3",{children:S}),(0,Xe.jsx)("p",{children:O})]}),T&&T?.retryable?(0,Xe.jsx)(gs,{onClick:()=>{El(),s(E),x(void 0)},disabled:!v&&!T?.retryable,children:"Retry"}):null]}),(0,Xe.jsx)(ee,{}),(0,Xe.jsx)(re,{})]})},JC=cd.default.div`
|
|
2167
2167
|
display: flex;
|
|
2168
2168
|
flex-direction: column;
|
|
2169
2169
|
align-items: center;
|
|
@@ -2171,7 +2171,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2171
2171
|
margin-left: 27px;
|
|
2172
2172
|
margin-right: 27px;
|
|
2173
2173
|
gap: 24px;
|
|
2174
|
-
`,
|
|
2174
|
+
`,QC=cd.default.div`
|
|
2175
2175
|
display: flex;
|
|
2176
2176
|
flex-direction: column;
|
|
2177
2177
|
justify-content: center;
|
|
@@ -2194,55 +2194,55 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2194
2194
|
left: -19px;
|
|
2195
2195
|
top: -19px;
|
|
2196
2196
|
}
|
|
2197
|
-
`;var
|
|
2197
|
+
`;var ca=require("react"),ag=f(require("styled-components"));var ng=require("react-device-detect");var ig=(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(!wr()&&ng.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`};var Tt=require("react/jsx-runtime"),sg=()=>{let{forkSession:e,ready:t,authenticated:o}=G(),[r,n]=(0,ca.useState)(""),[i,a]=(0,ca.useState)(!1);(0,ca.useEffect)(()=>{t&&o&&e().then(n)},[t,o]);let l=ig(r,!i),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)(k,{},"header"),(0,Tt.jsx)(X,{}),(0,Tt.jsx)(Oo,{title:s.title,description:s.description}),(0,Tt.jsxs)(to,{children:[(0,Tt.jsx)(ZC,{children:(0,Tt.jsx)(Wo,{style:{width:"72px",height:"72px"}})}),(0,Tt.jsx)(ys,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?(0,Tt.jsx)("p",{children:s.footnote}):null]}),(0,Tt.jsx)(ee,{}),(0,Tt.jsx)($,{protectedByPrivy:!0})]})},ZC=(0,ag.default)(oo)`
|
|
2198
2198
|
margin: 16px auto;
|
|
2199
|
-
`;var
|
|
2199
|
+
`;var dd=require("@ethersproject/bignumber"),ug=require("@ethersproject/providers"),$e=require("react"),dn=f(require("styled-components"));function lg(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var Tl=require("@ethersproject/bignumber"),cg=f(require("styled-components"));var jo=require("react/jsx-runtime"),XC=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let o=Tl.BigNumber.from(e.gasUsed),r=Tl.BigNumber.from(e.effectiveGasPrice),n=o.mul(r);if(t){let i=Tl.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},dg=({txn:e,receipt:t,transactionInfo:o,onClose:r,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a})=>(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(k,{onClose:r}),(0,jo.jsx)(Oi,{title:"Transaction complete!",description:"You're all set."}),(0,jo.jsx)(fi,{tokenPrice:n,from:t.from,to:t.to,gas:XC(t,a),txn:e,transactionInfo:o,tokenSymbol:i}),(0,jo.jsx)(eb,{loading:!1,onClick:r,children:"All Done"}),(0,jo.jsx)(re,{})]}),eb=(0,cg.default)(F)`
|
|
2200
2200
|
&& {
|
|
2201
2201
|
margin-top: 24px;
|
|
2202
2202
|
}
|
|
2203
2203
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2204
|
-
`;var he=require("react/jsx-runtime");var
|
|
2204
|
+
`;var he=require("react/jsx-runtime");var tb=({txn:e,txnFamily:t,uiOptions:o,tokenSymbol:r,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(o.transactionInfo?.contractInfo)return(0,he.jsx)(Qc,{contractInfo:o.transactionInfo.contractInfo,description:o.description});if(o.senderInfo)return(0,he.jsx)(Qc,{contractInfo:o.senderInfo,description:o.description||o.senderInfo.actionText})}return(0,he.jsx)(he.Fragment,{children:(0,he.jsx)(Ly,{description:o.description||o.transactionInfo?.description||"",txn:e,tokenSymbol:r,tokenPrice:n})})},mg=()=>{let{authenticated:e,getAccessToken:t}=G(),{wallets:o}=Ci(),{walletProxy:r,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s}=M(),{app:c,navigate:m,data:y,onUserCloseViaDialogOrKeybindRef:g,setModalData:v}=_(),{transactionRequest:b,onSuccess:T,onFailure:x,uiOptions:E,fundWalletConfig:A}=y.sendTransaction,[I,W]=(0,$e.useState)(null),[S,O]=(0,$e.useState)(null),[D,B]=(0,$e.useState)(""),[V,Y]=(0,$e.useState)(),[U,j]=(0,$e.useState)(!1),R=()=>{B(""),Y(void 0)},le=(St,rt,hr)=>{B(St),Y(new Me(new Kt(rt??St,hr??it.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[pe,Q]=(0,$e.useState)(!1),[pt,Ie]=(0,$e.useState)(!0),[Pt,qe]=(0,$e.useState)(null),[ue,Jo]=(0,$e.useState)(b),{tokenPrice:so,isTokenPriceLoading:un}=Cl(ue),xt=s(b.chainId)||"ETH",[je,ko]=(0,$e.useState)(null),[mn,N]=(0,$e.useState)(null),[ut,xi]=(0,$e.useState)(!0);(0,$e.useEffect)(()=>{e||(m("LANDING"),x(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let oe=(0,$e.useMemo)(()=>o.find(St=>St.walletClientType==="privy"),[o]),$t=async()=>{if(!oe)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:St,externalTransactionId:rt}=await i(oe.address,{config:A?.config||{}});v({fiatOnRampPrompt:{signedUrl:St},fiatOnRampStatus:{externalTransactionId:rt}}),m("FIAT_ON_RAMP_PROMPT_SCREEN")},fn=(0,$e.useMemo)(()=>new ug.StaticJsonRpcProvider(uo(ue.chainId,l,a)),[ue.chainId,a]);(0,$e.useEffect)(()=>{async function St(){let rt=ue;if(!await t()||!r||!oe)return;try{rt=await vi(oe.address,ue,fn),Jo(rt)}catch(yr){le("There was an error preparing your transaction. Please try again.",yr.reason)}let Br=dd.BigNumber.from(0),Hr=dd.BigNumber.from(0);try{({totalGasEstimate:Br,l1ExecutionFeeEstimate:Hr}=await gi(rt,fn)),ko(Br.toHexString()),N(Hr.toHexString())}catch{ko(null)}try{let{balance:yr,hasSufficientFunds:ma}=await vl(oe.address,rt,Br,fn);qe(yr.toHexString()),ma||(Ie(!1),le("Wallet has insufficient funds for this transaction."),c?.fiatOnRamp.enabled&&j(!0))}catch(yr){console.warn(`Failed to fetch wallet balance with error: ${yr}`)}xi(!1)}St()},[r]);let ua=lg(ue),Si=ua==="SEND"?`Send ${xt}`:"Review transaction",fr={modalTitle:E.header||E.modalTitle||Si,buttonText:E.buttonText||"Submit"},hn=()=>{pe||(S?T(S):x(V||new Me(new Kt("The user rejected the request",it.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return g.current=hn,so===void 0&&un||ut?(0,he.jsxs)(he.Fragment,{children:[E.transactionInfo?.contractInfo?.imgUrl&&(0,he.jsx)(Ga,{src:E.transactionInfo?.contractInfo?.imgUrl}),(0,he.jsx)(k,{title:fr.modalTitle,onClose:hn}),(0,he.jsx)(pg,{children:(0,he.jsx)(Kn,{})})]}):I!==null?(0,he.jsx)(dg,{txn:ue,onClose:hn,receipt:I,transactionInfo:E.transactionInfo,tokenPrice:so,tokenSymbol:xt,l1GasEstimate:mn}):(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)(k,{title:fr.modalTitle,onClose:hn}),(0,he.jsxs)(pg,{children:[(0,he.jsxs)(ib,{children:[(0,he.jsx)(tb,{txn:ue,txnFamily:ua,uiOptions:E,tokenSymbol:xt,tokenPrice:so}),oe?(0,he.jsx)(fi,{from:oe.address,to:ue.to,txn:ue,transactionInfo:E.transactionInfo,gas:je||void 0,tokenPrice:so,tokenSymbol:xt}):null]}),(0,he.jsxs)(ab,{children:[(0,he.jsx)(ob,{children:D}),(0,he.jsx)(My,{txn:ue,address:oe?.address??"",hasFunds:pt,balance:Pt}),(0,he.jsxs)(rb,{children:[U&&(0,he.jsx)(F,{onClick:$t,children:"Add Funds"}),(0,he.jsx)(nb,{disabled:pe||!pt,loading:!r||pe,loadingText:pe?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{Q(!0);let St=await t();if(St&&!pe&&oe)try{let rt=await gl(St,oe.address,r,ue,fn);O(rt);let hr=await rt.wait();W(wl(hr)),R()}catch(rt){let hr="There was an error processing your transaction. Please contact support.";console.warn({transaction:ue,error:rt}),le(hr,rt.reason)}finally{Q(!1)}},children:fr.buttonText})]})]})]})]})},pg=dn.default.div`
|
|
2205
2205
|
display: flex;
|
|
2206
2206
|
flex-direction: column;
|
|
2207
2207
|
justify-content: space-between;
|
|
2208
2208
|
flex-grow: 1;
|
|
2209
2209
|
padding-bottom: 16px;
|
|
2210
|
-
`,
|
|
2210
|
+
`,ob=dn.default.div`
|
|
2211
2211
|
font-size: 13px;
|
|
2212
2212
|
color: var(--privy-color-error);
|
|
2213
2213
|
width: 100%;
|
|
2214
2214
|
margin-top: 16px;
|
|
2215
|
-
`,
|
|
2215
|
+
`,rb=dn.default.div`
|
|
2216
2216
|
display: flex;
|
|
2217
2217
|
direction: row;
|
|
2218
2218
|
justify-content: space-between;
|
|
2219
2219
|
align-items: center;
|
|
2220
2220
|
gap: 8px;
|
|
2221
|
-
`,
|
|
2221
|
+
`,nb=(0,dn.default)(F)`
|
|
2222
2222
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2223
|
-
`,
|
|
2223
|
+
`,ib=dn.default.div`
|
|
2224
2224
|
height: 100%;
|
|
2225
2225
|
display: flex;
|
|
2226
2226
|
flex-direction: column;
|
|
2227
2227
|
justify-content: space-evenly;
|
|
2228
2228
|
flex-grow: 1;
|
|
2229
|
-
`,
|
|
2229
|
+
`,ab=dn.default.div`
|
|
2230
2230
|
display: flex;
|
|
2231
2231
|
flex-direction: column;
|
|
2232
2232
|
gap: 8px;
|
|
2233
|
-
`;var
|
|
2233
|
+
`;var fg=require("@ethersproject/bytes"),hg=require("@ethersproject/strings"),Fr=require("react"),So=f(require("styled-components"));var de=require("react/jsx-runtime"),sb=e=>{if(!(0,fg.isHexString)(e))return e;try{return(0,hg.toUtf8String)(e)}catch{return e}},lb=e=>JSON.stringify(e,null,2),cb=({data:e})=>{let t=o=>typeof o=="object"&&o!==null?(0,de.jsx)(fb,{children:Object.entries(o).map(([r,n])=>(0,de.jsxs)("li",{children:[(0,de.jsxs)("strong",{children:[r,":"]})," ",t(n)]},r))}):(0,de.jsx)("span",{children:String(o)});return(0,de.jsx)("div",{children:t(e)})},db=e=>{let{types:t,primaryType:o,...r}=e.typedData;return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(gg,{children:(0,de.jsx)(cb,{data:r})}),(0,de.jsx)(oi,{text:lb(e.typedData),itemName:"full payload to clipboard"})," "]})},yg=()=>{let{authenticated:e}=G(),{initializeWalletProxy:t,closePrivyModal:o}=M(),{navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=_(),[a,l]=(0,Fr.useState)(!0),[s,c]=(0,Fr.useState)(""),[m,y]=(0,Fr.useState)(),[g,v]=(0,Fr.useState)(null),b=g!==null;(0,Fr.useEffect)(()=>{e||r("LANDING")},[e]),(0,Fr.useEffect)(()=>{t(bn).then(D=>{l(!1),D||(c("An error has occurred, please try again."),y(new Me(new Kt(s,it.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:T,data:x,confirmAndSign:E,onSuccess:A,onFailure:I,uiOptions:W}=n.signMessage,S={title:W.title||"Sign message",description:W.description||"Signing this message will not cost you any fees.",buttonText:W.buttonText||"Sign and continue"},O=D=>{D?A(D):I(m||new Me(new Kt("The user rejected the request.",it.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1}),v(null),c(""),y(void 0)};return i.current=()=>{O(g)},(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(k,{onClose:()=>O(g)}),(0,de.jsx)(X,{}),(0,de.jsxs)(pb,{children:[(0,de.jsx)(ub,{children:S.title}),(0,de.jsx)(mb,{children:S.description}),T==="personal_sign"&&(0,de.jsx)(gg,{children:sb(x)}),T==="eth_signTypedData_v4"&&(0,de.jsx)(db,{typedData:x}),(0,de.jsx)(hb,{fail:!0,children:s}),(0,de.jsx)(gb,{success:b,loading:a,disabled:b,onClick:async()=>{try{let D=await E();v(D),c(""),setTimeout(()=>{O(D)},gt)}catch{c("An error has occurred, please try again."),y(new Me(new Kt(s,it.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:b?(0,de.jsxs)(yb,{children:[(0,de.jsx)(Os,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,de.jsx)("span",{children:"Success"})]}):S.buttonText})]}),(0,de.jsx)(ee,{}),(0,de.jsx)($,{protectedByPrivy:!0})]})},pb=So.default.div`
|
|
2234
2234
|
display: flex;
|
|
2235
2235
|
flex-direction: column;
|
|
2236
2236
|
align-items: center;
|
|
2237
2237
|
justify-content: center;
|
|
2238
|
-
`,
|
|
2238
|
+
`,ub=So.default.span`
|
|
2239
2239
|
color: var(--privy-color-foreground);
|
|
2240
2240
|
text-align: center;
|
|
2241
2241
|
font-size: 1.125rem;
|
|
2242
2242
|
font-weight: 500;
|
|
2243
2243
|
line-height: 1.25rem; /* 111.111% */
|
|
2244
2244
|
text-align: center;
|
|
2245
|
-
`,
|
|
2245
|
+
`,mb=So.default.span`
|
|
2246
2246
|
margin-top: 4px;
|
|
2247
2247
|
color: var(--privy-color-foreground);
|
|
2248
2248
|
text-align: center;
|
|
@@ -2252,7 +2252,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2252
2252
|
font-weight: 400;
|
|
2253
2253
|
line-height: 20px; /* 142.857% */
|
|
2254
2254
|
letter-spacing: -0.008px;
|
|
2255
|
-
`,
|
|
2255
|
+
`,gg=So.default.div`
|
|
2256
2256
|
margin-top: 1.5rem;
|
|
2257
2257
|
background-color: var(--privy-color-background-2);
|
|
2258
2258
|
border-radius: var(--privy-border-radius-md);
|
|
@@ -2271,7 +2271,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2271
2271
|
display: none; /* Safari and Chrome */
|
|
2272
2272
|
}
|
|
2273
2273
|
}
|
|
2274
|
-
`,
|
|
2274
|
+
`,fb=So.default.ul`
|
|
2275
2275
|
margin-left: 12px !important;
|
|
2276
2276
|
white-space: nowrap;
|
|
2277
2277
|
|
|
@@ -2283,7 +2283,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2283
2283
|
font-weight: 500 !important;
|
|
2284
2284
|
}
|
|
2285
2285
|
}
|
|
2286
|
-
`,
|
|
2286
|
+
`,hb=So.default.div`
|
|
2287
2287
|
line-height: 20px;
|
|
2288
2288
|
height: 20px;
|
|
2289
2289
|
font-size: 13px;
|
|
@@ -2293,22 +2293,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2293
2293
|
width: 100%;
|
|
2294
2294
|
margin-top: 16px;
|
|
2295
2295
|
margin-bottom: 4px;
|
|
2296
|
-
`,
|
|
2296
|
+
`,yb=So.default.span`
|
|
2297
2297
|
display: flex;
|
|
2298
2298
|
align-items: center;
|
|
2299
2299
|
gap: 8px;
|
|
2300
|
-
`,
|
|
2300
|
+
`,gb=(0,So.default)(F)`
|
|
2301
2301
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2302
2302
|
|
|
2303
|
-
${e=>e.success&&
|
|
2303
|
+
${e=>e.success&&So.css`
|
|
2304
2304
|
&&&& {
|
|
2305
2305
|
background-color: var(--privy-color-success);
|
|
2306
2306
|
color: #ffffff;
|
|
2307
2307
|
}
|
|
2308
2308
|
`}
|
|
2309
|
-
`;var
|
|
2309
|
+
`;var Cg=f(require("@heroicons/react/24/outline/EnvelopeIcon"));var vg=f(require("@heroicons/react/24/outline/EnvelopeIcon")),da=require("react"),pd=f(require("styled-components"));var _o=require("react/jsx-runtime"),wg=(0,da.forwardRef)((e,t)=>{let[o,r]=(0,da.useState)(""),[n,i]=(0,da.useState)(!1),{authenticated:a,user:l}=G(),{initUpdateEmail:s}=M(),{navigate:c,setModalData:m,currentScreen:y}=_(),{enabled:g,token:v}=_e(),b=Ra(o),T=n,x=n||!b,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,o,I),c("AWAITING_PASSWORDLESS_CODE")}catch(W){m({errorModalData:{error:W,previousScreen:y||"LANDING"}})}i(!1)},A=()=>{g&&!v&&!a?(m({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,o,I)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):E(v)};return(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(vb,{children:(0,_o.jsxs)(wb,{children:[(0,_o.jsx)(vg.default,{}),(0,_o.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:I=>r(I.target.value),onKeyUp:I=>{I.key==="Enter"&&A()},value:o,autoComplete:"email"}),e.stacked?null:(0,_o.jsx)(Dn,{isSubmitting:T,onClick:A,disabled:x,children:"Submit"})]})}),e.stacked?(0,_o.jsx)(F,{loadingText:null,loading:T,disabled:x,onClick:A,children:"Submit"}):null]})}),vb=pd.default.div`
|
|
2310
2310
|
width: 100%;
|
|
2311
|
-
`,
|
|
2311
|
+
`,wb=pd.default.label`
|
|
2312
2312
|
display: block;
|
|
2313
2313
|
position: relative;
|
|
2314
2314
|
width: 100%;
|
|
@@ -2366,7 +2366,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2366
2366
|
&& > input::placeholder {
|
|
2367
2367
|
color: var(--privy-color-foreground-3);
|
|
2368
2368
|
}
|
|
2369
|
-
`;var zt=require("react/jsx-runtime"),
|
|
2369
|
+
`;var zt=require("react/jsx-runtime"),bg=()=>(0,zt.jsxs)(zt.Fragment,{children:[(0,zt.jsx)(k,{},"header"),(0,zt.jsx)(X,{}),(0,zt.jsx)(Oe,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,zt.jsx)(Cg.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,zt.jsx)(to,{children:(0,zt.jsx)(wg,{stacked:!0})}),(0,zt.jsx)(ee,{}),(0,zt.jsx)($,{protectedByPrivy:!0})]});var Pl=f(require("styled-components"));var Cb=`
|
|
2370
2370
|
*,
|
|
2371
2371
|
::before,
|
|
2372
2372
|
::after {
|
|
@@ -2596,7 +2596,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2596
2596
|
[hidden] {
|
|
2597
2597
|
display: none;
|
|
2598
2598
|
}
|
|
2599
|
-
`,
|
|
2599
|
+
`,Eg=Cb;var Tg=Pl.createGlobalStyle`
|
|
2600
2600
|
:root {
|
|
2601
2601
|
// Borders
|
|
2602
2602
|
--privy-border-radius-sm: 6px;
|
|
@@ -2628,10 +2628,10 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2628
2628
|
--privy-height-modal-full: 620px;
|
|
2629
2629
|
--privy-height-modal-compact: 480px;
|
|
2630
2630
|
};
|
|
2631
|
-
`,
|
|
2631
|
+
`,Pg=Pl.default.div`
|
|
2632
2632
|
// css normalize only the privy application to avoid conflicts
|
|
2633
2633
|
// with consuming application
|
|
2634
|
-
${
|
|
2634
|
+
${Eg}
|
|
2635
2635
|
|
|
2636
2636
|
// Privy styles
|
|
2637
2637
|
color: var(--privy-color-foreground-2);
|
|
@@ -2690,4 +2690,4 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2690
2690
|
opacity: 1;
|
|
2691
2691
|
}
|
|
2692
2692
|
}
|
|
2693
|
-
`;var Fe=require("react/jsx-runtime"),mb={["LANDING"]:Uh,["CONNECT_OR_CREATE"]:Dh,["AWAITING_PASSWORDLESS_CODE"]:zu,["AWAITING_CONNECTION"]:fm,["AWAITING_CONNECT_ONLY_CONNECTION"]:gm,["AWAITING_FARCASTER_CONNECTION"]:zf,["PHANTOM_INTERSTITIAL_SCREEN"]:Jy,["LOGIN_FAILED_SCREEN"]:$h,["AWAITING_OAUTH_SCREEN"]:qy,["ALLOWLIST_REJECTION_SCREEN"]:Mu,["INSTALL_PHANTOM_SCREEN"]:uh,["LINK_EMAIL_SCREEN"]:Bh,["LINK_PHONE_SCREEN"]:Gh,["LINK_WALLET_SCREEN"]:Vh,["UPDATE_EMAIL_SCREEN"]:pg,["CONNECT_ONLY_LANDING_SCREEN"]:pm,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:im,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:vf,["EMBEDDED_WALLET_CREATED_SCREEN"]:_m,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Pm,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:xf,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Wm,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:ag,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:rg,["FIAT_ON_RAMP_PROMPT_SCREEN"]:Xf,["FIAT_ON_RAMP_STATUS_SCREEN"]:nh,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Tf,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:wf,["MFA_ENROLLMENT_FLOW_SCREEN"]:ly,["CAPTCHA_SCREEN"]:Zu,["ERROR_SCREEN"]:Af,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:sh,["AFFIRMATIVE_CONSENT_SCREEN"]:Iu},fb=["LANDING","AWAITING_CONNECTION"],hb=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:o,isModalOpen:r}=G(),{headless:n}=M(),{ready:i,currentScreen:a}=_(),{status:l,execute:s,reset:c,enabled:m}=_e(),y=(0,gr.useRef)(null),g=gu(y),v=r&&a&&fb.includes(a)&&!n&&l==="ready";if((0,gr.useEffect)(()=>{v&&s()},[v]),(0,gr.useEffect)(()=>{!r&&m&&c()},[r,m]),(!o||!i)&&a!=="AWAITING_OAUTH_SCREEN")return(0,Fe.jsxs)(di,{children:[(0,Fe.jsx)(A,{}),(0,Fe.jsx)(X,{}),(0,Fe.jsx)(jh,{children:(0,Fe.jsx)(Zt,{})}),(0,Fe.jsx)(ee,{}),(0,Fe.jsx)(re,{})]});if(!a&&e)return(0,Fe.jsx)(di,{style:{height:g},children:(0,Fe.jsx)("div",{ref:y,children:(0,Fe.jsx)(td,{open:e,onClose:t})})});if(!a)return null;let b=mb[a];return(0,Fe.jsx)(di,{style:{height:g},children:(0,Fe.jsxs)("div",{ref:y,children:[(0,Fe.jsx)(ar,{if:!!e,children:(0,Fe.jsx)(b,{})}),(0,Fe.jsx)(ar,{if:!e,children:(0,Fe.jsx)(td,{open:e,onClose:t})})]})})},yb=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=_();return{gracefulClosePrivyModal:(0,gr.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},yg=({open:e})=>{let{app:t}=_(),{gracefulClosePrivyModal:o}=yb(),[r,n]=(0,gr.useState)(!1);ps({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=(0,Fe.jsx)(fg,{children:(0,Fe.jsx)(hb,{isMfaVerifying:r,onMfaVerificationComplete:()=>n(!1)})}),a=e||r,l=t?.render.inDialog?(0,Fe.jsx)(qh,{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 hg.default.createPortal(l,s)}return l};var Tl=require("react");var El=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 mn(e,t,o,r,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):r.current?.reject(new Ve("missing_or_invalid_mfa","MFA verification failed, retry."));let y=await new Promise((g,v)=>{o.current={resolve:g,reject:v};let b=1e3*60*5;setTimeout(()=>{let T=new Ve("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(T),v(T)},b)});return await e(y)}return await e()},s=4,c=null;for(let m=0;m<s;m++)try{c=await l(m),r.current?.resolve(void 0);break}catch(y){if(y.type==="missing_or_invalid_mfa")a=!0;else throw r.current?.resolve(void 0),y}if(c===null){let m=new Ve("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(m),m}return c}var vg=require("react/jsx-runtime"),gb=function(e){return()=>`id-${e++}`}(0);function vb(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Jo(e){return e.error!==void 0}var ko=new El,id=new Map,wb=(e,t)=>typeof t=="bigint"?t.toString():t,Cb=(e,t)=>`${e}${JSON.stringify(t,wb)}`;function Qo(e,t,o){let r=o.contentWindow;if(!r)throw new Error("iframe not initialized");let n=Cb(e,t);if(e==="privy:wallet:create"){let a=id.get(n);if(a)return a}let i=new Promise((a,l)=>{let s=gb();ko.enqueue(s,{resolve:a,reject:l}),r.postMessage({id:s,event:e,data:t},"*")}).finally(()=>{id.delete(n)});return id.set(n,i),i}function bb(e){switch(e.event){case"privy:iframe:ready":let t=ko.dequeue(e.event,e.id);return Jo(e)?t.reject(new Ve(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=ko.dequeue(e.event,e.id);return Jo(e)?o.reject(new Ve(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=ko.dequeue(e.event,e.id);return Jo(e)?r.reject(new Ve(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=ko.dequeue(e.event,e.id);return Jo(e)?n.reject(new Ve(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=ko.dequeue(e.event,e.id);return Jo(e)?i.reject(new Ve(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=ko.dequeue(e.event,e.id);return Jo(e)?a.reject(new Ve(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=ko.dequeue(e.event,e.id);return Jo(e)?l.reject(new Ve(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=ko.dequeue(e.event,e.id);return Jo(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=ko.dequeue(e.event,e.id);return Jo(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=ko.dequeue(e.event,e.id);return Jo(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function gg(e){let t=(0,Tl.useRef)(null),o=Cu();return(0,Tl.useEffect)(()=>{let r=t.current;if(!r)return;function n(c){c&&c.origin===e.origin&&vb(c.data)&&bb(c.data)}let i={create(c){return Qo("privy:wallet:create",c,r)},connect(c){return Qo("privy:wallet:connect",c,r)},recover(c){return mn(m=>Qo("privy:wallet:recover",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(c){return mn(m=>Qo("privy:wallet:rpc",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(c){return mn(m=>Qo("privy:wallet:set-recovery-password",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(c){return mn(m=>Qo("privy:mfa:verify",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(c){return mn(m=>Qo("privy:mfa:init-enrollment",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(c){return Qo("privy:mfa:submit-enrollment",c,r)},unenrollMfa(c){return mn(m=>Qo("privy:mfa:unenroll",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)}};window.addEventListener("message",n);let a=()=>e.onLoad(i),l=(...c)=>{console.warn("Privy iframe failed to load: ",...c),e.onLoadFailed()},s=new AbortController;return up(()=>Qo("privy:iframe:ready",{},r),{abortSignal:s.signal}).then(a,l),()=>{window.removeEventListener("message",n),s.abort()}},[t.current,e.mfaMethods]),(0,vg.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},src:ka(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function ad(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(r=>t.includes(r))}var Pl=class{constructor(t,o){this.meta={action:t,phoneNumber:o}}async init(){if(!this.meta.action)throw new C("action required");if(!this.api)throw new C("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new C("phone number must be set when initialzing authentication.");try{let t=Vd();await this.api.post(t,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw me(t)}}async authenticate(){if(!this.meta.action)throw new C("action required");if(!this.api)throw new C("Mfa flow has no API instance");if(!this.meta.smsCode)throw new C("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new C("phone number must be set prior to calling authenticate.");try{let t=zd(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return Lt(o)}catch(t){throw me(t)}}};var Wt=require("react/jsx-runtime"),bi;function Eb(e){return typeof e=="string"&&e.length===25}function Ke(){if(!bi){let e=de.get(zr);return Promise.resolve(e||null)}return bi.getAccessToken()}var Cg,vp=(e,t)=>Cg(e,t),bg,wp=(e,t)=>bg(e,t),Eg,Cp=(e,t)=>Eg(e,t),Tg,bp=()=>Tg(),Tb=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;de.put(Si,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},Pg=({config:e,...t})=>{if(!Eb(t.appId))throw new C("Cannot initialize the Privy provider with an invalid Privy app ID");bi||(bi=new On({appId:t.appId,apiUrl:t.apiUrl||ba}));let o=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&o.embeddedWallets?.createOnLogin===void 0&&(o.embeddedWallets||(o.embeddedWallets={}),o.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,Wt.jsx)($p,{client:bi,clientConfig:o,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,Wt.jsx)(Pb,{...t,config:o,client:bi})})},Pb=e=>{let t=e.client,[o,r]=(0,J.useState)(!1),[n,i]=(0,J.useState)(!1),[a,l]=(0,J.useState)(!1),[s,c]=(0,J.useState)(null),[m,y]=(0,J.useState)(!1),[g,v]=(0,J.useState)([]),b=(0,J.useRef)(g),[T,x]=(0,J.useState)(!1),[E,k]=(0,J.useState)(null),[I,W]=(0,J.useState)(!1),[S,O]=(0,J.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:P}),[D,B]=(0,J.useState)(null),[V,K]=(0,J.useState)(null),[U,j]=(0,J.useState)(null),R=es(),le=qp(),[ue,Q]=(0,J.useState)(!0),[ct,Ie]=(0,J.useState)({}),[Tt,qe]=(0,J.useState)(null),[ce,Zo]=(0,J.useState)(null),[lo,fn]=(0,J.useState)(!1),[Pt,je]=(0,J.useState)(!1),Ro=(0,J.useRef)(null),hn=(0,J.useRef)(null),N=(0,J.useRef)(vu);t.onStoreToken=d=>{d&&H(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{H(N,"accessToken","onAccessTokenRemoved")};let dt=(0,J.useRef)(),Ti=(0,J.useCallback)(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(w=>w.type==="wallet"&&w.walletClientType==="privy")?p&&d?.some(w=>w?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),oe=d=>{k(d),setTimeout(()=>{r(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},$t=d=>{R.embeddedWallets.createOnLogin!=="off"&&Q(!0),oe(d)};(0,J.useEffect)(()=>{if(!U||!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(U,p,R.defaultChain)}},[U,s]),(0,J.useEffect)(()=>{U&&ce?.(U)},[U]),(0,J.useEffect)(()=>{(async()=>{if(!R.customAuth?.enabled)return;Q(!0);let{getCustomAccessToken:p,isLoading:h}=R.customAuth;if(!(!n||h))try{let w=await p();if(!w){await gn.logout();return}if(a)return;t.startAuthFlow(new wn(w));let{user:L,isNewUser:Y}=await t.authenticate();L||await gn.logout(),c(L||null),x(Y||!1),l(!0),je(!0)}catch(w){console.warn(w),a&&await gn.logout()}})()},[R.customAuth?.enabled,R.customAuth?.getCustomAccessToken,R.customAuth?.isLoading,n,a]),(0,J.useEffect)(()=>{Pt&&U&&s&&Kt(s,e.config?.embeddedWallets?.createOnLogin)&&(je(!1),pa(s,En).catch(console.error))},[Pt&&U&&s]),(0,J.useEffect)(()=>{async function d(){let p=Vr();Tb();let h=(0,wg.createStore)();B(h),t.initializeConnectorManager(R.walletConnectCloudProjectId,R.rpcConfig,R.chains,R.defaultChain,h,R.appearance.walletList,R.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{yn()});let w=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!w),w&&H(N,"login","onComplete",w,!1,!0,null),c(w)),p||Ae.setReadyToTrue(),p&&w&&y(!0)}!n&&le&&d()},[t,Tt,n,le]);let Vr=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_oauth_code"),h=d.get("privy_oauth_state"),w=d.get("privy_oauth_provider");return p&&h&&w?(t.startAuthFlow(new br(w,p,h)),$t("AWAITING_OAUTH_SCREEN"),!0):!1},ca=async(d,p,h,w)=>{let L=await t.connectors?.createWalletConnector(d,p)||null;Pi(L,p,h,w)};async function Pi(d,p,h,w){if(!d)return O({status:"disconnected",connectedWallet:null,connectError:new Z("Unable to connect to wallet."),connector:null,connectRetry:P}),w?.(null,h);d instanceof Oo&&p&&await d.resetConnection(p),O({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Pi(d,p,h,w)});try{let L=await d.connect({showPrompt:!0});if(R.shouldEnforceDefaultChainOnConnect&&!R.chains.find(Y=>Y.id===Number(L?.chainId))&&!(L?.connectorType==="wallet_connect_v2"&&L?.walletClientType==="metamask")){O(Y=>({...Y,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:P}));try{await L?.switchChain(R.defaultChain.id),L&&(L.chainId=Tn(Kr(R.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${R.defaultChain.id}`)}}return O(Y=>({...Y,status:"connected",connectedWallet:L,connectError:null,connectRetry:P})),L&&!I&&H(N,"connectWallet","onSuccess",L),w?.(L,h)}catch(L){return L instanceof rt?(console.warn(L.cause?L.cause:L.message),I||H(N,"connectWallet","onError",L.privyErrorCode||"generic_connect_wallet_error")):(console.warn(L),I||H(N,"connectWallet","onError","unknown_connect_wallet_error")),O(Y=>({...Y,status:"disconnected",connectedWallet:null,connectError:L})),w?.(null,h)}}let vr=async(d,p)=>{if(d===null)return;let h=new qr(d,p);t.startAuthFlow(h)},yn=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),h=d.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!Er()&&$t("LOGIN_FAILED_SCREEN"),!t.connectors)throw new C("Connector not initialized");oe("AWAITING_CONNECTION");let w=new URL(window.location.href);w.searchParams.delete("privy_connector"),w.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",w),ca(p,h,void 0,vr)};(0,J.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let pt=()=>{if(!a)throw new C("User must be authenticated before linking a wallet.");y(!0),oe("LINK_WALLET_SCREEN")},Mt=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},qt=async d=>{if(!t.connectors)throw new C("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(O(h=>({...h,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:P})),R.captchaEnabled&&!a){let h={callback:w=>vr(d,w),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};Ie({captchaModalData:h}),$t("CAPTCHA_SCREEN")}else await vr(d),$t("AWAITING_CONNECTION")},da=async(d,p)=>{if(!R.fiatOnRamp.enabled)throw new C("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:h,externalTransactionId:w}=await Qf(t,d,p?.config??{},R.appearance.palette,R.fiatOnRamp.useSandbox);return{signedUrl:h,externalTransactionId:w}}else throw new C("Unsupported fund provider. Currently supported option is `moonpay`.")},wr=()=>{v(d=>{let p=t.connectors?.wallets.map(h=>({...h,linked:Mt(h),loginOrLink:async()=>{if(!await h.isConnected())throw new C("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new C("Cannot link or login with embedded wallet");qt(h)},fund:async w=>{let{signedUrl:L,externalTransactionId:Y}=await da(h.address,w);Ie({fiatOnRampPrompt:{signedUrl:L},fiatOnRampStatus:{externalTransactionId:Y}}),oe("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new C("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new C("Cannot unlink an embedded wallet");let w=await t.unlinkWallet(h.address);c(w)}}))||[];return fn(Ti(p)),Wa(d,p)?d:p})};(0,J.useEffect)(()=>{wr()},[s?.linkedAccounts,a,n]),(0,J.useEffect)(()=>{if(n){if(!t.connectors)throw new C("Connector not initialized");wr(),t.connectors.on("walletsUpdated",wr)}},[n]);let co=()=>{oe(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,J.useEffect)(()=>{if(!g[0])return;let d=g[0],p=b.current.find(w=>w.address===d.address),h;if(d.walletClientType==="privy"?h=s?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType==="privy"):h=s?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType!=="privy"),!p&&h){let w=Object.assign({},s);w.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType},c(w)}b.current=g},[g]);let pa=async(d,p)=>{if(ke(d))throw H(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[w,L]=await Promise.all([Ae.initializeWalletProxy(p),Ke()]);if(!w&&e.config?.customAuth?.enabled)throw H(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!w||!L||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((Y,Pe)=>{Q(!0),Ie({createWallet:{onSuccess:xt=>{H(N,"createWallet","onSuccess",xt),Y(xt)},onFailure:xt=>{H(N,"createWallet","onError","unknown_embedded_wallet_error"),Pe(xt)},callAuthOnSuccessOnClose:!1}}),oe("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await w.create({accessToken:L});let Y=await Ae.refreshUser(),Pe=ke(Y);if(!Pe)throw H(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return H(N,"createWallet","onSuccess",Pe),Pe}},Yg=d=>{if(!R.chains.map(p=>p.id).includes(d))throw new Z(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},cd=(d,p,h)=>new Promise(async(w,L)=>{if(!a||!s){H(N,"sendTransaction","onError","must_be_authenticated"),L(new Error("User must be authenticated before signing with a Privy wallet"));return}let Y=ke(s);if(!Y){H(N,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have a Privy wallet before signing"));return}Q(!0);let Pe=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,ut=d.chainId?Number(d.chainId):Pe.chainId;Yg(ut);let xt=Object.assign({},d,{chainId:ut}),Xo=async()=>{let mt=await Ke();if(!mt||!U){H(N,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await Ae.recoverEmbeddedWallet()){H(N,"sendTransaction","onError","unknown_connect_wallet_error"),L(new Error("Unable to connect to wallet"));return}let er=new Ei.StaticJsonRpcProvider(mo(xt.chainId,R.chains,R.rpcConfig)),Qg=await yi(Y.address,xt,er),ud=await fl(mt,Y.address,U,Qg,er);H(N,"sendTransaction","onSuccess",ud),w(ud)}catch(po){H(N,"sendTransaction","onError","transaction_failure"),L(po)}};if(R.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Xo();else{let mt={transactionRequest:xt,onSuccess:er=>{H(N,"sendTransaction","onSuccess",er),w(er)},onFailure:er=>{H(N,"sendTransaction","onError","transaction_failure"),L(er)},uiOptions:p||{},fundWalletConfig:h},po={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:er=>{H(N,"sendTransaction","onError","unknown_connect_wallet_error"),L(er)}};Ie({connectWallet:po,sendTransaction:mt}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function dd(){return new Promise(async(d,p)=>{let h=await Ke();if(!h||!U)throw new Error("Must have valid access token to enroll in MFA");try{await U.verifyMfa({accessToken:h}),d()}catch(w){p(w)}})}let gn={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:co,linkWallet:pt,linkEmail:()=>{if(!a)throw new C("User must be authenticated before linking an email address.");if(s?.email)throw new C("User already has an email linked to their account.");y(!0),oe("LINK_EMAIL_SCREEN")},linkPhone:()=>{if(!a)throw new C("User must be authenticated before linking a phone number.");if(s?.phone)throw new C("User already has a phone number linked to their account.");y(!0),oe("LINK_PHONE_SCREEN")},linkGoogle:async()=>{if(!a)throw new C("User must be authenticated before linking a Google account.");if(s?.google)throw new C("User already has a Google account linked to their account.");await Ae.initLoginWithOAuth("google")},linkTwitter:async()=>{if(!a)throw new C("User must be authenticated before linking a Twitter account.");if(s?.twitter)throw new C("User already has a Twitter account linked to their account.");await Ae.initLoginWithOAuth("twitter")},linkDiscord:async()=>{if(!a)throw new C("User must be authenticated before linking a Discord account.");if(s?.discord)throw new C("User already has a Discord account linked to their account.");await Ae.initLoginWithOAuth("discord")},linkGithub:async()=>{if(!a)throw new C("User must be authenticated before linking a GitHub account.");if(s?.github)throw new C("User already has a Github account linked to their account.");await Ae.initLoginWithOAuth("github")},linkSpotify:async()=>{if(!a)throw new C("User must be authenticated before linking a Spotify account.");if(s?.spotify)throw new C("User already has a Spotify account linked to their account.");await Ae.initLoginWithOAuth("spotify")},linkTiktok:async()=>{if(!a)throw new C("User must be authenticated before linking a TikTok account.");if(s?.tiktok)throw new C("User already has a Tiktok account linked to their account.");await Ae.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{if(!a)throw new C("User must be authenticated before linking a LinkedIn account.");if(s?.linkedin)throw new C("User already has a LinkedIn account linked to their account.");await Ae.initLoginWithOAuth("linkedin")},linkApple:async()=>{if(!a)throw new C("User must be authenticated before linking an Apple account.");await Ae.initLoginWithOAuth("apple")},linkFarcaster:async()=>{if(!a)throw new C("User must be authenticated before linking a Farcaster account.");await Ae.initLoginWithFarcaster(),y(!0),oe("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(!a)throw new C("User must be authenticated before updating an email address.");if(!s?.email)throw new C("User does not have an email linked to their account.");y(!0),oe("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{qe(()=>d)}),qe(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}W(!0),$t("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{qe(()=>d)}),qe(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(g[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}$t("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),k(null),H(N,"logout","onSuccess"),y(!1),r(!1),de.del(_i)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Se;let d=g.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(w=>w.address===d?.address));return!d||!p?new Se:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Ei.Web3Provider(new ho(new Se));let d=g.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(w=>w.address===d?.address));return!d||!p?new Ei.Web3Provider(new ho(new Se)):new Ei.Web3Provider(new ho(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new xr(new Se);let d=g.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(w=>w.address===d?.address));return!d||!p?new xr(new Se):new xr(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=g.find(w=>(0,la.getAddress)(w.address)===(0,la.getAddress)(d)),h=s?.linkedAccounts.find(w=>w.type==="wallet"&&(0,la.getAddress)(w.address)===(0,la.getAddress)(d));if(!p||!await p.isConnected())K(d),pt();else if(!p.linked)p.loginOrLink();else{let w=Object.assign({},s);w.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType},c(w)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw H(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return pa(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw H(N,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=ke(s);if(!d||!U)throw H(N,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw H(N,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await dd()}catch(p){throw H(N,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,h)=>{Q(!0);let w={onSuccess:Y=>{H(N,"setWalletPassword","onSuccess",Y),p(Y)},onFailure:Y=>{H(N,"setWalletPassword","onError","user_exited_set_password_flow"),h(Y)},callAuthOnSuccessOnClose:!1},L={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:Y=>{H(N,"setWalletPassword","onError","unknown_connect_wallet_error"),h(Y)}};Ie({setWalletPassword:w,connectWallet:L}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(h,w)=>{if(!a||!s){H(N,"signMessage","onError","must_be_authenticated"),w(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=ke(s);if(!L){H(N,"signMessage","onError","embedded_wallet_not_found"),w(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){H(N,"signMessage","onError","invalid_message"),w(new Error("Message must be a non-empty string"));return}Q(!0);let Y=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Pe=await Ke();if(!U||!Pe)throw new Error("Unable to connect to wallet");if(!await Ae.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:L.address});let{response:xt}=await U.rpc({accessToken:Pe,address:L.address,request:{method:"personal_sign",params:[d,L.address]}}),Xo=xt.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:L.address}),Xo};if(R.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Pe=await Y();H(N,"signMessage","onSuccess",Pe),h(Pe)}catch(Pe){H(N,"signMessage","onError","unable_to_sign"),w(Pe??new nt("Unable to sign message"))}}else{let xt={method:"personal_sign",data:d,confirmAndSign:Y,onSuccess:mt=>{H(N,"signMessage","onSuccess",mt),h(mt)},onFailure:mt=>{H(N,"signMessage","onError","unable_to_sign"),w(mt)},uiOptions:p||{}},Xo={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:mt=>{H(N,"signMessage","onError","unknown_connect_wallet_error"),w(mt)}};Ie({signMessage:xt,connectWallet:Xo}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(h,w)=>{if(!a||!s){H(N,"signTypedData","onError","must_be_authenticated"),w(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=ke(s);if(!L){H(N,"signTypedData","onError","embedded_wallet_not_found"),w(new Error("Must have a Privy wallet before signing"));return}Q(!0);let Y=Ra(d),Pe=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ut=await Ke();if(!U||!ut)throw new Error("Unable to connect to wallet");if(!await Ae.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:L.address});let{response:Xo}=await U.rpc({accessToken:ut,address:L.address,request:{method:"eth_signTypedData_v4",params:[L.address,Y]}}),mt=Xo.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:L.address}),mt};if(R.embeddedWallets.noPromptOnSignature||(R.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ut=await Pe();H(N,"signTypedData","onSuccess",ut),h(ut)}catch(ut){H(N,"signTypedData","onError","unable_to_sign"),w(ut??new nt("Unable to sign message"))}}else{let Xo={method:"eth_signTypedData_v4",data:Y,confirmAndSign:Pe,onSuccess:po=>{H(N,"signTypedData","onSuccess",po),h(po)},onFailure:po=>{H(N,"signTypedData","onError","unable_to_sign"),w(po)},uiOptions:p||{}},mt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:po=>{H(N,"signMessage","onError","unknown_connect_wallet_error"),w(po)}};Ie({signMessage:Xo,connectWallet:mt}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,h)=>{let L=await(await cd(d,p,h)).wait();return yl(L)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let h=ke(s);if(!h){p(new Error("Must have a Privy wallet before exporting"));return}Q(!0);let w={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},L=await Ke();if(!L||!U){p(new Error("Must have valid access token to enroll in MFA"));return}if(!U){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await U.connect({accessToken:L,address:h.address}),await U.verifyMfa({accessToken:L})}catch(Pe){if(Qr(Pe))await Ae.recoverEmbeddedWallet();else throw Pe}}catch(Pe){p(Pe);return}let Y={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};Ie({keyExport:Y,connectWallet:w}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:dd,async init(d){let p;switch(d){case"sms":p=new Pl("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":Ro.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((h,w)=>{hn.current={resolve:h,reject:w}});break;default:throw Ro.current?.reject(new C("Unsupported MFA method")),new C(`Unsupported MFA method: ${d}`)}},cancel(){Ro.current?.reject(new C("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to enroll in MFA");await U.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,h)=>{if(!d){Ae.closePrivyModal(),p();return}R.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."),Ie({mfaEnrollmentFlow:{mfaMethods:R.mfa.methods,onSuccess:p,onFailure:h}}),oe("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ke();if(!d||!U)throw new Error("Must have valid access token to enroll in MFA");let p=await U.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to enroll in MFA");await U.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async submitEnrollmentWithTotp(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to enroll in MFA");await U.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async unenroll(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to remove MFA");await U.unenrollMfa({method:d,accessToken:p});let h=await t.getAuthenticatedUser();c(h)},loginWithCode(d){return Ae.loginWithCode(d)},initLoginWithEmail(d){return Ae.initLoginWithEmail(d)},initLoginWithSms(d){return Ae.initLoginWithSms(d)},fundWallet(d,p){return Ae.fundWallet(d,p)},isModalOpen:o};Cg=gn.signMessage,bg=gn.signTypedData,Eg=async(...d)=>{let p=await cd(...d);return R.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let pd=!!e.config?.headless,Ae=(()=>({headless:pd,isNewUserThisSession:T,isLinking:m,linkingHint:V,pendingTransaction:null,walletConnectionStatus:S,mipdStore:D,connectors:t.connectors?.walletConnectors??[],rpcConfig:R.rpcConfig,chains:R.chains,showFiatPrices:R.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>R.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(U)return U;let p=new Promise(L=>{Zo(()=>Y=>L(Y))}),h=new Promise(L=>setTimeout(()=>L(null),d)),w=await Promise.race([p,h]);return Zo(null),w},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0})=>{let p=n&&a&&s;d.shouldCallAuthOnSuccess&&p?(H(N,"login","onComplete",s,T,!1,dt.current??null),e.onSuccess?.(s,T)):I&&H(N,"login","onError","exited_auth_flow"),K(null),W(!1),y(!1),x(!1),r(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:oe,connectWallet:Pi,initLoginWithWallet:async(d,p)=>{dt.current="siwe",vr(d,p)},loginWithWallet:async()=>{if(!n)throw new vn;if(!(t.authFlow instanceof qr))throw new C("Must initialize SIWE flow first.");let d,p;if(a)d=await t.link();else try{({user:d,isNewUser:p}=await t.authenticate())}catch(h){throw H(N,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||s||null),x(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new xi(d);t.startAuthFlow(p);try{dt.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw H(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},loginWithFarcaster:async()=>{if(!n)throw new vn;if(!(t.authFlow instanceof xi))throw new C("Must initialize Farcaster flow first.");let d,p;if(a)d=await t.link();else try{({user:d,isNewUser:p}=await t.authenticate())}catch(h){throw H(N,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||null),x(p||!1),l(!0)},initLoginWithOAuth:async(d,p)=>{if(ap()){if(d==="google"&&ad(window.navigator.userAgent)){$t("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{$t("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let h=new br(d);p&&h.addCaptchaToken(p),t.startAuthFlow(h);let w=await t.authFlow.getAuthorizationUrl();w&&w.url&&window.location.assign(w.url)},loginWithOAuth:async d=>{if(!(t.authFlow instanceof br))throw new C("Must initialize OAuth flow before calling loginWithOAuth");let p=uo.get(Cn),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:h??""}),new C("Unexpected auth flow. This may be a phishing attempt.");let w,L;if(a)w=await t.link();else try{({user:w,isNewUser:L}=await t.authenticate()),dt.current=d}catch(Y){throw H(N,"login","onError",Y.privyErrorCode||"unknown_auth_error"),Y}c(w),x(L||!1),l(!0)},initLoginWithEmail:async(d,p)=>{let h=new Cr(d,p);t.startAuthFlow(h);try{dt.current="email",await h.sendCodeEmail()}catch(w){throw H(N,"login","onError",w.privyErrorCode||"unknown_auth_error"),w}},initUpdateEmail:async(d,p,h)=>{let w=new wa(d,p,h);t.startAuthFlow(w),await w.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let h=new jr(d,p);t.startAuthFlow(h);try{dt.current="sms",await h.sendSmsCode()}catch(w){throw H(N,"login","onError",w.privyErrorCode||"unknown_auth_error"),w}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(!n)throw new vn;if(t.authFlow instanceof Cr)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof jr)t.authFlow.meta.smsCode=d.trim();else throw new C("Must initialize a passwordless code flow first");let p,h;a?p=await t.link():{user:p,isNewUser:h}=await t.authenticate(),c(p||s||null),x(h||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:U,createAnalyticsEvent:(d,p,h)=>t.createAnalyticsEvent(d,p,h),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let h=s?.linkedAccounts.find(L=>L.type==="wallet"&&L.walletClientType==="privy"),w=await Ke();if(!w||!U||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await U.connect({accessToken:w,address:h.address}),d(!0)}catch(L){Qr(L)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:h.address}),(await U.recover({address:h.address,accessToken:w})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:h.address}),d(!0)):Qr(L)?(Ie({recoverWallet:{privyWallet:h,onFailure:p,onSuccess:()=>d(!0)}}),oe("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(L)}}),getFiatOnRampConfig:da,setReadyToTrue:()=>{i(!0),Tt?.()},updateWallets:()=>wr(),fundWallet:async(d,p)=>{let{signedUrl:h,externalTransactionId:w}=await da(d,p);Ie({fiatOnRampPrompt:{signedUrl:h},fiatOnRampStatus:{externalTransactionId:w}}),oe("FIAT_ON_RAMP_PROMPT_SCREEN")}}))();Tg=Ae.recoverEmbeddedWallet;let Jg=(0,J.useMemo)(()=>({wallets:g,ready:lo}),[g,lo]);return(0,Wt.jsx)(ge.Provider,{value:gn,children:(0,Wt.jsx)(Jl.Provider,{value:N,children:(0,Wt.jsx)(Zc.Provider,{value:Jg,children:(0,Wt.jsxs)(fu,{...R,children:[e.children,(0,Wt.jsxs)(Yl.Provider,{value:Ae,children:[!pd&&R.captchaEnabled&&n&&!a&&(0,Wt.jsx)(ss,{delayedExecution:!1}),(0,Wt.jsx)(mg,{theme:{...R.appearance.palette||{}}}),(0,Wt.jsx)(Yp,{data:ct,setModalData:Ie,setInitialScreen:k,initialScreen:E,authenticated:a,open:o,children:(0,Wt.jsx)(yg,{open:o})}),ue&&le?(0,Wt.jsx)(gg,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Ro,mfaSubmitPromise:hn,onLoad:j,onLoadFailed:()=>null}):null]})]})})})})};var xg=require("react");function Sg(e){let{login:t}=(0,xg.useContext)(ge);return Be("login",e),{login:t}}var _g=require("react");function Ag(e){let{logout:t}=(0,_g.useContext)(ge);return Be("logout",e),{logout:t}}var sd=require("react");var kg=()=>{let e=_e(),{initLoginWithEmail:t,loginWithCode:o}=G(),r=(0,sd.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return e.status==="disabled",t(i)},[t]),n=(0,sd.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new nr(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var ld=require("react");var Rg=()=>{let e=_e(),{initLoginWithSms:t,loginWithCode:o}=G(),r=(0,ld.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return e.status==="disabled",t(i)},[t]),n=(0,ld.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new nr(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var Ig=require("react");function Wg(e){let{connectWallet:t}=(0,Ig.useContext)(ge);return Be("connectWallet",e),{connectWallet:t}}var Mg=require("react");function Ng(e){let{createWallet:t}=(0,Mg.useContext)(ge);return Be("createWallet",e),{createWallet:t}}var Lg=()=>{let{fundWallet:e}=G();return{fundWallet:e}};var Og=require("react");function Dg(e){let{sendTransaction:t}=(0,Og.useContext)(ge);return Be("sendTransaction",e),{sendTransaction:t}}var Ug=require("react");function Fg(e){let{setWalletPassword:t}=(0,Ug.useContext)(ge);return Be("setWalletPassword",e),{setWalletPassword:t}}var Bg=require("react");function Hg(e){let{signMessage:t}=(0,Bg.useContext)(ge);return Be("signMessage",e),{signMessage:t}}var Gg=require("react");function Vg(e){let{signTypedData:t}=(0,Gg.useContext)(ge);return Be("signTypedData",e),{signTypedData:t}}var zg=require("react");var $g=()=>{let{isModalOpen:e}=(0,zg.useContext)(ge);return{isOpen:e}};var qg=require("react");function jg(e){let{getAccessToken:t}=(0,qg.useContext)(ge);return Be("accessToken",e),{getAccessToken:t}}function Kg(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,useConnectWallet,useCreateWallet,useFundWallet,useLogin,useLoginWithEmail,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSignMessage,useSignTypedData,useToken,useWallets});
|
|
2693
|
+
`;var Fe=require("react/jsx-runtime"),bb={["LANDING"]:zh,["CONNECT_OR_CREATE"]:Vh,["AWAITING_PASSWORDLESS_CODE"]:Qu,["AWAITING_CONNECTION"]:bm,["AWAITING_CONNECT_ONLY_CONNECTION"]:Pm,["AWAITING_FARCASTER_CONNECTION"]:Jf,["PHANTOM_INTERSTITIAL_SCREEN"]:sg,["LOGIN_FAILED_SCREEN"]:Qh,["AWAITING_OAUTH_SCREEN"]:rg,["ALLOWLIST_REJECTION_SCREEN"]:Bu,["INSTALL_PHANTOM_SCREEN"]:vh,["LINK_EMAIL_SCREEN"]:qh,["LINK_PHONE_SCREEN"]:Kh,["LINK_WALLET_SCREEN"]:Yh,["UPDATE_EMAIL_SCREEN"]:bg,["CONNECT_ONLY_LANDING_SCREEN"]:vm,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:um,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Pf,["EMBEDDED_WALLET_CREATED_SCREEN"]:Mm,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Rm,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:If,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Um,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:yg,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:mg,["FIAT_ON_RAMP_PROMPT_SCREEN"]:ih,["FIAT_ON_RAMP_STATUS_SCREEN"]:dh,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:kf,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:xf,["MFA_ENROLLMENT_FLOW_SCREEN"]:fy,["CAPTCHA_SCREEN"]:im,["ERROR_SCREEN"]:Nf,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:mh,["AFFIRMATIVE_CONSENT_SCREEN"]:Uu},Eb=["LANDING","AWAITING_CONNECTION"],Tb=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:o,isModalOpen:r}=G(),{headless:n}=M(),{ready:i,currentScreen:a}=_(),{status:l,execute:s,reset:c,enabled:m}=_e(),y=(0,mr.useRef)(null),g=Pu(y),v=r&&a&&Eb.includes(a)&&!n&&l==="ready";if((0,mr.useEffect)(()=>{v&&s()},[v]),(0,mr.useEffect)(()=>{!r&&m&&c()},[r,m]),(!o||!i)&&a!=="AWAITING_OAUTH_SCREEN")return(0,Fe.jsxs)(di,{children:[(0,Fe.jsx)(k,{}),(0,Fe.jsx)(X,{}),(0,Fe.jsx)(Xh,{children:(0,Fe.jsx)(Zt,{})}),(0,Fe.jsx)(ee,{}),(0,Fe.jsx)(re,{})]});if(!a&&e)return(0,Fe.jsx)(di,{style:{height:g},children:(0,Fe.jsx)("div",{ref:y,children:(0,Fe.jsx)(sd,{open:e,onClose:t})})});if(!a)return null;let b=bb[a];return(0,Fe.jsx)(di,{style:{height:g},children:(0,Fe.jsxs)("div",{ref:y,children:[(0,Fe.jsx)(rr,{if:!!e,children:(0,Fe.jsx)(b,{})}),(0,Fe.jsx)(rr,{if:!e,children:(0,Fe.jsx)(sd,{open:e,onClose:t})})]})})},Pb=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=_();return{gracefulClosePrivyModal:(0,mr.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Sg=({open:e})=>{let{app:t}=_(),{gracefulClosePrivyModal:o}=Pb(),[r,n]=(0,mr.useState)(!1);ms({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=(0,Fe.jsx)(Pg,{children:(0,Fe.jsx)(Tb,{isMfaVerifying:r,onMfaVerificationComplete:()=>n(!1)})}),a=e||r,l=t?.render.inDialog?(0,Fe.jsx)(Zh,{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 xg.default.createPortal(l,s)}return l};var Sl=require("react");var xl=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 pn(e,t,o,r,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):r.current?.reject(new Ve("missing_or_invalid_mfa","MFA verification failed, retry."));let y=await new Promise((g,v)=>{o.current={resolve:g,reject:v};let b=1e3*60*5;setTimeout(()=>{let T=new Ve("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(T),v(T)},b)});return await e(y)}return await e()},s=4,c=null;for(let m=0;m<s;m++)try{c=await l(m),r.current?.resolve(void 0);break}catch(y){if(y.type==="missing_or_invalid_mfa")a=!0;else throw r.current?.resolve(void 0),y}if(c===null){let m=new Ve("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(m),m}return c}var Ag=require("react/jsx-runtime"),xb=function(e){return()=>`id-${e++}`}(0);function Sb(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Ko(e){return e.error!==void 0}var Ao=new xl,ud=new Map,_b=(e,t)=>typeof t=="bigint"?t.toString():t,Ab=(e,t)=>`${e}${JSON.stringify(t,_b)}`;function Yo(e,t,o){let r=o.contentWindow;if(!r)throw new Error("iframe not initialized");let n=Ab(e,t);if(e==="privy:wallet:create"){let a=ud.get(n);if(a)return a}let i=new Promise((a,l)=>{let s=xb();Ao.enqueue(s,{resolve:a,reject:l}),r.postMessage({id:s,event:e,data:t},"*")}).finally(()=>{ud.delete(n)});return ud.set(n,i),i}function kb(e){switch(e.event){case"privy:iframe:ready":let t=Ao.dequeue(e.event,e.id);return Ko(e)?t.reject(new Ve(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=Ao.dequeue(e.event,e.id);return Ko(e)?o.reject(new Ve(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=Ao.dequeue(e.event,e.id);return Ko(e)?r.reject(new Ve(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=Ao.dequeue(e.event,e.id);return Ko(e)?n.reject(new Ve(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=Ao.dequeue(e.event,e.id);return Ko(e)?i.reject(new Ve(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=Ao.dequeue(e.event,e.id);return Ko(e)?a.reject(new Ve(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=Ao.dequeue(e.event,e.id);return Ko(e)?l.reject(new Ve(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=Ao.dequeue(e.event,e.id);return Ko(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=Ao.dequeue(e.event,e.id);return Ko(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=Ao.dequeue(e.event,e.id);return Ko(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function _g(e){let t=(0,Sl.useRef)(null),o=_u();return(0,Sl.useEffect)(()=>{let r=t.current;if(!r)return;function n(c){c&&c.origin===e.origin&&Sb(c.data)&&kb(c.data)}let i={create(c){return Yo("privy:wallet:create",c,r)},connect(c){return Yo("privy:wallet:connect",c,r)},recover(c){return pn(m=>Yo("privy:wallet:recover",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(c){return pn(m=>Yo("privy:wallet:rpc",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(c){return pn(m=>Yo("privy:wallet:set-recovery-password",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(c){return pn(m=>Yo("privy:mfa:verify",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(c){return pn(m=>Yo("privy:mfa:init-enrollment",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(c){return Yo("privy:mfa:submit-enrollment",c,r)},unenrollMfa(c){return pn(m=>Yo("privy:mfa:unenroll",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)}};window.addEventListener("message",n);let a=()=>e.onLoad(i),l=(...c)=>{console.warn("Privy iframe failed to load: ",...c),e.onLoadFailed()},s=new AbortController;return wp(()=>Yo("privy:iframe:ready",{},r),{abortSignal:s.signal}).then(a,l),()=>{window.removeEventListener("message",n),s.abort()}},[t.current,e.mfaMethods]),(0,Ag.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},src:Ia(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function md(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(r=>t.includes(r))}var _l=class{constructor(t,o){this.meta={action:t,phoneNumber:o}}async init(){if(!this.meta.action)throw new C("action required");if(!this.api)throw new C("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new C("phone number must be set when initialzing authentication.");try{let t=Jd();await this.api.post(t,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw me(t)}}async authenticate(){if(!this.meta.action)throw new C("action required");if(!this.api)throw new C("Mfa flow has no API instance");if(!this.meta.smsCode)throw new C("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new C("phone number must be set prior to calling authenticate.");try{let t=Qd(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return Lt(o)}catch(t){throw me(t)}}};var Mt=require("react/jsx-runtime"),Ti;function Rb(e){return typeof e=="string"&&e.length===25}function Ke(){if(!Ti){let e=ce.get(Gr);return Promise.resolve(e||null)}return Ti.getAccessToken()}var Rg,xp=(e,t)=>Rg(e,t),Ig,Sp=(e,t)=>Ig(e,t),Wg,_p=(e,t)=>Wg(e,t),Mg,Ap=()=>Mg(),Ib=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;ce.put(Ai,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},Ng=({config:e,...t})=>{if(!Rb(t.appId))throw new C("Cannot initialize the Privy provider with an invalid Privy app ID");Ti||(Ti=new Ln({appId:t.appId,apiUrl:t.apiUrl||Ta}));let o=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&o.embeddedWallets?.createOnLogin===void 0&&(o.embeddedWallets||(o.embeddedWallets={}),o.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,Mt.jsx)(Zp,{client:Ti,clientConfig:o,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,Mt.jsx)(Wb,{...t,config:o,client:Ti})})},Wb=e=>{let t=e.client,[o,r]=(0,J.useState)(!1),[n,i]=(0,J.useState)(!1),[a,l]=(0,J.useState)(!1),[s,c]=(0,J.useState)(null),[m,y]=(0,J.useState)(!1),[g,v]=(0,J.useState)([]),b=(0,J.useRef)(g),[T,x]=(0,J.useState)(!1),[E,A]=(0,J.useState)(null),[I,W]=(0,J.useState)(!1),[S,O]=(0,J.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:P}),[D,B]=(0,J.useState)(null),[V,Y]=(0,J.useState)(null),[U,j]=(0,J.useState)(null),R=os(),le=Xp(),[pe,Q]=(0,J.useState)(!0),[pt,Ie]=(0,J.useState)({}),[Pt,qe]=(0,J.useState)(null),[ue,Jo]=(0,J.useState)(null),[so,un]=(0,J.useState)(!1),[xt,je]=(0,J.useState)(!1),ko=(0,J.useRef)(null),mn=(0,J.useRef)(null),N=(0,J.useRef)(xu);t.onStoreToken=d=>{d&&H(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{H(N,"accessToken","onAccessTokenRemoved")};let ut=(0,J.useRef)(),xi=(0,J.useCallback)(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(w=>w.type==="wallet"&&w.walletClientType==="privy")?p&&d?.some(w=>w?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),oe=d=>{A(d),setTimeout(()=>{r(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},$t=d=>{R.embeddedWallets.createOnLogin!=="off"&&Q(!0),oe(d)};(0,J.useEffect)(()=>{if(!U||!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(U,p,R.defaultChain)}},[U,s]),(0,J.useEffect)(()=>{U&&ue?.(U)},[U]),(0,J.useEffect)(()=>{(async()=>{if(!R.customAuth?.enabled)return;Q(!0);let{getCustomAccessToken:p,isLoading:h}=R.customAuth;if(!(!n||h))try{let w=await p();if(!w){await yn.logout();return}if(a)return;t.startAuthFlow(new vn(w));let{user:L,isNewUser:K}=await t.authenticate();L||await yn.logout(),c(L||null),x(K||!1),l(!0),je(!0)}catch(w){console.warn(w),a&&await yn.logout()}})()},[R.customAuth?.enabled,R.customAuth?.getCustomAccessToken,R.customAuth?.isLoading,n,a]),(0,J.useEffect)(()=>{xt&&U&&s&&jt(s,e.config?.embeddedWallets?.createOnLogin)&&(je(!1),ma(s,bn).catch(console.error))},[xt&&U&&s]),(0,J.useEffect)(()=>{async function d(){let p=fn();Ib();let h=(0,kg.createStore)();B(h),t.initializeConnectorManager(R.walletConnectCloudProjectId,R.rpcConfig,R.chains,R.defaultChain,h,R.appearance.walletList,R.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{hn()});let w=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!w),w&&H(N,"login","onComplete",w,!1,!0,null),c(w)),p||Ae.setReadyToTrue(),p&&w&&y(!0)}!n&&le&&d()},[t,Pt,n,le]);let fn=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_oauth_code"),h=d.get("privy_oauth_state"),w=d.get("privy_oauth_provider");return p&&h&&w?(t.startAuthFlow(new vr(w,p,h)),$t("AWAITING_OAUTH_SCREEN"),!0):!1},ua=async(d,p,h,w)=>{let L=await t.connectors?.createWalletConnector(d,p)||null;Si(L,p,h,w)};async function Si(d,p,h,w){if(!d)return O({status:"disconnected",connectedWallet:null,connectError:new Z("Unable to connect to wallet."),connector:null,connectRetry:P}),w?.(null,h);d instanceof No&&p&&await d.resetConnection(p),O({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Si(d,p,h,w)});try{let L=await d.connect({showPrompt:!0});if(R.shouldEnforceDefaultChainOnConnect&&!R.chains.find(K=>K.id===Number(L?.chainId))&&!(L?.connectorType==="wallet_connect_v2"&&L?.walletClientType==="metamask")){O(K=>({...K,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:P}));try{await L?.switchChain(R.defaultChain.id),L&&(L.chainId=En(qr(R.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${R.defaultChain.id}`)}}return O(K=>({...K,status:"connected",connectedWallet:L,connectError:null,connectRetry:P})),L&&!I&&H(N,"connectWallet","onSuccess",L),w?.(L,h)}catch(L){return L instanceof nt?(console.warn(L.cause?L.cause:L.message),I||H(N,"connectWallet","onError",L.privyErrorCode||"generic_connect_wallet_error")):(console.warn(L),I||H(N,"connectWallet","onError","unknown_connect_wallet_error")),O(K=>({...K,status:"disconnected",connectedWallet:null,connectError:L})),w?.(null,h)}}let fr=async(d,p)=>{if(d===null)return;let h=new zr(d,p);t.startAuthFlow(h)},hn=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),h=d.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!wr()&&$t("LOGIN_FAILED_SCREEN"),!t.connectors)throw new C("Connector not initialized");oe("AWAITING_CONNECTION");let w=new URL(window.location.href);w.searchParams.delete("privy_connector"),w.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",w),ua(p,h,void 0,fr)};(0,J.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let St=()=>{if(!a)throw new C("User must be authenticated before linking a wallet.");y(!0),oe("LINK_WALLET_SCREEN")},rt=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},hr=async d=>{if(!t.connectors)throw new C("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(O(h=>({...h,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:P})),R.captchaEnabled&&!a){let h={callback:w=>fr(d,w),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};Ie({captchaModalData:h}),$t("CAPTCHA_SCREEN")}else await fr(d),$t("AWAITING_CONNECTION")},Br=async(d,p)=>{if(!R.fiatOnRamp.enabled)throw new C("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:h,externalTransactionId:w}=await rh(t,d,p?.config??{},R.appearance.palette,R.fiatOnRamp.useSandbox);return{signedUrl:h,externalTransactionId:w}}else throw new C("Unsupported fund provider. Currently supported option is `moonpay`.")},Hr=()=>{v(d=>{let p=t.connectors?.wallets.map(h=>({...h,linked:rt(h),loginOrLink:async()=>{if(!await h.isConnected())throw new C("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new C("Cannot link or login with embedded wallet");hr(h)},fund:async w=>{let{signedUrl:L,externalTransactionId:K}=await Br(h.address,w);Ie({fiatOnRampPrompt:{signedUrl:L},fiatOnRampStatus:{externalTransactionId:K}}),oe("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new C("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new C("Cannot unlink an embedded wallet");let w=await t.unlinkWallet(h.address);c(w)}}))||[];return un(xi(p)),Na(d,p)?d:p})};(0,J.useEffect)(()=>{Hr()},[s?.linkedAccounts,a,n]),(0,J.useEffect)(()=>{if(n){if(!t.connectors)throw new C("Connector not initialized");Hr(),t.connectors.on("walletsUpdated",Hr)}},[n]);let yr=()=>{oe(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,J.useEffect)(()=>{if(!g[0])return;let d=g[0],p=b.current.find(w=>w.address===d.address),h;if(d.walletClientType==="privy"?h=s?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType==="privy"):h=s?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType!=="privy"),!p&&h){let w=Object.assign({},s);w.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType},c(w)}b.current=g},[g]);let ma=async(d,p)=>{if(ke(d))throw H(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[w,L]=await Promise.all([Ae.initializeWalletProxy(p),Ke()]);if(!w&&e.config?.customAuth?.enabled)throw H(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!w||!L||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((K,Pe)=>{Q(!0),Ie({createWallet:{onSuccess:_t=>{H(N,"createWallet","onSuccess",_t),K(_t)},onFailure:_t=>{H(N,"createWallet","onError","unknown_embedded_wallet_error"),Pe(_t)},callAuthOnSuccessOnClose:!1}}),oe("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await w.create({accessToken:L});let K=await Ae.refreshUser(),Pe=ke(K);if(!Pe)throw H(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return H(N,"createWallet","onSuccess",Pe),Pe}},iv=d=>{if(!R.chains.map(p=>p.id).includes(d))throw new Z(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},yd=(d,p,h)=>new Promise(async(w,L)=>{if(!a||!s){H(N,"sendTransaction","onError","must_be_authenticated"),L(new Error("User must be authenticated before signing with a Privy wallet"));return}let K=ke(s);if(!K){H(N,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have a Privy wallet before signing"));return}Q(!0);let Pe=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,mt=d.chainId?Number(d.chainId):Pe.chainId;iv(mt);let _t=Object.assign({},d,{chainId:mt}),Qo=async()=>{let ft=await Ke();if(!ft||!U){H(N,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await Ae.recoverEmbeddedWallet()){H(N,"sendTransaction","onError","unknown_connect_wallet_error"),L(new Error("Unable to connect to wallet"));return}let co=new Pi.StaticJsonRpcProvider(uo(_t.chainId,R.chains,R.rpcConfig)),Al=await vi(K.address,_t,co);if(R.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:sv}=await gi(Al,co),{hasSufficientFunds:lv}=await vl(K.address,Al,sv,co);if(!lv)throw new Me(new Kt("Wallet has insufficient funds for this transaction.",it.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let wd=await gl(ft,K.address,U,Al,co);H(N,"sendTransaction","onSuccess",wd),w(wd)}catch(lo){H(N,"sendTransaction","onError","transaction_failure"),L(lo)}};if(R.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Qo();else{let ft={transactionRequest:_t,onSuccess:co=>{H(N,"sendTransaction","onSuccess",co),w(co)},onFailure:co=>{H(N,"sendTransaction","onError","transaction_failure"),L(co)},uiOptions:p||{},fundWalletConfig:h},lo={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:co=>{H(N,"sendTransaction","onError","unknown_connect_wallet_error"),L(co)}};Ie({connectWallet:lo,sendTransaction:ft}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function gd(){return new Promise(async(d,p)=>{let h=await Ke();if(!h||!U)throw new Error("Must have valid access token to enroll in MFA");try{await U.verifyMfa({accessToken:h}),d()}catch(w){p(w)}})}let yn={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:yr,linkWallet:St,linkEmail:()=>{if(!a)throw new C("User must be authenticated before linking an email address.");if(s?.email)throw new C("User already has an email linked to their account.");y(!0),oe("LINK_EMAIL_SCREEN")},linkPhone:()=>{if(!a)throw new C("User must be authenticated before linking a phone number.");if(s?.phone)throw new C("User already has a phone number linked to their account.");y(!0),oe("LINK_PHONE_SCREEN")},linkGoogle:async()=>{if(!a)throw new C("User must be authenticated before linking a Google account.");if(s?.google)throw new C("User already has a Google account linked to their account.");await Ae.initLoginWithOAuth("google")},linkTwitter:async()=>{if(!a)throw new C("User must be authenticated before linking a Twitter account.");if(s?.twitter)throw new C("User already has a Twitter account linked to their account.");await Ae.initLoginWithOAuth("twitter")},linkDiscord:async()=>{if(!a)throw new C("User must be authenticated before linking a Discord account.");if(s?.discord)throw new C("User already has a Discord account linked to their account.");await Ae.initLoginWithOAuth("discord")},linkGithub:async()=>{if(!a)throw new C("User must be authenticated before linking a GitHub account.");if(s?.github)throw new C("User already has a Github account linked to their account.");await Ae.initLoginWithOAuth("github")},linkSpotify:async()=>{if(!a)throw new C("User must be authenticated before linking a Spotify account.");if(s?.spotify)throw new C("User already has a Spotify account linked to their account.");await Ae.initLoginWithOAuth("spotify")},linkTiktok:async()=>{if(!a)throw new C("User must be authenticated before linking a TikTok account.");if(s?.tiktok)throw new C("User already has a Tiktok account linked to their account.");await Ae.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{if(!a)throw new C("User must be authenticated before linking a LinkedIn account.");if(s?.linkedin)throw new C("User already has a LinkedIn account linked to their account.");await Ae.initLoginWithOAuth("linkedin")},linkApple:async()=>{if(!a)throw new C("User must be authenticated before linking an Apple account.");await Ae.initLoginWithOAuth("apple")},linkFarcaster:async()=>{if(!a)throw new C("User must be authenticated before linking a Farcaster account.");await Ae.initLoginWithFarcaster(),y(!0),oe("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(!a)throw new C("User must be authenticated before updating an email address.");if(!s?.email)throw new C("User does not have an email linked to their account.");y(!0),oe("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{qe(()=>d)}),qe(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}W(!0),$t("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{qe(()=>d)}),qe(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(g[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}$t("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),A(null),H(N,"logout","onSuccess"),y(!1),r(!1),ce.del(ki)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Se;let d=g.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(w=>w.address===d?.address));return!d||!p?new Se:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Pi.Web3Provider(new fo(new Se));let d=g.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(w=>w.address===d?.address));return!d||!p?new Pi.Web3Provider(new fo(new Se)):new Pi.Web3Provider(new fo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Er(new Se);let d=g.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(w=>w.address===d?.address));return!d||!p?new Er(new Se):new Er(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=g.find(w=>(0,pa.getAddress)(w.address)===(0,pa.getAddress)(d)),h=s?.linkedAccounts.find(w=>w.type==="wallet"&&(0,pa.getAddress)(w.address)===(0,pa.getAddress)(d));if(!p||!await p.isConnected())Y(d),St();else if(!p.linked)p.loginOrLink();else{let w=Object.assign({},s);w.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType},c(w)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw H(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return ma(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw H(N,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=ke(s);if(!d||!U)throw H(N,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw H(N,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await gd()}catch(p){throw H(N,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,h)=>{Q(!0);let w={onSuccess:K=>{H(N,"setWalletPassword","onSuccess",K),p(K)},onFailure:K=>{H(N,"setWalletPassword","onError","user_exited_set_password_flow"),h(K)},callAuthOnSuccessOnClose:!1},L={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:K=>{H(N,"setWalletPassword","onError","unknown_connect_wallet_error"),h(K)}};Ie({setWalletPassword:w,connectWallet:L}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(h,w)=>{if(!a||!s){H(N,"signMessage","onError","must_be_authenticated"),w(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=ke(s);if(!L){H(N,"signMessage","onError","embedded_wallet_not_found"),w(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){H(N,"signMessage","onError","invalid_message"),w(new Error("Message must be a non-empty string"));return}Q(!0);let K=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Pe=await Ke();if(!U||!Pe)throw new Error("Unable to connect to wallet");if(!await Ae.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:L.address});let{response:_t}=await U.rpc({accessToken:Pe,address:L.address,request:{method:"personal_sign",params:[d,L.address]}}),Qo=_t.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:L.address}),Qo};if(R.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Pe=await K();H(N,"signMessage","onSuccess",Pe),h(Pe)}catch(Pe){H(N,"signMessage","onError","unable_to_sign"),w(Pe??new Me("Unable to sign message"))}}else{let _t={method:"personal_sign",data:d,confirmAndSign:K,onSuccess:ft=>{H(N,"signMessage","onSuccess",ft),h(ft)},onFailure:ft=>{H(N,"signMessage","onError","unable_to_sign"),w(ft)},uiOptions:p||{}},Qo={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:ft=>{H(N,"signMessage","onError","unknown_connect_wallet_error"),w(ft)}};Ie({signMessage:_t,connectWallet:Qo}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(h,w)=>{if(!a||!s){H(N,"signTypedData","onError","must_be_authenticated"),w(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=ke(s);if(!L){H(N,"signTypedData","onError","embedded_wallet_not_found"),w(new Error("Must have a Privy wallet before signing"));return}Q(!0);let K=Wa(d),Pe=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let mt=await Ke();if(!U||!mt)throw new Error("Unable to connect to wallet");if(!await Ae.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:L.address});let{response:Qo}=await U.rpc({accessToken:mt,address:L.address,request:{method:"eth_signTypedData_v4",params:[L.address,K]}}),ft=Qo.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:L.address}),ft};if(R.embeddedWallets.noPromptOnSignature||(R.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let mt=await Pe();H(N,"signTypedData","onSuccess",mt),h(mt)}catch(mt){H(N,"signTypedData","onError","unable_to_sign"),w(mt??new Me("Unable to sign message"))}}else{let Qo={method:"eth_signTypedData_v4",data:K,confirmAndSign:Pe,onSuccess:lo=>{H(N,"signTypedData","onSuccess",lo),h(lo)},onFailure:lo=>{H(N,"signTypedData","onError","unable_to_sign"),w(lo)},uiOptions:p||{}},ft={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:lo=>{H(N,"signMessage","onError","unknown_connect_wallet_error"),w(lo)}};Ie({signMessage:Qo,connectWallet:ft}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,h)=>{let L=await(await yd(d,p,h)).wait();return wl(L)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let h=ke(s);if(!h){p(new Error("Must have a Privy wallet before exporting"));return}Q(!0);let w={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},L=await Ke();if(!L||!U){p(new Error("Must have valid access token to enroll in MFA"));return}if(!U){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await U.connect({accessToken:L,address:h.address}),await U.verifyMfa({accessToken:L})}catch(Pe){if(Kr(Pe))await Ae.recoverEmbeddedWallet();else throw Pe}}catch(Pe){p(Pe);return}let K={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};Ie({keyExport:K,connectWallet:w}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:gd,async init(d){let p;switch(d){case"sms":p=new _l("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":ko.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((h,w)=>{mn.current={resolve:h,reject:w}});break;default:throw ko.current?.reject(new C("Unsupported MFA method")),new C(`Unsupported MFA method: ${d}`)}},cancel(){ko.current?.reject(new C("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to enroll in MFA");await U.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,h)=>{if(!d){Ae.closePrivyModal(),p();return}R.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."),Ie({mfaEnrollmentFlow:{mfaMethods:R.mfa.methods,onSuccess:p,onFailure:h}}),oe("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ke();if(!d||!U)throw new Error("Must have valid access token to enroll in MFA");let p=await U.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to enroll in MFA");await U.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async submitEnrollmentWithTotp(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to enroll in MFA");await U.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async unenroll(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to remove MFA");await U.unenrollMfa({method:d,accessToken:p});let h=await t.getAuthenticatedUser();c(h)},loginWithCode(d){return Ae.loginWithCode(d)},initLoginWithEmail(d){return Ae.initLoginWithEmail(d)},initLoginWithSms(d){return Ae.initLoginWithSms(d)},fundWallet(d,p){return Ae.fundWallet(d,p)},isModalOpen:o};Rg=yn.signMessage,Ig=yn.signTypedData,Wg=async(...d)=>{let p=await yd(...d);return R.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let vd=!!e.config?.headless,Ae=(()=>({headless:vd,isNewUserThisSession:T,isLinking:m,linkingHint:V,pendingTransaction:null,walletConnectionStatus:S,mipdStore:D,connectors:t.connectors?.walletConnectors??[],rpcConfig:R.rpcConfig,chains:R.chains,showFiatPrices:R.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>R.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(U)return U;let p=new Promise(L=>{Jo(()=>K=>L(K))}),h=new Promise(L=>setTimeout(()=>L(null),d)),w=await Promise.race([p,h]);return Jo(null),w},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0})=>{let p=n&&a&&s;d.shouldCallAuthOnSuccess&&p?(H(N,"login","onComplete",s,T,!1,ut.current??null),e.onSuccess?.(s,T)):I&&H(N,"login","onError","exited_auth_flow"),Y(null),W(!1),y(!1),x(!1),r(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:oe,connectWallet:Si,initLoginWithWallet:async(d,p)=>{ut.current="siwe",fr(d,p)},loginWithWallet:async()=>{if(!n)throw new gn;if(!(t.authFlow instanceof zr))throw new C("Must initialize SIWE flow first.");let d,p;if(a)d=await t.link();else try{({user:d,isNewUser:p}=await t.authenticate())}catch(h){throw H(N,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||s||null),x(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new _i(d);t.startAuthFlow(p);try{ut.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw H(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},loginWithFarcaster:async()=>{if(!n)throw new gn;if(!(t.authFlow instanceof _i))throw new C("Must initialize Farcaster flow first.");let d,p;if(a)d=await t.link();else try{({user:d,isNewUser:p}=await t.authenticate())}catch(h){throw H(N,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||null),x(p||!1),l(!0)},initLoginWithOAuth:async(d,p)=>{if(mp()){if(d==="google"&&md(window.navigator.userAgent)){$t("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{$t("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let h=new vr(d);p&&h.addCaptchaToken(p),t.startAuthFlow(h);let w=await t.authFlow.getAuthorizationUrl();w&&w.url&&window.location.assign(w.url)},loginWithOAuth:async d=>{if(!(t.authFlow instanceof vr))throw new C("Must initialize OAuth flow before calling loginWithOAuth");let p=po.get(wn),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:h??""}),new C("Unexpected auth flow. This may be a phishing attempt.");let w,L;if(a)w=await t.link();else try{({user:w,isNewUser:L}=await t.authenticate()),ut.current=d}catch(K){throw H(N,"login","onError",K.privyErrorCode||"unknown_auth_error"),K}c(w),x(L||!1),l(!0)},initLoginWithEmail:async(d,p)=>{let h=new gr(d,p);t.startAuthFlow(h);try{ut.current="email",await h.sendCodeEmail()}catch(w){throw H(N,"login","onError",w.privyErrorCode||"unknown_auth_error"),w}},initUpdateEmail:async(d,p,h)=>{let w=new ba(d,p,h);t.startAuthFlow(w),await w.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let h=new $r(d,p);t.startAuthFlow(h);try{ut.current="sms",await h.sendSmsCode()}catch(w){throw H(N,"login","onError",w.privyErrorCode||"unknown_auth_error"),w}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(!n)throw new gn;if(t.authFlow instanceof gr)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof $r)t.authFlow.meta.smsCode=d.trim();else throw new C("Must initialize a passwordless code flow first");let p,h;a?p=await t.link():{user:p,isNewUser:h}=await t.authenticate(),c(p||s||null),x(h||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:U,createAnalyticsEvent:(d,p,h)=>t.createAnalyticsEvent(d,p,h),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let h=s?.linkedAccounts.find(L=>L.type==="wallet"&&L.walletClientType==="privy"),w=await Ke();if(!w||!U||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await U.connect({accessToken:w,address:h.address}),d(!0)}catch(L){Kr(L)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:h.address}),(await U.recover({address:h.address,accessToken:w})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:h.address}),d(!0)):Kr(L)?(Ie({recoverWallet:{privyWallet:h,onFailure:p,onSuccess:()=>d(!0)}}),oe("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(L)}}),getFiatOnRampConfig:Br,setReadyToTrue:()=>{i(!0),Pt?.()},updateWallets:()=>Hr(),fundWallet:async(d,p)=>{let{signedUrl:h,externalTransactionId:w}=await Br(d,p);Ie({fiatOnRampPrompt:{signedUrl:h},fiatOnRampStatus:{externalTransactionId:w}}),oe("FIAT_ON_RAMP_PROMPT_SCREEN")}}))();Mg=Ae.recoverEmbeddedWallet;let av=(0,J.useMemo)(()=>({wallets:g,ready:so}),[g,so]);return(0,Mt.jsx)(ge.Provider,{value:yn,children:(0,Mt.jsx)(ec.Provider,{value:N,children:(0,Mt.jsx)(nd.Provider,{value:av,children:(0,Mt.jsxs)(bu,{...R,children:[e.children,(0,Mt.jsxs)(Xl.Provider,{value:Ae,children:[!vd&&R.captchaEnabled&&n&&!a&&(0,Mt.jsx)(cs,{delayedExecution:!1}),(0,Mt.jsx)(Tg,{theme:{...R.appearance.palette||{}}}),(0,Mt.jsx)(ou,{data:pt,setModalData:Ie,setInitialScreen:A,initialScreen:E,authenticated:a,open:o,children:(0,Mt.jsx)(Sg,{open:o})}),pe&&le?(0,Mt.jsx)(_g,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:ko,mfaSubmitPromise:mn,onLoad:j,onLoadFailed:()=>null}):null]})]})})})})};var Lg=require("react");function Og(e){let{login:t}=(0,Lg.useContext)(ge);return Be("login",e),{login:t}}var Dg=require("react");function Ug(e){let{logout:t}=(0,Dg.useContext)(ge);return Be("logout",e),{logout:t}}var fd=require("react");var Fg=()=>{let e=_e(),{initLoginWithEmail:t,loginWithCode:o}=G(),r=(0,fd.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return e.status==="disabled",t(i)},[t]),n=(0,fd.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new tr(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var hd=require("react");var Bg=()=>{let e=_e(),{initLoginWithSms:t,loginWithCode:o}=G(),r=(0,hd.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return e.status==="disabled",t(i)},[t]),n=(0,hd.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new tr(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var Hg=require("react");function Gg(e){let{connectWallet:t}=(0,Hg.useContext)(ge);return Be("connectWallet",e),{connectWallet:t}}var Vg=require("react");function zg(e){let{createWallet:t}=(0,Vg.useContext)(ge);return Be("createWallet",e),{createWallet:t}}var $g=()=>{let{fundWallet:e}=G();return{fundWallet:e}};var qg=require("react");function jg(e){let{sendTransaction:t}=(0,qg.useContext)(ge);return Be("sendTransaction",e),{sendTransaction:t}}var Kg=require("react");function Yg(e){let{setWalletPassword:t}=(0,Kg.useContext)(ge);return Be("setWalletPassword",e),{setWalletPassword:t}}var Jg=require("react");function Qg(e){let{signMessage:t}=(0,Jg.useContext)(ge);return Be("signMessage",e),{signMessage:t}}var Zg=require("react");function Xg(e){let{signTypedData:t}=(0,Zg.useContext)(ge);return Be("signTypedData",e),{signTypedData:t}}var ev=require("react");var tv=()=>{let{isModalOpen:e}=(0,ev.useContext)(ge);return{isOpen:e}};var ov=require("react");function rv(e){let{getAccessToken:t}=(0,ov.useContext)(ge);return Be("accessToken",e),{getAccessToken:t}}function nv(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,useConnectWallet,useCreateWallet,useFundWallet,useLogin,useLoginWithEmail,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSignMessage,useSignTypedData,useToken,useWallets});
|