@privy-io/react-auth 1.82.0 → 1.83.1

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.
@@ -0,0 +1,118 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var V=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Vn=(e,t,n)=>(V(e,t,"read from private field"),n?n.call(e):t.get(e)),$n= exports.b =(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Yn= exports.c =(e,t,n,r)=>(V(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var zn=(e,t,n)=>(V(e,t,"access private method"),n);var re="1.83.1";var oe="34357d3c125c2bcf2ce2bc3309d98715",Jn= exports.K ="https://auth.privy.io",Qn= exports.L =2e4,er= exports.M =1400,tr= exports.N =2500,nr= exports.O =4e3,rr= exports.P =re;var or="privy:token",ir= exports.R ="privy-token",sr= exports.S ="privy:refresh_token",ar= exports.T ="privy-refresh-token",lr= exports.U ="privy:id_token",cr= exports.V ="privy-id-token",pr= exports.W ="privy-session",ur= exports.X ="privy:session_transfer_token",xt="privy:wallet",dr= exports.Y ="privy:caid",mr= exports.Z =e=>`privy:guest:${e}`,hr= exports._ =e=>`privy:cross-app:${e}`,fr= exports.$ ="privy:state_code",gr= exports.aa ="privy:code_verifier",yr= exports.ba ="privy:headless_oauth",br= exports.ca ="privy:oauth_disable_signup",_r= exports.da =e=>`${xt}:${e}`,vr= exports.ea ="privy:connectors",Ar= exports.fa ="privy:connections";var Er=12e4,Cr= exports.ha =1,wr= exports.ia ="0x1",kr= exports.ja =3e4,Tr= exports.ka ="https://api.moonpay.com/v1",xr= exports.la ="https://api.moonpay.com/v1",Wr= exports.ma ="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Pr= exports.na ="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var Sr="deprecated";var ie={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},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 se={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var ae={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 le={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 ce={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},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"}}};var pe={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var ue={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var de={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 me={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 he={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 fe={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 ge={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}};var ye={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 be={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{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 _e={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 ve={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}};var D={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},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 Ae={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},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 Ee={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var Ce={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},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 we={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};var ke={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}};var Te={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var xe={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 We={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 Pe={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 N=[ie,se,Te,D,Ae,Ee,Ce,we,de,me,he,fe,ce,pe,ue,ve,be,_e,ae,le,xe,Pe,We,ye,ke,ge],Mo= exports.Na =new Set(N.map(e=>e.id));var _react = require('react');var o=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var W=_react.createContext.call(void 0, {ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:o,login:o,connectOrCreateWallet:o,linkEmail:o,linkPhone:o,linkFarcaster:o,linkWallet:o,startCrossAppAuthFlow:o,linkGoogle:o,linkTwitter:o,linkDiscord:o,linkGithub:o,linkSpotify:o,linkInstagram:o,linkTelegram:o,linkTiktok:o,linkLinkedIn:o,linkApple:o,linkPasskey:o,updateEmail:o,updatePhone:o,logout:o,getAccessToken:o,getEthereumProvider:o,getEthersProvider:o,getWeb3jsProvider:o,unlinkEmail:o,unlinkPhone:o,unlinkWallet:o,unlinkGoogle:o,unlinkTwitter:o,unlinkDiscord:o,unlinkGithub:o,unlinkSpotify:o,unlinkInstagram:o,unlinkTiktok:o,unlinkLinkedIn:o,unlinkApple:o,unlinkCrossAppAccount:o,unlinkFarcaster:o,unlinkTelegram:o,unlinkPasskey:o,setActiveWallet:o,forkSession:o,createWallet:o,importWallet:o,signMessage:o,signTypedData:o,enrollInMfa:o,initEnrollmentWithSms:o,initEnrollmentWithTotp:o,initEnrollmentWithPasskey:o,promptMfa:o,init:o,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:o,submitEnrollmentWithPasskey:o,unenroll:o,submit:o,cancel:o,sendTransaction:o,exportWallet:o,setWalletPassword:o,setWalletRecovery:o,requestFarcasterSignerFromWarpcast:o,getFarcasterSignerPublicKey:o,signFarcasterMessage:o,createGuestAccount:o,initLoginWithEmail:o,initLoginWithSms:o,otpState:{status:"initial"},loginWithCode:o,fundWallet:o,initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:o,generateSiweMessage:o,linkWithSiwe:o,signMessageWithCrossAppWallet:o,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:o,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[],setCustomMetadata:o}),Se= exports.Wa =()=>_react.useContext.call(void 0, W);var No={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},setCustomMetadata:{onSuccess:[],onError:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},It= exports.Za =_react.createContext.call(void 0, void 0),Me=()=>_react.useContext.call(void 0, It);function C(e,t){if(!t)return;let r=Me().current[e];return _react.useEffect.call(void 0, ()=>{for(let[i,s]of Object.entries(t))r.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${e}"`),_optionalChain([r, 'access', _2 => _2[i], 'optionalAccess', _3 => _3.push, 'call', _4 => _4(s)]);return()=>{for(let[i,s]of Object.entries(t))r.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${e}"`),r[i]=_optionalChain([r, 'access', _5 => _5[i], 'optionalAccess', _6 => _6.filter, 'call', _7 => _7(l=>l!==s)])}},[t])}function Ut(e,t,n,...r){for(let i of e.current[t][n])i(...r)}function Fo(){let e=Me();return(t,n,...r)=>Ut(e,t,n,...r)}function Go(e){let{logout:t}=_react.useContext.call(void 0, W);return C("logout",e),{logout:t}}var Nt=_react.createContext.call(void 0, null);function Yo(){let e=_react.useContext.call(void 0, Nt);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}function Jo(e){let{login:t}=_react.useContext.call(void 0, W);return C("login",e),{login:t}}function ri(e){let{connectWallet:t}=_react.useContext.call(void 0, W);return C("connectWallet",e),{connectWallet:t}}var ai=e=>{C("fundWallet",e);let{fundWallet:t}=Se();return{fundWallet:t}};var _ofetch = require('ofetch');var P=class extends Error{constructor(n,r,i){super(n);r instanceof Error&&(this.cause=r),this.privyErrorCode=i}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},F= exports.f =class extends P{constructor(n,r,i,s,l){super(i,s,l);this.type=n;this.status=r}},k= exports.g =class extends P{constructor(n,r,i){super(n,r,i);this.type="client_error"}},Oe= exports.h =class extends k{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var x=class extends P{constructor(n,r,i){super(n,r,i);this.type="connector_error"}},pi= exports.j =e=>{if(e instanceof P)return e;if(!(e instanceof _ofetch.FetchError))return Kt(e);if(!e.response)return new F("api_error",null,e.message,e);let{type:t,message:n,error:r,code:i}=e.data;return new F(t||"ApiError",e.response.status,n||r,e,i)},Kt= exports.k =e=>e instanceof P?e:e instanceof Error?new k(e.message,e):new k(`Internal error: ${e}`);var Ie=class extends k{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Ue= exports.m =class extends k{constructor(t="Embedded wallet error",n){super(t,n,"unknown_embedded_wallet_error")}},Re= exports.n =class extends k{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Le=class extends k{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var $=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,n){n!==void 0?this._cache[t]=n:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},j=class{get(t){let n=localStorage.getItem(t);return n===null?void 0:JSON.parse(n)}put(t,n){n!==void 0?localStorage.setItem(t,JSON.stringify(n)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function di(){try{let e="privy:__session_storage__test",t="blobby",n=new j;return n.put(e,t),n.del(e),!0}catch (e2){return!1}}function Bt(){return typeof window<"u"&&window.localStorage?new j:new $}var M=Bt();function De(){let e=window,t=e.ethereum;if(!t)return[];let n=[];if(_optionalChain([t, 'access', _8 => _8.providers, 'optionalAccess', _9 => _9.length]))for(let r of t.providers)r&&n.push(r);return n.push(e.ethereum),n}var H=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 Y=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||H(e)!=="MetaMask")return!1;if(e.providers){for(let n of e.providers)if(!Y(n))return!1}return!0},gi= exports.r =()=>!!("phantom"in window&&_optionalChain([window, 'optionalAccess', _10 => _10.phantom, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.isPhantom])),yi= exports.s =()=>{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 _providers = require('@ethersproject/providers');var Ci=(e,t)=>{let n=[],r=[];for(let[i,s]of e.entries())i<t?n.push(s):r.push(s);return[n,r]},wi= exports.u =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,}))$/),ki= exports.v =(e,t)=>{let n=e.slice(0),r=[];for(;n.length;)r.push(n.splice(0,t));return r},z= exports.w =(e,t=3,n=4,r="ethereum")=>{if(!e)return"";let i=r==="ethereum"?2:0,s=3;if(t+n+i+s>=e.length)return e;let l=e.slice(0,i+t),p=e.slice(e.length-n,e.length);return`${l}...${p}`},Gt= exports.x =e=>new Promise(t=>setTimeout(t,e));function Ti(e,{interval:t=100,timeout:n=5e3}={}){return new Promise((r,i)=>{let s=0,l,p=()=>{if(s>=n){i("Max attempts reached without result");return}if(l=e(),s+=t,l!=null){r(l);return}setTimeout(p,t)};p()})}var xi=(e,t={})=>{let n=t.delayMs||150,r=t.maxAttempts||270;return new Promise(async(i,s)=>{let l=!1,p=0;for(;!l&&p<r;){if(_optionalChain([t, 'access', _13 => _13.abortSignal, 'optionalAccess', _14 => _14.aborted]))return;e().then(a=>{l=!0,i(a)},(...a)=>{l=!0,s(...a)}),p+=1,await Gt(n)}l||s(new Error("Exceeded max attempts before resolving function"))})},Wi= exports.A =(e,t,n={},r={})=>{let i=new URL(t,e);for(let[l,p]of Object.entries(n))p!==void 0&&i.searchParams.set(l,p);let s=Object.entries(r);if(s.length>0){let l=new URLSearchParams;for(let[p,a]of s)l.append(p,a);i.hash=l.toString()}return i.href};var Pi=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Si= exports.C =e=>typeof e=="string"?e:"0x"+e.toString(16);async function Mi(e,t,n,r=3e3){let i=!1,s=window;return new Promise(l=>{s.ethereum?p():(window.addEventListener("ethereum#initialized",p,{once:!0}),setTimeout(()=>{p()},r));function p(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",p);let a=e.getProviders();console.debug("Detected injected providers:",a.map(d=>d.info));let u=[];for(let d of a)t.includes("coinbase_wallet")&&d.info.rdns==="com.coinbase.wallet"||u.push({type:d.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:d});for(let d of De()){let f=H(d);if(!a.some(m=>m.info.name===f)){if(Y(d,!0)&&!u.find(m=>m.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(f==="Phantom"&&!u.find(m=>m.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(f==="Coinbase Wallet"&&!u.find(m=>m.type==="coinbase_wallet"&&_optionalChain([n, 'optionalAccess', _15 => _15.coinbaseWallet, 'optionalAccess', _16 => _16.connectionOptions])!=="smartWalletOnly")){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find(m=>m.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}l(u)}})}function Oi(e){return`eip155:${String(Number(e))}`}var Ii=(e,t,n,r)=>{let i=Number(e),s=t.find(l=>l.id===i);if(!s)throw new x(`Unsupported chainId ${e}`,4901);return Vt(s,n,r)},Vt= exports.G =(e,t,n)=>{let r=e.id,i=Number(e.id),s;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])s=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[i])s=t.rpcUrls[i];else if(_optionalChain([e, 'access', _17 => _17.rpcUrls, 'access', _18 => _18.privy, 'optionalAccess', _19 => _19.http, 'access', _20 => _20[0]])){let l=new URL(e.rpcUrls.privy.http[0]);l.searchParams.append("privyAppId",n),s=l.toString()}else _optionalChain([e, 'access', _21 => _21.rpcUrls, 'access', _22 => _22.public, 'optionalAccess', _23 => _23.http, 'access', _24 => _24[0]])?s=e.rpcUrls.public.http[0]:s=_optionalChain([e, 'access', _25 => _25.rpcUrls, 'access', _26 => _26.default, 'optionalAccess', _27 => _27.http, 'access', _28 => _28[0]]);if(!s)throw new x(`No RPC url found for ${r}`);return s},Ne=(e,t)=>{let n=Number(e),r=t.find(i=>i.id===n);if(!r)throw new x(`Unsupported chainId ${e}`,4901);return _optionalChain([r, 'access', _29 => _29.blockExplorers, 'optionalAccess', _30 => _30.default, 'access', _31 => _31.url])},Ui= exports.H =(e,t,n,r)=>{let i=Number(e),s=t.find(p=>p.id===i);if(!s)throw new x(`Unsupported chainId ${e}`,4901);let l;if(s.rpcUrls.privyWalletOverride&&s.rpcUrls.privyWalletOverride.http[0]?l=new (0, _providers.StaticJsonRpcProvider)(s.rpcUrls.privyWalletOverride.http[0]):n.rpcUrls&&n.rpcUrls[i]?l=new (0, _providers.StaticJsonRpcProvider)(n.rpcUrls[i]):_optionalChain([s, 'access', _32 => _32.rpcUrls, 'access', _33 => _33.privy, 'optionalAccess', _34 => _34.http, 'access', _35 => _35[0]])?l=new (0, _providers.StaticJsonRpcProvider)({url:s.rpcUrls.privy.http[0],headers:{"privy-app-id":r.appId}}):_optionalChain([s, 'access', _36 => _36.rpcUrls, 'access', _37 => _37.public, 'optionalAccess', _38 => _38.http, 'access', _39 => _39[0]])?l=new (0, _providers.StaticJsonRpcProvider)(s.rpcUrls.public.http[0]):l=new (0, _providers.StaticJsonRpcProvider)(_optionalChain([s, 'access', _40 => _40.rpcUrls, 'access', _41 => _41.default, 'optionalAccess', _42 => _42.http, 'access', _43 => _43[0]])),!l)throw new x(`No RPC url found for ${e}`);return l},Ri= exports.I =e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=_nullishCoalesce(e.types.EIP712Domain, () => (Object.entries(e.domain).map(([r,i])=>{if(i!=null&&typeof r=="string"&&r in t)return{name:r,type:t[r]}}).filter(r=>r!==void 0)));return{...e,types:{...e.types,EIP712Domain:n}}};function Li(e,{min:t,max:n}){return Math.min(Math.max(e,t),n)}var _address = require('@ethersproject/address');function c(e){return e?new Date(e*1e3):null}function $t(e){let t=[];for(let n of e){let r=n.type;switch(n.type){case"wallet":let i={address:n.address,type:n.type,imported:n.imported,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at),chainType:n.chain_type,chainId:n.chain_id,walletClient:n.wallet_client_type==="privy"?"privy":"unknown",walletClientType:n.wallet_client_type,connectorType:n.connector_type,recoveryMethod:n.recovery_method,walletIndex:n.wallet_index};t.push(i);break;case"cross_app":let s={type:n.type,subject:n.subject,embeddedWallets:n.embedded_wallets,smartWallets:n.smart_wallets,providerApp:{id:n.provider_app_id},verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(s);break;case"email":let l={address:n.address,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(l);break;case"phone":let p={number:n.phoneNumber,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(p);break;case"google_oauth":let a={subject:n.subject,email:n.email,name:n.name,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(a);break;case"spotify_oauth":let u={subject:n.subject,email:n.email,name:n.name,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(u);break;case"instagram_oauth":let d={subject:n.subject,username:n.username,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(d);break;case"twitter_oauth":let f={subject:n.subject,username:n.username,name:n.name,type:n.type,profilePictureUrl:n.profile_picture_url,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(f);break;case"discord_oauth":let m={subject:n.subject,username:n.username,email:n.email,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(m);break;case"github_oauth":let _={subject:n.subject,username:n.username,name:n.name,email:n.email,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(_);break;case"tiktok_oauth":let h={subject:n.subject,username:n.username,name:n.name,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(h);break;case"linkedin_oauth":let g={subject:n.subject,name:n.name,email:n.email,vanityName:n.vanity_name,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(g);break;case"apple_oauth":let E={subject:n.subject,email:n.email,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(E);break;case"custom_auth":t.push({type:n.type,customUserId:n.custom_user_id,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)});break;case"farcaster":let w={type:n.type,fid:n.fid,ownerAddress:n.owner_address,displayName:n.display_name,username:n.username,bio:n.bio,pfp:n.profile_picture_url,url:n.homepage_url,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at),signerPublicKey:n.signer_public_key};t.push(w);break;case"passkey":let v={type:n.type,enrolledInMfa:n.enrolled_in_mfa,credentialId:n.credential_id,authenticatorName:n.authenticator_name,createdWithDevice:n.created_with_device,createdWithOs:n.created_with_os,createdWithBrowser:n.created_with_browser,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(v);break;case"telegram":let T={type:n.type,telegramUserId:n.telegram_user_id,firstName:n.first_name,lastName:n.last_name,username:n.username,photoUrl:n.photo_url,verifiedAt:c(n.first_verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(T);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function b(e,t){return e.slice().sort((n,r)=>(_nullishCoalesce(r.firstVerifiedAt, () => (r.verifiedAt))).getTime()-(_nullishCoalesce(n.firstVerifiedAt, () => (n.verifiedAt))).getTime()).find(n=>n.type===t)}var je=e=>_optionalChain([e, 'optionalAccess', _44 => _44.linkedAccounts, 'access', _45 => _45.find, 'call', _46 => _46(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"&&t.walletIndex===0)])||null,Fi= exports.qa =e=>_optionalChain([e, 'optionalAccess', _47 => _47.linkedAccounts, 'access', _48 => _48.filter, 'call', _49 => _49(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")]),Yt=e=>_optionalChain([e, 'optionalAccess', _50 => _50.linkedAccounts, 'access', _51 => _51.filter, 'call', _52 => _52(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.chainType==="ethereum")]),zt= exports.ra =e=>_optionalChain([e, 'optionalAccess', _53 => _53.linkedAccounts, 'access', _54 => _54.find, 'call', _55 => _55(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")])||null,ji= exports.sa =e=>_optionalChain([e, 'optionalAccess', _56 => _56.linkedAccounts, 'access', _57 => _57.find, 'call', _58 => _58(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")])||null,Hi= exports.ta =(e,t)=>{let n=Yt(e).find(i=>_address.getAddress.call(void 0, i.address)===_address.getAddress.call(void 0, t)),r=n?n.imported?n:je(e):void 0;return{signingWallet:n,rootWallet:r}},qt=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Ki= exports.ua =(e,t)=>je(e)||zt(e)?!1:t==="all-users"||t==="users-without-wallets"&&!_optionalChain([qt, 'call', _59 => _59(e), 'optionalAccess', _60 => _60.length]);function Bi(e){if(!e)return null;let t=$t(e.linked_accounts),n=b(t,"wallet"),r=b(t,"email"),i=b(t,"phone"),s=b(t,"google_oauth"),l=b(t,"twitter_oauth"),p=b(t,"discord_oauth"),a=b(t,"github_oauth"),u=b(t,"spotify_oauth"),d=b(t,"instagram_oauth"),f=b(t,"tiktok_oauth"),m=b(t,"linkedin_oauth"),_=b(t,"apple_oauth"),h=b(t,"farcaster"),g=b(t,"telegram"),E=e.mfa_methods.map(({type:v,verified_at:T})=>({type:v,verifiedAt:c(T)}));return{id:e.id,createdAt:c(e.created_at),linkedAccounts:t,email:r&&{address:_optionalChain([r, 'optionalAccess', _61 => _61.address])},phone:i&&{number:_optionalChain([i, 'optionalAccess', _62 => _62.number])},wallet:n&&{address:n.address,chainType:n.chainType,chainId:n.chainId,walletClient:n.walletClient,walletClientType:n.walletClientType,connectorType:n.connectorType,recoveryMethod:n.recoveryMethod,imported:n.imported,walletIndex:n.walletIndex},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:l&&{subject:l.subject,username:l.username,name:l.name,profilePictureUrl:l.profilePictureUrl},discord:p&&{subject:p.subject,username:p.username,email:p.email},github:a&&{subject:a.subject,username:a.username,name:a.name,email:a.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:m&&{subject:m.subject,name:m.name,email:m.email,vanityName:m.vanityName},apple:_&&{subject:_.subject,email:_.email},farcaster:h&&{fid:h.fid,ownerAddress:h.ownerAddress,displayName:h.displayName,username:h.username,bio:h.bio,pfp:h.pfp,url:h.url,signerPublicKey:h.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:E.map(v=>v.type),hasAcceptedTerms:_nullishCoalesce(e.has_accepted_terms, () => (!1)),isGuest:e.is_guest,customMetadata:e.custom_metadata}}var _jsxruntime = require('react/jsx-runtime');var Ke=({...e})=>_jsxruntime.jsx.call(void 0, "svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:_jsxruntime.jsx.call(void 0, "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 y={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:oe,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var Be=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],n=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let r of e.primary.slice(1))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let r of _nullishCoalesce(e.overflow, () => ([])))!t.includes(r)&&!n.includes(r)?n.push(r):console.warn(`Duplicated login method: ${r}`);return{primary:t,overflow:n}};var Xt=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet","safe"]),Ge=e=>Xt.has(e),Ve=(e,t,n)=>n.indexOf(e)===t,$e=({input:e,overrides:t})=>t?t.primary.concat(_nullishCoalesce(t.overflow, () => ([]))).filter(Ge).filter(Ve):e?e.filter(Ge).filter(Ve):y.appearance.walletList;var _tinycolor2 = require('tinycolor2'); var _tinycolor22 = _interopRequireDefault(_tinycolor2);var Ye="#FFFFFF",Zt="#040217",Jt=Ye,Qt="#1E1E1D";function en(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 A(e,t){let n=Math.max(0,Math.min(1,e.toHsl().l+t));return _tinycolor22.default.call(void 0, {...e.toHsl(),l:n})}var tn="#51BA81",nn="#FFB74D",rn="#EC6351",on=Ye,sn=Zt;function ze({backgroundTheme:e,accentHex:t}){let n;switch(e){case"light":n=Jt;break;case"dark":n=Qt;break;default:n=e;break}let r=_tinycolor22.default.call(void 0, n),i=_tinycolor22.default.call(void 0, t),s=_tinycolor22.default.call(void 0, tn),l=_tinycolor22.default.call(void 0, nn),p=_tinycolor22.default.call(void 0, rn),a=en(r.getLuminance()),u=A(r,a==="light"?-.04:.11),d=A(r,a==="light"?-.88:.87),f=A(r,a==="light"?-.7:.75),m=A(r,a==="light"?-.43:.45).desaturate(a==="light"?60:20),_=A(r,a==="light"?-.08:.25).desaturate(a==="light"?60:20),h=A(i,.15),g=A(i,-.06),E=A(p,.3),w=A(l,.3),v=_tinycolor22.default.call(void 0, i.getLuminance()>.5?sn:on),T=A(s,-.16),L=A(s,.4);return{colorScheme:a,background:r.toHslString(),background2:u.toHslString(),foreground:d.toHslString(),foreground2:f.toHslString(),foreground3:m.toHslString(),foreground4:_.toHslString(),accent:i.toHslString(),accentLight:h.toHslString(),accentDark:g.toHslString(),foregroundAccent:v.toHslString(),success:s.toHslString(),successDark:T.toHslString(),successLight:L.toHslString(),error:p.toHslString(),errorLight:E.toHslString(),warn:l.toHslString(),warnLight:w.toHslString()}}function q(e,t,n){let r=n?console.warn:()=>{},i,s,l,p,a,u,d,f,m,_,h,g,E,w,v;_optionalChain([t, 'optionalAccess', _63 => _63.loginMethods])?(i=t.loginMethods.includes("email"),s=t.loginMethods.includes("sms"),p=t.loginMethods.includes("wallet"),a=t.loginMethods.includes("google"),u=t.loginMethods.includes("twitter"),d=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),_=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),h=t.loginMethods.includes("linkedin"),E=t.loginMethods.includes("apple"),w=t.loginMethods.includes("farcaster"),v=t.loginMethods.includes("telegram")):(i=e.emailAuth,s=e.smsAuth,p=e.walletAuth,a=e.googleOAuth,u=e.twitterOAuth,d=e.discordOAuth,g=e.githubOAuth,m=e.spotifyOAuth,_=e.instagramOAuth,f=e.tiktokOAuth,h=e.linkedinOAuth,E=e.appleOAuth,w=e.farcasterAuth,v=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?l=!1:e.passkeyAuth&&(l=!0);let T=[i,s].filter(Boolean),L=[a,u,d,g,m,_,f,h,E,w,v].filter(Boolean),B=[p].filter(Boolean);if(T.length+L.length+B.length===0)throw new Error("You must enable at least one login method");let I=_optionalChain([t, 'optionalAccess', _64 => _64.appearance, 'optionalAccess', _65 => _65.showWalletLoginFirst])!==void 0?_optionalChain([t, 'optionalAccess', _66 => _66.appearance, 'optionalAccess', _67 => _67.showWalletLoginFirst]):e.showWalletLoginFirst;I&&B.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):!I&&L.length+T.length===0&&(r("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0);let bt=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _68 => _68.externalWallets, 'optionalAccess', _69 => _69.walletConnect, 'optionalAccess', _70 => _70.enabled]), () => (!0));_optionalChain([t, 'optionalAccess', _71 => _71.loginMethods])&&t.loginMethodsAndOrder&&r("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let _t=$e({input:_optionalChain([t, 'optionalAccess', _72 => _72.appearance, 'optionalAccess', _73 => _73.walletList]),overrides:_optionalChain([t, 'optionalAccess', _74 => _74.loginMethodsAndOrder])}),vt=Be({input:_optionalChain([t, 'optionalAccess', _75 => _75.loginMethodsAndOrder])}),At=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _76 => _76.intl, 'optionalAccess', _77 => _77.defaultCountry]), () => ("US")),{chains:Et,defaultChain:Ct}=an({additionalChains:_optionalChain([t, 'optionalAccess', _78 => _78.additionalChains]),supportedChains:_optionalChain([t, 'optionalAccess', _79 => _79.supportedChains]),defaultChainFromConfig:_optionalChain([t, 'optionalAccess', _80 => _80.defaultChain]),hasRpcConfigDefined:Object.keys(_nullishCoalesce(_optionalChain([t, 'optionalAccess', _81 => _81.rpcConfig, 'optionalAccess', _82 => _82.rpcUrls]), () => ({}))).length>0}),wt=!!_optionalChain([t, 'optionalAccess', _83 => _83.defaultChain]),G=_optionalChain([t, 'optionalAccess', _84 => _84.customAuth, 'optionalAccess', _85 => _85.getCustomAccessToken])&&_optionalChain([t, 'optionalAccess', _86 => _86.customAuth, 'optionalAccess', _87 => _87.enabled])!==!1,U,te=!(_nullishCoalesce(e.enforceWalletUis, () => (!0)));if(_nullishCoalesce(e.legacyWalletUiConfig, () => (!0))?G?U=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _88 => _88.embeddedWallets, 'optionalAccess', _89 => _89.noPromptOnSignature]), () => (!0)):U=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _90 => _90.embeddedWallets, 'optionalAccess', _91 => _91.noPromptOnSignature]), () => (te)):U=te,_optionalChain([t, 'optionalAccess', _92 => _92.embeddedWallets, 'optionalAccess', _93 => _93.waitForTransactionConfirmation])===!1&&U!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:ne,...kt}=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _94 => _94.embeddedWallets]), () => ({}));return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _95 => _95.appearance, 'optionalAccess', _96 => _96.logo]), () => (e.logoUrl)),landingHeader:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _97 => _97.appearance, 'optionalAccess', _98 => _98.landingHeader]), () => (y.appearance.landingHeader)),loginMessage:typeof _optionalChain([t, 'optionalAccess', _99 => _99.appearance, 'optionalAccess', _100 => _100.loginMessage])=="string"?_optionalChain([t, 'optionalAccess', _101 => _101.appearance, 'optionalAccess', _102 => _102.loginMessage, 'access', _103 => _103.slice, 'call', _104 => _104(0,100)]):_optionalChain([t, 'optionalAccess', _105 => _105.appearance, 'optionalAccess', _106 => _106.loginMessage]),palette:ze({backgroundTheme:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _107 => _107.appearance, 'optionalAccess', _108 => _108.theme]), () => (y.appearance.theme)),accentHex:_nullishCoalesce(_nullishCoalesce(_optionalChain([t, 'optionalAccess', _109 => _109.appearance, 'optionalAccess', _110 => _110.accentColor]), () => (e.accentColor)), () => (y.appearance.accentColor))}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!_optionalChain([t, 'optionalAccess', _111 => _111.appearance, 'optionalAccess', _112 => _112.hideDirectWeb2Inputs]),walletList:_t},loginMethods:{wallet:p,email:i,sms:s,passkey:l,google:a,twitter:u,discord:d,github:g,spotify:m,instagram:_,tiktok:f,linkedin:h,apple:E,farcaster:w,telegram:v},loginMethodsAndOrder:vt,legal:{termsAndConditionsUrl:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _113 => _113.legal, 'optionalAccess', _114 => _114.termsAndConditionsUrl]), () => (e.termsAndConditionsUrl)),privacyPolicyUrl:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _115 => _115.legal, 'optionalAccess', _116 => _116.privacyPolicyUrl]), () => (e.privacyPolicyUrl)),requireUsersAcceptTerms:_nullishCoalesce(e.requireUsersAcceptTerms, () => (!1))},walletConnectCloudProjectId:_nullishCoalesce(_nullishCoalesce(_optionalChain([t, 'optionalAccess', _117 => _117.walletConnectCloudProjectId]), () => (e.walletConnectCloudProjectId)), () => (y.walletConnectCloudProjectId)),rpcConfig:{rpcUrls:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _118 => _118.rpcConfig, 'optionalAccess', _119 => _119.rpcUrls]), () => (y.rpcConfig.rpcUrls)),rpcTimeouts:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _120 => _120.rpcConfig, 'optionalAccess', _121 => _121.rpcTimeouts]), () => (y.rpcConfig.rpcTimeouts))},chains:Et,defaultChain:Ct,intl:{defaultCountry:At},shouldEnforceDefaultChainOnConnect:wt,captchaEnabled:_nullishCoalesce(e.captchaEnabled, () => (y.captchaEnabled)),captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _122 => _122.externalWallets, 'optionalAccess', _123 => _123.coinbaseWallet, 'optionalAccess', _124 => _124.connectionOptions]), () => (y.externalWallets.coinbaseWallet.connectionOptions))},walletConnect:{enabled:bt}},embeddedWallets:{...e.embeddedWalletConfig,...typeof ne=="boolean"?{requireUserOwnedRecoveryOnCreate:ne}:{},...G?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...kt,noPromptOnSignature:U},mfa:{methods:_nullishCoalesce(e.mfaMethods, () => ([])),noPromptOnMfaRequired:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _125 => _125.mfa, 'optionalAccess', _126 => _126.noPromptOnMfaRequired]), () => (!1))},customAuth:G?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!_optionalChain([t, 'optionalAccess', _127 => _127.headless]),render:{standalone:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _128 => _128._render, 'optionalAccess', _129 => _129.standalone]), () => (y._render.standalone))},fundingConfig:e.fundingConfig,fundingMethodConfig:{..._nullishCoalesce(_optionalChain([t, 'optionalAccess', _130 => _130.fundingMethodConfig]), () => (y.fundingMethodConfig)),moonpay:{..._nullishCoalesce(_optionalChain([t, 'optionalAccess', _131 => _131.fundingMethodConfig, 'optionalAccess', _132 => _132.moonpay]), () => (y.fundingMethodConfig.moonpay)),useSandbox:_nullishCoalesce(_nullishCoalesce(_optionalChain([t, 'optionalAccess', _133 => _133.fundingMethodConfig, 'optionalAccess', _134 => _134.moonpay, 'access', _135 => _135.useSandbox]), () => (_optionalChain([t, 'optionalAccess', _136 => _136.fiatOnRamp, 'optionalAccess', _137 => _137.useSandbox]))), () => (y.fundingMethodConfig.moonpay.useSandbox))}}}}function qe(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:n,additionalChains:r,supportedChains:i,defaultChain:s,...l}=e;return{...l,...r?{additionalChains:r.map(a=>a.id)}:void 0,...i?{supportedChains:i.map(a=>a.id)}:void 0,...s?{defaultChain:s.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function an({additionalChains:e,supportedChains:t,defaultChainFromConfig:n,hasRpcConfigDefined:r}){let i;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(a=>a.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`."),i=t.map(a=>a.rpcUrls.privyWalletOverride?a:_nullishCoalesce(N.find(d=>d.id===a.id), () => (a)))}else i=N.concat(_nullishCoalesce(e, () => ([])));let s=t?i[0]:D,l=_nullishCoalesce(n, () => (s));if(!i.find(p=>p.id===l.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:l}}var Xe=function(e,t=0){let n=3735928559^t,r=1103547991^t;for(let i=0,s;i<e.length;i++)s=e.charCodeAt(i),n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)};var Qe={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},un= exports.Oa =q(Qe,void 0,!1),X=_react.createContext.call(void 0, {appConfig:un,isServerConfigLoaded:!1}),ms= exports.Pa =({children:e,legacyCreateEmbeddedWalletFlag:t,client:n,clientConfig:r})=>{let[i,s]=_react.useState.call(void 0, null),l=_react.useMemo.call(void 0, ()=>q(_nullishCoalesce(i, () => (Qe)),r,!!i),[i,r]);return _react.useEffect.call(void 0, ()=>{if(!i)return;let p=qe(r,t),a=Xe(JSON.stringify(p)).toString(),u=`privy:sent:${i.id}:${a}`;localStorage.getItem(u)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:p}),localStorage.setItem(u,"t"))},[r,t,i]),_react.useEffect.call(void 0, ()=>{i||(async()=>{try{let a=await n.getServerConfig();a.customApiUrl&&n.updateApiUrl(a.customApiUrl),s(a)}catch(a){console.warn("Error generating app config: ",a)}})()},[]),_jsxruntime.jsx.call(void 0, X.Provider,{value:{appConfig:l,isServerConfigLoaded:!!i},children:e})},et= exports.Qa =()=>{let{appConfig:e}=_react.useContext.call(void 0, X);return e},hs= exports.Ra =()=>{let{isServerConfigLoaded:e}=_react.useContext.call(void 0, X);return e};var fn=_react.createContext.call(void 0, {isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},nativeTokenSymbolForChainId:o,initializeWalletProxy:o,getAuthMeta:o,getAuthFlow:o,closePrivyModal:o,openPrivyModal:o,connectWallet:o,initLoginWithWallet:o,loginWithWallet:o,initLoginWithFarcaster:o,loginWithFarcaster:o,loginWithCode:o,initLoginWithEmail:o,initLoginWithSms:o,initUpdateEmail:o,initUpdatePhone:o,resendEmailCode:o,resendSmsCode:o,initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:o,crossAppAuthFlow:o,initLoginWithOAuth:o,recoveryOAuthFlow:o,loginWithOAuth:o,initLoginWithPasskey:o,loginWithPasskey:o,initLinkWithPasskey:o,linkWithPasskey:o,refreshUser:o,loginWithGuestAccountFlow:o,walletProxy:null,createAnalyticsEvent:o,acceptTerms:o,getUsdTokenPrice:o,recoverEmbeddedEthereumWallet:o,getMoonpaySignedUrl:o,initCoinbaseOnRamp:o,getCoinbaseOnRampStatus:o,updateWallets:o,fundWallet:o,setReadyToTrue:o,requestFarcasterSignerStatus:o,initLoginWithTelegram:o,loginWithTelegram:o,generateSiweMessage:o,linkWithSiwe:o,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:o,recoverEmbeddedSolanaWallet:o,exportSolanaWallet:o,solanaSignMessage:o,connectCoinbaseSmartWallet:o,setCustomMetadataForUser:o}),tt= exports.Ua =()=>_react.useContext.call(void 0, fn);var As=e=>{let[t,n]=_react.useState.call(void 0, "auto");return _react.useEffect.call(void 0, ()=>{let r=new ResizeObserver(i=>{n(_nullishCoalesce(_optionalChain([i, 'access', _138 => _138[0], 'optionalAccess', _139 => _139.contentRect, 'access', _140 => _140.height]), () => ("auto")))});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},[e.current]),t};var _styledcomponents = require('styled-components'); var _styledcomponents2 = _interopRequireDefault(_styledcomponents);var Z=_styledcomponents2.default.div`
2
+ margin-top: 16px;
3
+ font-size: 13px;
4
+ text-align: center;
5
+ color: var(--privy-color-foreground-3);
6
+
7
+ && > a {
8
+ color: var(--privy-color-accent);
9
+ }
10
+ `;function ks(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:n,requireUsersAcceptTerms:r}}=e.app;if(r&&!e.alwaysShowImplicitConsent)return _jsxruntime.jsx.call(void 0, Z,{});if(!n&&!t)return _jsxruntime.jsx.call(void 0, Z,{});let i=!!(t&&n);return _jsxruntime.jsxs.call(void 0, Z,{children:["By logging in I agree to the"," ",n&&_jsxruntime.jsx.call(void 0, "a",{href:n,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",t&&_jsxruntime.jsx.call(void 0, "a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var Ts=()=>_jsxruntime.jsxs.call(void 0, bn,{children:[_jsxruntime.jsx.call(void 0, Ke,{}),_jsxruntime.jsx.call(void 0, "a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),bn= exports.db =_styledcomponents2.default.div`
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ padding-top: 8px;
15
+ padding-bottom: 12px;
16
+ gap: 2px;
17
+
18
+ font-size: 13px;
19
+
20
+ && svg {
21
+ height: 14px;
22
+ width: 14px;
23
+ margin-bottom: 2px;
24
+ opacity: 0.5;
25
+ }
26
+
27
+ && a {
28
+ color: var(--privy-color-foreground-3);
29
+ &:hover {
30
+ text-decoration: underline;
31
+ }
32
+ }
33
+
34
+ @media all and (display-mode: standalone) {
35
+ padding-bottom: 30px;
36
+ }
37
+ `;var it=_react.createContext.call(void 0, {}),Rs= exports.gb =({children:e})=>{let t=et(),[n,r]=_react.useState.call(void 0, {});return C("login",{onComplete:(i,s,l,p,a)=>{!a||a.type==="passkey"||a.type==="cross_app"||a.type==="wallet"&&a.walletClientType==="privy"||(M.put(ot(t.id),a.type),a.type==="wallet"?(M.put(J(t.id),a.walletClientType),r({accountType:a.type,walletClientType:a.walletClientType})):(M.del(J(t.id)),r({accountType:a.type})))}}),_react.useEffect.call(void 0, ()=>{if(!t.id)return;let i=M.get(ot(t.id)),s=M.get(J(t.id));i&&r(i==="wallet"?{accountType:i,walletClientType:s}:{accountType:i})},[t.id]),_jsxruntime.jsx.call(void 0, it.Provider,{value:n,children:e})},ot=e=>`privy:${e}:recent-login-method`,J=e=>`privy:${e}:recent-login-wallet-client`,Ls= exports.hb =()=>_react.useContext.call(void 0, it);var _Square2StackIcon = require('@heroicons/react/24/outline/Square2StackIcon'); var _Square2StackIcon2 = _interopRequireDefault(_Square2StackIcon);var at=({address:e,showCopyIcon:t,url:n,className:r})=>n?_jsxruntime.jsx.call(void 0, "a",{title:e,className:r,href:`${n}/address/${e}`,target:"_blank",children:z(e)}):_jsxruntime.jsxs.call(void 0, "button",{title:e,className:r,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[z(e),t&&_jsxruntime.jsx.call(void 0, Tn,{})]}),Tn=_styledcomponents2.default.call(void 0, _Square2StackIcon2.default)`
38
+ && {
39
+ display: inline;
40
+ }
41
+ stroke-width: 2;
42
+ height: 0.875rem;
43
+ width: 0.875rem;
44
+ margin-left: 0.125rem;
45
+ color: var(--privy-color-foreground-3);
46
+ `;var Pn=_styledcomponents.keyframes`
47
+ from, to {
48
+ background: var(--privy-color-foreground-4);
49
+ color: var(--privy-color-foreground-4);
50
+ }
51
+
52
+ 50% {
53
+ background: var(--privy-color-foreground-accent);
54
+ color: var(--privy-color-foreground-accent);
55
+ }
56
+ `,ct= exports.eb =_styledcomponents.css`
57
+ ${e=>e.$isLoading?_styledcomponents.css`
58
+ width: 35%;
59
+ animation: ${Pn} 2s linear infinite;
60
+ border-radius: var(--privy-border-radius-sm);
61
+ `:""}
62
+ `;var ut=({children:e,color:t,isLoading:n,isPulsing:r,className:i})=>_jsxruntime.jsx.call(void 0, On,{$color:t,$isLoading:n,$isPulsing:r,className:i,children:e}),On=_styledcomponents2.default.span`
63
+ padding: 0.125rem 0.5rem;
64
+ font-size: 0.75rem;
65
+ font-weight: 500;
66
+ line-height: 1.125rem; /* 150% */
67
+ border-radius: var(--privy-border-radius-sm);
68
+
69
+ ${e=>{let t,n;e.$color==="green"&&(t="var(--privy-color-success-dark)",n="var(--privy-color-success-light)"),e.$color==="red"&&(t="var(--privy-color-error)",n="var(--privy-color-error-light)"),e.$color==="gray"&&(t="var(--privy-color-foreground-2)",n="var(--privy-color-background-2)");let r=_styledcomponents.keyframes`
70
+ from, to {
71
+ background-color: ${n};
72
+ }
73
+
74
+ 50% {
75
+ background-color: rgba(${n}, 0.8);
76
+ }
77
+ `;return _styledcomponents.css`
78
+ color: ${t};
79
+ background-color: ${n};
80
+ ${e.$isPulsing&&_styledcomponents.css`
81
+ animation: ${r} 3s linear infinite;
82
+ `};
83
+ `}}
84
+
85
+ ${ct}
86
+ `;var dt=_styledcomponents2.default.div`
87
+ display: flex;
88
+ flex-direction: column;
89
+ `;var mt=_styledcomponents2.default.span`
90
+ text-align: left;
91
+ font-size: 0.75rem;
92
+ font-weight: 500;
93
+ line-height: 1.125rem; /* 150% */
94
+
95
+ color: var(--privy-color-error);
96
+ `;var ht=_styledcomponents2.default.span`
97
+ color: var(--privy-color-foreground-3);
98
+ font-size: 0.75rem;
99
+ font-weight: 500;
100
+ line-height: 1.125rem; /* 150% */
101
+ `;var Fn=_styledcomponents.css`
102
+ && {
103
+ border-width: 1px;
104
+ padding: 0.5rem 1rem;
105
+ }
106
+
107
+ width: 100%;
108
+ text-align: left;
109
+ border: solid 1px var(--privy-color-foreground-4);
110
+ border-radius: var(--privy-border-radius-md);
111
+ display: flex;
112
+ justify-content: space-between;
113
+ align-items: center;
114
+
115
+ ${e=>e.$state==="error"?"border-color: var(--privy-color-error);":""}
116
+ `,ft= exports.mb =_styledcomponents2.default.div`
117
+ ${Fn}
118
+ `;var pa=({errMsg:e,balance:t,address:n,isLoading:r,className:i,title:s,isPulsing:l,showIcon:p,statusColor:a="green"})=>{let u;return a?u=a:e?u="red":u="green",_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, ft,{className:i,$state:e?"error":void 0,children:[_jsxruntime.jsxs.call(void 0, dt,{children:[_jsxruntime.jsx.call(void 0, ht,{children:s||"Pay with"}),_jsxruntime.jsx.call(void 0, at,{address:n,showCopyIcon:p||!!e})]}),t!==void 0&&_jsxruntime.jsx.call(void 0, ut,{isLoading:r,isPulsing:l,color:u,children:t})]}),e&&_jsxruntime.jsx.call(void 0, mt,{style:{marginTop:"0.25rem"},children:e})]})};var _bignumber = require('@ethersproject/bignumber');var _units = require('@ethersproject/units');var _jssdkcore = require('@privy-io/js-sdk-core');var Bn=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),yt=e=>Bn.format(e),ba= exports.rb =(e,t)=>{let n=yt(t*parseFloat(e));return n!=="$0.00"?n:"<$0.01"},_a= exports.sb =(e,t)=>{let n=yt(t*parseFloat(_units.formatEther.call(void 0, e)));return n==="$0.00"?"<$0.01":n},va= exports.tb =(e,t,n=6,r=!1)=>{let s=parseFloat(_units.formatEther.call(void 0, e)).toFixed(n).replace(/0+$/,"").replace(/\.$/,"");return r?`${s} ${t}`:`${s==="0"?"<0.001":s} ${t}`},Aa= exports.ub =e=>e.map(_jssdkcore.QuantityToBigNumber).reduce((t,n)=>t.add(n),_bignumber.BigNumber.from(0)).toHexString(),Ea= exports.vb =(e,t)=>{let{chains:n}=tt(),r=`https://etherscan.io/address/${t}`,i=`${Ne(e,n)}/address/${t}`;if(!i)return r;try{new URL(i)}catch (e3){return r}return i};var wa=({color:e,...t})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "g",{children:_jsxruntime.jsx.call(void 0, "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"})})});exports.a = Vn; exports.b = $n; exports.c = Yn; exports.d = zn; exports.e = P; exports.f = F; exports.g = k; exports.h = Oe; exports.i = x; exports.j = pi; exports.k = Kt; exports.l = Ie; exports.m = Ue; exports.n = Re; exports.o = Le; exports.p = di; exports.q = M; exports.r = gi; exports.s = yi; exports.t = Ci; exports.u = wi; exports.v = ki; exports.w = z; exports.x = Gt; exports.y = Ti; exports.z = xi; exports.A = Wi; exports.B = Pi; exports.C = Si; exports.D = Mi; exports.E = Oi; exports.F = Ii; exports.G = Vt; exports.H = Ui; exports.I = Ri; exports.J = Li; exports.K = Jn; exports.L = Qn; exports.M = er; exports.N = tr; exports.O = nr; exports.P = rr; exports.Q = or; exports.R = ir; exports.S = sr; exports.T = ar; exports.U = lr; exports.V = cr; exports.W = pr; exports.X = ur; exports.Y = dr; exports.Z = mr; exports._ = hr; exports.$ = fr; exports.aa = gr; exports.ba = yr; exports.ca = br; exports.da = _r; exports.ea = vr; exports.fa = Ar; exports.ga = Er; exports.ha = Cr; exports.ia = wr; exports.ja = kr; exports.ka = Tr; exports.la = xr; exports.ma = Wr; exports.na = Pr; exports.oa = Sr; exports.pa = je; exports.qa = Fi; exports.ra = zt; exports.sa = ji; exports.ta = Hi; exports.ua = Ki; exports.va = Bi; exports.wa = Ke; exports.xa = ie; exports.ya = se; exports.za = ae; exports.Aa = le; exports.Ba = ce; exports.Ca = pe; exports.Da = de; exports.Ea = be; exports.Fa = D; exports.Ga = Ae; exports.Ha = Ee; exports.Ia = Ce; exports.Ja = we; exports.Ka = Te; exports.La = xe; exports.Ma = N; exports.Na = Mo; exports.Oa = un; exports.Pa = ms; exports.Qa = et; exports.Ra = hs; exports.Sa = o; exports.Ta = fn; exports.Ua = tt; exports.Va = W; exports.Wa = Se; exports.Xa = As; exports.Ya = No; exports.Za = It; exports._a = C; exports.$a = Ut; exports.ab = Fo; exports.bb = ks; exports.cb = Ts; exports.db = bn; exports.eb = ct; exports.fb = ut; exports.gb = Rs; exports.hb = Ls; exports.ib = at; exports.jb = Go; exports.kb = mt; exports.lb = Fn; exports.mb = ft; exports.nb = pa; exports.ob = wa; exports.pb = Nt; exports.qb = Yo; exports.rb = ba; exports.sb = _a; exports.tb = va; exports.ub = Aa; exports.vb = Ea; exports.wb = Jo; exports.xb = ri; exports.yb = ai;
@@ -0,0 +1,118 @@
1
+ var V=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Vn=(e,t,n)=>(V(e,t,"read from private field"),n?n.call(e):t.get(e)),$n=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Yn=(e,t,n,r)=>(V(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var zn=(e,t,n)=>(V(e,t,"access private method"),n);var re="1.83.1";var oe="34357d3c125c2bcf2ce2bc3309d98715",Jn="https://auth.privy.io",Qn=2e4,er=1400,tr=2500,nr=4e3,rr=re;var or="privy:token",ir="privy-token",sr="privy:refresh_token",ar="privy-refresh-token",lr="privy:id_token",cr="privy-id-token",pr="privy-session",ur="privy:session_transfer_token",xt="privy:wallet",dr="privy:caid",mr=e=>`privy:guest:${e}`,hr=e=>`privy:cross-app:${e}`,fr="privy:state_code",gr="privy:code_verifier",yr="privy:headless_oauth",br="privy:oauth_disable_signup",_r=e=>`${xt}:${e}`,vr="privy:connectors",Ar="privy:connections";var Er=12e4,Cr=1,wr="0x1",kr=3e4,Tr="https://api.moonpay.com/v1",xr="https://api.moonpay.com/v1",Wr="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Pr="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var Sr="deprecated";var ie={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},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 se={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var ae={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 le={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 ce={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},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"}}};var pe={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var ue={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var de={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 me={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 he={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 fe={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 ge={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}};var ye={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 be={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{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 _e={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 ve={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}};var D={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},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 Ae={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},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 Ee={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var Ce={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},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 we={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};var ke={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}};var Te={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var xe={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 We={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 Pe={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 N=[ie,se,Te,D,Ae,Ee,Ce,we,de,me,he,fe,ce,pe,ue,ve,be,_e,ae,le,xe,Pe,We,ye,ke,ge],Mo=new Set(N.map(e=>e.id));import{createContext as Wt,useContext as Pt}from"react";var o=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var W=Wt({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:o,login:o,connectOrCreateWallet:o,linkEmail:o,linkPhone:o,linkFarcaster:o,linkWallet:o,startCrossAppAuthFlow:o,linkGoogle:o,linkTwitter:o,linkDiscord:o,linkGithub:o,linkSpotify:o,linkInstagram:o,linkTelegram:o,linkTiktok:o,linkLinkedIn:o,linkApple:o,linkPasskey:o,updateEmail:o,updatePhone:o,logout:o,getAccessToken:o,getEthereumProvider:o,getEthersProvider:o,getWeb3jsProvider:o,unlinkEmail:o,unlinkPhone:o,unlinkWallet:o,unlinkGoogle:o,unlinkTwitter:o,unlinkDiscord:o,unlinkGithub:o,unlinkSpotify:o,unlinkInstagram:o,unlinkTiktok:o,unlinkLinkedIn:o,unlinkApple:o,unlinkCrossAppAccount:o,unlinkFarcaster:o,unlinkTelegram:o,unlinkPasskey:o,setActiveWallet:o,forkSession:o,createWallet:o,importWallet:o,signMessage:o,signTypedData:o,enrollInMfa:o,initEnrollmentWithSms:o,initEnrollmentWithTotp:o,initEnrollmentWithPasskey:o,promptMfa:o,init:o,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:o,submitEnrollmentWithPasskey:o,unenroll:o,submit:o,cancel:o,sendTransaction:o,exportWallet:o,setWalletPassword:o,setWalletRecovery:o,requestFarcasterSignerFromWarpcast:o,getFarcasterSignerPublicKey:o,signFarcasterMessage:o,createGuestAccount:o,initLoginWithEmail:o,initLoginWithSms:o,otpState:{status:"initial"},loginWithCode:o,fundWallet:o,initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:o,generateSiweMessage:o,linkWithSiwe:o,signMessageWithCrossAppWallet:o,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:o,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[],setCustomMetadata:o}),Se=()=>Pt(W);import{useContext as Rt}from"react";import{createContext as St,useContext as Mt,useEffect as Ot}from"react";var No={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},setCustomMetadata:{onSuccess:[],onError:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},It=St(void 0),Me=()=>Mt(It);function C(e,t){if(!t)return;let r=Me().current[e];return Ot(()=>{for(let[i,s]of Object.entries(t))r.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${e}"`),r[i]?.push(s);return()=>{for(let[i,s]of Object.entries(t))r.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${e}"`),r[i]=r[i]?.filter(l=>l!==s)}},[t])}function Ut(e,t,n,...r){for(let i of e.current[t][n])i(...r)}function Fo(){let e=Me();return(t,n,...r)=>Ut(e,t,n,...r)}function Go(e){let{logout:t}=Rt(W);return C("logout",e),{logout:t}}import{createContext as Lt,useContext as Dt}from"react";var Nt=Lt(null);function Yo(){let e=Dt(Nt);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}import{useContext as Ft}from"react";function Jo(e){let{login:t}=Ft(W);return C("login",e),{login:t}}import{useContext as jt}from"react";function ri(e){let{connectWallet:t}=jt(W);return C("connectWallet",e),{connectWallet:t}}var ai=e=>{C("fundWallet",e);let{fundWallet:t}=Se();return{fundWallet:t}};import{FetchError as Ht}from"ofetch";var P=class extends Error{constructor(n,r,i){super(n);r instanceof Error&&(this.cause=r),this.privyErrorCode=i}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},F=class extends P{constructor(n,r,i,s,l){super(i,s,l);this.type=n;this.status=r}},k=class extends P{constructor(n,r,i){super(n,r,i);this.type="client_error"}},Oe=class extends k{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var x=class extends P{constructor(n,r,i){super(n,r,i);this.type="connector_error"}},pi=e=>{if(e instanceof P)return e;if(!(e instanceof Ht))return Kt(e);if(!e.response)return new F("api_error",null,e.message,e);let{type:t,message:n,error:r,code:i}=e.data;return new F(t||"ApiError",e.response.status,n||r,e,i)},Kt=e=>e instanceof P?e:e instanceof Error?new k(e.message,e):new k(`Internal error: ${e}`);var Ie=class extends k{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Ue=class extends k{constructor(t="Embedded wallet error",n){super(t,n,"unknown_embedded_wallet_error")}},Re=class extends k{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Le=class extends k{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var $=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,n){n!==void 0?this._cache[t]=n:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},j=class{get(t){let n=localStorage.getItem(t);return n===null?void 0:JSON.parse(n)}put(t,n){n!==void 0?localStorage.setItem(t,JSON.stringify(n)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function di(){try{let e="privy:__session_storage__test",t="blobby",n=new j;return n.put(e,t),n.del(e),!0}catch{return!1}}function Bt(){return typeof window<"u"&&window.localStorage?new j:new $}var M=Bt();function De(){let e=window,t=e.ethereum;if(!t)return[];let n=[];if(t.providers?.length)for(let r of t.providers)r&&n.push(r);return n.push(e.ethereum),n}var H=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 Y=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||H(e)!=="MetaMask")return!1;if(e.providers){for(let n of e.providers)if(!Y(n))return!1}return!0},gi=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),yi=()=>{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};import{StaticJsonRpcProvider as R}from"@ethersproject/providers";var Ci=(e,t)=>{let n=[],r=[];for(let[i,s]of e.entries())i<t?n.push(s):r.push(s);return[n,r]},wi=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,}))$/),ki=(e,t)=>{let n=e.slice(0),r=[];for(;n.length;)r.push(n.splice(0,t));return r},z=(e,t=3,n=4,r="ethereum")=>{if(!e)return"";let i=r==="ethereum"?2:0,s=3;if(t+n+i+s>=e.length)return e;let l=e.slice(0,i+t),p=e.slice(e.length-n,e.length);return`${l}...${p}`},Gt=e=>new Promise(t=>setTimeout(t,e));function Ti(e,{interval:t=100,timeout:n=5e3}={}){return new Promise((r,i)=>{let s=0,l,p=()=>{if(s>=n){i("Max attempts reached without result");return}if(l=e(),s+=t,l!=null){r(l);return}setTimeout(p,t)};p()})}var xi=(e,t={})=>{let n=t.delayMs||150,r=t.maxAttempts||270;return new Promise(async(i,s)=>{let l=!1,p=0;for(;!l&&p<r;){if(t.abortSignal?.aborted)return;e().then(a=>{l=!0,i(a)},(...a)=>{l=!0,s(...a)}),p+=1,await Gt(n)}l||s(new Error("Exceeded max attempts before resolving function"))})},Wi=(e,t,n={},r={})=>{let i=new URL(t,e);for(let[l,p]of Object.entries(n))p!==void 0&&i.searchParams.set(l,p);let s=Object.entries(r);if(s.length>0){let l=new URLSearchParams;for(let[p,a]of s)l.append(p,a);i.hash=l.toString()}return i.href};var Pi=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Si=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Mi(e,t,n,r=3e3){let i=!1,s=window;return new Promise(l=>{s.ethereum?p():(window.addEventListener("ethereum#initialized",p,{once:!0}),setTimeout(()=>{p()},r));function p(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",p);let a=e.getProviders();console.debug("Detected injected providers:",a.map(d=>d.info));let u=[];for(let d of a)t.includes("coinbase_wallet")&&d.info.rdns==="com.coinbase.wallet"||u.push({type:d.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:d});for(let d of De()){let f=H(d);if(!a.some(m=>m.info.name===f)){if(Y(d,!0)&&!u.find(m=>m.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(f==="Phantom"&&!u.find(m=>m.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(f==="Coinbase Wallet"&&!u.find(m=>m.type==="coinbase_wallet"&&n?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find(m=>m.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}l(u)}})}function Oi(e){return`eip155:${String(Number(e))}`}var Ii=(e,t,n,r)=>{let i=Number(e),s=t.find(l=>l.id===i);if(!s)throw new x(`Unsupported chainId ${e}`,4901);return Vt(s,n,r)},Vt=(e,t,n)=>{let r=e.id,i=Number(e.id),s;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])s=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[i])s=t.rpcUrls[i];else if(e.rpcUrls.privy?.http[0]){let l=new URL(e.rpcUrls.privy.http[0]);l.searchParams.append("privyAppId",n),s=l.toString()}else e.rpcUrls.public?.http[0]?s=e.rpcUrls.public.http[0]:s=e.rpcUrls.default?.http[0];if(!s)throw new x(`No RPC url found for ${r}`);return s},Ne=(e,t)=>{let n=Number(e),r=t.find(i=>i.id===n);if(!r)throw new x(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url},Ui=(e,t,n,r)=>{let i=Number(e),s=t.find(p=>p.id===i);if(!s)throw new x(`Unsupported chainId ${e}`,4901);let l;if(s.rpcUrls.privyWalletOverride&&s.rpcUrls.privyWalletOverride.http[0]?l=new R(s.rpcUrls.privyWalletOverride.http[0]):n.rpcUrls&&n.rpcUrls[i]?l=new R(n.rpcUrls[i]):s.rpcUrls.privy?.http[0]?l=new R({url:s.rpcUrls.privy.http[0],headers:{"privy-app-id":r.appId}}):s.rpcUrls.public?.http[0]?l=new R(s.rpcUrls.public.http[0]):l=new R(s.rpcUrls.default?.http[0]),!l)throw new x(`No RPC url found for ${e}`);return l},Ri=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=e.types.EIP712Domain??Object.entries(e.domain).map(([r,i])=>{if(i!=null&&typeof r=="string"&&r in t)return{name:r,type:t[r]}}).filter(r=>r!==void 0);return{...e,types:{...e.types,EIP712Domain:n}}};function Li(e,{min:t,max:n}){return Math.min(Math.max(e,t),n)}import{getAddress as Fe}from"@ethersproject/address";function c(e){return e?new Date(e*1e3):null}function $t(e){let t=[];for(let n of e){let r=n.type;switch(n.type){case"wallet":let i={address:n.address,type:n.type,imported:n.imported,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at),chainType:n.chain_type,chainId:n.chain_id,walletClient:n.wallet_client_type==="privy"?"privy":"unknown",walletClientType:n.wallet_client_type,connectorType:n.connector_type,recoveryMethod:n.recovery_method,walletIndex:n.wallet_index};t.push(i);break;case"cross_app":let s={type:n.type,subject:n.subject,embeddedWallets:n.embedded_wallets,smartWallets:n.smart_wallets,providerApp:{id:n.provider_app_id},verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(s);break;case"email":let l={address:n.address,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(l);break;case"phone":let p={number:n.phoneNumber,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(p);break;case"google_oauth":let a={subject:n.subject,email:n.email,name:n.name,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(a);break;case"spotify_oauth":let u={subject:n.subject,email:n.email,name:n.name,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(u);break;case"instagram_oauth":let d={subject:n.subject,username:n.username,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(d);break;case"twitter_oauth":let f={subject:n.subject,username:n.username,name:n.name,type:n.type,profilePictureUrl:n.profile_picture_url,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(f);break;case"discord_oauth":let m={subject:n.subject,username:n.username,email:n.email,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(m);break;case"github_oauth":let _={subject:n.subject,username:n.username,name:n.name,email:n.email,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(_);break;case"tiktok_oauth":let h={subject:n.subject,username:n.username,name:n.name,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(h);break;case"linkedin_oauth":let g={subject:n.subject,name:n.name,email:n.email,vanityName:n.vanity_name,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(g);break;case"apple_oauth":let E={subject:n.subject,email:n.email,type:n.type,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(E);break;case"custom_auth":t.push({type:n.type,customUserId:n.custom_user_id,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)});break;case"farcaster":let w={type:n.type,fid:n.fid,ownerAddress:n.owner_address,displayName:n.display_name,username:n.username,bio:n.bio,pfp:n.profile_picture_url,url:n.homepage_url,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at),signerPublicKey:n.signer_public_key};t.push(w);break;case"passkey":let v={type:n.type,enrolledInMfa:n.enrolled_in_mfa,credentialId:n.credential_id,authenticatorName:n.authenticator_name,createdWithDevice:n.created_with_device,createdWithOs:n.created_with_os,createdWithBrowser:n.created_with_browser,verifiedAt:c(n.verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(v);break;case"telegram":let T={type:n.type,telegramUserId:n.telegram_user_id,firstName:n.first_name,lastName:n.last_name,username:n.username,photoUrl:n.photo_url,verifiedAt:c(n.first_verified_at),firstVerifiedAt:c(n.first_verified_at),latestVerifiedAt:c(n.latest_verified_at)};t.push(T);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function b(e,t){return e.slice().sort((n,r)=>(r.firstVerifiedAt??r.verifiedAt).getTime()-(n.firstVerifiedAt??n.verifiedAt).getTime()).find(n=>n.type===t)}var je=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"&&t.walletIndex===0)||null,Fi=e=>e?.linkedAccounts.filter(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"),Yt=e=>e?.linkedAccounts.filter(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.chainType==="ethereum"),zt=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,ji=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,Hi=(e,t)=>{let n=Yt(e).find(i=>Fe(i.address)===Fe(t)),r=n?n.imported?n:je(e):void 0;return{signingWallet:n,rootWallet:r}},qt=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Ki=(e,t)=>je(e)||zt(e)?!1:t==="all-users"||t==="users-without-wallets"&&!qt(e)?.length;function Bi(e){if(!e)return null;let t=$t(e.linked_accounts),n=b(t,"wallet"),r=b(t,"email"),i=b(t,"phone"),s=b(t,"google_oauth"),l=b(t,"twitter_oauth"),p=b(t,"discord_oauth"),a=b(t,"github_oauth"),u=b(t,"spotify_oauth"),d=b(t,"instagram_oauth"),f=b(t,"tiktok_oauth"),m=b(t,"linkedin_oauth"),_=b(t,"apple_oauth"),h=b(t,"farcaster"),g=b(t,"telegram"),E=e.mfa_methods.map(({type:v,verified_at:T})=>({type:v,verifiedAt:c(T)}));return{id:e.id,createdAt:c(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:i&&{number:i?.number},wallet:n&&{address:n.address,chainType:n.chainType,chainId:n.chainId,walletClient:n.walletClient,walletClientType:n.walletClientType,connectorType:n.connectorType,recoveryMethod:n.recoveryMethod,imported:n.imported,walletIndex:n.walletIndex},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:l&&{subject:l.subject,username:l.username,name:l.name,profilePictureUrl:l.profilePictureUrl},discord:p&&{subject:p.subject,username:p.username,email:p.email},github:a&&{subject:a.subject,username:a.username,name:a.name,email:a.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:m&&{subject:m.subject,name:m.name,email:m.email,vanityName:m.vanityName},apple:_&&{subject:_.subject,email:_.email},farcaster:h&&{fid:h.fid,ownerAddress:h.ownerAddress,displayName:h.displayName,username:h.username,bio:h.bio,pfp:h.pfp,url:h.url,signerPublicKey:h.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:E.map(v=>v.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}import{jsx as He}from"react/jsx-runtime";var Ke=({...e})=>He("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:He("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)"})});import{useContext as Je,useEffect as Ze,useMemo as ln,useState as cn}from"react";import{createContext as pn}from"react";var y={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:oe,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var Be=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],n=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let r of e.primary.slice(1))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let r of e.overflow??[])!t.includes(r)&&!n.includes(r)?n.push(r):console.warn(`Duplicated login method: ${r}`);return{primary:t,overflow:n}};var Xt=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet","safe"]),Ge=e=>Xt.has(e),Ve=(e,t,n)=>n.indexOf(e)===t,$e=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Ge).filter(Ve):e?e.filter(Ge).filter(Ve):y.appearance.walletList;import S from"tinycolor2";var Ye="#FFFFFF",Zt="#040217",Jt=Ye,Qt="#1E1E1D";function en(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 A(e,t){let n=Math.max(0,Math.min(1,e.toHsl().l+t));return S({...e.toHsl(),l:n})}var tn="#51BA81",nn="#FFB74D",rn="#EC6351",on=Ye,sn=Zt;function ze({backgroundTheme:e,accentHex:t}){let n;switch(e){case"light":n=Jt;break;case"dark":n=Qt;break;default:n=e;break}let r=S(n),i=S(t),s=S(tn),l=S(nn),p=S(rn),a=en(r.getLuminance()),u=A(r,a==="light"?-.04:.11),d=A(r,a==="light"?-.88:.87),f=A(r,a==="light"?-.7:.75),m=A(r,a==="light"?-.43:.45).desaturate(a==="light"?60:20),_=A(r,a==="light"?-.08:.25).desaturate(a==="light"?60:20),h=A(i,.15),g=A(i,-.06),E=A(p,.3),w=A(l,.3),v=S(i.getLuminance()>.5?sn:on),T=A(s,-.16),L=A(s,.4);return{colorScheme:a,background:r.toHslString(),background2:u.toHslString(),foreground:d.toHslString(),foreground2:f.toHslString(),foreground3:m.toHslString(),foreground4:_.toHslString(),accent:i.toHslString(),accentLight:h.toHslString(),accentDark:g.toHslString(),foregroundAccent:v.toHslString(),success:s.toHslString(),successDark:T.toHslString(),successLight:L.toHslString(),error:p.toHslString(),errorLight:E.toHslString(),warn:l.toHslString(),warnLight:w.toHslString()}}function q(e,t,n){let r=n?console.warn:()=>{},i,s,l,p,a,u,d,f,m,_,h,g,E,w,v;t?.loginMethods?(i=t.loginMethods.includes("email"),s=t.loginMethods.includes("sms"),p=t.loginMethods.includes("wallet"),a=t.loginMethods.includes("google"),u=t.loginMethods.includes("twitter"),d=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),_=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),h=t.loginMethods.includes("linkedin"),E=t.loginMethods.includes("apple"),w=t.loginMethods.includes("farcaster"),v=t.loginMethods.includes("telegram")):(i=e.emailAuth,s=e.smsAuth,p=e.walletAuth,a=e.googleOAuth,u=e.twitterOAuth,d=e.discordOAuth,g=e.githubOAuth,m=e.spotifyOAuth,_=e.instagramOAuth,f=e.tiktokOAuth,h=e.linkedinOAuth,E=e.appleOAuth,w=e.farcasterAuth,v=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?l=!1:e.passkeyAuth&&(l=!0);let T=[i,s].filter(Boolean),L=[a,u,d,g,m,_,f,h,E,w,v].filter(Boolean),B=[p].filter(Boolean);if(T.length+L.length+B.length===0)throw new Error("You must enable at least one login method");let I=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;I&&B.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):!I&&L.length+T.length===0&&(r("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0);let bt=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&r("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let _t=$e({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),vt=Be({input:t?.loginMethodsAndOrder}),At=t?.intl?.defaultCountry??"US",{chains:Et,defaultChain:Ct}=an({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),wt=!!t?.defaultChain,G=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,U,te=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?G?U=t?.embeddedWallets?.noPromptOnSignature??!0:U=t?.embeddedWallets?.noPromptOnSignature??te:U=te,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&U!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:ne,...kt}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??y.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:ze({backgroundTheme:t?.appearance?.theme??y.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??y.appearance.accentColor}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:_t},loginMethods:{wallet:p,email:i,sms:s,passkey:l,google:a,twitter:u,discord:d,github:g,spotify:m,instagram:_,tiktok:f,linkedin:h,apple:E,farcaster:w,telegram:v},loginMethodsAndOrder:vt,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??y.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??y.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??y.rpcConfig.rpcTimeouts},chains:Et,defaultChain:Ct,intl:{defaultCountry:At},shouldEnforceDefaultChainOnConnect:wt,captchaEnabled:e.captchaEnabled??y.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??y.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:bt}},embeddedWallets:{...e.embeddedWalletConfig,...typeof ne=="boolean"?{requireUserOwnedRecoveryOnCreate:ne}:{},...G?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...kt,noPromptOnSignature:U},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:G?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??y._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??y.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??y.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??y.fundingMethodConfig.moonpay.useSandbox}}}}function qe(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:n,additionalChains:r,supportedChains:i,defaultChain:s,...l}=e;return{...l,...r?{additionalChains:r.map(a=>a.id)}:void 0,...i?{supportedChains:i.map(a=>a.id)}:void 0,...s?{defaultChain:s.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function an({additionalChains:e,supportedChains:t,defaultChainFromConfig:n,hasRpcConfigDefined:r}){let i;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(a=>a.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`."),i=t.map(a=>a.rpcUrls.privyWalletOverride?a:N.find(d=>d.id===a.id)??a)}else i=N.concat(e??[]);let s=t?i[0]:D,l=n??s;if(!i.find(p=>p.id===l.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:l}}var Xe=function(e,t=0){let n=3735928559^t,r=1103547991^t;for(let i=0,s;i<e.length;i++)s=e.charCodeAt(i),n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)};import{jsx as dn}from"react/jsx-runtime";var Qe={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},un=q(Qe,void 0,!1),X=pn({appConfig:un,isServerConfigLoaded:!1}),ms=({children:e,legacyCreateEmbeddedWalletFlag:t,client:n,clientConfig:r})=>{let[i,s]=cn(null),l=ln(()=>q(i??Qe,r,!!i),[i,r]);return Ze(()=>{if(!i)return;let p=qe(r,t),a=Xe(JSON.stringify(p)).toString(),u=`privy:sent:${i.id}:${a}`;localStorage.getItem(u)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:p}),localStorage.setItem(u,"t"))},[r,t,i]),Ze(()=>{i||(async()=>{try{let a=await n.getServerConfig();a.customApiUrl&&n.updateApiUrl(a.customApiUrl),s(a)}catch(a){console.warn("Error generating app config: ",a)}})()},[]),dn(X.Provider,{value:{appConfig:l,isServerConfigLoaded:!!i},children:e})},et=()=>{let{appConfig:e}=Je(X);return e},hs=()=>{let{isServerConfigLoaded:e}=Je(X);return e};import{createContext as mn,useContext as hn}from"react";var fn=mn({isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},nativeTokenSymbolForChainId:o,initializeWalletProxy:o,getAuthMeta:o,getAuthFlow:o,closePrivyModal:o,openPrivyModal:o,connectWallet:o,initLoginWithWallet:o,loginWithWallet:o,initLoginWithFarcaster:o,loginWithFarcaster:o,loginWithCode:o,initLoginWithEmail:o,initLoginWithSms:o,initUpdateEmail:o,initUpdatePhone:o,resendEmailCode:o,resendSmsCode:o,initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:o,crossAppAuthFlow:o,initLoginWithOAuth:o,recoveryOAuthFlow:o,loginWithOAuth:o,initLoginWithPasskey:o,loginWithPasskey:o,initLinkWithPasskey:o,linkWithPasskey:o,refreshUser:o,loginWithGuestAccountFlow:o,walletProxy:null,createAnalyticsEvent:o,acceptTerms:o,getUsdTokenPrice:o,recoverEmbeddedEthereumWallet:o,getMoonpaySignedUrl:o,initCoinbaseOnRamp:o,getCoinbaseOnRampStatus:o,updateWallets:o,fundWallet:o,setReadyToTrue:o,requestFarcasterSignerStatus:o,initLoginWithTelegram:o,loginWithTelegram:o,generateSiweMessage:o,linkWithSiwe:o,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:o,recoverEmbeddedSolanaWallet:o,exportSolanaWallet:o,solanaSignMessage:o,connectCoinbaseSmartWallet:o,setCustomMetadataForUser:o}),tt=()=>hn(fn);import{useEffect as gn,useState as yn}from"react";var As=e=>{let[t,n]=yn("auto");return gn(()=>{let r=new ResizeObserver(i=>{n(i[0]?.contentRect.height??"auto")});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},[e.current]),t};import nt from"styled-components";import{jsx as O,jsxs as rt}from"react/jsx-runtime";var Z=nt.div`
2
+ margin-top: 16px;
3
+ font-size: 13px;
4
+ text-align: center;
5
+ color: var(--privy-color-foreground-3);
6
+
7
+ && > a {
8
+ color: var(--privy-color-accent);
9
+ }
10
+ `;function ks(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:n,requireUsersAcceptTerms:r}}=e.app;if(r&&!e.alwaysShowImplicitConsent)return O(Z,{});if(!n&&!t)return O(Z,{});let i=!!(t&&n);return rt(Z,{children:["By logging in I agree to the"," ",n&&O("a",{href:n,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",t&&O("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var Ts=()=>rt(bn,{children:[O(Ke,{}),O("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),bn=nt.div`
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ padding-top: 8px;
15
+ padding-bottom: 12px;
16
+ gap: 2px;
17
+
18
+ font-size: 13px;
19
+
20
+ && svg {
21
+ height: 14px;
22
+ width: 14px;
23
+ margin-bottom: 2px;
24
+ opacity: 0.5;
25
+ }
26
+
27
+ && a {
28
+ color: var(--privy-color-foreground-3);
29
+ &:hover {
30
+ text-decoration: underline;
31
+ }
32
+ }
33
+
34
+ @media all and (display-mode: standalone) {
35
+ padding-bottom: 30px;
36
+ }
37
+ `;import{useContext as _n,useEffect as vn,useState as An}from"react";import{createContext as En}from"react";import{jsx as Cn}from"react/jsx-runtime";var it=En({}),Rs=({children:e})=>{let t=et(),[n,r]=An({});return C("login",{onComplete:(i,s,l,p,a)=>{!a||a.type==="passkey"||a.type==="cross_app"||a.type==="wallet"&&a.walletClientType==="privy"||(M.put(ot(t.id),a.type),a.type==="wallet"?(M.put(J(t.id),a.walletClientType),r({accountType:a.type,walletClientType:a.walletClientType})):(M.del(J(t.id)),r({accountType:a.type})))}}),vn(()=>{if(!t.id)return;let i=M.get(ot(t.id)),s=M.get(J(t.id));i&&r(i==="wallet"?{accountType:i,walletClientType:s}:{accountType:i})},[t.id]),Cn(it.Provider,{value:n,children:e})},ot=e=>`privy:${e}:recent-login-method`,J=e=>`privy:${e}:recent-login-wallet-client`,Ls=()=>_n(it);import wn from"@heroicons/react/24/outline/Square2StackIcon";import kn from"styled-components";import{jsx as st,jsxs as xn}from"react/jsx-runtime";var at=({address:e,showCopyIcon:t,url:n,className:r})=>n?st("a",{title:e,className:r,href:`${n}/address/${e}`,target:"_blank",children:z(e)}):xn("button",{title:e,className:r,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[z(e),t&&st(Tn,{})]}),Tn=kn(wn)`
38
+ && {
39
+ display: inline;
40
+ }
41
+ stroke-width: 2;
42
+ height: 0.875rem;
43
+ width: 0.875rem;
44
+ margin-left: 0.125rem;
45
+ color: var(--privy-color-foreground-3);
46
+ `;import Sn,{css as pt,keyframes as Mn}from"styled-components";import{keyframes as Wn,css as lt}from"styled-components";var Pn=Wn`
47
+ from, to {
48
+ background: var(--privy-color-foreground-4);
49
+ color: var(--privy-color-foreground-4);
50
+ }
51
+
52
+ 50% {
53
+ background: var(--privy-color-foreground-accent);
54
+ color: var(--privy-color-foreground-accent);
55
+ }
56
+ `,ct=lt`
57
+ ${e=>e.$isLoading?lt`
58
+ width: 35%;
59
+ animation: ${Pn} 2s linear infinite;
60
+ border-radius: var(--privy-border-radius-sm);
61
+ `:""}
62
+ `;import{jsx as In}from"react/jsx-runtime";var ut=({children:e,color:t,isLoading:n,isPulsing:r,className:i})=>In(On,{$color:t,$isLoading:n,$isPulsing:r,className:i,children:e}),On=Sn.span`
63
+ padding: 0.125rem 0.5rem;
64
+ font-size: 0.75rem;
65
+ font-weight: 500;
66
+ line-height: 1.125rem; /* 150% */
67
+ border-radius: var(--privy-border-radius-sm);
68
+
69
+ ${e=>{let t,n;e.$color==="green"&&(t="var(--privy-color-success-dark)",n="var(--privy-color-success-light)"),e.$color==="red"&&(t="var(--privy-color-error)",n="var(--privy-color-error-light)"),e.$color==="gray"&&(t="var(--privy-color-foreground-2)",n="var(--privy-color-background-2)");let r=Mn`
70
+ from, to {
71
+ background-color: ${n};
72
+ }
73
+
74
+ 50% {
75
+ background-color: rgba(${n}, 0.8);
76
+ }
77
+ `;return pt`
78
+ color: ${t};
79
+ background-color: ${n};
80
+ ${e.$isPulsing&&pt`
81
+ animation: ${r} 3s linear infinite;
82
+ `};
83
+ `}}
84
+
85
+ ${ct}
86
+ `;import Un from"styled-components";var dt=Un.div`
87
+ display: flex;
88
+ flex-direction: column;
89
+ `;import Rn from"styled-components";var mt=Rn.span`
90
+ text-align: left;
91
+ font-size: 0.75rem;
92
+ font-weight: 500;
93
+ line-height: 1.125rem; /* 150% */
94
+
95
+ color: var(--privy-color-error);
96
+ `;import Ln from"styled-components";var ht=Ln.span`
97
+ color: var(--privy-color-foreground-3);
98
+ font-size: 0.75rem;
99
+ font-weight: 500;
100
+ line-height: 1.125rem; /* 150% */
101
+ `;import Dn,{css as Nn}from"styled-components";var Fn=Nn`
102
+ && {
103
+ border-width: 1px;
104
+ padding: 0.5rem 1rem;
105
+ }
106
+
107
+ width: 100%;
108
+ text-align: left;
109
+ border: solid 1px var(--privy-color-foreground-4);
110
+ border-radius: var(--privy-border-radius-md);
111
+ display: flex;
112
+ justify-content: space-between;
113
+ align-items: center;
114
+
115
+ ${e=>e.$state==="error"?"border-color: var(--privy-color-error);":""}
116
+ `,ft=Dn.div`
117
+ ${Fn}
118
+ `;import{Fragment as jn,jsx as K,jsxs as Q}from"react/jsx-runtime";var pa=({errMsg:e,balance:t,address:n,isLoading:r,className:i,title:s,isPulsing:l,showIcon:p,statusColor:a="green"})=>{let u;return a?u=a:e?u="red":u="green",Q(jn,{children:[Q(ft,{className:i,$state:e?"error":void 0,children:[Q(dt,{children:[K(ht,{children:s||"Pay with"}),K(at,{address:n,showCopyIcon:p||!!e})]}),t!==void 0&&K(ut,{isLoading:r,isPulsing:l,color:u,children:t})]}),e&&K(mt,{style:{marginTop:"0.25rem"},children:e})]})};import{BigNumber as Hn}from"@ethersproject/bignumber";import{formatEther as gt}from"@ethersproject/units";import{QuantityToBigNumber as Kn}from"@privy-io/js-sdk-core";var Bn=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),yt=e=>Bn.format(e),ba=(e,t)=>{let n=yt(t*parseFloat(e));return n!=="$0.00"?n:"<$0.01"},_a=(e,t)=>{let n=yt(t*parseFloat(gt(e)));return n==="$0.00"?"<$0.01":n},va=(e,t,n=6,r=!1)=>{let s=parseFloat(gt(e)).toFixed(n).replace(/0+$/,"").replace(/\.$/,"");return r?`${s} ${t}`:`${s==="0"?"<0.001":s} ${t}`},Aa=e=>e.map(Kn).reduce((t,n)=>t.add(n),Hn.from(0)).toHexString(),Ea=(e,t)=>{let{chains:n}=tt(),r=`https://etherscan.io/address/${t}`,i=`${Ne(e,n)}/address/${t}`;if(!i)return r;try{new URL(i)}catch{return r}return i};import{jsx as ee}from"react/jsx-runtime";var wa=({color:e,...t})=>ee("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:ee("g",{children:ee("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"})})});export{Vn as a,$n as b,Yn as c,zn as d,P as e,F as f,k as g,Oe as h,x as i,pi as j,Kt as k,Ie as l,Ue as m,Re as n,Le as o,di as p,M as q,gi as r,yi as s,Ci as t,wi as u,ki as v,z as w,Gt as x,Ti as y,xi as z,Wi as A,Pi as B,Si as C,Mi as D,Oi as E,Ii as F,Vt as G,Ui as H,Ri as I,Li as J,Jn as K,Qn as L,er as M,tr as N,nr as O,rr as P,or as Q,ir as R,sr as S,ar as T,lr as U,cr as V,pr as W,ur as X,dr as Y,mr as Z,hr as _,fr as $,gr as aa,yr as ba,br as ca,_r as da,vr as ea,Ar as fa,Er as ga,Cr as ha,wr as ia,kr as ja,Tr as ka,xr as la,Wr as ma,Pr as na,Sr as oa,je as pa,Fi as qa,zt as ra,ji as sa,Hi as ta,Ki as ua,Bi as va,Ke as wa,ie as xa,se as ya,ae as za,le as Aa,ce as Ba,pe as Ca,de as Da,be as Ea,D as Fa,Ae as Ga,Ee as Ha,Ce as Ia,we as Ja,Te as Ka,xe as La,N as Ma,Mo as Na,un as Oa,ms as Pa,et as Qa,hs as Ra,o as Sa,fn as Ta,tt as Ua,W as Va,Se as Wa,As as Xa,No as Ya,It as Za,C as _a,Ut as $a,Fo as ab,ks as bb,Ts as cb,bn as db,ct as eb,ut as fb,Rs as gb,Ls as hb,at as ib,Go as jb,mt as kb,Fn as lb,ft as mb,pa as nb,wa as ob,Nt as pb,Yo as qb,ba as rb,_a as sb,va as tb,Aa as ub,Ea as vb,Jo as wb,ri as xb,ai as yb};