@privy-io/react-auth 1.84.0 → 1.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-BWEW65KO.js → chunk-3AGMJGHJ.js} +1 -1
- package/dist/chunk-LEABMTNM.js +118 -0
- package/dist/chunk-QTSNS7VF.js +3281 -0
- package/dist/chunk-XKAIXCX7.js +1 -0
- package/dist/esm/{chunk-BWEW65KO.js → chunk-3AGMJGHJ.js} +1 -1
- package/dist/esm/chunk-LEABMTNM.js +118 -0
- package/dist/esm/chunk-QTSNS7VF.js +3281 -0
- package/dist/esm/chunk-XKAIXCX7.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/smart-wallets.js +1 -1
- package/dist/esm/solana.js +1 -1
- package/dist/esm/ui.js +1 -1
- package/dist/index.d.ts +56 -6
- package/dist/index.js +1 -1
- package/dist/smart-wallets.js +1 -1
- package/dist/solana.d.ts +41 -11
- package/dist/solana.js +1 -1
- package/dist/{types-cbc2ff3a.d.ts → types-fcce0fc5.d.ts} +34 -3
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +8 -8
- package/package.json +5 -2
- package/dist/chunk-CMFOSIZZ.js +0 -118
- package/dist/chunk-KD3IIYQS.js +0 -1
- package/dist/chunk-M7S3ORHS.js +0 -3276
- package/dist/esm/chunk-CMFOSIZZ.js +0 -118
- package/dist/esm/chunk-KD3IIYQS.js +0 -1
- package/dist/esm/chunk-M7S3ORHS.js +0 -3276
- package/dist/useSolanaWallets-56085db4.d.ts +0 -37
|
@@ -0,0 +1 @@
|
|
|
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 L=(t,n,o)=>{if(!n.has(t))throw TypeError("Cannot "+o)};var ut=(t,n,o)=>(L(t,n,"read from private field"),o?o.call(t):n.get(t)),ht= exports.b =(t,n,o)=>{if(n.has(t))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(t):n.set(t,o)},gt= exports.c =(t,n,o,s)=>(L(t,n,"write to private field"),s?s.call(t,o):n.set(t,o),o);var yt=(t,n,o)=>(L(t,n,"access private method"),o);var F="1.85.0";var H="34357d3c125c2bcf2ce2bc3309d98715",_t= exports.p ="https://auth.privy.io",Ct= exports.q =2e4,St= exports.r =1400,At= exports.s =2500,wt= exports.t =4e3,Tt= exports.u =F;var kt="privy:token",Pt= exports.w ="privy-token",xt= exports.x ="privy:refresh_token",vt= exports.y ="privy-refresh-token",Wt= exports.z ="privy:id_token",Ot= exports.A ="privy-id-token",It= exports.B ="privy-session",Ut= exports.C ="privy:session_transfer_token",De="privy:wallet",Lt= exports.D ="privy:caid",Mt= exports.E =t=>`privy:guest:${t}`,Rt= exports.F =t=>`privy:cross-app:${t}`,Nt= exports.G ="privy:state_code",Dt= exports.H ="privy:code_verifier",Ft= exports.I ="privy:headless_oauth",Ht= exports.J ="privy:oauth_disable_signup",jt= exports.K =t=>`${De}:${t}`,Kt= exports.L ="privy:connectors",Yt= exports.M ="privy:connections";var Gt=12e4,Bt= exports.O =1,qt= exports.P ="0x1",zt= exports.Q =3e4,Vt= exports.R ="https://api.moonpay.com/v1",Xt= exports.S ="https://api.moonpay.com/v1",$t= exports.T ="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Zt= exports.U ="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var Jt="deprecated";var j={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 K={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 Y={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 G={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 B={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 q={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 z={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 V={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 X={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 $={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 Z={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 J={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 Q={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 ee={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 te={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 ne={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 v={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 oe={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 se={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 ie={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 ae={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 re={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 le={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 pe={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 ce={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 de={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 W=[j,K,le,v,oe,se,ie,ae,V,X,$,Z,B,q,z,ne,ee,te,Y,G,pe,de,ce,Q,re,J],Qn= exports.la =new Set(W.map(t=>t.id));var _react = require('react');var e=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var je=_react.createContext.call(void 0, {ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:e,login:e,connectOrCreateWallet:e,linkEmail:e,linkPhone:e,linkFarcaster:e,linkWallet:e,startCrossAppAuthFlow:e,linkGoogle:e,linkTwitter:e,linkDiscord:e,linkGithub:e,linkSpotify:e,linkInstagram:e,linkTelegram:e,linkTiktok:e,linkLinkedIn:e,linkApple:e,linkPasskey:e,updateEmail:e,updatePhone:e,logout:e,getAccessToken:e,getEthereumProvider:e,getEthersProvider:e,getWeb3jsProvider:e,unlinkEmail:e,unlinkPhone:e,unlinkWallet:e,unlinkGoogle:e,unlinkTwitter:e,unlinkDiscord:e,unlinkGithub:e,unlinkSpotify:e,unlinkInstagram:e,unlinkTiktok:e,unlinkLinkedIn:e,unlinkApple:e,unlinkCrossAppAccount:e,unlinkFarcaster:e,unlinkTelegram:e,unlinkPasskey:e,setActiveWallet:e,forkSession:e,createWallet:e,importWallet:e,signMessage:e,signTypedData:e,enrollInMfa:e,initEnrollmentWithSms:e,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:e,promptMfa:e,init:e,submitEnrollmentWithSms:e,submitEnrollmentWithTotp:e,submitEnrollmentWithPasskey:e,unenroll:e,submit:e,cancel:e,sendTransaction:e,sendSolanaTransaction:e,exportWallet:e,setWalletPassword:e,setWalletRecovery:e,requestFarcasterSignerFromWarpcast:e,getFarcasterSignerPublicKey:e,signFarcasterMessage:e,createGuestAccount:e,initLoginWithEmail:e,initLoginWithSms:e,otpState:{status:"initial"},loginWithCode:e,fundWallet:e,initLoginWithHeadlessOAuth:e,loginWithHeadlessOAuth:e,generateSiweMessage:e,linkWithSiwe:e,signMessageWithCrossAppWallet:e,signTypedDataWithCrossAppWallet:e,sendTransactionWithCrossAppWallet:e,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),so= exports.ta =()=>_react.useContext.call(void 0, je);var Ge=_react.createContext.call(void 0, null);function ro(){let t=_react.useContext.call(void 0, Ge);if(t===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return t}var _ofetch = require('ofetch');var g=class extends Error{constructor(o,s,i){super(o);s instanceof Error&&(this.cause=s),this.privyErrorCode=i}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},O= exports.f =class extends g{constructor(o,s,i,r,l){super(i,r,l);this.type=o;this.status=s}},u= exports.g =class extends g{constructor(o,s,i){super(o,s,i);this.type="client_error"}},me= exports.h =class extends u{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var ue=class extends g{constructor(o,s,i){super(o,s,i);this.type="connector_error"}},co= exports.j =t=>{if(t instanceof g)return t;if(!(t instanceof _ofetch.FetchError))return qe(t);if(!t.response)return new O("api_error",null,t.message,t);let{type:n,message:o,error:s,code:i}=t.data;return new O(n||"ApiError",t.response.status,o||s,t,i)},qe= exports.k =t=>t instanceof g?t:t instanceof Error?new u(t.message,t):new u(`Internal error: ${t}`);var he=class extends u{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ge= exports.m =class extends u{constructor(n="Embedded wallet error",o){super(n,o,"unknown_embedded_wallet_error")}},ye= exports.n =class extends u{constructor(n="User must be authenticated"){super(n,void 0,"must_be_authenticated")}};var fe=class extends u{constructor(n){super("This application is in development mode and must be upgraded to production to log in new users.",n,"max_accounts_reached")}};var d={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:H,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var be=({input:t})=>{if(!t||!t.primary[0])return;let n=[t.primary[0]],o=[];t.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let s of t.primary.slice(1))n.includes(s)?console.warn(`Duplicated login method: ${s}`):n.push(s);for(let s of _nullishCoalesce(t.overflow, () => ([])))!n.includes(s)&&!o.includes(s)?o.push(s):console.warn(`Duplicated login method: ${s}`);return{primary:n,overflow:o}};var ze=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet","safe"]),Ee=t=>ze.has(t),_e=(t,n,o)=>o.indexOf(t)===n,Ce=({input:t,overrides:n})=>n?n.primary.concat(_nullishCoalesce(n.overflow, () => ([]))).filter(Ee).filter(_e):t?t.filter(Ee).filter(_e):d.appearance.walletList;var _tinycolor2 = require('tinycolor2'); var _tinycolor22 = _interopRequireDefault(_tinycolor2);var Se="#FFFFFF",Ve="#040217",Xe=Se,$e="#1E1E1D";function Ze(t){return t<.8&&t>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),t>.5?"light":"dark"}function m(t,n){let o=Math.max(0,Math.min(1,t.toHsl().l+n));return _tinycolor22.default.call(void 0, {...t.toHsl(),l:o})}var Je="#51BA81",Qe="#FFB74D",et="#EC6351",tt=Se,nt=Ve;function Ae({backgroundTheme:t,accentHex:n}){let o;switch(t){case"light":o=Xe;break;case"dark":o=$e;break;default:o=t;break}let s=_tinycolor22.default.call(void 0, o),i=_tinycolor22.default.call(void 0, n),r=_tinycolor22.default.call(void 0, Je),l=_tinycolor22.default.call(void 0, Qe),p=_tinycolor22.default.call(void 0, et),a=Ze(s.getLuminance()),c=m(s,a==="light"?-.04:.11),h=m(s,a==="light"?-.88:.87),f=m(s,a==="light"?-.7:.75),b=m(s,a==="light"?-.43:.45).desaturate(a==="light"?60:20),E=m(s,a==="light"?-.08:.25).desaturate(a==="light"?60:20),_=m(i,.15),C=m(i,-.06),S=m(p,.3),A=m(l,.3),w=_tinycolor22.default.call(void 0, i.getLuminance()>.5?nt:tt),P=m(r,-.16),x=m(r,.4);return{colorScheme:a,background:s.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:f.toHslString(),foreground3:b.toHslString(),foreground4:E.toHslString(),accent:i.toHslString(),accentLight:_.toHslString(),accentDark:C.toHslString(),foregroundAccent:w.toHslString(),success:r.toHslString(),successDark:P.toHslString(),successLight:x.toHslString(),error:p.toHslString(),errorLight:S.toHslString(),warn:l.toHslString(),warnLight:A.toHslString()}}function M(t,n,o){let s=o?console.warn:()=>{},i,r,l,p,a,c,h,f,b,E,_,C,S,A,w;_optionalChain([n, 'optionalAccess', _2 => _2.loginMethods])?(i=n.loginMethods.includes("email"),r=n.loginMethods.includes("sms"),p=n.loginMethods.includes("wallet"),a=n.loginMethods.includes("google"),c=n.loginMethods.includes("twitter"),h=n.loginMethods.includes("discord"),b=n.loginMethods.includes("spotify"),E=n.loginMethods.includes("instagram"),f=n.loginMethods.includes("tiktok"),C=n.loginMethods.includes("github"),_=n.loginMethods.includes("linkedin"),S=n.loginMethods.includes("apple"),A=n.loginMethods.includes("farcaster"),w=n.loginMethods.includes("telegram")):(i=t.emailAuth,r=t.smsAuth,p=t.walletAuth,a=t.googleOAuth,c=t.twitterOAuth,h=t.discordOAuth,C=t.githubOAuth,b=t.spotifyOAuth,E=t.instagramOAuth,f=t.tiktokOAuth,_=t.linkedinOAuth,S=t.appleOAuth,A=t.farcasterAuth,w=t.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?l=!1:t.passkeyAuth&&(l=!0);let P=[i,r].filter(Boolean),x=[a,c,h,C,b,E,f,_,S,A,w].filter(Boolean),I=[p].filter(Boolean);if(P.length+x.length+I.length===0)throw new Error("You must enable at least one login method");let T=_optionalChain([n, 'optionalAccess', _3 => _3.appearance, 'optionalAccess', _4 => _4.showWalletLoginFirst])!==void 0?_optionalChain([n, 'optionalAccess', _5 => _5.appearance, 'optionalAccess', _6 => _6.showWalletLoginFirst]):t.showWalletLoginFirst;T&&I.length===0?(s("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),T=!1):!T&&x.length+P.length===0&&(s("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),T=!0);let ve=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _7 => _7.externalWallets, 'optionalAccess', _8 => _8.walletConnect, 'optionalAccess', _9 => _9.enabled]), () => (!0));_optionalChain([n, 'optionalAccess', _10 => _10.loginMethods])&&n.loginMethodsAndOrder&&s("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let We=Ce({input:_optionalChain([n, 'optionalAccess', _11 => _11.appearance, 'optionalAccess', _12 => _12.walletList]),overrides:_optionalChain([n, 'optionalAccess', _13 => _13.loginMethodsAndOrder])}),Oe=be({input:_optionalChain([n, 'optionalAccess', _14 => _14.loginMethodsAndOrder])}),Ie=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _15 => _15.intl, 'optionalAccess', _16 => _16.defaultCountry]), () => ("US")),{chains:Ue,defaultChain:Le}=ot({additionalChains:_optionalChain([n, 'optionalAccess', _17 => _17.additionalChains]),supportedChains:_optionalChain([n, 'optionalAccess', _18 => _18.supportedChains]),defaultChainFromConfig:_optionalChain([n, 'optionalAccess', _19 => _19.defaultChain]),hasRpcConfigDefined:Object.keys(_nullishCoalesce(_optionalChain([n, 'optionalAccess', _20 => _20.rpcConfig, 'optionalAccess', _21 => _21.rpcUrls]), () => ({}))).length>0}),Me=!!_optionalChain([n, 'optionalAccess', _22 => _22.defaultChain]),U=_optionalChain([n, 'optionalAccess', _23 => _23.customAuth, 'optionalAccess', _24 => _24.getCustomAccessToken])&&_optionalChain([n, 'optionalAccess', _25 => _25.customAuth, 'optionalAccess', _26 => _26.enabled])!==!1,k,N=!(_nullishCoalesce(t.enforceWalletUis, () => (!0)));if(_nullishCoalesce(t.legacyWalletUiConfig, () => (!0))?U?k=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _27 => _27.embeddedWallets, 'optionalAccess', _28 => _28.noPromptOnSignature]), () => (!0)):k=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _29 => _29.embeddedWallets, 'optionalAccess', _30 => _30.noPromptOnSignature]), () => (N)):k=N,_optionalChain([n, 'optionalAccess', _31 => _31.embeddedWallets, 'optionalAccess', _32 => _32.waitForTransactionConfirmation])===!1&&k!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:D,...Re}=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _33 => _33.embeddedWallets]), () => ({}));return{id:t.id,name:t.name,allowlistConfig:t.allowlistConfig,legacyWalletUiConfig:t.legacyWalletUiConfig,appearance:{logo:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _34 => _34.appearance, 'optionalAccess', _35 => _35.logo]), () => (t.logoUrl)),landingHeader:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _36 => _36.appearance, 'optionalAccess', _37 => _37.landingHeader]), () => (d.appearance.landingHeader)),loginMessage:typeof _optionalChain([n, 'optionalAccess', _38 => _38.appearance, 'optionalAccess', _39 => _39.loginMessage])=="string"?_optionalChain([n, 'optionalAccess', _40 => _40.appearance, 'optionalAccess', _41 => _41.loginMessage, 'access', _42 => _42.slice, 'call', _43 => _43(0,100)]):_optionalChain([n, 'optionalAccess', _44 => _44.appearance, 'optionalAccess', _45 => _45.loginMessage]),palette:Ae({backgroundTheme:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _46 => _46.appearance, 'optionalAccess', _47 => _47.theme]), () => (d.appearance.theme)),accentHex:_nullishCoalesce(_nullishCoalesce(_optionalChain([n, 'optionalAccess', _48 => _48.appearance, 'optionalAccess', _49 => _49.accentColor]), () => (t.accentColor)), () => (d.appearance.accentColor))}),loginGroupPriority:T?"web3-first":"web2-first",hideDirectWeb2Inputs:!!_optionalChain([n, 'optionalAccess', _50 => _50.appearance, 'optionalAccess', _51 => _51.hideDirectWeb2Inputs]),walletList:We,walletChainType:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _52 => _52.appearance, 'optionalAccess', _53 => _53.walletChainType]), () => ("ethereum-only"))},loginMethods:{wallet:p,email:i,sms:r,passkey:l,google:a,twitter:c,discord:h,github:C,spotify:b,instagram:E,tiktok:f,linkedin:_,apple:S,farcaster:A,telegram:w},loginMethodsAndOrder:Oe,legal:{termsAndConditionsUrl:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _54 => _54.legal, 'optionalAccess', _55 => _55.termsAndConditionsUrl]), () => (t.termsAndConditionsUrl)),privacyPolicyUrl:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _56 => _56.legal, 'optionalAccess', _57 => _57.privacyPolicyUrl]), () => (t.privacyPolicyUrl)),requireUsersAcceptTerms:_nullishCoalesce(t.requireUsersAcceptTerms, () => (!1))},walletConnectCloudProjectId:_nullishCoalesce(_nullishCoalesce(_optionalChain([n, 'optionalAccess', _58 => _58.walletConnectCloudProjectId]), () => (t.walletConnectCloudProjectId)), () => (d.walletConnectCloudProjectId)),rpcConfig:{rpcUrls:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _59 => _59.rpcConfig, 'optionalAccess', _60 => _60.rpcUrls]), () => (d.rpcConfig.rpcUrls)),rpcTimeouts:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _61 => _61.rpcConfig, 'optionalAccess', _62 => _62.rpcTimeouts]), () => (d.rpcConfig.rpcTimeouts))},chains:Ue,defaultChain:Le,intl:{defaultCountry:Ie},shouldEnforceDefaultChainOnConnect:Me,captchaEnabled:_nullishCoalesce(t.captchaEnabled, () => (d.captchaEnabled)),captchaSiteKey:t.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _63 => _63.externalWallets, 'optionalAccess', _64 => _64.coinbaseWallet, 'optionalAccess', _65 => _65.connectionOptions]), () => (d.externalWallets.coinbaseWallet.connectionOptions))},walletConnect:{enabled:ve},solana:{connectors:_optionalChain([n, 'optionalAccess', _66 => _66.externalWallets, 'optionalAccess', _67 => _67.solana, 'optionalAccess', _68 => _68.connectors])}},embeddedWallets:{...t.embeddedWalletConfig,...typeof D=="boolean"?{requireUserOwnedRecoveryOnCreate:D}:{},...U?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...Re,noPromptOnSignature:k},mfa:{methods:_nullishCoalesce(t.mfaMethods, () => ([])),noPromptOnMfaRequired:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _69 => _69.mfa, 'optionalAccess', _70 => _70.noPromptOnMfaRequired]), () => (!1))},customAuth:U?{enabled:!0,...n.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:t.telegramAuthConfiguration},headless:!!_optionalChain([n, 'optionalAccess', _71 => _71.headless]),render:{standalone:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _72 => _72._render, 'optionalAccess', _73 => _73.standalone]), () => (d._render.standalone))},fundingConfig:t.fundingConfig,fundingMethodConfig:{..._nullishCoalesce(_optionalChain([n, 'optionalAccess', _74 => _74.fundingMethodConfig]), () => (d.fundingMethodConfig)),moonpay:{..._nullishCoalesce(_optionalChain([n, 'optionalAccess', _75 => _75.fundingMethodConfig, 'optionalAccess', _76 => _76.moonpay]), () => (d.fundingMethodConfig.moonpay)),useSandbox:_nullishCoalesce(_nullishCoalesce(_optionalChain([n, 'optionalAccess', _77 => _77.fundingMethodConfig, 'optionalAccess', _78 => _78.moonpay, 'access', _79 => _79.useSandbox]), () => (_optionalChain([n, 'optionalAccess', _80 => _80.fiatOnRamp, 'optionalAccess', _81 => _81.useSandbox]))), () => (d.fundingMethodConfig.moonpay.useSandbox))}}}}function we(t,n){if(!t)return{legacyCreateEmbeddedWalletFlag:n};let{appearance:o,additionalChains:s,supportedChains:i,defaultChain:r,externalWallets:l,...p}=t;return{...p,...s?{additionalChains:s.map(c=>c.id)}:void 0,...i?{supportedChains:i.map(c=>c.id)}:void 0,...r?{defaultChain:r.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:_optionalChain([l, 'access', _82 => _82.solana, 'optionalAccess', _83 => _83.connectors, 'optionalAccess', _84 => _84.get, 'call', _85 => _85(), 'access', _86 => _86.map, 'call', _87 => _87(c=>c.walletClientType)])}}:void 0,legacyCreateEmbeddedWalletFlag:n}}function ot({additionalChains:t,supportedChains:n,defaultChainFromConfig:o,hasRpcConfigDefined:s}){let i;if(t&&n&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),n){if(n.length===0)throw new Error("`supportedChains` must contain at least one chain");n.filter(a=>a.rpcUrls.privyWalletOverride).length>0&&s&&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=n.map(a=>a.rpcUrls.privyWalletOverride?a:_nullishCoalesce(W.find(h=>h.id===a.id), () => (a)))}else i=W.concat(_nullishCoalesce(t, () => ([])));let r=n?i[0]:v,l=_nullishCoalesce(o, () => (r));if(!i.find(p=>p.id===l.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:l}}var Te=function(t,n=0){let o=3735928559^n,s=1103547991^n;for(let i=0,r;i<t.length;i++)r=t.charCodeAt(i),o=Math.imul(o^r,2654435761),s=Math.imul(s^r,1597334677);return o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507),s^=Math.imul(o^o>>>13,3266489909),4294967296*(2097151&s)+(o>>>0)};var _jsxruntime = require('react/jsx-runtime');var xe={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:""},rt= exports.ma =M(xe,void 0,!1),R=_react.createContext.call(void 0, {appConfig:rt,isServerConfigLoaded:!1}),Uo= exports.na =({children:t,legacyCreateEmbeddedWalletFlag:n,client:o,clientConfig:s})=>{let[i,r]=_react.useState.call(void 0, null),l=_react.useMemo.call(void 0, ()=>M(_nullishCoalesce(i, () => (xe)),s,!!i),[i,s]);return _react.useEffect.call(void 0, ()=>{if(!i)return;let p=we(s,n),a=Te(JSON.stringify(p)).toString(),c=`privy:sent:${i.id}:${a}`;localStorage.getItem(c)||(o.createAnalyticsEvent({eventName:"sdk_initialize",payload:p}),localStorage.setItem(c,"t"))},[s,n,i]),_react.useEffect.call(void 0, ()=>{i||(async()=>{try{let a=await o.getServerConfig();a.customApiUrl&&o.updateApiUrl(a.customApiUrl),r(a)}catch(a){console.warn("Error generating app config: ",a)}})()},[]),_jsxruntime.jsx.call(void 0, R.Provider,{value:{appConfig:l,isServerConfigLoaded:!!i},children:t})},Lo= exports.oa =()=>{let{appConfig:t}=_react.useContext.call(void 0, R);return t},Mo= exports.pa =()=>{let{isServerConfigLoaded:t}=_react.useContext.call(void 0, R);return t};var dt=_react.createContext.call(void 0, {isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:e,initializeWalletProxy:e,getAuthMeta:e,getAuthFlow:e,closePrivyModal:e,openPrivyModal:e,connectWallet:e,initLoginWithWallet:e,loginWithWallet:e,initLoginWithFarcaster:e,loginWithFarcaster:e,loginWithCode:e,initLoginWithEmail:e,initLoginWithSms:e,initUpdateEmail:e,initUpdatePhone:e,resendEmailCode:e,resendSmsCode:e,initLoginWithHeadlessOAuth:e,loginWithHeadlessOAuth:e,crossAppAuthFlow:e,initLoginWithOAuth:e,recoveryOAuthFlow:e,loginWithOAuth:e,initLoginWithPasskey:e,loginWithPasskey:e,initLinkWithPasskey:e,linkWithPasskey:e,refreshUser:e,loginWithGuestAccountFlow:e,walletProxy:null,createAnalyticsEvent:e,acceptTerms:e,getUsdTokenPrice:e,getUsdPriceForSol:e,recoverEmbeddedEthereumWallet:e,getMoonpaySignedUrl:e,initCoinbaseOnRamp:e,getCoinbaseOnRampStatus:e,updateWallets:e,fundWallet:e,setReadyToTrue:e,requestFarcasterSignerStatus:e,initLoginWithTelegram:e,loginWithTelegram:e,generateSiweMessage:e,linkWithSiwe:e,linkSmartWallet:e,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:e,recoverEmbeddedSolanaWallet:e,exportSolanaWallet:e,solanaSignMessage:e,connectCoinbaseSmartWallet:e}),Ho= exports.ra =()=>_react.useContext.call(void 0, dt);exports.a = ut; exports.b = ht; exports.c = gt; exports.d = yt; exports.e = g; exports.f = O; exports.g = u; exports.h = me; exports.i = ue; exports.j = co; exports.k = qe; exports.l = he; exports.m = ge; exports.n = ye; exports.o = fe; exports.p = _t; exports.q = Ct; exports.r = St; exports.s = At; exports.t = wt; exports.u = Tt; exports.v = kt; exports.w = Pt; exports.x = xt; exports.y = vt; exports.z = Wt; exports.A = Ot; exports.B = It; exports.C = Ut; exports.D = Lt; exports.E = Mt; exports.F = Rt; exports.G = Nt; exports.H = Dt; exports.I = Ft; exports.J = Ht; exports.K = jt; exports.L = Kt; exports.M = Yt; exports.N = Gt; exports.O = Bt; exports.P = qt; exports.Q = zt; exports.R = Vt; exports.S = Xt; exports.T = $t; exports.U = Zt; exports.V = Jt; exports.W = e; exports.X = j; exports.Y = K; exports.Z = Y; exports._ = G; exports.$ = B; exports.aa = q; exports.ba = V; exports.ca = ee; exports.da = v; exports.ea = oe; exports.fa = se; exports.ga = ie; exports.ha = ae; exports.ia = le; exports.ja = pe; exports.ka = W; exports.la = Qn; exports.ma = rt; exports.na = Uo; exports.oa = Lo; exports.pa = Mo; exports.qa = dt; exports.ra = Ho; exports.sa = je; exports.ta = so; exports.ua = Ge; exports.va = ro;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as a,ka as c,la as d,ma as s,oa as u}from"./chunk-
|
|
1
|
+
import{W as a,ka as c,la as d,ma as s,oa as u}from"./chunk-XKAIXCX7.js";function E(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function N(e){let t=e.filter(n=>!d.has(n.id));return c.concat(t)}function R(e){return e.find(n=>n.walletClientType==="privy"&&n.connectorType==="embedded"&&!n.imported)??null}import{createContext as M,useContext as I,useEffect as r,useRef as v,useState as D}from"react";import{jsx as C}from"react/jsx-runtime";function p({src:e,...t}){return C("img",{src:e,...t,style:{display:"none"}})}import{jsx as h,jsxs as x}from"react/jsx-runtime";var f=M({ready:!1,app:s,currentScreen:null,lastScreen:null,navigate:a,navigateBack:a,resetNavigation:a,setModalData:a,onUserCloseViaDialogOrKeybindRef:void 0}),y=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],W=e=>{let t=u(),n=e.authenticated,[i,l]=D(e.initialScreen);r(()=>{!n&&!y.includes(e.initialScreen)&&e.setInitialScreen(null)},[n]);let o=v(null);r(()=>{e.open||(o.current=null)},[e.open]),r(()=>{o.current=null},[e.initialScreen]);let g={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:i,navigate:(S,m=!0)=>{e.setInitialScreen(S),m&&l(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(i)},resetNavigation:()=>{e.setInitialScreen(null),l(null)},onUserCloseViaDialogOrKeybindRef:o};return x(f.Provider,{value:g,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&h(p,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k=()=>I(f);function G(e){let n=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(n)return parseInt(n);throw new Error("Chain ID not compatible with CAIP-2 format.")}export{W as a,k as b,E as c,N as d,G as e,R as f};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import{i as _,oa as F,ra as D,sa as b,ta as V}from"./chunk-XKAIXCX7.js";import{useContext as he}from"react";import{createContext as de,useContext as pe,useEffect as fe}from"react";var tt={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:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},me=de(void 0),N=()=>pe(me);function y(t,r){if(!r)return;let n=N().current[t];return fe(()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),n[i]?.push(o);return()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),n[i]=n[i]?.filter(s=>s!==o)}},[r])}function ye(t,r,e,...n){for(let i of t.current[r][e])i(...n)}function rt(){let t=N();return(r,e,...n)=>ye(t,r,e,...n)}function st(t){let{logout:r}=he(b);return y("logout",t),{logout:r}}import{useContext as ve}from"react";function pt(t){let{login:r}=ve(b);return y("login",t),{login:r}}import{useContext as ge}from"react";function vt(t){let{connectWallet:r}=ge(b);return y("connectWallet",t),{connectWallet:r}}var At=t=>{y("fundWallet",t);let{fundWallet:r}=V();return{fundWallet:r}};var S=class{constructor(){this._cache={}}get(r){return this._cache[r]}put(r,e){e!==void 0?this._cache[r]=e:this.del(r)}del(r){delete this._cache[r]}getKeys(){return Object.keys(this._cache)}},P=class{get(r){let e=localStorage.getItem(r);return e===null?void 0:JSON.parse(e)}put(r,e){e!==void 0?localStorage.setItem(r,JSON.stringify(e)):this.del(r)}del(r){localStorage.removeItem(r)}getKeys(){return Object.entries(localStorage).map(([r])=>r)}};function wt(){try{let t="privy:__session_storage__test",r="blobby",e=new P;return e.put(t,r),e.del(t),!0}catch{return!1}}function _e(){return typeof window<"u"&&window.localStorage?new P:new S}var A=_e();function B(){let t=window,r=t.ethereum;if(!r)return[];let e=[];if(r.providers?.length)for(let n of r.providers)n&&e.push(n);return e.push(t.ethereum),e}var T=t=>{if(t.isApexWallet)return"Apex Wallet";if(t.isAvalanche)return"Core Wallet";if(t.isBackpack)return"Backpack";if(t.isBifrost)return"Bifrost Wallet";if(t.isBitKeep)return"BitKeep";if(t.isBitski)return"Bitski";if(t.isBlockWallet)return"BlockWallet";if(t.isBraveWallet)return"Brave Wallet";if(t.isClover)return"Clover";if(t.isCoin98)return"Coin98 Wallet";if(t.isCoinbaseWallet)return"Coinbase Wallet";if(t.isDawn)return"Dawn Wallet";if(t.isDefiant)return"Defiant";if(t.isDesig)return"Desig Wallet";if(t.isEnkrypt)return"Enkrypt";if(t.isExodus)return"Exodus";if(t.isFordefi)return"Fordefi";if(t.isFrame)return"Frame";if(t.isFrontier)return"Frontier Wallet";if(t.isGamestop)return"GameStop Wallet";if(t.isHaqqWallet)return"HAQQ Wallet";if(t.isHyperPay)return"HyperPay Wallet";if(t.isImToken)return"ImToken";if(t.isHaloWallet)return"Halo Wallet";if(t.isKuCoinWallet)return"KuCoin Wallet";if(t.isMathWallet)return"MathWallet";if(t.isNovaWallet)return"Nova Wallet";if(t.isOkxWallet||t.isOKExWallet)return"OKX Wallet";if(t.isOneInchIOSWallet||t.isOneInchAndroidWallet)return"1inch Wallet";if(t.isOneKey)return"OneKey Wallet";if(t.isOpera)return"Opera";if(t.isPhantom)return"Phantom";if(t.isPortal)return"Ripio Portal";if(t.isRabby)return"Rabby Wallet";if(t.isRainbow)return"Rainbow";if(t.isSafePal)return"SafePal Wallet";if(t.isStatus)return"Status";if(t.isSubWallet)return"SubWallet";if(t.isTalisman)return"Talisman";if(t.isTally||t.isTaho)return"Taho";if(t.isTokenPocket)return"TokenPocket";if(t.isTokenary)return"Tokenary";if(t.isTrust||t.isTrustWallet)return"Trust Wallet";if(t.isTTWallet)return"TTWallet";if(t.isXDEFI)return"XDEFI Wallet";if(t.isZeal)return"Zeal";if(t.isZerion)return"Zerion";if(t.isMetaMask)return"MetaMask"};var R=(t,r)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!r)return!0;if(t.isBraveWallet&&!t._events&&!t._state||T(t)!=="MetaMask")return!1;if(t.providers){for(let e of t.providers)if(!R(e))return!1}return!0},Tt=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Ct=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let r of t.ethereum.providers)if(r&&r.isCoinbaseWallet)return!0}return!1};import{StaticJsonRpcProvider as x}from"@ethersproject/providers";var It=(t,r)=>{let e=[],n=[];for(let[i,o]of t.entries())i<r?e.push(o):n.push(o);return[e,n]},Ut=t=>!!String(t).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,}))$/),Lt=(t,r)=>{let e=t.slice(0),n=[];for(;e.length;)n.push(e.splice(0,r));return n},O=(t,r=3,e=4,n="ethereum")=>{if(!t)return"";let i=n==="ethereum"?2:0,o=3;if(r+e+i+o>=t.length)return t;let s=t.slice(0,i+r),c=t.slice(t.length-e,t.length);return`${s}...${c}`},be=t=>new Promise(r=>setTimeout(r,t));function jt(t,{interval:r=100,timeout:e=5e3}={}){return new Promise((n,i)=>{let o=0,s,c=()=>{if(o>=e){i("Max attempts reached without result");return}if(s=t(),o+=r,s!=null){n(s);return}setTimeout(c,r)};c()})}var $t=(t,r={})=>{let e=r.delayMs||150,n=r.maxAttempts||270;return new Promise(async(i,o)=>{let s=!1,c=0;for(;!s&&c<n;){if(r.abortSignal?.aborted)return;t().then(l=>{s=!0,i(l)},(...l)=>{s=!0,o(...l)}),c+=1,await be(e)}s||o(new Error("Exceeded max attempts before resolving function"))})},Ft=(t,r,e={},n={})=>{let i=new URL(r,t);for(let[s,c]of Object.entries(e))c!==void 0&&i.searchParams.set(s,c);let o=Object.entries(n);if(o.length>0){let s=new URLSearchParams;for(let[c,l]of o)s.append(c,l);i.hash=s.toString()}return i.href};var Dt=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Vt=t=>typeof t=="string"?t:"0x"+t.toString(16);async function Nt(t,r,e,n=3e3){let i=!1,o=window;return new Promise(s=>{o.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},n));function c(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",c);let l=t.getProviders();console.debug("Detected injected providers:",l.map(d=>d.info));let u=[];for(let d of l)r.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 B()){let h=T(d);if(!l.some(p=>p.info.name===h)){if(R(d,!0)&&!u.find(p=>p.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(h==="Phantom"&&!u.find(p=>p.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(h==="Coinbase Wallet"&&!u.find(p=>p.type==="coinbase_wallet"&&e?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find(p=>p.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}s(u)}})}function Bt(t){return`eip155:${String(Number(t))}`}var Gt=(t,r,e,n)=>{let i=Number(t),o=r.find(s=>s.id===i);if(!o)throw new _(`Unsupported chainId ${t}`,4901);return Ae(o,e,n)},Ae=(t,r,e)=>{let n=t.id,i=Number(t.id),o;if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])o=t.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[i])o=r.rpcUrls[i];else if(t.rpcUrls.privy?.http[0]){let s=new URL(t.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",e),o=s.toString()}else t.rpcUrls.public?.http[0]?o=t.rpcUrls.public.http[0]:o=t.rpcUrls.default?.http[0];if(!o)throw new _(`No RPC url found for ${n}`);return o},G=(t,r)=>{let e=Number(t),n=r.find(i=>i.id===e);if(!n)throw new _(`Unsupported chainId ${t}`,4901);return n.blockExplorers?.default.url},Ht=(t,r,e,n)=>{let i=Number(t),o=r.find(c=>c.id===i);if(!o)throw new _(`Unsupported chainId ${t}`,4901);let s;if(o.rpcUrls.privyWalletOverride&&o.rpcUrls.privyWalletOverride.http[0]?s=new x(o.rpcUrls.privyWalletOverride.http[0]):e.rpcUrls&&e.rpcUrls[i]?s=new x(e.rpcUrls[i]):o.rpcUrls.privy?.http[0]?s=new x({url:o.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}):o.rpcUrls.public?.http[0]?s=new x(o.rpcUrls.public.http[0]):s=new x(o.rpcUrls.default?.http[0]),!s)throw new _(`No RPC url found for ${t}`);return s},Kt=t=>{let r={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},e=t.types.EIP712Domain??Object.entries(t.domain).map(([n,i])=>{if(i!=null&&typeof n=="string"&&n in r)return{name:n,type:r[n]}}).filter(n=>n!==void 0);return{...t,types:{...t.types,EIP712Domain:e}}};function zt(t,{min:r,max:e}){return Math.min(Math.max(t,r),e)}import{getAddress as H}from"@ethersproject/address";function a(t){return t?new Date(t*1e3):null}function We(t){let r=[];for(let e of t){let n=e.type;switch(e.type){case"wallet":let i={address:e.address,type:e.type,imported:e.imported,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),chainType:e.chain_type,chainId:e.chain_id,walletClient:e.wallet_client_type==="privy"?"privy":"unknown",walletClientType:e.wallet_client_type,connectorType:e.connector_type,recoveryMethod:e.recovery_method,walletIndex:e.wallet_index};r.push(i);break;case"smart_wallet":let o={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),smartWalletType:e.smart_wallet_type};r.push(o);break;case"cross_app":let s={type:e.type,subject:e.subject,embeddedWallets:e.embedded_wallets,smartWallets:e.smart_wallets,providerApp:{id:e.provider_app_id},verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(s);break;case"email":let c={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(c);break;case"phone":let l={number:e.phoneNumber,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(l);break;case"google_oauth":let u={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(u);break;case"spotify_oauth":let d={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(d);break;case"instagram_oauth":let h={subject:e.subject,username:e.username,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(h);break;case"twitter_oauth":let p={subject:e.subject,username:e.username,name:e.name,type:e.type,profilePictureUrl:e.profile_picture_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(p);break;case"discord_oauth":let g={subject:e.subject,username:e.username,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(g);break;case"github_oauth":let w={subject:e.subject,username:e.username,name:e.name,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(w);break;case"tiktok_oauth":let m={subject:e.subject,username:e.username,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(m);break;case"linkedin_oauth":let v={subject:e.subject,name:e.name,email:e.email,vanityName:e.vanity_name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(v);break;case"apple_oauth":let E={subject:e.subject,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(E);break;case"custom_auth":r.push({type:e.type,customUserId:e.custom_user_id,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)});break;case"farcaster":let $={type:e.type,fid:e.fid,ownerAddress:e.owner_address,displayName:e.display_name,username:e.username,bio:e.bio,pfp:e.profile_picture_url,url:e.homepage_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),signerPublicKey:e.signer_public_key};r.push($);break;case"passkey":let k={type:e.type,enrolledInMfa:e.enrolled_in_mfa,credentialId:e.credential_id,authenticatorName:e.authenticator_name,createdWithDevice:e.created_with_device,createdWithOs:e.created_with_os,createdWithBrowser:e.created_with_browser,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(k);break;case"telegram":let M={type:e.type,telegramUserId:e.telegram_user_id,firstName:e.first_name,lastName:e.last_name,username:e.username,photoUrl:e.photo_url,verifiedAt:a(e.first_verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(M);break;default:console.warn(`Unrecognized account type: ${n}. Please consider upgrading the Privy SDK.`)}}return r}function f(t,r){return t.slice().sort((e,n)=>(n.firstVerifiedAt??n.verifiedAt).getTime()-(e.firstVerifiedAt??e.verifiedAt).getTime()).find(e=>e.type===r)}var K=t=>t?.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum"&&r.walletIndex===0)||null,Qt=t=>t?.linkedAccounts.filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum"),we=t=>t?.linkedAccounts.filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType==="ethereum"),ke=t=>t?.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="solana")||null,Xt=t=>t?.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.imported&&r.chainType==="ethereum")||null,qt=(t,r)=>{let e=we(t).find(i=>H(i.address)===H(r)),n=e?e.imported?e:K(t):void 0;return{signingWallet:e,rootWallet:n}},xe=t=>t.linkedAccounts.filter(r=>r.type==="wallet"),Yt=(t,r)=>K(t)||ke(t)?!1:r==="all-users"||r==="users-without-wallets"&&!xe(t)?.length;function er(t){if(!t)return null;let r=We(t.linked_accounts),e=f(r,"wallet"),n=f(r,"smart_wallet"),i=f(r,"email"),o=f(r,"phone"),s=f(r,"google_oauth"),c=f(r,"twitter_oauth"),l=f(r,"discord_oauth"),u=f(r,"github_oauth"),d=f(r,"spotify_oauth"),h=f(r,"instagram_oauth"),p=f(r,"tiktok_oauth"),g=f(r,"linkedin_oauth"),w=f(r,"apple_oauth"),m=f(r,"farcaster"),v=f(r,"telegram"),E=t.mfa_methods.map(({type:k,verified_at:M})=>({type:k,verifiedAt:a(M)}));return{id:t.id,createdAt:a(t.created_at),linkedAccounts:r,email:i&&{address:i?.address},phone:o&&{number:o?.number},wallet:e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,recoveryMethod:e.recoveryMethod,imported:e.imported,walletIndex:e.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:c&&{subject:c.subject,username:c.username,name:c.name,profilePictureUrl:c.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:u&&{subject:u.subject,username:u.username,name:u.name,email:u.email},spotify:d&&{subject:d.subject,email:d.email,name:d.name},instagram:h&&{subject:h.subject,username:h.username},tiktok:p&&{subject:p.subject,username:p.username,name:p.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:w&&{subject:w.subject,email:w.email},farcaster:m&&{fid:m.fid,ownerAddress:m.ownerAddress,displayName:m.displayName,username:m.username,bio:m.bio,pfp:m.pfp,url:m.url,signerPublicKey:m.signerPublicKey},telegram:v&&{telegramUserId:v.telegramUserId,firstName:v.firstName,lastName:v.lastName,username:v.username,photoUrl:v.photoUrl},mfaMethods:E.map(k=>k.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}import{useEffect as Pe,useState as Te}from"react";var nr=t=>{let[r,e]=Te("auto");return Pe(()=>{let n=new ResizeObserver(i=>{e(i[0]?.contentRect.height??"auto")});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),r};import J from"styled-components";import{jsx as z}from"react/jsx-runtime";var Z=({...t})=>z("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:z("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:t.color||"var(--privy-color-foreground-3)"})});import{jsx as W,jsxs as Q}from"react/jsx-runtime";var I=J.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 cr(t){let{legal:{privacyPolicyUrl:r,termsAndConditionsUrl:e,requireUsersAcceptTerms:n}}=t.app;if(n&&!t.alwaysShowImplicitConsent)return W(I,{});if(!e&&!r)return W(I,{});let i=!!(r&&e);return Q(I,{children:["By logging in I agree to the"," ",e&&W("a",{href:e,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",r&&W("a",{href:r,target:"_blank",children:"Privacy Policy"})]})}var ur=()=>Q(Ce,{children:[W(Z,{}),W("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),Ce=J.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 Ee,useEffect as Me,useState as Se}from"react";import{createContext as Re}from"react";import{jsx as Oe}from"react/jsx-runtime";var q=Re({}),_r=({children:t})=>{let r=F(),[e,n]=Se({});return y("login",{onComplete:(i,o,s,c,l)=>{!l||l.type==="passkey"||l.type==="cross_app"||l.type==="wallet"&&l.walletClientType==="privy"||(A.put(X(r.id),l.type),l.type==="wallet"?(A.put(U(r.id),l.walletClientType),n({accountType:l.type,connectorType:l.connectorType,walletClientType:l.walletClientType})):(A.del(U(r.id)),n({accountType:l.type})))}}),Me(()=>{if(!r.id)return;let i=A.get(X(r.id)),o=A.get(U(r.id));i&&n(i==="wallet"?{accountType:i,walletClientType:o}:{accountType:i})},[r.id]),Oe(q.Provider,{value:e,children:t})},X=t=>`privy:${t}:recent-login-method`,U=t=>`privy:${t}:recent-login-wallet-client`,br=()=>Ee(q);import Ie from"@heroicons/react/24/outline/Square2StackIcon";import Ue from"styled-components";import{jsx as Y,jsxs as je}from"react/jsx-runtime";var ee=({address:t,showCopyIcon:r,url:e,className:n})=>e?Y("a",{title:t,className:n,href:`${e}/address/${t}`,target:"_blank",children:O(t)}):je("button",{title:t,className:n,onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[O(t),r&&Y(Le,{})]}),Le=Ue(Ie)`
|
|
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 De,{css as ne,keyframes as Ve}from"styled-components";import{keyframes as $e,css as te}from"styled-components";var Fe=$e`
|
|
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
|
+
`,re=te`
|
|
57
|
+
${t=>t.$isLoading?te`
|
|
58
|
+
width: 35%;
|
|
59
|
+
animation: ${Fe} 2s linear infinite;
|
|
60
|
+
border-radius: var(--privy-border-radius-sm);
|
|
61
|
+
`:""}
|
|
62
|
+
`;import{jsx as Be}from"react/jsx-runtime";var ie=({children:t,color:r,isLoading:e,isPulsing:n,className:i})=>Be(Ne,{$color:r,$isLoading:e,$isPulsing:n,className:i,children:t}),Ne=De.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
|
+
${t=>{let r,e;t.$color==="green"&&(r="var(--privy-color-success-dark)",e="var(--privy-color-success-light)"),t.$color==="red"&&(r="var(--privy-color-error)",e="var(--privy-color-error-light)"),t.$color==="gray"&&(r="var(--privy-color-foreground-2)",e="var(--privy-color-background-2)");let n=Ve`
|
|
70
|
+
from, to {
|
|
71
|
+
background-color: ${e};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
50% {
|
|
75
|
+
background-color: rgba(${e}, 0.8);
|
|
76
|
+
}
|
|
77
|
+
`;return ne`
|
|
78
|
+
color: ${r};
|
|
79
|
+
background-color: ${e};
|
|
80
|
+
${t.$isPulsing&&ne`
|
|
81
|
+
animation: ${n} 3s linear infinite;
|
|
82
|
+
`};
|
|
83
|
+
`}}
|
|
84
|
+
|
|
85
|
+
${re}
|
|
86
|
+
`;import Ge from"styled-components";var ae=Ge.div`
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
`;import He from"styled-components";var oe=He.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 Ke from"styled-components";var se=Ke.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 ze,{css as Ze}from"styled-components";var Je=Ze`
|
|
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
|
+
${t=>t.$state==="error"?"border-color: var(--privy-color-error);":""}
|
|
116
|
+
`,le=ze.div`
|
|
117
|
+
${Je}
|
|
118
|
+
`;import{Fragment as Qe,jsx as C,jsxs as L}from"react/jsx-runtime";var Zr=({errMsg:t,balance:r,address:e,isLoading:n,className:i,title:o,isPulsing:s,showIcon:c,statusColor:l="green"})=>{let u;return l?u=l:t?u="red":u="green",L(Qe,{children:[L(le,{className:i,$state:t?"error":void 0,children:[L(ae,{children:[C(se,{children:o||"Pay with"}),C(ee,{address:e,showCopyIcon:c||!!t})]}),r!==void 0&&C(ie,{isLoading:n,isPulsing:s,color:u,children:r})]}),t&&C(oe,{style:{marginTop:"0.25rem"},children:t})]})};import{BigNumber as Xe}from"@ethersproject/bignumber";import{formatEther as ce}from"@ethersproject/units";import{QuantityToBigNumber as qe}from"@privy-io/js-sdk-core";var Ye=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),ue=t=>Ye.format(t),rn=(t,r)=>{let e=ue(r*parseFloat(t));return e!=="$0.00"?e:"<$0.01"},nn=(t,r)=>{let e=ue(r*parseFloat(ce(t)));return e==="$0.00"?"<$0.01":e},an=(t,r,e=6,n=!1)=>{let o=parseFloat(ce(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"");return n?`${o} ${r}`:`${o==="0"?"<0.001":o} ${r}`},on=t=>t.map(qe).reduce((r,e)=>r.add(e),Xe.from(0)).toHexString(),sn=(t,r)=>{let{chains:e}=D(),n=`https://etherscan.io/address/${r}`,i=`${G(t,e)}/address/${r}`;if(!i)return n;try{new URL(i)}catch{return n}return i};import{jsx as j}from"react/jsx-runtime";var cn=({color:t,...r})=>j("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",...r,children:j("g",{children:j("path",{fill:t||"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{wt as a,A as b,Tt as c,Ct as d,It as e,Ut as f,Lt as g,O as h,be as i,jt as j,$t as k,Ft as l,Dt as m,Vt as n,Nt as o,Bt as p,Gt as q,Ae as r,Ht as s,Kt as t,zt as u,K as v,Qt as w,ke as x,Xt as y,qt as z,Yt as A,er as B,Z as C,nr as D,tt as E,me as F,y as G,ye as H,rt as I,cr as J,ur as K,Ce as L,re as M,ie as N,_r as O,br as P,ee as Q,st as R,oe as S,Je as T,le as U,Zr as V,cn as W,rn as X,nn as Y,an as Z,on as _,sn as $,pt as aa,vt as ba,At as ca};
|